[go: up one dir, main page]

CN109815477B - Method and device for identifying browser information - Google Patents

Method and device for identifying browser information Download PDF

Info

Publication number
CN109815477B
CN109815477B CN201811474132.2A CN201811474132A CN109815477B CN 109815477 B CN109815477 B CN 109815477B CN 201811474132 A CN201811474132 A CN 201811474132A CN 109815477 B CN109815477 B CN 109815477B
Authority
CN
China
Prior art keywords
browser
keyword
weight
keywords
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811474132.2A
Other languages
Chinese (zh)
Other versions
CN109815477A (en
Inventor
张其科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Minglue Zhaohui Technology Co Ltd
Original Assignee
Beijing Minglue Zhaohui Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Minglue Zhaohui Technology Co Ltd filed Critical Beijing Minglue Zhaohui Technology Co Ltd
Priority to CN201811474132.2A priority Critical patent/CN109815477B/en
Publication of CN109815477A publication Critical patent/CN109815477A/en
Application granted granted Critical
Publication of CN109815477B publication Critical patent/CN109815477B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a method and a device for identifying browser information. The method comprises the following steps: word segmentation is carried out on User agents of the browser, so that a plurality of keywords are obtained; inquiring the weight corresponding to each keyword in a browser keyword dictionary, wherein the browser keyword dictionary comprises: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword; and taking the browser information corresponding to the keyword with the largest weight as the identified target browser information. The application solves the problems of complex steps and low accuracy of identifying browser information in the related technology.

Description

Method and device for identifying browser information
Technical Field
The application relates to the technical field of information identification, in particular to a method and a device for identifying browser information.
Background
The User Agent, UA for short, is Chinese name User Agent information, which is a special character string head, so that the server can identify the operating system and version, CPU type, browser and version, browser rendering engine, browser language, browser plug-in and so on used by the client. Some websites often send different pages to different operating systems and different browsers by judging UA, so that browser information corresponding to UA, such as name, version and the like of the browser, needs to be accurately judged, and corresponding configuration is performed according to the browser information.
Aiming at the problems of complex steps and low accuracy of identifying browser information in the related technology, no effective solution is proposed at present.
Disclosure of Invention
The application mainly aims to provide a method and a device for identifying browser information, which are used for solving the problems of complex steps and low accuracy of identifying the browser information in the related technology.
In order to achieve the above object, according to one aspect of the present application, there is provided a method of identifying browser information. The method comprises the following steps: word segmentation is carried out on User agents of the browser, so that a plurality of keywords are obtained; inquiring the weight corresponding to each keyword in a browser keyword dictionary, wherein the browser keyword dictionary comprises: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword; and taking the browser information corresponding to the keyword with the largest weight as the identified target browser information.
Further, before the weights corresponding to each keyword are queried in the browser keyword dictionary, the method further comprises: collecting a plurality of browser keywords, wherein the browser keywords at least comprise a kernel name of a browser, a manufacturer name of the browser, a version name of the browser and a browser name; setting weight for each browser keyword according to the type of the browser keyword; determining browser information corresponding to each browser keyword; and constructing a browser keyword dictionary according to the plurality of browser keywords, the weight corresponding to each browser keyword and the browser information corresponding to each browser keyword.
Further, setting weights for each browser keyword according to the type of the browser keyword includes: setting a first weight for the kernel name of the browser, setting a second weight for the vendor name of the browser, setting a third weight for the version name of the browser, and setting a fourth weight for the browser name, wherein the first weight is smaller than the second weight, the second weight is smaller than the third weight, and the third weight is smaller than the fourth weight.
Further, taking browser information corresponding to the keyword with the largest weight as the identified target browser information includes: when a plurality of keywords with the largest weights exist, sorting the keywords with the largest weights according to the lengths of the keywords, and acquiring the keywords with the longest lengths; and taking the browser information corresponding to the keyword with the longest length as the identified target browser information.
Further, querying the weights corresponding to each keyword in the browser keyword dictionary includes: detecting whether a browser keyword matched with the keyword exists in a browser keyword dictionary; and if the browser keywords matched with the keywords exist, acquiring weights corresponding to the browser keywords.
Further, after detecting whether there is a browser keyword matching the keyword in the browser keyword dictionary, the method further includes: and if the browser keywords matched with the keywords do not exist, returning an identification result of unknown browser information.
In order to achieve the above object, according to another aspect of the present application, there is provided an identifying browser information apparatus. The device comprises: the word segmentation unit is used for segmenting the User Agent of the browser to obtain a plurality of keywords; the query unit is used for querying the weight corresponding to each keyword in the browser keyword dictionary, wherein the browser keyword dictionary comprises: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword; and the first determining unit is used for taking the browser information corresponding to the keyword with the largest weight as the identified target browser information.
Further, the apparatus further comprises: the collecting unit is used for collecting a plurality of browser keywords, wherein the browser keywords at least comprise kernel names of the browser, manufacturer names of the browser, version names of the browser and browser names; the setting unit is used for setting weight for each browser keyword according to the type of the browser keyword; the second determining unit is used for determining browser information corresponding to each browser keyword; and the construction unit is used for constructing a browser keyword dictionary according to the browser keywords, the weight corresponding to each browser keyword and the browser information corresponding to each browser keyword.
In order to achieve the above object, according to another aspect of the present application, there is provided a storage medium including a stored program, wherein the program performs any one of the above-described methods of identifying browser information.
In order to achieve the above object, according to another aspect of the present application, there is provided a processor for executing a program, wherein the program executes any one of the above methods for identifying browser information.
According to the application, the following steps are adopted: word segmentation is carried out on User agents of the browser, so that a plurality of keywords are obtained; inquiring the weight corresponding to each keyword in a browser keyword dictionary, wherein the browser keyword dictionary comprises: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword; browser information corresponding to the keyword with the largest weight is used as identified target browser information, and the problems of complex steps and low accuracy in identifying the browser information in the related technology are solved. The browser information corresponding to the keyword with the largest weight is used as the identified target browser information by inquiring a plurality of keywords obtained after User Agent word segmentation in the browser keyword dictionary, so that the effects of simplifying the steps of identifying the browser information and improving the identification accuracy are achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
FIG. 1 is a flow chart of a method for identifying browser information provided in accordance with an embodiment of the present application; and
fig. 2 is a schematic diagram of an apparatus for identifying browser information according to an embodiment of the present application.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the application herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of description, the following will describe some terms or terminology involved in the embodiments of the present application:
user Agent: user agent information, UA for short, is a special string header that enables a server to identify the operating system and version, CPU type, browser and version, browser rendering engine, browser language, browser plug-in, etc. used by a client.
According to an embodiment of the application, a method for identifying browser information is provided.
Fig. 1 is a flowchart of a method of identifying browser information according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, word segmentation is carried out on User agents of the browser, and a plurality of keywords are obtained.
Specifically, a universal word segmentation algorithm is utilized to segment words and extract keywords from User agents, so that a plurality of keywords are obtained.
Step S102, inquiring the weight corresponding to each keyword in a browser keyword dictionary, wherein the browser keyword dictionary comprises: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword.
It should be noted that, weights are set for each browser keyword recorded in the browser keyword dictionary, if weights corresponding to a certain keyword can be queried in the browser keyword dictionary, the browser information corresponding to the browser can also be queried in the description, the keyword is described as an effective keyword, if weights corresponding to a certain keyword and browser information are not queried in the browser keyword dictionary, the keyword is described as an ineffective keyword, namely, the keyword which does not contribute to determining the browser information.
Optionally, in the method for identifying browser information provided by the embodiment of the present application, before the weights corresponding to each keyword are queried in the browser keyword dictionary, the method further includes: collecting a plurality of browser keywords, wherein the browser keywords at least comprise a kernel name of a browser, a manufacturer name of the browser, a version name of the browser and a browser name; setting weight for each browser keyword according to the type of the browser keyword; determining browser information corresponding to each browser keyword; and constructing a browser keyword dictionary according to the plurality of browser keywords, the weight corresponding to each browser keyword and the browser information corresponding to each browser keyword.
Specifically, collecting common browser keywords, including but not limited to browser kernel names, browser manufacturer names, version names, browser names, sorting the common browser keywords, and the like, setting weights for the common browser keywords according to browser types, recording browser information corresponding to each browser keyword, at least including browser names, browser version numbers, and the like, and sorting the common browser keywords, the weights corresponding to the common browser keywords, and the browser information to generate a keyword browser dictionary.
In order to accurately obtain browser information corresponding to a User Agent, optionally, in the method for identifying browser information provided by the embodiment of the present application, setting weights for each browser keyword according to the type of the browser keyword includes: setting a first weight for the kernel name of the browser, setting a second weight for the vendor name of the browser, setting a third weight for the version name of the browser, and setting a fourth weight for the browser name, wherein the first weight is smaller than the second weight, the second weight is smaller than the third weight, and the third weight is smaller than the fourth weight.
It should be noted that, the kernels corresponding to the different browsers are the same, the kernel has smaller contribution to determining the unique browser, and a lower first weight is determined for the browser kernel; the plurality of different browsers also have the same situation of corresponding manufacturers, but the contribution of the manufacturers to determining the unique browser is larger than that of the kernel, and a second weight larger than the first weight can be set for the manufacturers; the browser information corresponding to the version name is more accurate, and a third weight larger than the second weight is set for the version name; in addition, the keywords obtained by word segmentation of the User Agent may have browser names, corresponding browsers can be directly determined according to the browser names, and fourth weights larger than the third weights are set for the browser names.
For example, the first weight set for the kernel is defined as 0, specifically, the weights of keywords such as (MSIE) Trident, webKit, gecko, prest are all set as 0; the second weight set for the manufacturer is defined as 5, specifically, the weights of keywords such as MSIE, safari, chrome, firefox and the like are all set as 5; the third weight set for the version name is defined as 10, specifically, MSIE8.0, version/5 (less than Safari version 10), chrome/19, version/10 (Opera version), fireFox/21 and other keywords are all set as 10; the fourth weight set for the browser name is defined as 15, and specifically, the weights of keywords such as BaiduBrowser,360EE,XiaoMi are all set as 15.
According to the embodiment, according to the types of the keywords, higher weight is set for determining the keywords with large contribution from the unique browser, so that accuracy of acquiring browser information corresponding to the User Agent is improved.
Optionally, in the method for identifying browser information provided by the embodiment of the present application, querying weights corresponding to each keyword in a browser keyword dictionary includes: detecting whether a browser keyword matched with the keyword exists in a browser keyword dictionary; and if the browser keywords matched with the keywords exist, acquiring weights corresponding to the browser keywords.
Specifically, the process of searching the weights corresponding to the keywords and the browser information in the browser keyword dictionary is equivalent to searching the dictionary, searching whether the browser keywords which are the same as the keywords exist in the browser keyword dictionary, and if so, acquiring the weights corresponding to the browser keywords.
Optionally, in the method for identifying browser information provided by the embodiment of the present application, after detecting whether a browser keyword matched with a keyword exists in a browser keyword dictionary, the method further includes: and if the browser keywords matched with the keywords do not exist, returning an identification result for identifying that the browser information is unknown.
If the browser information corresponding to any one keyword is not searched in the browser keyword dictionary, the keywords obtained by the User Agent segmentation are invalid keywords, the browser information is not searched according to the User Agent, and a recognition result for recognizing that the browser information is unknown is returned.
Step S103, browser information corresponding to the keyword with the largest weight is used as identified target browser information.
For example, keywords of the queried browser information obtained according to User Agent segmentation are "MSIE8.0", "MSIE", "qq", and since "MSIE8.0" corresponds to a version name, "MSIE" corresponds to a vendor name, "qq" corresponds to a browser name, and the keywords are ranked according to weights: MSIE < MSIE8.0 < qq, and determining browser information corresponding to 'qq' as identified target browser information.
For another example, keywords of the queried browser information obtained according to User Agent segmentation are "WebKit", "Safari" and "Version/x", and the keywords are ranked according to weights, wherein the "WebKit" corresponds to a kernel name, the "Safari" corresponds to a manufacturer name, and the "Version/x" corresponds to a Version name: webKit < Safari < Version/x, and determining browser information corresponding to 'Version/x' as identified target browser information.
For another example, keywords of the queried browser information obtained according to User Agent segmentation are "Chrome", "Chrome/xx" and "XiaoMi", and the keywords are ranked according to weights because "Chrome" corresponds to a manufacturer name, "Chrome/xx" corresponds to a version name and "XiaoMi" corresponds to a browser name: and determining browser information corresponding to the 'XiaoMi' as the identified target browser information.
For another example, keywords of the queried browser information obtained according to User Agent segmentation are "Gecko/presto", "Firefox", "Version/x" and "Opera", and the keywords are ranked according to weights because "WebKit" corresponds to a kernel name, "Safari" corresponds to a vendor name, "Version/x" corresponds to a Version name and "Opera" corresponds to a browser name: gecko/presto < Firefox < Version/x < Opera, and determining browser information corresponding to "Opera" as the identified target browser information.
Optionally, in the method for identifying browser information provided by the embodiment of the present application, using browser information corresponding to a keyword with a maximum weight as the identified target browser information includes: when a plurality of keywords with the largest weights exist, sorting the keywords with the largest weights according to the lengths of the keywords, and acquiring the keywords with the longest lengths; and taking the browser information corresponding to the keyword with the longest length as the identified target browser information.
The longer the keyword is, the more effective information is contained, and the more accurate the browser information is determined, so that when there are a plurality of keywords with the largest weight, the browser information corresponding to the keyword with the longest length is used as the identified target browser information, thereby improving the accuracy of identifying the browser information.
According to the browser information identifying method provided by the embodiment of the application, the User Agent of the browser is segmented to obtain a plurality of keywords; inquiring the weight corresponding to each keyword in a browser keyword dictionary, wherein the browser keyword dictionary comprises: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword; browser information corresponding to the keyword with the largest weight is used as identified target browser information, and the problems of complex steps and low accuracy in identifying the browser information in the related technology are solved. The browser information corresponding to the keyword with the largest weight is used as the identified target browser information by inquiring a plurality of keywords obtained after User Agent word segmentation in the browser keyword dictionary, so that the effects of simplifying the steps of identifying the browser information and improving the identification accuracy are achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a browser information identifying device, and the browser information identifying device can be used for executing the browser information identifying method provided by the embodiment of the application. The information device for identifying the browser provided by the embodiment of the application is described below.
Fig. 2 is a schematic diagram of an identifying browser information means according to an embodiment of the present application. As shown in fig. 2, the apparatus includes: the word segmentation unit 10, the query unit 20 and the first determination unit 30.
Specifically, the word segmentation unit 10 is configured to segment a User Agent of a browser to obtain a plurality of keywords;
a query unit 20, configured to query a browser keyword dictionary for a weight corresponding to each keyword, where the browser keyword dictionary includes: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword;
the first determining unit 30 is configured to take browser information corresponding to the keyword with the largest weight as identified target browser information.
Optionally, in the identifying browser information apparatus provided in the embodiment of the present application, the apparatus further includes: the collecting unit is used for collecting a plurality of browser keywords, wherein the browser keywords at least comprise kernel names of the browser, manufacturer names of the browser, version names of the browser and browser names; the setting unit is used for setting weight for each browser keyword according to the type of the browser keyword; the second determining unit is used for determining browser information corresponding to each browser keyword; and the construction unit is used for constructing a browser keyword dictionary according to the browser keywords, the weight corresponding to each browser keyword and the browser information corresponding to each browser keyword.
Optionally, in the identifying browser information apparatus provided in the embodiment of the present application, the setting unit includes: the setting module is used for setting a first weight for the kernel name of the browser, a second weight for the manufacturer name of the browser, a third weight for the version name of the browser and a fourth weight for the browser name, wherein the first weight is smaller than the second weight, the second weight is smaller than the third weight, and the third weight is smaller than the fourth weight.
Optionally, in the identifying browser information apparatus provided in the embodiment of the present application, the first determining unit 10 includes: the ordering module is used for ordering the keywords with the maximum weight according to the lengths of the keywords and acquiring the keywords with the longest lengths when the keywords with the maximum weight are in a plurality of keywords; and the determining module is used for taking the browser information corresponding to the keyword with the longest length as the identified target browser information.
Optionally, in the identifying browser information apparatus provided in the embodiment of the present application, the query unit 20 includes: the detection module is used for detecting whether browser keywords matched with the keywords exist in the browser keyword dictionary; and the acquisition module is used for acquiring the weight corresponding to the browser keyword if the browser keyword matched with the keyword exists.
Optionally, in the identifying browser information apparatus provided in the embodiment of the present application, the apparatus further includes: and the return unit is used for returning the identification result of unknown browser information under the condition that the browser keywords matched with the keywords do not exist after detecting whether the browser keywords matched with the keywords exist in the browser keyword dictionary. .
According to the browser identification information device provided by the embodiment of the application, the word segmentation unit 10 is used for segmenting the User Agent of the browser to obtain a plurality of keywords; the querying unit 20 queries the weight corresponding to each keyword in the browser keyword dictionary, where the browser keyword dictionary includes: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword; the first determining unit 30 uses the browser information corresponding to the keyword with the largest weight as the identified target browser information, solves the problems of complex steps and low accuracy of identifying the browser information in the related art, and achieves the effects of simplifying the steps of identifying the browser information and improving the identification accuracy by inquiring a plurality of keywords obtained after User Agent word segmentation in a browser keyword dictionary and using the browser information corresponding to the keyword with the largest weight as the identified target browser information.
The identifying browser information apparatus includes a processor and a memory, the word segmentation unit 10, the query unit 20, the first determination unit 30, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel, and the problems of complex steps and low accuracy in identifying browser information in the related technology are solved by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the application provides a storage medium, on which a program is stored, which when executed by a processor, implements the method for identifying browser information.
The embodiment of the application provides a processor which is used for running a program, wherein the method for identifying browser information is executed when the program runs.
The embodiment of the application provides equipment, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the processor realizes the following steps when executing the program: word segmentation is carried out on User agents of the browser, so that a plurality of keywords are obtained; inquiring the weight corresponding to each keyword in a browser keyword dictionary, wherein the browser keyword dictionary comprises: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword; and taking the browser information corresponding to the keyword with the largest weight as the identified target browser information.
Before the weights corresponding to each keyword are queried in the browser keyword dictionary, the method further comprises the following steps: collecting a plurality of browser keywords, wherein the browser keywords at least comprise a kernel name of a browser, a manufacturer name of the browser, a version name of the browser and a browser name; setting weight for each browser keyword according to the type of the browser keyword; determining browser information corresponding to each browser keyword; and constructing a browser keyword dictionary according to the plurality of browser keywords, the weight corresponding to each browser keyword and the browser information corresponding to each browser keyword.
Setting weights for each browser keyword according to the type of the browser keyword comprises: setting a first weight for the kernel name of the browser, setting a second weight for the vendor name of the browser, setting a third weight for the version name of the browser, and setting a fourth weight for the browser name, wherein the first weight is smaller than the second weight, the second weight is smaller than the third weight, and the third weight is smaller than the fourth weight.
The browser information corresponding to the keyword with the largest weight is taken as the identified target browser information, and the method comprises the following steps: when a plurality of keywords with the largest weights exist, sorting the keywords with the largest weights according to the lengths of the keywords, and acquiring the keywords with the longest lengths; and taking the browser information corresponding to the keyword with the longest length as the identified target browser information.
Querying weights corresponding to each keyword in the browser keyword dictionary comprises: detecting whether a browser keyword matched with the keyword exists in a browser keyword dictionary; and if the browser keywords matched with the keywords exist, acquiring weights corresponding to the browser keywords.
After detecting whether there is a browser keyword matching the keyword in the browser keyword dictionary, the method further includes: and if the browser keywords matched with the keywords do not exist, returning an identification result of unknown browser information. The device herein may be a server, PC, PAD, cell phone, etc.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: word segmentation is carried out on User agents of the browser, so that a plurality of keywords are obtained; inquiring the weight corresponding to each keyword in a browser keyword dictionary, wherein the browser keyword dictionary comprises: the browser information comprises a plurality of browser keywords, weights corresponding to each browser keyword and browser information corresponding to each browser keyword; and taking the browser information corresponding to the keyword with the largest weight as the identified target browser information.
Before the weights corresponding to each keyword are queried in the browser keyword dictionary, the method further comprises the following steps: collecting a plurality of browser keywords, wherein the browser keywords at least comprise a kernel name of a browser, a manufacturer name of the browser, a version name of the browser and a browser name; setting weight for each browser keyword according to the type of the browser keyword; determining browser information corresponding to each browser keyword; and constructing a browser keyword dictionary according to the plurality of browser keywords, the weight corresponding to each browser keyword and the browser information corresponding to each browser keyword.
Setting weights for each browser keyword according to the type of the browser keyword comprises: setting a first weight for the kernel name of the browser, setting a second weight for the vendor name of the browser, setting a third weight for the version name of the browser, and setting a fourth weight for the browser name, wherein the first weight is smaller than the second weight, the second weight is smaller than the third weight, and the third weight is smaller than the fourth weight.
The browser information corresponding to the keyword with the largest weight is taken as the identified target browser information, and the method comprises the following steps: when a plurality of keywords with the largest weights exist, sorting the keywords with the largest weights according to the lengths of the keywords, and acquiring the keywords with the longest lengths; and taking the browser information corresponding to the keyword with the longest length as the identified target browser information.
Querying weights corresponding to each keyword in the browser keyword dictionary comprises: detecting whether a browser keyword matched with the keyword exists in a browser keyword dictionary; and if the browser keywords matched with the keywords exist, acquiring weights corresponding to the browser keywords.
After detecting whether there is a browser keyword matching the keyword in the browser keyword dictionary, the method further includes: and if the browser keywords matched with the keywords do not exist, returning an identification result of unknown browser information.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (7)

1. A method of identifying browser information, comprising:
word segmentation is carried out on User agents of the browser, so that a plurality of keywords are obtained;
inquiring the weight corresponding to each keyword in a browser keyword dictionary, wherein the browser keyword dictionary comprises the following components: the browser information comprises a plurality of browser keywords, weights corresponding to the browser keywords and browser information corresponding to the browser keywords;
taking browser information corresponding to the keyword with the largest weight as identified target browser information;
before the weights corresponding to the keywords are queried in the browser keyword dictionary, the method further comprises the following steps:
collecting a plurality of browser keywords, wherein the browser keywords at least comprise a kernel name of a browser, a manufacturer name of the browser, a version name of the browser and a browser name;
setting weight for each browser keyword according to the type of the browser keyword;
determining browser information corresponding to each browser keyword;
constructing a browser keyword dictionary according to the browser keywords, the weight corresponding to each browser keyword and the browser information corresponding to each browser keyword;
wherein setting weights for each browser keyword according to the type of the browser keyword comprises:
setting a first weight for the kernel name of the browser, setting a second weight for the vendor name of the browser, setting a third weight for the version name of the browser, and setting a fourth weight for the browser name, wherein the first weight is smaller than the second weight, the second weight is smaller than the third weight, and the third weight is smaller than the fourth weight.
2. The method of claim 1, wherein using browser information corresponding to the keyword with the greatest weight as the identified target browser information comprises:
when a plurality of keywords with the maximum weight exist, sorting the keywords with the maximum weight according to the lengths of the keywords, and acquiring the keywords with the longest lengths;
and taking the browser information corresponding to the keyword with the longest length as the identified target browser information.
3. The method of claim 1, wherein querying the browser keyword dictionary for weights corresponding to each of the keywords comprises:
detecting whether a browser keyword matched with the keyword exists in the browser keyword dictionary;
and if the browser keywords matched with the keywords exist, acquiring weights corresponding to the browser keywords.
4. The method of claim 3, wherein after detecting whether there is a browser keyword within the browser keyword dictionary that matches the keyword, the method further comprises:
and if the browser keywords matched with the keywords do not exist, returning an identification result of unknown browser information.
5. An apparatus for identifying browser information, comprising:
the word segmentation unit is used for segmenting the User Agent of the browser to obtain a plurality of keywords;
the query unit is used for querying the weight corresponding to each keyword in the browser keyword dictionary, wherein the browser keyword dictionary comprises the following components: the browser information comprises a plurality of browser keywords, weights corresponding to the browser keywords and browser information corresponding to the browser keywords;
the first determining unit is used for taking browser information corresponding to the keyword with the largest weight as identified target browser information;
the collecting unit is used for collecting a plurality of browser keywords, wherein the browser keywords at least comprise a kernel name of a browser, a manufacturer name of the browser, a version name of the browser and a browser name;
the setting unit is used for setting weight for each browser keyword according to the type of the browser keyword;
the second determining unit is used for determining browser information corresponding to each browser keyword;
the construction unit is used for constructing the browser keyword dictionary according to the browser keywords, the weight corresponding to each browser keyword and the browser information corresponding to each browser keyword;
the setting unit includes: the setting module is used for setting a first weight for the kernel name of the browser, a second weight for the manufacturer name of the browser, a third weight for the version name of the browser and a fourth weight for the browser name, wherein the first weight is smaller than the second weight, the second weight is smaller than the third weight, and the third weight is smaller than the fourth weight.
6. A storage medium comprising a stored program, wherein the program performs the method of identifying browser information of any one of claims 1 to 4.
7. A processor for running a program, wherein the program runs on performing the method of identifying browser information according to any one of claims 1 to 4.
CN201811474132.2A 2018-12-04 2018-12-04 Method and device for identifying browser information Active CN109815477B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811474132.2A CN109815477B (en) 2018-12-04 2018-12-04 Method and device for identifying browser information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811474132.2A CN109815477B (en) 2018-12-04 2018-12-04 Method and device for identifying browser information

Publications (2)

Publication Number Publication Date
CN109815477A CN109815477A (en) 2019-05-28
CN109815477B true CN109815477B (en) 2023-10-17

Family

ID=66601916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811474132.2A Active CN109815477B (en) 2018-12-04 2018-12-04 Method and device for identifying browser information

Country Status (1)

Country Link
CN (1) CN109815477B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112241621A (en) * 2019-07-18 2021-01-19 北京京东尚科信息技术有限公司 Method and device for identifying client environment through user agent
CN114996616A (en) * 2022-06-20 2022-09-02 中国平安财产保险股份有限公司 Information generation method, device and equipment based on browser and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017096967A1 (en) * 2015-12-10 2017-06-15 乐视控股(北京)有限公司 Method and device for self-adaptively displaying web page
CN107463573A (en) * 2016-06-02 2017-12-12 广州市动景计算机科技有限公司 Content information provides method, equipment, browser, electronic equipment and server
CN107590164A (en) * 2016-07-08 2018-01-16 广州市动景计算机科技有限公司 For generating the method, equipment and server of Hot Contents
CN108280106A (en) * 2017-03-08 2018-07-13 广州市动景计算机科技有限公司 Processing method, device and the mobile terminal of search key
EP3373161A1 (en) * 2017-03-09 2018-09-12 Wipro Limited Method and system for classification of web browsing history

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017096967A1 (en) * 2015-12-10 2017-06-15 乐视控股(北京)有限公司 Method and device for self-adaptively displaying web page
CN107463573A (en) * 2016-06-02 2017-12-12 广州市动景计算机科技有限公司 Content information provides method, equipment, browser, electronic equipment and server
CN107590164A (en) * 2016-07-08 2018-01-16 广州市动景计算机科技有限公司 For generating the method, equipment and server of Hot Contents
CN108280106A (en) * 2017-03-08 2018-07-13 广州市动景计算机科技有限公司 Processing method, device and the mobile terminal of search key
EP3373161A1 (en) * 2017-03-09 2018-09-12 Wipro Limited Method and system for classification of web browsing history

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Chrome浏览器历史记录提取与分析;杨雪等;《计算机应用与软件》;20161215(第12期);全文 *
浏览器识别研究;李周辉等;《信息网络安全》;20160310(第03期);全文 *

Also Published As

Publication number Publication date
CN109815477A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
US8559731B2 (en) Personalized tag ranking
CN108270629A (en) Site visitor&#39;s behavior monitoring method and device
CN109145110B (en) Label query method and device
US12050657B2 (en) Retrieval of content using link-based search
US10614500B2 (en) Identifying search friendly web pages
CN110969022B (en) Semantic determining method and related equipment
CN114900546B (en) Data processing method, device and equipment and readable storage medium
CN111125155B (en) Access path-based data query method, device, storage medium and processor
CN111709327B (en) Fuzzy matching method and device based on OCR (optical character recognition)
CN109815477B (en) Method and device for identifying browser information
CN110929188A (en) Method and device for rendering server page
CN111738173A (en) Video clip detection method and device, electronic equipment and storage medium
CN110619075A (en) Webpage identification method and equipment
CN110555165B (en) Information identification method and device, computer equipment and storage medium
CN106610989B (en) Search keyword clustering method and device
CN108984572B (en) Website information pushing method and device
CN110968763A (en) Data processing method and device
CN113392355A (en) Page configuration method, device, equipment and storage medium
CN107665208B (en) User preference measurement method and device
CN110674495B (en) Detection method, device and equipment for group border crossing access
CN110969469B (en) Data acquisition method and device
CN110046180B (en) A method, device and electronic device for locating similar instances
CN110019295B (en) Database retrieval method, device, system and storage medium
CN117453739A (en) Configure data query methods, devices, servers and storage media
CN110019357B (en) Database query script generation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201224

Address after: Room 2020, 2 / F, building 27, No. 25, North Third Ring Road West, Haidian District, Beijing 100098

Applicant after: Beijing minglue Zhaohui Technology Co.,Ltd.

Address before: Room 9014, 9 / F, building 3, yard 30, Shixing street, Shijingshan District, Beijing 100041

Applicant before: ADMASTER TECHNOLOGY (BEIJING) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant