Network device identification method and device, and computer-readable storage medium
By performing feature processing and fingerprinting on domain name resolution DNS requests of network devices, fingerprint information containing MAC addresses is generated, and its similarity with historical fingerprint information is calculated, which solves the problem of low network device identification accuracy and achieves higher accuracy. recognition accuracy.
Patent Information
- Application Number
- CN202111480134.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-06
AI Technical Summary
The identification method of network devices in the existing technology has low identification accuracy and cannot accurately distinguish different clients through fingerprint information, especially clients of the same model, which makes network management difficult.
By performing feature processing on domain name resolution DNS requests initiated by the target network device, key character information is extracted and fingerprinted to generate fingerprint information containing the mapping relationship between the current MAC address and key characters, and calculate the similarity between the fingerprint information and historical fingerprint information. to determine the device type.
The identification accuracy of network equipment is improved, different clients can be effectively distinguished, and the problem of low identification accuracy in the existing technology is solved.
Smart Images

Figure CN114338602B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for identifying network equipment and a device thereof, and a computer-readable storage medium. Background Art
[0002] The MAC address is the only reliable identifier of a device on the network. The MAC address is usually set at the factory and cannot be changed by conventional means. Therefore, it is also used to track users. In some systems, considering privacy issues, the system uses a random method to generate MAC addresses. However, this will bring great challenges to network management and some common user functions, such as parental control, QoS services, and smart home linkage.
[0003] There are currently some solutions to the above drawbacks. For example, by actively sending detection messages and using the feedback messages as data sets, however, the fingerprint information in this solution refers to information such as the device's operating system, that is, it can only identify information such as the device's operating system, but cannot accurately distinguish different clients, that is, clients of the same model cannot be distinguished.
[0004] With respect to the problem that the identification method of the network devices used in the above-mentioned related technologies has low reliability and makes network management difficult, no effective solution has been proposed so far. Summary of the invention
[0005] The embodiments of the present invention provide a method for identifying a network device and an apparatus thereof, and a computer-readable storage medium, so as to at least solve the technical problem in the related art that a network device client cannot accurately identify its type through fingerprint information.
[0006] According to one aspect of an embodiment of the present invention, a method for identifying a network device is provided, comprising: performing feature processing on a domain name resolution DNS request initiated by a target network device to obtain key character information of the target network device; performing fingerprint processing on the key character information to generate fingerprint information, wherein the fingerprint information includes a mapping relationship between a current MAC address of the target network device and each key character in the key character information; determining the similarity between the fingerprint information and historical fingerprint information; and determining the device type of the target network device based on the similarity.
[0007] Optionally, feature processing is performed on the domain name resolution DNS request initiated by the target network device to obtain key character information of the target network device, including: after detecting the network access information of the target network device, collecting the DNS request initiated by the target network device; extracting key characters from the DNS request to obtain domain name information in the DNS request; and feature processing is performed on key characters corresponding to the domain name information to obtain the key character information.
[0008] Optionally, feature processing is performed on the key characters corresponding to the domain name information to obtain the key character information, including: cleaning the key characters to obtain the cleaned key characters; encrypting the cleaned key characters to obtain the key character information.
[0009] Optionally, the key character information is fingerprinted to generate fingerprint information, including: obtaining the current MAC address of the target network device; obtaining the evaluation factor of each key character corresponding to the key character information, and generating a key-value pair of each key character based on the evaluation factor of each key character; generating a key-value pair of the current MAC address and each key character to obtain the fingerprint information.
[0010] Optionally, obtaining the evaluation factor of each key character corresponding to the key character information includes: obtaining the total number of occurrences of all key characters corresponding to all access network devices within a historical time period, and the number of accesses of all access network devices; obtaining the number of occurrences of each key character in the target network device's access, and the number of occurrences of each key character in the access times; determining a first sub-evaluation factor based on the number of occurrences of each key character in the target network device's access and the total number of occurrences of all key characters; determining a second sub-evaluation factor based on the access times of all access network devices and the number of occurrences of each key character in the access times; and determining the product of the first sub-evaluation factor and the second sub-evaluation factor as the evaluation factor of each key character.
[0011] Optionally, determining the similarity between the fingerprint information and the historical fingerprint information includes: obtaining an evaluation factor of each key character in the fingerprint information; obtaining an evaluation factor of each historical key character in the historical fingerprint information; and determining the similarity based on the evaluation factor of each key character and the evaluation factor of each historical key character.
[0012] Optionally, determining the similarity based on the evaluation factor of each key character and the evaluation factor of each historical key character includes: determining a first similarity value by a first formula, wherein the first formula is: A represents the first similarity value, wt ij represents the evaluation factor of the i-th key character in the j-th network device access information, where j and i are positive integers; and determining the second similarity value by a second formula, wherein the second formula is: B represents the second similarity value, wt ik represents the evaluation factor of the i-th key character in the k-th network device access information, where k is a positive integer; and the third similarity value is determined by a third formula, wherein the third formula is: C represents the third similarity value; the similarity is determined based on a ratio between the third similarity value and a product of the first similarity value and the second similarity value.
[0013] Optionally, determining the device type of the target network device based on the similarity includes: when the similarity is greater than a similarity threshold, determining that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device; when the similarity is not greater than a similarity threshold, determining that the target network device is a newly accessed network device.
[0014] Optionally, the network device identification method also includes: when it is determined that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device, while updating the fingerprint library and the total number of times each key character appears in the fingerprint library, each key character in the target network device and the number of times each key character appears are updated; when it is determined that the target network device is a newly accessed network device, while updating the fingerprint library and the total number of times each key character appears in the fingerprint library, the fingerprint information is added to the fingerprint library.
[0015] According to another aspect of an embodiment of the present invention, a network device identification device is also provided, including: a feature processing unit, used to perform feature processing on a domain name resolution DNS request initiated by a target network device to obtain key character information of the target network device; a fingerprint processing unit, used to perform fingerprint processing on the key character information to generate fingerprint information, wherein the fingerprint information includes a mapping relationship between a current MAC address of the target network device and each key character in the key character information; a first determination unit, used to determine the similarity between the fingerprint information and historical fingerprint information; and a second determination unit, used to determine the device type of the target network device based on the similarity.
[0016] Optionally, the feature processing unit includes: a collection module, used to collect the DNS request initiated by the target network device after detecting the network access information of the target network device; a key character extraction module, used to extract key characters from the DNS request to obtain the domain name information in the DNS request; and a feature processing module, used to perform feature processing on key characters corresponding to the domain name information to obtain the key character information.
[0017] Optionally, the feature processing module includes: a cleaning processing submodule, used for cleaning the key characters to obtain the cleaned key characters; and an encryption processing submodule, used for encrypting the cleaned key characters to obtain the key character information.
[0018] Optionally, the fingerprint processing unit includes: a first acquisition module, used to obtain the current MAC address of the target network device; a second acquisition module, used to obtain the evaluation factor of each key character corresponding to the key character information, and generate a key-value pair of each key character based on the evaluation factor of each key character; a generation module, used to generate a key-value pair of the current MAC address and each key character to obtain the fingerprint information.
[0019] Optionally, the second acquisition module includes: a first acquisition submodule, used to obtain the total number of occurrences of all key characters corresponding to all access network devices within a historical time period, and the number of access times of all access network devices; a second acquisition submodule, used to obtain the number of occurrences of each key character in the target network device's access, and the number of occurrences of each key character in the access times; a first determination submodule, used to determine a first sub-evaluation factor based on the number of occurrences of each key character in the target network device's access and the total number of occurrences of all key characters; a second determination submodule, used to determine a second sub-evaluation factor based on the access times of all access network devices and the number of occurrences of each key character in the access times; and a third determination submodule, used to determine the product of the first sub-evaluation factor and the second sub-evaluation factor as the evaluation factor of each key character.
[0020] Optionally, the first determination unit includes: a third acquisition module, used to obtain the evaluation factor of each key character in the fingerprint information; a fourth acquisition module, used to obtain the evaluation factor of each historical key character in the historical fingerprint information; and a first determination module, used to determine the similarity based on the evaluation factor of each key character and the evaluation factor of each historical key character.
[0021] Optionally, the first determination module includes: a fourth determination submodule, configured to determine a first similarity value by using a first formula, wherein the first formula is: A represents the first similarity value, wt ij represents the evaluation factor of the i-th key character in the j-th network device access information, where j and i are positive integers; a fifth determination submodule, configured to determine a second similarity value by a second formula, wherein the second formula is: B represents the second similarity value, wt ik represents the evaluation factor of the i-th key character in the k-th network device access information, where k is a positive integer; a sixth determination submodule, configured to determine a third similarity value by a third formula, wherein the third formula is: C represents the third similarity value; a seventh determination submodule is used to determine the similarity based on the ratio between the third similarity value and the product of the first similarity value and the second similarity value.
[0022] Optionally, the second determination unit includes: a second determination module, used to determine that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device when the similarity is greater than a similarity threshold; and a third determination module, used to determine that the target network device is a newly accessed network device when the similarity is not greater than a similarity threshold.
[0023] Optionally, the identification device of the network device also includes: a first updating module, which is used to update the fingerprint library and the total number of times each key character appears in the target network device when it is determined that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device; and a second updating module, which is used to add the fingerprint information to the fingerprint library while updating the fingerprint library and the total number of times each key character appears in the fingerprint library when it is determined that the target network device is a newly accessed network device.
[0024] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute any of the above-mentioned methods for identifying a network device.
[0025] According to another aspect of an embodiment of the present invention, a processor is provided, wherein the processor is used to run a computer program, wherein the computer program executes any one of the above-mentioned methods for identifying a network device when running.
[0026] In an embodiment of the present invention, a domain name resolution DNS request initiated by a target network device is feature processed to obtain key character information of the target network device; the key character information is fingerprinted to generate fingerprint information, wherein the fingerprint information includes a mapping relationship between the current MAC address of the target network device and each key character in the key character information; the similarity between the fingerprint information and the historical fingerprint information is determined; and the device type of the target network device is determined based on the similarity. The network device identification method provided by an embodiment of the present invention achieves the purpose of using the key character information of the target network device to form fingerprint information and compare it with the historical fingerprint information to determine the device type of the target network device based on the similarity, thereby achieving the technical effect of improving the accuracy of identifying network devices, and further solving the technical problem in the related art that the network device client cannot accurately identify its type through fingerprint information. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0028] Figure 1 is a flow chart of a method for identifying a network device according to an embodiment of the present invention;
[0029] Figure 2 is a schematic diagram of a receiver operating characteristic (ROC) curve when similarity is determined as a change in a threshold value of the same client according to an embodiment of the present invention;
[0030] Figure 3 is a flow chart of a preferred method for identifying a network device according to an embodiment of the present invention;
[0031] Figure 4 is a schematic diagram of an identification device for a network device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] For the convenience of description, some nouns or terms appearing in the embodiments of the present invention are explained below.
[0035] Domain Name Resolution (DNS) is a service that points a domain name to a website space IP, allowing people to easily access the website through a registered domain name.
[0036] Example 1
[0037] According to an embodiment of the present invention, a method embodiment of a method for identifying a network device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] Figure 1 is a flow chart of a method for identifying a network device according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0039] Step S102: performing feature processing on the domain name resolution DNS request initiated by the target network device to obtain key character information of the target network device.
[0040] Optionally, in the above steps, keywords are extracted from the domain name in the DNS request, for example, the domain name is truncated with characters such as ':', ' / ', '.', etc.
[0041] Step S104: fingerprint the key character information to generate fingerprint information, wherein the fingerprint information includes a mapping relationship between the current MAC address of the target network device and each key character in the key character information.
[0042] Optionally, in the above steps, the key character information previously obtained is fingerprinted to obtain fingerprint information. It should be noted that the fingerprint information includes the mapping relationship between the MAC address of the target network device when the DNS request is currently initiated and each key character in the key character information previously extracted. Among them, the MAC address is the unique network identifier of each network device, which can also be called the network card address, which is written inside the hardware when the network device manufacturer produces it.
[0043] Step S106: Determine the similarity between the fingerprint information and the historical fingerprint information.
[0044] Optionally, in the above steps, the similarity between the fingerprint information and the historical fingerprint information is calculated by using an evaluation factor.
[0045] Step S108: determining the device type of the target network device based on the similarity.
[0046] As can be seen from the above, in the embodiment of the present invention, the domain name resolution DNS request initiated by the target network device can first be feature processed to obtain the key character information of the target network device; then the key character information can be fingerprinted to generate fingerprint information, wherein the fingerprint information includes the mapping relationship between the current MAC address of the target network device and each key character in the key character information; then the similarity between the fingerprint information and the historical fingerprint information can be determined; finally, the device type of the target network device can be determined based on the similarity. The network device identification method provided by the embodiment of the present invention achieves the purpose of using the key character information of the target network device to form fingerprint information and compare it with the historical fingerprint information to determine the device type of the target network device based on the similarity, thereby achieving the technical effect of improving the accuracy of identifying network devices, and further solving the technical problem in the related technology that the network device client cannot accurately identify its type through fingerprint information.
[0047] As an optional embodiment, feature processing is performed on the domain name resolution DNS request initiated by the target network device to obtain key character information of the target network device, including: after detecting the network access information of the target network device, collecting the DNS request initiated by the target network device; extracting key characters from the DNS request to obtain the domain name information in the DNS request; and performing feature processing on the key characters corresponding to the domain name information to obtain the key character information.
[0048] In the above optional steps, the target network device first makes a domain name resolution request (i.e., network access information), and sends the request to the local domain name server after searching the local HOST file. At this time, the method provided in this embodiment will collect the DNS request and extract key characters to obtain the domain name information in the DNS request, and finally perform feature processing on the key characters corresponding to the domain name information to obtain the key character information.
[0049] As an optional embodiment, feature processing is performed on key characters corresponding to the domain name information to obtain key character information, including: cleaning the key characters to obtain cleaned key characters; encrypting the cleaned key characters to obtain key character information.
[0050] In the above optional embodiment, the key characters are first cleaned, for example, single characters or special characters such as Arabic numerals and special mathematical characters are removed, which helps to better obtain the key character information.
[0051] It should be noted that in some confidentiality scenarios, in order to protect user privacy, the key characters after cleaning need to be encrypted. Common methods include keyword hash processing, MD5 processing, etc.
[0052] As an optional embodiment, the key character information is fingerprinted to generate fingerprint information, including: obtaining the current MAC address of the target network device; obtaining the evaluation factor of each key character corresponding to the key character information, and generating a key-value pair for each key character based on the evaluation factor of each key character; generating a key-value pair of the current MAC address and each key character to obtain fingerprint information.
[0053] In the above optional embodiment, in the embodiment of the present invention, in order to obtain fingerprint information, first obtain the Mac-fingerprint key-value pair, where it should be noted that fingerprint is a series of keyword-wt key-value pairs, where MAC is the current MAC address of the access client, keyword is the keywords in the above steps, and wt is the evaluation factor of the keyword.
[0054] As an optional embodiment, obtaining an evaluation factor for each key character corresponding to key character information includes: obtaining the total number of occurrences of all key characters corresponding to all access network devices within a historical time period, and the number of accesses of all access network devices; obtaining the number of occurrences of each key character in the target network device during the access, and the number of occurrences of each key character in the number of accesses; determining a first sub-evaluation factor based on the number of occurrences of each key character in the target network device during the access and the total number of occurrences of all key characters; determining a second sub-evaluation factor based on the number of accesses of all access network devices and the number of occurrences of each key character in the number of accesses; and determining the product of the first sub-evaluation factor and the second sub-evaluation factor as the evaluation factor for each key character.
[0055] In the above optional embodiment, the fingerprint information is obtained by using the evaluation factor of the keyword. The calculation steps of the evaluation factor of the keyword are described in detail below.
[0056] 1) Definition Among them, n i is keyword i The number of times the keyword appears in all the keywords of the device during this access. The denominator is the sum of the number of times all keywords appear in all the devices that have accessed in history.
[0057] 2) Definition Where D is the number of times all network devices accessed in the historical time period, d i To represent keyword i The number of times it appears in D records.
[0058] 3) Define wt i =tf i *idf i , where wt i This is the evaluation factor.
[0059] As an optional embodiment, determining the similarity between fingerprint information and historical fingerprint information includes: obtaining an evaluation factor of each key character in the fingerprint information; obtaining an evaluation factor of each historical key character in the historical fingerprint information; and determining the similarity based on the evaluation factor of each key character and the evaluation factor of each historical key character.
[0060] In the above optional embodiment, the evaluation factor of each key character in the fingerprint information and the historical fingerprint information is obtained, and the similarity is determined based on this, that is, the wireless fingerprint information is compared with the fingerprints in the historical fingerprint library for similarity. If the similarity is greater than the set threshold, it is determined to be the same client; otherwise, it is a new client.
[0061] As an optional embodiment, determining the similarity based on the evaluation factor of each key character and the evaluation factor of each historical key character includes: determining a first similarity value by a first formula, wherein the first formula is: A represents the first similarity value, wt ij represents the evaluation factor of the i-th key character in the j-th network device access information, where j and i are positive integers; and the second similarity value is determined by the second formula, wherein the second formula is: B represents the second similarity value, wt ik represents the evaluation factor of the i-th key character in the k-th network device access information, where k is a positive integer; and the third similarity value is determined by a third formula, wherein the third formula is: C represents a third similarity value; the similarity is determined based on a ratio between the third similarity value and a product of the first similarity value and the second similarity value.
[0062] In the above optional embodiment, the evaluation factor of each key character in the previously acquired fingerprint information and the historical fingerprint information is used to determine the similarity. The following is a similar description of the steps for obtaining the similarity.
[0063] 1) Definition Among them, wt ij is the evaluation factor of the i-th keyword in the j-th device access information.
[0064] 2) Definition by analogy Among them, wt ik is the evaluation factor of the i-th keyword in the k-th device access information.
[0065] 3) Definition
[0066] 4) The similarity between the fingerprint information of the j-th device access information and the fingerprint information of the k-th device access information is defined as C / (A*B).
[0067] 5) The selection of the threshold requires the collection of a large amount of data through experiments. The confusion matrix under different thresholds is analyzed by this scheme to obtain: Figure 2 is a schematic diagram of a receiver operating characteristic (ROC) curve under the change of the threshold value of the same client when the similarity is determined according to an embodiment of the present invention, such as Figure 2 As shown, under the method provided in the embodiment of the present invention, the accuracy represented by the solid line is getting higher and higher. In actual production tests, a suitable threshold value can be selected according to actual needs.
[0068] As an optional embodiment, determining the device type of the target network device based on similarity includes: when the similarity is greater than a similarity threshold, determining that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device; when the similarity is not greater than the similarity threshold, determining that the target network device is a newly accessed network device.
[0069] In the above optional real-time example, when the similarity is greater than the preset similarity threshold, it is determined that the target network device and the network device corresponding to the historical fingerprint information are the same network device; when the similarity is not greater than the similarity threshold, it is determined that the target network device is a newly connected network device.
[0070] As an optional embodiment, the network device identification method also includes: when it is determined that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device, while updating the fingerprint library and the total number of times each key character appears in the fingerprint library, each key character in the target network device and the number of times each key character appears are updated; when it is determined that the target network device is a newly connected network device, while updating the fingerprint library and the total number of times each key character appears in the fingerprint library, the fingerprint information is added to the fingerprint library.
[0071] Figure 3 is a flow chart of a preferred method for identifying a network device according to an embodiment of the present invention. Figure 3 As shown, first, DNS requests within a certain period of time after the device is connected are collected, and then feature processing, keyword extraction, cleaning, fuzzification processing and wireless fingerprint information are successively performed, and then similarity comparison is performed and the client is determined, and finally the fingerprint library information is updated.
[0072] From the above, it can be seen that through the embodiments provided by the present invention, during the client access process, it is possible to effectively identify whether the client is a client that has accessed in the history and match them one by one; when the client MAC address changes, the client can still be effectively identified. In this solution, it relies on the DNS message within a period of time after the client accesses, that is, the change of the DNS message will affect the accuracy of client identification; the access end does not need to actively initiate interaction with the access device, which is a purely passive solution, that is, it will not affect network performance and client experience.
[0073] Example 2
[0074] According to another aspect of an embodiment of the present invention, a network device identification device is provided. Figure 4 is a schematic diagram of an identification device of a network device according to an embodiment of the present invention, Figure 4As shown, it includes: a feature processing unit 41, a fingerprint processing unit 43, a first determination unit 45 and a second determination unit 47. The identification device of the network device is described below.
[0075] The feature processing unit 41 is used to perform feature processing on the domain name resolution DNS request initiated by the target network device to obtain key character information of the target network device;
[0076] A fingerprint processing unit 43, configured to perform fingerprint processing on the key character information to generate fingerprint information, wherein the fingerprint information includes a mapping relationship between a current MAC address of the target network device and each key character in the key character information;
[0077] A first determining unit 45, configured to determine the similarity between the fingerprint information and the historical fingerprint information;
[0078] The second determining unit 47 is configured to determine the device type of the target network device based on the similarity.
[0079] It should be noted that the feature processing unit 41, fingerprint processing unit 43, first determination unit 45 and second determination unit 47 correspond to steps S102 to S108 in Embodiment 1, and the examples and application scenarios implemented by the modules are the same as those of the corresponding steps, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the modules as part of the apparatus can be executed in a computer system such as a set of computer executable instructions.
[0080] As can be seen from the above, in the embodiment of the present invention, the domain name resolution DNS request initiated by the target network device can first be feature processed with the help of the feature processing unit 41 to obtain the key character information of the target network device; then the key character information can be fingerprinted with the help of the fingerprint processing unit 43 to generate fingerprint information, wherein the fingerprint information includes the mapping relationship between the current MAC address of the target network device and each key character in the key character information; then the similarity between the fingerprint information and the historical fingerprint information can be determined with the help of the first determination unit 45; finally, the device type of the target network device can be determined based on the similarity with the help of the second determination unit 47. The identification device for network devices provided by the embodiment of the present invention achieves the purpose of using the key character information of the target network device to form fingerprint information and compare it with the historical fingerprint information to determine the device type of the target network device based on the similarity, thereby achieving the technical effect of improving the accuracy of identifying network devices, and further solving the technical problem in the related technology that the network device client cannot accurately identify its type through fingerprint information.
[0081] Optionally, the feature processing unit includes: a collection module, used to collect the DNS request initiated by the target network device after detecting the network access information of the target network device; a key character extraction module, used to extract key characters from the DNS request to obtain the domain name information in the DNS request; and a feature processing module, used to perform feature processing on the key characters corresponding to the domain name information to obtain the key character information.
[0082] Optionally, the feature processing module includes: a cleaning processing submodule, which is used to clean the key characters to obtain the cleaned key characters; and an encryption processing submodule, which is used to encrypt the cleaned key characters to obtain key character information.
[0083] Optionally, the fingerprint processing unit includes: a first acquisition module, used to obtain the current MAC address of the target network device; a second acquisition module, used to obtain the evaluation factor of each key character corresponding to the key character information, and generate a key-value pair of each key character based on the evaluation factor of each key character; a generation module, used to generate a key-value pair of the current MAC address and each key character to obtain fingerprint information.
[0084] Optionally, the second acquisition module includes: a first acquisition submodule, used to obtain the total number of occurrences of all key characters corresponding to all access network devices within a historical time period, and the number of access times of all access network devices; a second acquisition submodule, used to obtain the number of occurrences of each key character in the target network device's access, and the number of occurrences of each key character in the access times; a first determination submodule, used to determine a first sub-evaluation factor based on the number of occurrences of each key character in the target network device's access and the total number of occurrences of all key characters; a second determination submodule, used to determine a second sub-evaluation factor based on the access times of all access network devices and the number of occurrences of each key character in the access times; and a third determination submodule, used to determine the product of the first sub-evaluation factor and the second sub-evaluation factor as the evaluation factor of each key character.
[0085] Optionally, the first determination unit includes: a third acquisition module, used to obtain the evaluation factor of each key character in the fingerprint information; a fourth acquisition module, used to obtain the evaluation factor of each historical key character in the historical fingerprint information; and a first determination module, used to determine the similarity based on the evaluation factor of each key character and the evaluation factor of each historical key character.
[0086] Optionally, the first determination module includes: a fourth determination submodule, configured to determine the first similarity value by using a first formula, wherein the first formula is: A represents the first similarity value, wt ijrepresents the evaluation factor of the i-th key character in the j-th network device access information, where j and i are positive integers; a fifth determination submodule, configured to determine a second similarity value by a second formula, wherein the second formula is: B represents the second similarity value, wt ij represents the evaluation factor of the i-th key character in the k-th network device access information, where k is a positive integer; a sixth determination submodule, configured to determine a third similarity value by a third formula, wherein the third formula is: C represents a third similarity value; a seventh determination submodule is used to determine the similarity based on a ratio between the third similarity value and a product of the first similarity value and the second similarity value.
[0087] Optionally, the second determination unit includes: a second determination module, used to determine that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device when the similarity is greater than a similarity threshold; a third determination module, used to determine that the target network device is a newly accessed network device when the similarity is not greater than a similarity threshold.
[0088] Optionally, the identification device of the network device also includes: a first update module, which is used to update the fingerprint library and the total number of times each key character appears in the fingerprint library, and update each key character and the number of times each key character appears in the target network device when it is determined that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device; a second update module, which is used to add the fingerprint information to the fingerprint library while updating the fingerprint library and the total number of times each key character appears in the fingerprint library when it is determined that the target network device is a newly accessed network device.
[0089] Example 3
[0090] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned methods for identifying a network device.
[0091] Example 4
[0092] According to another aspect of an embodiment of the present invention, a processor is provided, and the processor is used to run a computer program, wherein the computer program executes any of the above-mentioned methods for identifying a network device when running.
[0093] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0094] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0095] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0096] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0097] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0098] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0099] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for identifying a network device, characterized in that: include: Performing feature processing on a domain name resolution DNS request initiated by a target network device to obtain key character information of the target network device; Fingerprinting the key character information to generate fingerprint information, wherein the fingerprint information includes a mapping relationship between a current MAC address of the target network device and each key character in the key character information; Determining the similarity between the fingerprint information and historical fingerprint information; Determining a device type of the target network device based on the similarity; The key character information is fingerprinted to generate fingerprint information, including: Obtain the current MAC address of the target network device; Acquire an evaluation factor of each key character corresponding to the key character information, and generate a key-value pair of each key character based on the evaluation factor of each key character; Generate a key-value pair of the current MAC address and each key character to obtain the fingerprint information.
2. The method according to claim 1, characterized in that Perform feature processing on the domain name resolution DNS request initiated by the target network device to obtain key character information of the target network device, including: After detecting the network access information of the target network device, collecting the DNS request initiated by the target network device; Extract key characters from the DNS request to obtain domain name information in the DNS request; Feature processing is performed on the key characters corresponding to the domain name information to obtain the key character information.
3. The method according to claim 1, characterized in that Obtaining an evaluation factor of each key character corresponding to the key character information includes: Obtaining the total number of occurrences of all key characters corresponding to all network access devices within a historical time period, and the number of access times of all network access devices; Obtain the number of times each key character appears in the access of the target network device, and the number of times each key character appears in the access times; Determine a first sub-evaluation factor based on the number of times each key character appears in the target network device's access and the sum of the number of times all key characters appear; Determine a second sub-evaluation factor based on the access times of all the access network devices and the number of occurrences of each key character in the access times; The product of the first sub-evaluation factor and the second sub-evaluation factor is determined as the evaluation factor of each key character.
4. The method according to claim 3, characterized in that Determining the similarity between the fingerprint information and the historical fingerprint information includes: Obtaining an evaluation factor of each key character in the fingerprint information; Obtaining an evaluation factor of each historical key character in the historical fingerprint information; The similarity is determined based on the evaluation factor of each key character and the evaluation factor of each historical key character.
5. The method according to claim 4, characterized in that Determining the similarity based on the evaluation factor of each key character and the evaluation factor of each historical key character includes: The first similarity value is determined by a first formula, wherein the first formula is: A represents the first similarity value, wt ij represents the evaluation factor of the i-th key character in the j-th network device access information, where j and i are positive integers; The second similarity value is determined by a second formula, wherein the second formula is: B represents the second similarity value, wt ik represents the evaluation factor of the i-th key character in the k-th network device access information, where k is a positive integer; The third similarity value is determined by a third formula, wherein the third formula is: C represents the third similarity value; The similarity is determined based on a ratio between the third similarity value and a product of the first similarity value and the second similarity value.
6. The method according to any one of claims 1 to 5, characterized in that Determining the device type of the target network device based on the similarity includes: When the similarity is greater than a similarity threshold, determining that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device; When the similarity is not greater than a similarity threshold, it is determined that the target network device is a newly accessed network device.
7. The method according to claim 6, characterized in that Also includes: When it is determined that the target network device and the network device corresponding to the MAC address in the historical fingerprint information are the same network device, while updating the fingerprint library and the total number of times each key character appears in the fingerprint library, each key character in the target network device and the number of times each key character appears are updated; When it is determined that the target network device is a newly accessed network device, the fingerprint information is added to the fingerprint database while updating the fingerprint database and the total number of occurrences of each key character in the fingerprint database.
8. A network device identification device, characterized in that: include: A feature processing unit, used for performing feature processing on a domain name resolution DNS request initiated by a target network device to obtain key character information of the target network device; A fingerprint processing unit, configured to perform fingerprint processing on the key character information to generate fingerprint information, wherein the fingerprint information includes a mapping relationship between a current MAC address of the target network device and each key character in the key character information; A first determining unit, configured to determine a similarity between the fingerprint information and historical fingerprint information; A second determining unit, configured to determine a device type of the target network device based on the similarity; The fingerprint processing unit comprises: A first acquisition module, used to acquire the current MAC address of the target network device; A second acquisition module, configured to acquire an evaluation factor of each key character corresponding to the key character information, and generate a key-value pair of each key character based on the evaluation factor of each key character; The generating module is used to generate a key-value pair of the current MAC address and each key character to obtain the fingerprint information.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the network device identification method described in any one of claims 1 to 7.
10. A processor, characterized in that: The processor is used to run a computer program, wherein the computer program executes the network device identification method described in any one of claims 1 to 7 when running.
