Terminal identification method and device, network equipment and storage medium
By vectorizing the identification information field in the terminal message and inputting it into the neural network model, the category and manufacturer information of the terminal are identified, which solves the problem of identifying unexposed terminal models and achieves precise identification and improved accuracy of terminals.
Patent Information
- Application Number
- CN202310327880.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-03-30
AI Technical Summary
It is difficult for existing technology to identify terminal devices with unexposed models, especially when terminal manufacturers have increased awareness of user privacy protection. The traditional method of extracting terminal models through DHCP messages or HTTP messages fails.
By vectorizing the identification information field in the target message sent by the terminal, a target feature vector of a specific length is generated, and input into the neural network model to identify the terminal's category and manufacturer information, and the category and manufacturer identification model is used for accurate identification.
Even terminal equipment of unexposed models or new models can be accurately identified, which improves the accuracy and applicability of terminal identification and meets the network provider's targeted control requirements for terminals.
Smart Images

Figure CN118734027A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a terminal identification method, device, network equipment and storage medium. Background Art
[0002] With the development of technology, terminals are becoming more and more popular and their categories are becoming more and more abundant. By identifying the relevant information of the terminal, it helps network providers to carry out targeted control of the terminal, such as network optimization, fault detection and function development.
[0003] In the related art, the terminal model is determined by analyzing a key field containing the terminal model in a Dynamic Host Configuration Protocol (English: Dynamic Host Configuration Protocol, abbreviated as DHCP) message.
[0004] However, as terminal manufacturers gradually become more aware of user privacy protection, more and more devices no longer expose terminal models. Therefore, the above method is not suitable for information identification of terminals that do not expose model numbers. Summary of the invention
[0005] The present application provides a terminal identification method, apparatus, network equipment and storage medium for accurately and comprehensively identifying a terminal.
[0006] In a first aspect, an embodiment of the present application provides a terminal identification method, the method comprising:
[0007] Based on the target message sent by the terminal, determining the identification information field carried in the target message;
[0008] Vectorizing the identification information field to obtain a target feature vector of a first preset length corresponding to the target message;
[0009] The target feature vector is input into a terminal recognition model to determine the category information and manufacturer information corresponding to the target message.
[0010] In the above scheme, when performing targeted control on the terminal, it is usually only necessary to obtain the manufacturer and category of the terminal. The specific terminal model has little effect on the control strategy. It is relatively easy and accurate to identify the terminal category and manufacturer through a neural network. Therefore, the terminal identification model can accurately determine the category-related information and manufacturer-related information of the terminal, which is also applicable to terminals with unexposed models and new models. In addition, by vectorizing the identification information field, a target feature vector of a specific length is obtained, so the vectors input into the terminal identification model are all of equal length, which improves the recognition accuracy.
[0011] In some optional implementations, vectorizing the identification information field to obtain a target feature vector of a first preset length corresponding to the target message includes:
[0012] Vectorizing each character in the identification information field to obtain a feature value corresponding to each character;
[0013] Based on the initial feature vector, determining an adjustment vector of a second preset length; wherein the initial feature vector includes feature values corresponding to all characters in the identification information field;
[0014] The adjustment vector is compressed based on the autoencoder to obtain a target feature vector of a first preset length; wherein the second preset length is a preset multiple of the first preset length.
[0015] The above scheme obtains the eigenvalue corresponding to each character by vectorizing each character respectively, and the eigenvalues corresponding to all characters constitute the initial feature vector, that is, the vectorized representation of the identification information field; by unifying the initial feature vector into an adjustment vector of a specific length (a second preset length), the length of the vector input into the model is kept consistent, thereby improving the subsequent recognition accuracy; and then the adjustment vector is compressed by an autoencoder to obtain a shorter (first preset length) target feature vector, which can ensure a high compression rate and ensure that the effective information of the identification information field is fully retained.
[0016] In some optional implementations, determining the adjustment vector of the second preset length based on the initial feature vector includes:
[0017] If the length of the initial feature vector is less than the second preset length, adding a preset element of a target length to the initial feature vector; wherein the sum of the target length and the length of the initial feature vector is the second preset length; or
[0018] If the length of the initial feature vector is greater than the second preset length, an adjustment vector of the second preset length is intercepted from the initial feature vector.
[0019] In some optional implementations, the terminal identification model includes a category identification model and a manufacturer identification model, and inputting the target feature vector into the terminal identification model to determine the category information and manufacturer information corresponding to the target message includes:
[0020] Inputting the target feature vector into the category identification model and the manufacturer identification model respectively;
[0021] Extracting category features from the target feature vector using the category recognition model to obtain category information corresponding to the target message; and
[0022] The manufacturer feature is extracted from the target feature vector through the manufacturer identification model to obtain the manufacturer information corresponding to the target message.
[0023] The above scheme trains the category recognition model and the manufacturer recognition model respectively, and performs category recognition through the category recognition model and performs manufacturer recognition through the manufacturer recognition model to accurately determine the category information and the manufacturer information.
[0024] In some optional implementations, performing category feature extraction on the target feature vector by using the category recognition model to obtain category information corresponding to the target message includes:
[0025] Extracting category features from the target feature vector through the first convolutional layer in the category recognition model to obtain category features;
[0026] The category features are comprehensively classified through the first fully connected layer in the category recognition model, and category information corresponding to the target message is output.
[0027] The above scheme increases the receptive field of neurons through the first convolutional layer, so that the category recognition model has a certain range of local feature extraction capabilities, accurately extracts category features, and obtains category features; through the first fully connected layer, the category recognition model can connect context features, make comprehensive judgments, and output category information.
[0028] In some optional implementations, extracting vendor features from the target feature vector using the vendor identification model to obtain vendor information corresponding to the target message includes:
[0029] Extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model to obtain manufacturer features;
[0030] The vendor characteristics are comprehensively classified through the second fully connected layer in the vendor identification model, and the vendor information corresponding to the target message is output.
[0031] The above scheme increases the receptive field of neurons through the second convolutional layer, so that the manufacturer identification model has a certain range of local feature extraction capabilities, accurately extracts manufacturer features, and obtains manufacturer features; through the second fully connected layer, the manufacturer identification model can connect context features, make comprehensive judgments, and output manufacturer information.
[0032] In some optional implementations, if the terminal sends multiple target messages, after determining the category information and manufacturer information corresponding to each target message, the method further includes:
[0033] Selecting, from all the category information corresponding to the plurality of target messages, the category information with the largest number of occurrences as the target category information of the terminal; and
[0034] From all the manufacturer information corresponding to the multiple target messages, the manufacturer information with the largest number of appearances is selected as the target manufacturer information of the terminal.
[0035] The above scheme accurately determines the target category information of the terminal by selecting the category information with the largest number of occurrences from all the category information corresponding to the multiple target messages of the terminal; and accurately determines the target manufacturer information of the terminal by selecting the manufacturer information with the largest number of occurrences from all the manufacturer information corresponding to the multiple target messages of the terminal.
[0036] In some optional implementations, the target message is a Hyper Text Transfer Protocol (English: Hyper Text Transfer Protocol, abbreviated as HTTP) message, and the identification information field is a User Agent (English: User Agent, abbreviated as UA).
[0037] The above solution can cover most terminals by using HTTP messages as target messages, and can accurately determine manufacturer information and category information later by using the UA field as the identification information field.
[0038] In a second aspect, an embodiment of the present application provides a terminal identification device, including:
[0039] A field determination module, used to determine the identification information field carried in the target message based on the target message sent by the terminal;
[0040] A vectorization module, used to vectorize the identification information field to obtain a target feature vector of a first preset length corresponding to the target message;
[0041] The identification module is used to input the target feature vector into the terminal identification model to determine the category information and manufacturer information corresponding to the target message.
[0042] In some optional implementations, the vectorization module is specifically used to:
[0043] Vectorizing each character in the identification information field to obtain a feature value corresponding to each character;
[0044] Based on the initial feature vector, determining an adjustment vector of a second preset length; wherein the initial feature vector includes feature values corresponding to all characters in the identification information field;
[0045] The adjustment vector is compressed based on the autoencoder to obtain a target feature vector of a first preset length; wherein the second preset length is a preset multiple of the first preset length.
[0046] In some optional implementations, the vectorization module is specifically used to:
[0047] If the length of the initial feature vector is less than the second preset length, adding a preset element of a target length to the initial feature vector; wherein the sum of the target length and the length of the initial feature vector is the second preset length; or
[0048] If the length of the initial feature vector is greater than the second preset length, an adjustment vector of the second preset length is intercepted from the initial feature vector.
[0049] In some optional implementations, the terminal identification model includes a category identification model and a manufacturer identification model, and the identification module is specifically used to:
[0050] Inputting the target feature vector into the category identification model and the manufacturer identification model respectively;
[0051] Extracting category features from the target feature vector using the category recognition model to obtain category information corresponding to the target message; and
[0052] The manufacturer feature is extracted from the target feature vector through the manufacturer identification model to obtain the manufacturer information corresponding to the target message.
[0053] In some optional implementations, the identification module is specifically used to:
[0054] Extracting category features from the target feature vector through the first convolutional layer in the category recognition model to obtain category features;
[0055] The category features are comprehensively classified through the first fully connected layer in the category recognition model, and category information corresponding to the target message is output.
[0056] In some optional implementations, the identification module is specifically used to:
[0057] Extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model to obtain manufacturer features;
[0058] The vendor characteristics are comprehensively classified through the second fully connected layer in the vendor identification model, and the vendor information corresponding to the target message is output.
[0059] In some optional implementations, if the terminal sends multiple target messages, the identification module, after determining the category information and manufacturer information corresponding to each target message, is further configured to:
[0060] Selecting, from all the category information corresponding to the plurality of target messages, the category information with the largest number of occurrences as the target category information of the terminal; and
[0061] From all the manufacturer information corresponding to the multiple target messages, the manufacturer information with the largest number of appearances is selected as the target manufacturer information of the terminal.
[0062] In some optional implementations, the target message is an HTTP message, and the identification information field is a UA field.
[0063] In a third aspect, an embodiment of the present application provides a network device, including a processor and a memory;
[0064] The memory stores program code, and when the program code is executed by the processor, the processor executes the terminal identification method as described in any one of the first aspects.
[0065] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the terminal identification method as described in any one of the first aspects is implemented.
[0066] In addition, the technical effects brought about by any implementation method in the second to fourth aspects can refer to the technical effects brought about by different implementation methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0068] Figure 1 A schematic flow chart of a first terminal identification method provided in an embodiment of the present application;
[0069] Figure 2 A schematic flow chart of a second terminal identification method provided in an embodiment of the present application;
[0070] Figure 3 A schematic diagram of the vectorization process provided in an embodiment of the present application;
[0071] Figure 4A schematic flow chart of a third terminal identification method provided in an embodiment of the present application;
[0072] Figure 5 A schematic diagram of the identification process provided in an embodiment of the present application;
[0073] Figure 6 A schematic diagram of a category recognition model provided in an embodiment of the present application;
[0074] Figure 7 A schematic diagram of a manufacturer identification model provided in an embodiment of the present application;
[0075] Figure 8 A schematic flow chart of a fourth terminal identification method provided in an embodiment of the present application;
[0076] Fig. 9 A schematic diagram of the structure of a terminal identification device provided in an embodiment of the present application;
[0077] Fig.10 A schematic block diagram of a network device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0079] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0080] In the description of this application, unless otherwise clearly specified and limited, the term "connection" should be understood in a broad sense, for example, it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal connection of two devices. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0081] By identifying relevant information of the terminal, it helps network providers to carry out targeted control of the terminal, such as network optimization, fault detection and function development.
[0082] In some embodiments, the terminal model is determined by analyzing key fields containing the terminal model in the DHCP protocol message, such as the hostname of option (custom data field) 12 and the vendor class id of option 60.
[0083] However, as terminal manufacturers gradually become more aware of user privacy protection, more and more devices no longer expose terminal models. Therefore, the above method is not suitable for identifying terminals that do not expose model numbers.
[0084] In some embodiments, the UA field in the HTTP message may also carry terminal model information, and the model keyword in the UA is extracted through a regular expression to complete the identification.
[0085] However, this approach requires the construction of complex regular expressions, which are prone to omission or mis-extraction, and is not suitable for the identification of unexposed model terminals.
[0086] In some embodiments, terminal identification is performed based on the Media Access Control (MAC) address. Although terminal manufacturers are accustomed to assigning a continuous MAC address to terminal devices of the same device model, the same model of terminal may be produced in multiple batches, occupying multiple MAC address intervals, which will be mixed with other terminal models. Especially for some terminals with low production, the MAC addresses of such terminals are often mixed between the MAC addresses of other devices. Therefore, it is difficult to accurately identify the terminal in this way.
[0087] In some embodiments, terminal identification is performed based on a neural network. Currently, there are more than 30,000 smart terminal models on the market. This method requires a large amount of data to support the training of the neural network. If a new terminal model that has never appeared in the training set or a terminal model that appears less frequently is prone to misidentification.
[0088] Based on this, an embodiment of the present application provides a terminal identification method, device, network equipment and storage medium. The method is applied to a network device, including: based on a target message sent by the terminal, determining an identification information field carried in the target message; vectorizing the identification information field to obtain a target feature vector of a first preset length corresponding to the target message; inputting the target feature vector into a terminal identification model to determine the category information and manufacturer information corresponding to the target message.
[0089] This embodiment does not limit the specific implementation of the network device, such as a gateway.
[0090] In the above scheme, when performing targeted control on the terminal, it is usually only necessary to obtain the manufacturer and category of the terminal. The specific terminal model has little effect on the control strategy. It is relatively easy and accurate to identify the terminal category and manufacturer through a neural network. Therefore, the terminal identification model can accurately determine the category-related information and manufacturer-related information of the terminal, which is also applicable to terminals with unexposed models and new models. In addition, by vectorizing the identification information field, a target feature vector of a specific length is obtained, so the vectors input into the terminal identification model are all of equal length, which improves the recognition accuracy.
[0091] The following will be combined with the accompanying drawings and specific embodiments to explain in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0092] The present application embodiment provides a first terminal identification method, which is applied to a network device, such as Figure 1 As shown, the method may include:
[0093] Step S101: Based on a target message sent by a terminal, determining an identification information field carried in the target message.
[0094] In this embodiment, for a terminal to be identified, after it is connected to the network, the network device can receive various types of messages sent by the terminal, and after receiving a target message carrying an identification information field, determine the identification information field that characterizes the characteristics of the terminal.
[0095] This embodiment does not specifically limit the target message and the identification information field. In some optional implementations, the target message is an HTTP message, and the identification information field is a UA field.
[0096] For example, since most terminals will send HTTP messages during operation, the UA field in the HTTP message usually contains rich terminal information, such as operating system, application name, application version, etc., and the UA fields corresponding to terminals of different types and manufacturers are usually different. For example, there will be special characters in the UA field corresponding to a certain brand of terminal, and the UA field format of mobile phones and tablets is different. Therefore, by using HTTP messages as target messages, most terminals can be covered, and by using the UA field as the identification information field, the manufacturer information and category information can be accurately determined later.
[0097] In implementation, if the target message is an HTTP message, the above identification information field may also be a host (message header) field; or, if the target message is a Domain Name System (English: Domain Name System, abbreviated as DNS) message, the identification information field may be domain name information, etc. Examples will not be given one by one here.
[0098] Step S102: vectorizing the identification information field to obtain a target feature vector of a first preset length corresponding to the target message.
[0099] This embodiment determines the category-related information and manufacturer-related information of the terminal through the terminal recognition model. The input of the model needs to be vectorized, and equal-length vectors will improve recognition accuracy. Based on this, the recognition information field needs to be vectorized to obtain a target feature vector of a first preset length.
[0100] Step S103: input the target feature vector into a terminal recognition model to determine the category information and manufacturer information corresponding to the target message.
[0101] In the above scheme, when performing targeted control on the terminal, it is usually only necessary to obtain the manufacturer and category of the terminal. The specific terminal model has little effect on the control strategy. It is relatively easy and accurate to identify the terminal category and manufacturer through a neural network. Therefore, the terminal identification model can accurately determine the category-related information and manufacturer-related information of the terminal, which is also applicable to terminals with unexposed models and new models. In addition, by vectorizing the identification information field, a target feature vector of a specific length is obtained, so the vectors input into the terminal identification model are all of equal length, which improves the recognition accuracy.
[0102] The present application embodiment provides a second terminal identification method, such as Figure 2 As shown, the method may include:
[0103] Step S201: Based on a target message sent by a terminal, determining an identification information field carried in the target message.
[0104] The specific implementation of step S201 can refer to the above embodiment and will not be described again here.
[0105] Step S202: vectorizing each character in the identification information field to obtain a feature value corresponding to each character.
[0106] In implementation, each character is vectorized to obtain a vector representation of each character, that is, a eigenvalue corresponding to each character; the eigenvalues corresponding to all characters constitute an initial eigenvector, that is, a vectorized representation of the identification information field.
[0107] Step S203: Determine an adjustment vector of a second preset length based on the initial feature vector.
[0108] The initial feature vector includes the feature values corresponding to all the characters in the identification information field, that is, the initial feature vector is composed of the feature values corresponding to all the characters in the identification information field.
[0109] In this embodiment, the initial feature vector contains the feature values corresponding to all the characters in the identification information field, that is, the length of the initial feature vector matches the number of characters contained in the identification information field. Since the identification information fields of different messages are complex and changeable, and the number of characters is inconsistent, the length of the initial feature vector will also be different.
[0110] In order to improve the subsequent recognition accuracy, the vector input into the model needs to keep the same length. Based on this, the initial feature vector needs to be unified into an adjustment vector of a specific length (a second preset length).
[0111] Step S204: compressing the adjustment vector based on the autoencoder to obtain a target feature vector of a first preset length.
[0112] The second preset length is a preset multiple of the first preset length.
[0113] During implementation, in order to retain most of the features of the initial feature vector, the second preset length is set larger, that is, the length of the adjustment vector is longer. If the vector of the second preset length is directly used for model training and use, it will take a long time. Based on this, this embodiment uses an autoencoder to compress the adjustment vector to obtain a shorter (first preset length) target feature vector.
[0114] For example, if the second preset length is 512, the first preset length can be set to 128, and the second preset length is 4 times the first preset length. When the preset multiple is 4, the compression rate is doubled compared to the preset multiple is 2, but the valid information of the identification information field is basically retained (compared with the preset multiple of 2, the retention of valid information is not much different); when the preset multiple is 8, although the compression rate is low, a large amount of valid information in the identification information field is missing. Therefore, in implementation, the preset multiple can be set to 4, which can ensure a high compression rate and ensure that the valid information of the identification information field is fully retained.
[0115] Step S205: input the target feature vector into a terminal recognition model to determine the category information and manufacturer information corresponding to the target message.
[0116] The specific implementation of step S205 may refer to other embodiments and will not be described in detail here.
[0117] The above scheme obtains the eigenvalue corresponding to each character by vectorizing each character respectively, and the eigenvalues corresponding to all characters constitute the initial feature vector, that is, the vectorized representation of the recognition information field; by unifying the initial feature vector into an adjustment vector of a specific length (a second preset length), the length of the vector input into the model is kept consistent, thereby improving the subsequent recognition accuracy; and then the adjustment vector is compressed by an autoencoder to obtain a shorter (first preset length) target feature vector, thereby reducing the difficulty of model training.
[0118] In some optional implementation manners, the above step S203 may be implemented by but not limited to the following methods:
[0119] If the length of the initial feature vector is less than the second preset length, adding a preset element of a target length to the initial feature vector; wherein the sum of the target length and the length of the initial feature vector is the second preset length; or
[0120] If the length of the initial feature vector is greater than the second preset length, an adjustment vector of the second preset length is intercepted from the initial feature vector.
[0121] Exemplarily, if the length of the initial feature vector is less than the second preset length, it means that the number of eigenvalues in the initial feature vector is small, and it is necessary to add a preset element (such as 0) of a certain length (the difference between the second preset length and the length of the initial feature vector) on the basis of the initial feature vector, so that an adjustment vector of the second preset length can be obtained.
[0122] If the length of the initial feature vector is greater than the second preset length, it means that the initial feature vector contains a large number of eigenvalues and redundant eigenvalues (such as eigenvalues after the second preset length) need to be truncated to obtain an adjustment vector of the second preset length.
[0123] In implementation, since a larger second preset length is set, the length of the initial feature vector is usually smaller than the second preset length, and the adjustment vector is obtained by adding preset elements of the target length.
[0124] The following is a specific example:
[0125] See also Figure 3 As shown, each character in the identification information field is vectorized to obtain an initial feature vector (65, 112, 112, 108, 101, 67, 111, 114, ..., 49) with a length of 108;
[0126] The length of the initial feature vector is less than the second preset length (512), and 404 preset elements 0 are added to the initial feature vector to obtain an adjustment vector (65, 112, 112, 108, 101, 67, 111, 114, ..., 49, 0, 0, ..., 0) with a length of 512;
[0127] The above adjustment vector is compressed based on the autoencoder to obtain a target feature vector with a length of 128 (198.10, 224.95, 76.26, 79.98, 254.98, 231.81, ..., 1.42).
[0128] The above vectorization process is only an exemplary description. In implementation, the lengths of the initial feature vectors corresponding to the identification information fields of different messages may be different. Each preset length may be set according to actual needs and will not be described in detail here.
[0129] The present application embodiment provides a third terminal identification method, such as Figure 4 As shown, the method may include:
[0130] Step S401: Based on a target message sent by a terminal, determine an identification information field carried in the target message.
[0131] Step S402: vectorize the identification information field to obtain a target feature vector of a first preset length corresponding to the target message.
[0132] The specific implementation of steps S401 to S402 may refer to the above embodiments and will not be described in detail here.
[0133] Step S403: inputting the target feature vector into the category identification model and the manufacturer identification model respectively.
[0134] In implementation, the terminal identification model is required to determine the category-related information and manufacturer-related information of the terminal. Since the features extracted by category identification and manufacturer identification are different, this embodiment uses two models (category identification model and manufacturer identification model) to train and implement category identification and manufacturer identification respectively.
[0135] Step S404: extracting category features from the target feature vector through the category recognition model to obtain category information corresponding to the target message; and extracting vendor features from the target feature vector through the vendor recognition model to obtain vendor information corresponding to the target message.
[0136] In this embodiment, the features extracted by category identification and manufacturer identification are different. The category identification model learns the association between the vector and the category during the training process. When the model is used, the category features can be extracted. Based on this, the category features of the target feature vector are extracted through the category identification model to obtain the category information corresponding to the target message.
[0137] The vendor identification model learns the association between the vector and the vendor during the training process, and can extract vendor features when using the model. Based on this, the vendor identification model is used to extract vendor features from the target feature vector to obtain the vendor information corresponding to the target message.
[0138] See also Figure 5 As shown, the target feature vector is obtained after the identification information field is vectorized; the target feature vector is input into the category identification model and the manufacturer identification model respectively; the category identification model extracts category features and outputs category information; the manufacturer identification model extracts category features and outputs manufacturer information.
[0139] This embodiment does not specifically limit the model training process. Exemplarily, the sample feature vector of the first preset length corresponding to the sample terminal and the category of the sample terminal are taken as input, the predicted category is taken as output, and the category of the sample terminal and the similarity between the predicted categories are used as optimization conditions to train the initial model to obtain a category recognition model; the sample feature vector of the first preset length corresponding to the sample terminal and the manufacturer of the sample terminal are taken as input, the predicted manufacturer is taken as output, and the manufacturer of the sample terminal and the similarity between the predicted manufacturers are used as optimization conditions to train the initial model to obtain a manufacturer identification model.
[0140] The above scheme trains the category recognition model and the manufacturer recognition model respectively, and performs category recognition through the category recognition model and performs manufacturer recognition through the manufacturer recognition model to accurately determine the category information and the manufacturer information.
[0141] In some optional implementations, the extraction process of the category recognition model may be implemented by, but not limited to, the following methods:
[0142] Extracting category features from the target feature vector through the first convolutional layer in the category recognition model to obtain category features;
[0143] The category features are comprehensively classified through the first fully connected layer in the category recognition model, and category information corresponding to the target message is output.
[0144] In the implementation, the receptive field of neurons is increased through the first convolution layer (one-dimensional convolution), so that the category recognition model has a certain range of local feature extraction capabilities, accurately extracts category features, and obtains category features;
[0145] The first fully connected layer enables the category recognition model to connect the context features and make a comprehensive judgment, that is, to achieve classification based on the comprehensive features and output category information.
[0146] See also Figure 6 As shown, after the target feature vector is input into the category recognition model, it passes through the first convolutional layer and the first fully connected layer to output category information, such as mobile phone, tablet, TV, personal computer (English: personal computer, abbreviated as PC), watch, game console or others.
[0147] The above scheme increases the receptive field of neurons through the first convolutional layer, so that the category recognition model has a certain range of local feature extraction capabilities, accurately extracts category features, and obtains category features; through the first fully connected layer, the category recognition model can connect context features, make comprehensive judgments, and output category information.
[0148] In some optional implementations, the extraction process of the manufacturer identification model may be implemented by, but not limited to, the following methods:
[0149] Extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model to obtain manufacturer features;
[0150] The vendor characteristics are comprehensively classified through the second fully connected layer in the vendor identification model, and the vendor information corresponding to the target message is output.
[0151] In the implementation, the receptive field of neurons is increased through the second convolution layer (one-dimensional convolution), so that the manufacturer identification model has the ability to extract local features within a certain range, accurately extract manufacturer features, and obtain manufacturer features;
[0152] The second fully connected layer enables the manufacturer identification model to connect the context features and make a comprehensive judgment, that is, to achieve classification based on the comprehensive features and output the manufacturer information.
[0153] See also Figure 7 As shown in FIG. 1 , after the target feature vector is input into the manufacturer identification model, it passes through the second convolutional layer and the second fully connected layer to output manufacturer information, such as brand 1, brand 2, brand 3, brand 4, brand 5, …, brand N or others.
[0154] The above scheme increases the receptive field of neurons through the second convolutional layer, so that the manufacturer identification model has a certain range of local feature extraction capabilities, accurately extracts manufacturer features, and obtains manufacturer features; through the second fully connected layer, the manufacturer identification model can connect context features, make comprehensive judgments, and output manufacturer information.
[0155] In view of the situation where a terminal sends multiple target messages, the embodiment of the present application provides a fourth terminal identification method, such as Figure 8 As shown, the method may include:
[0156] Step S801: for any target message sent by the terminal, determine the identification information field carried in the target message.
[0157] Step S802: vectorize the identification information field to obtain a target feature vector of a first preset length corresponding to the target message.
[0158] Step S803: Input the target feature vector into a terminal recognition model to determine the category information and manufacturer information corresponding to the target message.
[0159] The specific implementation of steps S801 to S803 may refer to the above embodiment and will not be described in detail here.
[0160] Step S804: From all category information corresponding to multiple target messages sent by the terminal, select category information with the largest number of occurrences as target category information of the terminal; and from all manufacturer information corresponding to multiple target messages, select manufacturer information with the largest number of occurrences as target manufacturer information of the terminal.
[0161] In implementation, the identification information fields of messages sent by the same terminal may also be different. For example, the contents of the identification information fields corresponding to different applications are different. In order to more accurately determine the manufacturer and category of the terminal, the category information and manufacturer information of these multiple messages can be combined.
[0162] Exemplarily, if a certain category information appears more times, the probability that the category information is the true category of the terminal is greater. Based on this, from all the category information corresponding to multiple target messages, the category information with the largest number of appearances is selected as the target category information of the terminal;
[0163] If a certain manufacturer information appears more times, the probability that the manufacturer information is the real manufacturer of the terminal is greater. Based on this, from all the manufacturer information corresponding to multiple target messages, the manufacturer information that appears the most times is selected as the target manufacturer information of the terminal.
[0164] The above scheme accurately determines the target category information of the terminal by selecting the category information with the largest number of occurrences from all the category information corresponding to the multiple target messages of the terminal; and accurately determines the target manufacturer information of the terminal by selecting the manufacturer information with the largest number of occurrences from all the manufacturer information corresponding to the multiple target messages of the terminal.
[0165] like Fig. 9As shown, based on the same inventive concept, an embodiment of the present application provides a terminal identification device 900, including:
[0166] A field determination module 901 is used to determine the identification information field carried in the target message based on the target message sent by the terminal;
[0167] A vectorization module 902, configured to vectorize the identification information field to obtain a target feature vector of a first preset length corresponding to the target message;
[0168] The identification module 903 is used to input the target feature vector into the terminal identification model to determine the category information and manufacturer information corresponding to the target message.
[0169] In some optional implementations, the vectorization module 902 is specifically configured to:
[0170] Vectorizing each character in the identification information field to obtain a feature value corresponding to each character;
[0171] Based on the initial feature vector, determining an adjustment vector of a second preset length; wherein the initial feature vector includes feature values corresponding to all characters in the identification information field;
[0172] The adjustment vector is compressed based on the autoencoder to obtain a target feature vector of a first preset length; wherein the second preset length is a preset multiple of the first preset length.
[0173] In some optional implementations, the vectorization module 902 is specifically configured to:
[0174] If the length of the initial feature vector is less than the second preset length, adding a preset element of a target length to the initial feature vector; wherein the sum of the target length and the length of the initial feature vector is the second preset length; or
[0175] If the length of the initial feature vector is greater than the second preset length, an adjustment vector of the second preset length is intercepted from the initial feature vector.
[0176] In some optional implementations, the terminal identification model includes a category identification model and a manufacturer identification model, and the identification module 903 is specifically used to:
[0177] Inputting the target feature vector into the category identification model and the manufacturer identification model respectively;
[0178] Extracting category features from the target feature vector using the category recognition model to obtain category information corresponding to the target message; and
[0179] The manufacturer feature is extracted from the target feature vector through the manufacturer identification model to obtain the manufacturer information corresponding to the target message.
[0180] In some optional implementations, the identification module 903 is specifically configured to:
[0181] Extracting category features from the target feature vector through the first convolutional layer in the category recognition model to obtain category features;
[0182] The category features are comprehensively classified through the first fully connected layer in the category recognition model, and category information corresponding to the target message is output.
[0183] In some optional implementations, the identification module 903 is specifically configured to:
[0184] Extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model to obtain manufacturer features;
[0185] The vendor characteristics are comprehensively classified through the second fully connected layer in the vendor identification model, and the vendor information corresponding to the target message is output.
[0186] In some optional implementations, if the terminal sends multiple target messages, the identification module 903, after determining the category information and manufacturer information corresponding to each target message, is further configured to:
[0187] Selecting, from all the category information corresponding to the plurality of target messages, the category information with the largest number of occurrences as the target category information of the terminal; and
[0188] From all the manufacturer information corresponding to the multiple target messages, the manufacturer information with the largest number of appearances is selected as the target manufacturer information of the terminal.
[0189] In some optional implementations, the target message is an HTTP message, and the identification information field is a UA field.
[0190] Since the device is the device in the method in the embodiment of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0191] like Fig.10 As shown, based on the same inventive concept, an embodiment of the present application provides a network device 1000, including: a processor 1001 and a memory 1002;
[0192] The memory 1002 may be a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated as RAM); the memory 1002 may also be a non-volatile memory (English: non-volatile memory), such as a read-only memory, a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated as HDD) or a solid-state drive (English: solid-state drive, abbreviated as SSD); or the memory 1002 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1002 may be a combination of the above memories.
[0193] The processor 1001 may include one or more central processing units (CPUs), graphics processing units (GPUs), or digital processing units, etc.
[0194] The specific connection medium between the memory 1002 and the processor 1001 is not limited in the embodiment of the present application. Fig.10 In the embodiment, the memory 1002 and the processor 1001 are connected via a bus 1003. The bus 1003 is connected to the processor 1001 via a bus 1003. Fig.10 In the figure, the bus 1003 is represented by a bold line, and can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0195] The memory 1002 stores program codes. When the program codes are executed by the processor 1001, the processor 1001 performs the following process:
[0196] Based on the target message sent by the terminal, determining the identification information field carried in the target message;
[0197] Vectorizing the identification information field to obtain a target feature vector of a first preset length corresponding to the target message;
[0198] The target feature vector is input into a terminal recognition model to determine the category information and manufacturer information corresponding to the target message.
[0199] In some optional implementations, the processor 1001 specifically performs:
[0200] Vectorizing each character in the identification information field to obtain a feature value corresponding to each character;
[0201] Based on the initial feature vector, determining an adjustment vector of a second preset length; wherein the initial feature vector includes feature values corresponding to all characters in the identification information field;
[0202] The adjustment vector is compressed based on the autoencoder to obtain a target feature vector of a first preset length; wherein the second preset length is a preset multiple of the first preset length.
[0203] In some optional implementations, the processor 1001 specifically performs:
[0204] If the length of the initial feature vector is less than the second preset length, adding a preset element of a target length to the initial feature vector; wherein the sum of the target length and the length of the initial feature vector is the second preset length; or
[0205] If the length of the initial feature vector is greater than the second preset length, an adjustment vector of the second preset length is intercepted from the initial feature vector.
[0206] In some optional implementations, the terminal identification model includes a category identification model and a manufacturer identification model, and the processor 1001 specifically performs:
[0207] Inputting the target feature vector into the category identification model and the manufacturer identification model respectively;
[0208] Extracting category features from the target feature vector using the category recognition model to obtain category information corresponding to the target message; and
[0209] The manufacturer feature is extracted from the target feature vector through the manufacturer identification model to obtain the manufacturer information corresponding to the target message.
[0210] In some optional implementations, the processor 1001 specifically performs:
[0211] Extracting category features from the target feature vector through the first convolutional layer in the category recognition model to obtain category features;
[0212] The category features are comprehensively classified through the first fully connected layer in the category recognition model, and category information corresponding to the target message is output.
[0213] In some optional implementations, the processor 1001 specifically performs:
[0214] Extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model to obtain manufacturer features;
[0215] The vendor characteristics are comprehensively classified through the second fully connected layer in the vendor identification model, and the vendor information corresponding to the target message is output.
[0216] In some optional implementations, if the terminal sends multiple target messages, after determining the category information and the manufacturer information corresponding to each target message, the processor 1001 further executes:
[0217] Selecting, from all the category information corresponding to the plurality of target messages, the category information with the largest number of occurrences as the target category information of the terminal; and
[0218] From all the manufacturer information corresponding to the multiple target messages, the manufacturer information with the largest number of appearances is selected as the target manufacturer information of the terminal.
[0219] In some optional implementations, the target message is an HTTP message, and the identification information field is a UA field.
[0220] Since the network device is the network device that executes the method in the embodiment of the present application, and the principle of solving the problem by the network device is similar to that of the method, the implementation of the network device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0221] The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the terminal identification method described above are implemented. The readable storage medium may be a non-volatile readable storage medium.
[0222] The present application is described above with reference to the block diagrams and / or flow charts showing the methods, devices (systems) and / or computer program products according to the embodiments of the present application. It should be understood that a block of the block diagram and / or flow chart diagram and a combination of blocks of the block diagram and / or flow chart diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor and / or other programmable device of a general-purpose computer, a special-purpose computer, to produce a machine, so that the instructions executed by the computer processor and / or other programmable device create a method for implementing the functions / actions specified in the block diagram and / or flow chart block.
[0223] Accordingly, the present application may also be implemented with hardware and / or software (including firmware, resident software, microcode, etc.). Furthermore, the present application may take the form of a computer program product on a computer-usable or computer-readable storage medium, which has a computer-usable or computer-readable program code implemented in the medium, for use by an instruction execution system or in conjunction with an instruction execution system. In the context of the present application, a computer-usable or computer-readable medium may be any medium that may contain, store, communicate, transmit, or convey a program for use by an instruction execution system, device, or apparatus, or in conjunction with an instruction execution system, device, or apparatus.
[0224] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0225] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A terminal identification method, It is characterized in that The method comprises: Based on the target message sent by the terminal, determining the identification information field carried in the target message; Vectorizing the identification information field to obtain a target feature vector of a first preset length corresponding to the target message; The target feature vector is input into a terminal recognition model to determine the category information and manufacturer information corresponding to the target message.
2. The method according to claim 1, It is characterized in that Vectorizing the identification information field to obtain a target feature vector of a first preset length corresponding to the target message includes: Vectorizing each character in the identification information field to obtain a feature value corresponding to each character; Based on the initial feature vector, determining an adjustment vector of a second preset length; wherein the initial feature vector includes feature values corresponding to all characters in the identification information field; The adjustment vector is compressed based on the autoencoder to obtain a target feature vector of a first preset length; wherein the second preset length is a preset multiple of the first preset length.
3. The method according to claim 2, It is characterized in that Determining an adjustment vector of a second preset length based on the initial feature vector includes: If the length of the initial feature vector is less than the second preset length, adding a preset element of a target length to the initial feature vector; wherein the sum of the target length and the length of the initial feature vector is the second preset length; or If the length of the initial feature vector is greater than the second preset length, an adjustment vector of the second preset length is intercepted from the initial feature vector.
4. The method according to claim 1, It is characterized in that The terminal identification model includes a category identification model and a manufacturer identification model. The target feature vector is input into the terminal identification model to determine the category information and manufacturer information corresponding to the target message, including: Inputting the target feature vector into the category identification model and the manufacturer identification model respectively; Extracting category features from the target feature vector using the category recognition model to obtain category information corresponding to the target message; and The manufacturer feature is extracted from the target feature vector through the manufacturer identification model to obtain the manufacturer information corresponding to the target message.
5. The method according to claim 4, It is characterized in that Extracting category features from the target feature vector by using the category recognition model to obtain category information corresponding to the target message includes: Extracting category features from the target feature vector through the first convolutional layer in the category recognition model to obtain category features; The category features are comprehensively classified through the first fully connected layer in the category recognition model, and category information corresponding to the target message is output.
6. The method according to claim 4, It is characterized in that The target feature vector is subjected to vendor feature extraction by the vendor identification model to obtain vendor information corresponding to the target message, including: Extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model to obtain manufacturer features; The vendor characteristics are comprehensively classified through the second fully connected layer in the vendor identification model, and the vendor information corresponding to the target message is output.
7. The method according to claim 1, It is characterized in that If the terminal sends multiple target messages, after determining the category information and manufacturer information corresponding to each target message, the method further includes: Selecting, from all the category information corresponding to the plurality of target messages, the category information with the largest number of occurrences as the target category information of the terminal; and From all the manufacturer information corresponding to the multiple target messages, the manufacturer information with the largest number of appearances is selected as the target manufacturer information of the terminal.
8. The method according to any one of claims 1 to 7, It is characterized in that The target message is a Hypertext Transfer Protocol message, and the identification information field is a user agent field.
9. A terminal identification device, It is characterized in that The device includes: A field determination module, used to determine the identification information field carried in the target message based on the target message sent by the terminal; A vectorization module, used to vectorize the identification information field to obtain a target feature vector of a first preset length corresponding to the target message; The identification module is used to input the target feature vector into the terminal identification model to determine the category information and manufacturer information corresponding to the target message.
10. A network device, It is characterized in that include: Processor and memory; The memory stores program codes, and when the program codes are executed by the processor, the processor executes the terminal identification method according to any one of claims 1 to 8.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the terminal identification method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method of recognizing intelligent terminal
CN106712986A
Internet of Things asset marking method and device
CN111897962A
Message generation method, device and equipment
CN112214652A
Method and system identified by animal networking device, medium and device
CN113328985A
Detection model training method, system and device and storage medium
CN114257386A
