A terminal identification method and apparatus, a network device, and a storage medium
By vectorizing the identification information fields of terminal messages and using neural network models for identification, the problem of identifying terminals with unexposed models has been solved, enabling accurate identification of terminal categories and manufacturer information, and improving the accuracy and applicability of identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- RUIJIE NETWORKS CO LTD
- Filing Date
- 2023-03-30
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to accurately identify terminal devices whose models are not publicly disclosed, especially new models. Furthermore, traditional methods are insufficient in terms of accuracy and applicability.
By vectorizing the identification information fields in the messages sent by the terminal, a target feature vector of a specific length is generated, and a neural network model is used to identify the terminal category and manufacturer information, including the combined use of category identification model and manufacturer identification model.
It enables accurate identification of unexposed and new terminal models, improving the accuracy and applicability of identification and meeting the needs of network optimization and fault detection.
Smart Images

Figure CN118734027B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a terminal identification method, apparatus, network device, and storage medium. Background Technology
[0002] With the development of technology, terminals are becoming increasingly widespread and diverse. Identifying relevant terminal information helps network providers to perform targeted control over terminals, such as network optimization, fault detection, and feature development.
[0003] In related technologies, the terminal model is determined by analyzing key fields containing the terminal model in Dynamic Host Configuration Protocol (DHCP) messages.
[0004] However, as terminal manufacturers become increasingly aware of user privacy protection, more and more devices no longer expose their model numbers. Therefore, the above methods are not suitable for identifying information from terminals that do not expose their model numbers. Summary of the Invention
[0005] This application provides a terminal identification method, apparatus, network device, and storage medium for accurately and comprehensively identifying terminals.
[0006] In a first aspect, embodiments of this application provide a terminal identification method, the method comprising:
[0007] Based on the target message sent by the terminal, determine the identification information field carried in the target message;
[0008] The identification information field is vectorized to obtain a target feature vector of a first preset length corresponding to the target message;
[0009] The target feature vector is input into the terminal identification model to determine the category information and manufacturer information corresponding to the target message.
[0010] The above-described solution, when performing targeted control of terminals, typically only requires obtaining the terminal's manufacturer and category; the specific terminal model has little impact on the control strategy. Identifying terminal categories and manufacturers using neural networks is relatively easy and accurate. Therefore, the terminal identification model accurately determines the terminal's category and manufacturer information, applicable even to terminals with undisclosed models or newer models. Furthermore, by vectorizing the identification information fields to obtain target feature vectors of a specific length, the vectors input to the terminal identification model are all of equal length, improving identification accuracy.
[0011] In some optional implementations, the identification information field is vectorized to obtain a target feature vector of a first preset length corresponding to the target message, including:
[0012] Each character in the identification information field is vectorized to obtain the feature value corresponding to each character;
[0013] Based on the initial feature vector, an adjustment vector of a second preset length is determined; wherein, the initial feature vector contains feature values corresponding to all characters in the recognition information field;
[0014] The adjustment vector is compressed based on an 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 vectorizes each character to obtain the feature value corresponding to each character. The feature values corresponding to all characters form the initial feature vector, which is the vectorized representation of the recognition information field. By unifying the initial feature vector to an adjustment vector of a specific length (second preset length), the vectors input into the model maintain a consistent length, improving the accuracy of subsequent recognition. Then, an autoencoder is used to compress the adjustment vector to obtain a shorter target feature vector (first preset length), which can ensure both a high compression rate and sufficient preservation of the effective information of the recognition information field.
[0016] In some optional implementations, determining an adjustment vector of a 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, then a preset element of the target length is added 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, then an adjustment vector of the second preset length is extracted from the initial feature vector.
[0019] In some optional implementations, the terminal identification model includes a category identification model and a vendor identification model. The target feature vector is input into the terminal identification model to determine the category information and vendor information corresponding to the target message, including:
[0020] The target feature vector is input into the category recognition model and the manufacturer recognition model, respectively;
[0021] The category recognition model is used to extract category features from the target feature vector to obtain the category information corresponding to the target message; and
[0022] The vendor features of the target feature vector are extracted using the vendor identification model to obtain the vendor information corresponding to the target message.
[0023] The above scheme accurately determines category and manufacturer information by training a category recognition model and a manufacturer recognition model separately, and then using the category recognition model to identify categories and the manufacturer recognition model to identify manufacturers.
[0024] In some optional implementations, the category recognition model is used to extract category features from the target feature vector to obtain category information corresponding to the target message, including:
[0025] The category features are obtained by extracting category features from the target feature vector through the first convolutional layer in the category recognition model.
[0026] The category features are comprehensively classified by the first fully connected layer in the category recognition model, and the category information corresponding to the target message is output.
[0027] The above scheme increases the receptive field of neurons by using the first convolutional layer, enabling the category recognition model to have a certain range of local feature extraction capabilities, accurately extract category features, and obtain category features; the first fully connected layer enables the category recognition model to connect with contextual features, make a comprehensive judgment, and output category information.
[0028] In some optional implementations, the vendor feature is extracted from the target feature vector using the vendor identification model to obtain the vendor information corresponding to the target message, including:
[0029] The manufacturer features are obtained by extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model.
[0030] The vendor features are comprehensively classified by 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 by using the second convolutional layer, enabling the manufacturer identification model to have a certain range of local feature extraction capabilities, accurately extract manufacturer features, and obtain manufacturer features; the second fully connected layer enables the manufacturer identification model to connect with contextual 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 vendor information corresponding to each target message, the method further includes:
[0033] From all category information corresponding to multiple target messages, the category information that appears most frequently is selected as the target category information of the terminal; and
[0034] From all the vendor information corresponding to multiple target messages, select the vendor information that appears most frequently as the target vendor information of the terminal.
[0035] The above scheme accurately determines the target category information of the terminal by selecting the category information that appears most frequently from all category information corresponding to multiple target messages of the terminal; and accurately determines the target manufacturer information of the terminal by selecting the manufacturer information that appears most frequently from all manufacturer information corresponding to multiple target messages of the terminal.
[0036] In some optional implementations, the target message is a Hypertext Transfer Protocol (HTTP) message, and the identification information field is a User Agent (UA).
[0037] The above solution can cover most terminals by using HTTP messages as target messages, and can accurately determine manufacturer and category information by using the UA field as identification information field.
[0038] Secondly, embodiments of this application provide a terminal identification device, including:
[0039] The field determination module is used to determine the identification information field carried in the target message based on the target message sent by the terminal.
[0040] The vectorization module is 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 for:
[0043] Each character in the identification information field is vectorized to obtain the feature value corresponding to each character;
[0044] Based on the initial feature vector, an adjustment vector of a second preset length is determined; wherein, the initial feature vector contains feature values corresponding to all characters in the recognition information field;
[0045] The adjustment vector is compressed based on an 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 for:
[0047] If the length of the initial feature vector is less than the second preset length, then a preset element of the target length is added 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, then an adjustment vector of the second preset length is extracted 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 for:
[0050] The target feature vector is input into the category recognition model and the manufacturer recognition model, respectively;
[0051] The category recognition model is used to extract category features from the target feature vector to obtain the category information corresponding to the target message; and
[0052] The vendor features of the target feature vector are extracted using the vendor identification model to obtain the vendor information corresponding to the target message.
[0053] In some optional implementations, the identification module is specifically used for:
[0054] The category features are obtained by extracting category features from the target feature vector through the first convolutional layer in the category recognition model.
[0055] The category features are comprehensively classified by the first fully connected layer in the category recognition model, and the category information corresponding to the target message is output.
[0056] In some optional implementations, the identification module is specifically used for:
[0057] The manufacturer features are obtained by extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model.
[0058] The vendor features are comprehensively classified by 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] From all category information corresponding to multiple target messages, the category information that appears most frequently is selected as the target category information of the terminal; and
[0061] From all the vendor information corresponding to multiple target messages, select the vendor information that appears most frequently as the target vendor 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] Thirdly, embodiments of this application provide a network device, including a processor and a memory;
[0064] The memory stores program code that, when executed by the processor, causes the processor to perform the terminal identification method as described in any of the first aspects.
[0065] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the terminal identification method as described in any of the first aspects.
[0066] Furthermore, the technical effects of any of the implementation methods in the second to fourth aspects can be found in the technical effects of different implementation methods in the first aspect, and will not be repeated here. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1 A schematic flowchart illustrating the first terminal identification method provided in this application embodiment;
[0069] Figure 2 A schematic flowchart illustrating the second terminal identification method provided in this application embodiment;
[0070] Figure 3 A schematic diagram of the vectorization process provided in the embodiments of this application;
[0071] Figure 4A schematic flowchart illustrating the third terminal identification method provided in this application embodiment;
[0072] Figure 5 This is a schematic diagram of the identification process provided in an embodiment of this application;
[0073] Figure 6 A schematic diagram of the category recognition model provided in the embodiments of this application;
[0074] Figure 7 This is a schematic diagram of the manufacturer identification model provided in the embodiments of this application;
[0075] Figure 8 A schematic flowchart illustrating the fourth terminal identification method provided in this application embodiment;
[0076] Figure 9 This is a schematic diagram of the structure of the terminal identification device provided in the embodiments of this application;
[0077] Figure 10 A schematic block diagram of a network device provided in an embodiment of this application. Detailed Implementation
[0078] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0079] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0080] In the description of this application, unless otherwise expressly specified and limited, the term "connection" should be interpreted broadly. For example, it can refer to a direct connection, an indirect connection through an intermediate medium, or a connection within two devices. Those skilled in the art can understand the specific meaning of the above term in this application based on the specific circumstances.
[0081] Identifying relevant information about a terminal helps network providers to perform targeted control over the terminal, such as network optimization, fault detection, and feature development.
[0082] In some embodiments, the terminal model is determined by analyzing key fields of the terminal model contained in the DHCP protocol message, such as hostname in option (custom data field) 12 and vendor class id in option 60.
[0083] However, as device manufacturers become increasingly aware of user privacy protection, more and more devices no longer expose their model numbers. Therefore, the above method is not suitable for identifying devices whose model numbers are not exposed.
[0084] In some embodiments, the UA field in the HTTP message may also carry terminal model information. The model keywords in the UA are extracted using regular expressions to complete the identification.
[0085] However, this method requires constructing complex regular expressions, which are prone to omissions or mis-extractions, and it is not suitable for identifying terminals whose model is not exposed.
[0086] In some embodiments, terminal identification is based on Media Access Control (MAC) addresses. Although terminal manufacturers typically assign a continuous range of MAC addresses to terminal devices of the same model, multiple batches of the same model may be produced, occupying multiple MAC address ranges, leading to confusion with other terminal models. This is especially true for terminals produced in smaller batches, whose MAC addresses are often mixed in with those of other devices. Therefore, this method is difficult to use accurately for terminal identification.
[0087] In some embodiments, terminal identification is based on neural networks. Currently, there are over 30,000 smart terminal models on the market. This method requires a large amount of data to support the training of the neural network. Misidentification is prone to occur when encountering new terminal models that have never appeared in the training set or when encountering a limited number of terminal models.
[0088] Based on this, embodiments of this application provide a terminal identification method, apparatus, network device, and storage medium. The method is applied to a network device and includes: determining an identification information field carried in a target message sent by a terminal; vectorizing the identification information field to obtain a target feature vector of a first preset length corresponding to the target message; and 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] The above-described solution, when performing targeted control of terminals, typically only requires obtaining the terminal's manufacturer and category; the specific terminal model has little impact on the control strategy. Identifying terminal categories and manufacturers using neural networks is relatively easy and accurate. Therefore, the terminal identification model accurately determines the terminal's category and manufacturer information, applicable even to terminals with undisclosed models or newer models. Furthermore, by vectorizing the identification information fields to obtain target feature vectors of a specific length, the vectors input to the terminal identification model are all of equal length, improving identification accuracy.
[0091] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with reference to the accompanying drawings and specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0092] This application provides a first terminal identification method, applied to network devices, such as... Figure 1 As shown, the method may include:
[0093] Step S101: Based on the target message sent by the terminal, determine the identification information field carried in the target message.
[0094] In this embodiment, for the terminal to be identified, after it is connected to the network, the network device can receive various types of messages sent by the terminal. After receiving the target message carrying the identification information field, the identification information field that characterizes the terminal's features is determined.
[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 send HTTP messages during operation, the User-Agent (UA) field in these messages typically contains rich terminal information, such as operating system, application name, and application version. Furthermore, the UA field often differs between different types and manufacturers of terminals; for instance, a particular brand's UA field may contain special characters, and the UA field formats for mobile phones and tablets differ. Therefore, by using HTTP messages as the target message, most terminals can be covered, and by using the UA field as an identification information field, manufacturer and category information can be accurately determined subsequently.
[0097] In practice, if the target message is an HTTP message, the above identification information field can also be the host (message header) field; or, if the target message is a Domain Name System (DNS) message, the identification information field can be the domain name information, etc., which will not be listed here.
[0098] Step S102: Vectorize the identification information field to obtain a target feature vector of a first preset length corresponding to the target message.
[0099] This embodiment uses a terminal recognition model to determine the terminal's category and manufacturer information. The model's input needs to be vectorized, and vectors of equal length improve recognition accuracy. Therefore, the recognition information fields need to be vectorized to obtain a target feature vector of a first preset length.
[0100] Step S103: Input the target feature vector into the terminal identification model to determine the category information and manufacturer information corresponding to the target message.
[0101] The above-described solution, when performing targeted control of terminals, typically only requires obtaining the terminal's manufacturer and category; the specific terminal model has little impact on the control strategy. Identifying terminal categories and manufacturers using neural networks is relatively easy and accurate. Therefore, the terminal identification model accurately determines the terminal's category and manufacturer information, applicable even to terminals with undisclosed models or newer models. Furthermore, by vectorizing the identification information fields to obtain target feature vectors of a specific length, the vectors input to the terminal identification model are all of equal length, improving identification accuracy.
[0102] This application provides a second terminal identification method, such as... Figure 2 As shown, the method may include:
[0103] Step S201: Based on the target message sent by the terminal, determine the identification information field carried in the target message.
[0104] The specific implementation of step S201 can be found in the above embodiments, and will not be repeated here.
[0105] Step S202: Vectorize each character in the recognition information field to obtain the feature value corresponding to each character.
[0106] In practice, each character is vectorized to obtain the vector representation of each character, which is the feature value corresponding to each character; the feature values corresponding to all characters form the initial feature vector, which is the vectorized representation of the recognition information field.
[0107] Step S203: Based on the initial feature vector, determine the adjustment vector of the second preset length.
[0108] The initial feature vector contains the feature values corresponding to all characters in the recognition information field; that is, the initial feature vector is composed of the feature values corresponding to all characters in the recognition information field.
[0109] In this embodiment, the initial feature vector contains the feature values corresponding to all 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 varied and the number of characters is inconsistent, the length of the initial feature vector will also be different.
[0110] To improve subsequent recognition accuracy, the vectors input into the model need to maintain a consistent length. Therefore, the initial feature vectors need to be unified into adjustment vectors of a specific length (second preset length).
[0111] Step S204: Compress the adjustment vector based on the autoencoder to obtain a target feature vector of a first preset length.
[0112] Wherein, the second preset length is a preset multiple of the first preset length.
[0113] In practice, in order to retain most of the features of the initial feature vector, the second preset length is set to be relatively large, that is, the length of the adjustment vector is relatively long. If the vector of the second preset length is used directly for model training and use, the time required is relatively long. 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 four times the first preset length. At a preset multiple of 4, the compression rate is doubled compared to a preset multiple of 2, but the effective information in the identification information field is largely preserved (the difference in effective information preservation compared to a preset multiple of 2 is not significant). At a preset multiple of 8, although the compression rate is lower, a large amount of effective information in the identification information field is lost. Therefore, in implementation, setting the preset multiple to 4 can ensure both a high compression rate and sufficient preservation of the effective information in the identification information field.
[0115] Step S205: Input the target feature vector into the terminal identification model to determine the category information and manufacturer information corresponding to the target message.
[0116] The specific implementation of step S205 can be found in other embodiments, and will not be repeated here.
[0117] The above scheme vectorizes each character to obtain the feature value corresponding to each character. The feature values corresponding to all characters form the initial feature vector, which is the vectorized representation of the recognition information field. By unifying the initial feature vector to an adjustment vector of a specific length (second preset length), the vectors input into the model maintain a consistent length, improving the subsequent recognition accuracy. Furthermore, an autoencoder is used to compress the adjustment vector to obtain a shorter target feature vector (first preset length), reducing the difficulty of model training.
[0118] In some optional implementations, step S203 above can be implemented in, but is not limited to, the following ways:
[0119] If the length of the initial feature vector is less than the second preset length, then a preset element of the target length is added 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, then an adjustment vector of the second preset length is extracted from the initial feature vector.
[0121] For example, if the length of the initial feature vector is less than the second preset length, it means that the number of feature values in the initial feature vector is small. 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) to the initial feature vector. This will give us an adjustment vector of the second preset length.
[0122] If the length of the initial feature vector is greater than the second preset length, it means that there are too many feature values in the initial feature vector. It is necessary to truncate the redundant feature values (such as feature values after the second preset length) so that an adjustment vector of the second preset length can be obtained.
[0123] In practice, due to the large second preset length, the length of the initial feature vector is usually less than the second preset length. The adjusted vector is obtained by adding preset elements of the target length.
[0124] The following is a specific example to illustrate this:
[0125] See Figure 3 As shown, each character in the recognition information field is vectorized to obtain an initial feature vector of length 108 (65,112,112,108,101,67,111,114,……,49);
[0126] The length of the initial feature vector is less than the second preset length (512). 404 preset elements 0 are added to the initial feature vector to obtain an adjustment vector of length 512 (65,112,112,108,101,67,111,114,……,49,0,0,……,0);
[0127] The above adjustment vector is compressed using an autoencoder to obtain a target feature vector of length 128 (198.10, 224.95, 76.26, 79.98, 254.98, 231.81, ..., 1.42).
[0128] The above vectorization process is only an example. In practice, the initial feature vector lengths corresponding to the identification information fields of different messages can be different. Each preset length can be set according to actual needs, which will not be elaborated here.
[0129] This application provides a third terminal identification method, such as... Figure 4 As shown, the method may include:
[0130] Step S401: Based on the target message sent by the terminal, determine the 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 can be referred to the above embodiments, and will not be repeated here.
[0133] Step S403: Input the target feature vector into the category recognition model and the manufacturer recognition model respectively.
[0134] In implementation, a terminal identification model is needed to determine the terminal's category information and manufacturer information. Since the features extracted for category identification and manufacturer identification are different, this embodiment uses two models (a category identification model and a manufacturer identification model), which are trained separately to achieve category identification and manufacturer identification.
[0135] Step S404: Extract category features from the target feature vector using the category recognition model to obtain category information corresponding to the target message; and extract vendor features from the target feature vector using the vendor recognition model to obtain vendor information corresponding to the target message.
[0136] In this embodiment, the features extracted by category recognition and manufacturer recognition are different. The category recognition model learns the relationship between vectors and categories during the training process. When using the model, it can extract category features. Based on this, the category recognition model is used to extract category features from the target feature vector to obtain the category information corresponding to the target message.
[0137] The vendor identification model learns the association between vectors and vendors during the training process. When using the model, it can extract vendor features. 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 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. For example, the sample feature vector of the sample terminal of the first preset length and the category of the sample terminal are used as input, the predicted category is used as output, and the similarity between the category of the sample terminal and the predicted category is used as optimization condition to train the initial model to obtain the category recognition model; the sample feature vector of the sample terminal of the first preset length and the manufacturer of the sample terminal are used as input, the predicted manufacturer is used as output, and the similarity between the manufacturer of the sample terminal and the predicted manufacturer is used as optimization condition to train the initial model to obtain the manufacturer recognition model.
[0140] The above scheme accurately determines category and manufacturer information by training a category recognition model and a manufacturer recognition model separately, and then using the category recognition model to identify categories and the manufacturer recognition model to identify manufacturers.
[0141] In some alternative implementations, the extraction process of the category recognition model can be achieved in, but is not limited to, the following ways:
[0142] The category features are obtained by extracting category features from the target feature vector through the first convolutional layer in the category recognition model.
[0143] The category features are comprehensively classified by the first fully connected layer in the category recognition model, and the category information corresponding to the target message is output.
[0144] In practice, the receptive field of neurons is increased by the first convolutional layer (one-dimensional convolution), which enables the category recognition model to have a certain range of local feature extraction capabilities, accurately extract category features, and obtain category features.
[0145] The first fully connected layer enables the category recognition model to consider contextual features, make a comprehensive judgment, that is, to classify by combining features and output category information.
[0146] See 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, and outputs category information, such as mobile phone, tablet, TV, personal computer (PC), watch, game console or others.
[0147] The above scheme increases the receptive field of neurons by using the first convolutional layer, enabling the category recognition model to have a certain range of local feature extraction capabilities, accurately extract category features, and obtain category features; the first fully connected layer enables the category recognition model to connect with contextual features, make a comprehensive judgment, and output category information.
[0148] In some alternative implementations, the extraction process of the vendor identification model can be achieved in, but is not limited to, the following ways:
[0149] The manufacturer features are obtained by extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model.
[0150] The vendor features are comprehensively classified by the second fully connected layer in the vendor identification model, and the vendor information corresponding to the target message is output.
[0151] In practice, the receptive field of neurons is increased by the second convolutional layer (one-dimensional convolution), which enables the manufacturer identification model to have a certain range of local feature extraction capabilities, accurately extract manufacturer features, and obtain manufacturer features.
[0152] The second fully connected layer enables the manufacturer identification model to consider contextual features, make a comprehensive judgment, that is, to classify based on comprehensive features and output manufacturer information.
[0153] See Figure 7 As shown, 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 by using the second convolutional layer, enabling the manufacturer identification model to have a certain range of local feature extraction capabilities, accurately extract manufacturer features, and obtain manufacturer features; the second fully connected layer enables the manufacturer identification model to connect with contextual features, make comprehensive judgments, and output manufacturer information.
[0155] For situations where a terminal sends multiple target messages, embodiments of this application provide 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 the terminal identification model to determine the category information and manufacturer information corresponding to the target message.
[0159] The specific implementation of steps S801 to S803 can be found in the above embodiments, and will not be repeated here.
[0160] Step S804: Select the category information that appears most frequently from all category information corresponding to multiple target messages sent by the terminal as the target category information of the terminal; and select the manufacturer information that appears most frequently from all manufacturer information corresponding to multiple target messages as the target manufacturer information of the terminal.
[0161] In practice, the identification information fields of messages sent by the same terminal may differ. For example, the content of the identification information fields corresponding to different applications may be 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] For example, the more times a certain category of information appears, the greater the probability that the category of information is the true category of the terminal. Based on this, the category of information that appears most frequently is selected as the target category information of the terminal from all the category information corresponding to multiple target messages.
[0163] The more times a certain vendor information appears, the greater the probability that the vendor information is the actual vendor of the terminal. Based on this, the vendor information that appears most frequently is selected as the target vendor information of the terminal from all the vendor information corresponding to multiple target messages.
[0164] The above scheme accurately determines the target category information of the terminal by selecting the category information that appears most frequently from all category information corresponding to multiple target messages of the terminal; and accurately determines the target manufacturer information of the terminal by selecting the manufacturer information that appears most frequently from all manufacturer information corresponding to multiple target messages of the terminal.
[0165] like Figure 9As shown, based on the same inventive concept, this application provides a terminal identification device 900, including:
[0166] The 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] The vectorization module 902 is used 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 used for:
[0170] Each character in the identification information field is vectorized to obtain the feature value corresponding to each character;
[0171] Based on the initial feature vector, an adjustment vector of a second preset length is determined; wherein, the initial feature vector contains feature values corresponding to all characters in the recognition information field;
[0172] The adjustment vector is compressed based on an 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 used for:
[0174] If the length of the initial feature vector is less than the second preset length, then a preset element of the target length is added 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, then an adjustment vector of the second preset length is extracted 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 for:
[0177] The target feature vector is input into the category recognition model and the manufacturer recognition model, respectively;
[0178] The category recognition model is used to extract category features from the target feature vector to obtain the category information corresponding to the target message; and
[0179] The vendor features of the target feature vector are extracted using the vendor identification model to obtain the vendor information corresponding to the target message.
[0180] In some optional implementations, the identification module 903 is specifically used for:
[0181] The category features are obtained by extracting category features from the target feature vector through the first convolutional layer in the category recognition model.
[0182] The category features are comprehensively classified by the first fully connected layer in the category recognition model, and the category information corresponding to the target message is output.
[0183] In some optional implementations, the identification module 903 is specifically used for:
[0184] The manufacturer features are obtained by extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model.
[0185] The vendor features are comprehensively classified by 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] From all category information corresponding to multiple target messages, the category information that appears most frequently is selected as the target category information of the terminal; and
[0188] From all the vendor information corresponding to multiple target messages, select the vendor information that appears most frequently as the target vendor 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 this device is the same as the device in the method of this application embodiment, and the principle of the device in solving the problem is similar to that of the method, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described again.
[0191] like Figure 10 As shown, based on the same inventive concept, this application provides a network device 1000, including: a processor 1001 and a memory 1002;
[0192] Memory 1002 may be volatile memory, such as random-access memory (RAM); memory 1002 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 1002 may be any other medium capable of carrying or storing desired program code having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1002 may be a combination of the above-mentioned memories.
[0193] The processor 1001 may include one or more central processing units (CPUs), graphics processing units (GPUs), or digital processing units, etc.
[0194] This application embodiment does not limit the specific connection medium between the memory 1002 and the processor 1001. This application embodiment... Figure 10 The memory 1002 and the processor 1001 are connected via a bus 1003, and the bus 1003 is in Figure 10 The bus 1003, represented by thick lines, can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0195] The memory 1002 stores program code, which, when executed by the processor 1001, causes the processor 1001 to perform the following processes:
[0196] Based on the target message sent by the terminal, determine the identification information field carried in the target message;
[0197] The identification information field is vectorized to obtain a target feature vector of a first preset length corresponding to the target message;
[0198] The target feature vector is input into the terminal identification 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] Each character in the identification information field is vectorized to obtain the feature value corresponding to each character;
[0201] Based on the initial feature vector, an adjustment vector of a second preset length is determined; wherein, the initial feature vector contains feature values corresponding to all characters in the recognition information field;
[0202] The adjustment vector is compressed based on an 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, then a preset element of the target length is added 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, then an adjustment vector of the second preset length is extracted 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 executes:
[0207] The target feature vector is input into the category recognition model and the manufacturer recognition model, respectively;
[0208] The category recognition model is used to extract category features from the target feature vector to obtain the category information corresponding to the target message; and
[0209] The vendor features of the target feature vector are extracted using the vendor identification model to obtain the vendor information corresponding to the target message.
[0210] In some optional implementations, the processor 1001 specifically performs:
[0211] The category features are obtained by extracting category features from the target feature vector through the first convolutional layer in the category recognition model.
[0212] The category features are comprehensively classified by the first fully connected layer in the category recognition model, and the category information corresponding to the target message is output.
[0213] In some optional implementations, the processor 1001 specifically performs:
[0214] The manufacturer features are obtained by extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model.
[0215] The vendor features are comprehensively classified by 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 vendor information corresponding to each target message, the processor 1001 further executes:
[0217] From all category information corresponding to multiple target messages, the category information that appears most frequently is selected as the target category information of the terminal; and
[0218] From all the vendor information corresponding to multiple target messages, select the vendor information that appears most frequently as the target vendor 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 same network device that executes the method in the embodiments of this application, and the principle of the network device in solving the problem 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 described again.
[0221] This application provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the program implements the steps of the terminal identification method described above. The readable storage medium can be a non-volatile readable storage medium.
[0222] The present application has been described above with reference to block diagrams and / or flowcharts illustrating methods, apparatus (systems), and / or computer program products according to embodiments of the present application. It should be understood that a block of a block diagram and / or flowchart, as well as combinations of blocks of block diagrams and / or flowcharts, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, and / or other programmable means to produce a machine, such that the instructions, executable via the computer processor and / or other programmable means, create methods for implementing the functions / actions specified in the blocks of the block diagrams and / or flowcharts.
[0223] Accordingly, this application can also be implemented using hardware and / or software (including firmware, resident software, microcode, etc.). Furthermore, this application can take the form of a computer program product on a computer-usable or computer-readable storage medium, having computer-usable or computer-readable program code implemented in the medium for use by or in conjunction with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or deliver a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0224] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0225] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A terminal identification method, characterized in that, The method includes: Based on the target message sent by the terminal, determine the identification information field carried in the target message; Each character in the identification information field is vectorized to obtain the feature value corresponding to each character; Based on the initial feature vector, an adjustment vector of a second preset length is determined; wherein, the initial feature vector contains feature values corresponding to all characters in the recognition information field; The adjustment vector is compressed to obtain a target feature vector of a first preset length corresponding to the target message; The target feature vector is input into the terminal identification model to determine the category information and manufacturer information corresponding to the target message.
2. The method according to claim 1, characterized in that, Compression of the adjustment vector yields a target feature vector of a first preset length corresponding to the target message, including: The adjustment vector is compressed using an autoencoder to obtain a target feature vector of the first preset length; wherein the second preset length is a preset multiple of the first preset length.
3. The method according to claim 2, characterized in that, Based on the initial feature vector, determine the adjustment vector of the second preset length, including: If the length of the initial feature vector is less than the second preset length, then a preset element of the target length is added 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, then an adjustment vector of the second preset length is extracted from the initial feature vector.
4. The method according to claim 1, characterized in that, The terminal identification model includes a category identification model and a vendor identification model. The target feature vector is input into the terminal identification model to determine the category information and vendor information corresponding to the target message, including: The target feature vector is input into the category recognition model and the manufacturer recognition model, respectively; The category recognition model is used to extract category features from the target feature vector to obtain the category information corresponding to the target message; and The vendor features of the target feature vector are extracted using the vendor identification model to obtain the vendor information corresponding to the target message.
5. The method according to claim 4, characterized in that, The category recognition model is used to extract category features from the target feature vector to obtain the category information corresponding to the target message, including: The category features are obtained by extracting category features from the target feature vector through the first convolutional layer in the category recognition model. The category features are comprehensively classified by the first fully connected layer in the category recognition model, and the category information corresponding to the target message is output.
6. The method according to claim 4, characterized in that, The vendor features of the target feature vector are extracted using the vendor identification model to obtain the vendor information corresponding to the target message, including: The manufacturer features are obtained by extracting manufacturer features from the target feature vector through the second convolutional layer in the manufacturer identification model. The vendor features are comprehensively classified by 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, characterized in that, If the terminal sends multiple target messages, after determining the category information and vendor information corresponding to each target message, the method further includes: From all category information corresponding to multiple target messages, the category information that appears most frequently is selected as the target category information of the terminal; and From all the vendor information corresponding to multiple target messages, select the vendor information that appears most frequently as the target vendor information of the terminal.
8. The method according to any one of claims 1 to 7, 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, characterized in that, The device includes: The field determination module is used to determine the identification information field carried in the target message based on the target message sent by the terminal. The vectorization module is used to vectorize each character in the identification information field to obtain the feature value corresponding to each character; based on the initial feature vector, determine the adjustment vector of the second preset length; wherein, the initial feature vector contains the feature values corresponding to all characters in the identification information field; based on the adjustment vector of the second preset length, obtain the target feature vector of the 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, characterized in that, include: Processor and memory; The memory stores program code, which, when executed by the processor, causes the processor to perform the terminal identification method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the terminal identification method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method of recognizing intelligent terminal
CN106712986A
Detection model training method, system and device and storage medium
CN114257386A