Router classification method, device and equipment and computer readable storage medium

By weighting the organization-unique identifiers in the router's MAC address and identifying router categories using a random forest model, the problems of failure of identification and limited coverage in the prior art are solved, and router classification with high accuracy and wide coverage are achieved.

CN119922126AActive Publication Date: 2025-05-02FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510004085.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-02
Estimated Expiration
2045-01-02

AI Technical Summary

Technical Problem

When identifying router categories, the prior art faces the problem that users modify the default naming themselves, resulting in the failure of identification, limited expert knowledge base coverage, and not all routers have MQTT messages, resulting in a low success rate.

Method used

The product identifier is weighted based on the organization-unique identifier in the MAC address of the router to be identified, and the weighted product identifier is input into the trained random forest model to determine the category of the router.

Benefits of technology

Improves the accuracy and coverage of router classification, reduces the impact of noise information, and ensures accurate identification of different routers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922126A_ABST
    Figure CN119922126A_ABST
Patent Text Reader

Abstract

The invention discloses a router classification method, device and equipment and a computer readable storage medium. The method comprises the following steps: weighting a product identifier in an MAC address of a to-be-identified router based on an organization unique identifier in the MAC address of the to-be-identified router; and inputting the weighted product identifier into a classifier, and determining the category of the router to be identified based on the output of the classifier. According to the embodiment of the invention, the method achieves the high-coverage-rate router classification based on the formulation specification of the MAC address, the MAC address of the to-be-recognized router as the basis, and the classifier. And the product identifier is weighted through the organization unique identifier, so that the noise caused by directly utilizing the organization unique identifier to classify the routers can be reduced, and the effective information represented by the organization unique identifier can be transferred to the product identifier, thereby improving the classification accuracy of the routers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a router classification method, device, equipment and computer-readable storage medium. Background Art

[0002] Identifying router categories is the basis for defining network quality issues and is also a key technology for operators to ensure user experience. Currently, there are two main solutions for identifying router categories:

[0003] Solution 1: Determine the correspondence between the default router name and the router category in advance, so as to form an expert knowledge base, and then determine the router category according to the obtained router name.

[0004] Option 2:

[0005] Communicate with the router based on the MQTT protocol, obtain the MQTT message sent by the router, parse the MQTT message, and determine the router category.

[0006] Regarding Solution 1, in the actual use of routers, users often modify the default name of the router on their own, which will lead to identification failure. In addition, due to the large number of default names of routers on the market, the coverage of the expert knowledge base is limited. For these two reasons, the success rate of router classification based on Solution 1 is low.

[0007] Regarding Solution 2, the router needs to have a specific plug-in to send MQTT messages, but not all routers have this specific plug-in. Therefore, the success rate of router classification based on Solution 2 cannot be guaranteed. Summary of the invention

[0008] To solve the above technical problems, the present application provides a router classification method, apparatus, device and computer-readable storage medium.

[0009] In a first aspect, an embodiment of the present application provides a router classification method, the router classification method comprising:

[0010] weighting the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified;

[0011] The weighted product identifier is input into a classifier, and the category of the router to be identified is determined based on the output of the classifier.

[0012] In combination with the first aspect, in one implementation, the organization unique identifier includes Q organization unique identification bytes, the product identifier includes Q product identification bytes, and weighting the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified includes:

[0013] Input Q unique organization identification bytes into the trained fully connected network to obtain an m-dimensional vector corresponding to each product identification byte;

[0014] For each product identification byte of the Q product identification bytes, multiply it by the corresponding m-dimensional vector to obtain a weighted product identification byte.

[0015] In combination with the first aspect, in one implementation, the classifier is a trained random forest model, the trained random forest model includes a plurality of first-class decision trees, and inputting the weighted product identifier into the classifier, and determining the category of the router to be identified based on the output of the classifier includes:

[0016] Inputting Q weighted product identification bytes into each first-category decision tree, and obtaining first-category voting results output by each first-category decision tree;

[0017] Determining a target first category voting result having the largest number of repetitions from a plurality of first category voting results;

[0018] The category of the router to be identified is determined based on the target first category voting result.

[0019] In combination with the first aspect, in one implementation, after determining the target first category voting result with the largest number of repetitions from the plurality of first category voting results, the method further includes:

[0020] Determining a first confidence level based on the number of repetitions of the target first category voting results and the total number of first category decision trees;

[0021] Detecting whether the first confidence level is greater than or equal to a first threshold;

[0022] If the first confidence level is greater than or equal to the first threshold, the category of the router to be identified is determined based on the target first category voting result.

[0023] In combination with the first aspect, in one implementation, the trained random forest model further includes a plurality of second-type decision trees corresponding to each weighted product identification byte combination, wherein each weighted product identification byte combination includes (QP) weighted product identification bytes, P is the number of noise bytes in the Q product identification bytes that are not used to characterize the product category, P<Q, and after detecting whether the first confidence is greater than or equal to the first threshold, further includes:

[0024] If the first confidence level is less than the first threshold, a weighted product identification byte combination is selected according to a preset order and input into each corresponding second-category decision tree, and a second-category voting result output by each second-category decision tree is obtained;

[0025] determining a target second category voting result having the largest number of repetitions from a plurality of second category voting results;

[0026] Determining a second confidence level based on the number of repetitions of the target second category voting result and the total number of second category decision trees corresponding to the currently selected weighted product identification byte combination;

[0027] Detecting whether the second confidence level is greater than or equal to a second threshold;

[0028] If the second confidence level is greater than or equal to the second threshold, determining the category of the router to be identified based on the target second category voting result;

[0029] If the second confidence level is less than the second threshold, detecting whether all product identification byte combinations have been selected;

[0030] If not, return to execute the step of selecting a weighted product identification byte combination according to a preset order and inputting it into each corresponding second-category decision tree, and obtaining the second-category voting result output by each second-category decision tree;

[0031] If so, it is determined that the category of the router to be identified is an unknown category.

[0032] In combination with the first aspect, in one implementation, the classifier is a trained random forest model, the trained random forest model includes a plurality of first-type decision trees and a plurality of second-type decision trees corresponding to each weighted product identification byte combination, wherein each weighted product identification byte combination includes (QP) weighted product identification bytes, P is the number of noise bytes in the Q product identification bytes that are not used to characterize the product category, P<Q, and the step of inputting the weighted product identifier into the classifier and determining the category of the router to be identified based on the output of the classifier includes:

[0033] Inputting Q weighted product identification bytes into each first-category decision tree, obtaining the first-category voting results output by each first-category decision tree, determining a target first-category voting result having the largest number of repetitions from the plurality of first-category voting results, and determining a first confidence level based on the number of repetitions of the target first-category voting result and the total number of first-category decision trees;

[0034] For each weighted product identification byte combination, input the weighted product identification byte combination into each corresponding second category decision tree, obtain the second category voting result output by each second category decision tree, determine the target second category voting result with the largest number of repetitions from multiple second category voting results, and determine the second confidence corresponding to each weighted product identification byte combination based on the number of repetitions of the target second category voting result and the total number of second category decision trees corresponding to the weighted product identification byte combination;

[0035] Selecting a maximum value from the first confidence level and all second confidence levels;

[0036] The category of the router to be identified is determined based on the category voting result corresponding to the maximum value.

[0037] In combination with the first aspect, in one implementation, the number of second-type decision trees corresponding to different weighted product identification byte combinations is the same.

[0038] In a second aspect, an embodiment of the present application provides a router classification device, the router classification device comprising:

[0039] A weighting module, configured to weight the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified;

[0040] The classification module is used to input the weighted product identifier into a classifier, and determine the category of the router to be identified based on the output of the classifier.

[0041] In a third aspect, an embodiment of the present application provides a router classification device, comprising a processor, a memory, and a router classification program stored in the memory and executable by the processor, wherein when the router classification program is executed by the processor, the steps of the router classification method described in the first aspect are implemented.

[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a router classification program is stored, wherein when the router classification program is executed by a processor, the steps of the router classification method described in the first aspect are implemented.

[0043] The beneficial effects brought by the technical solution provided by the embodiments of the present application include:

[0044] In the embodiment of the present application, the product identifier in the MAC address of the router to be identified is weighted based on the organization unique identifier in the MAC address of the router to be identified; the weighted product identifier is input into the classifier, and the category of the router to be identified is determined based on the output of the classifier. Through the embodiment of the present application, based on the formulation specification of the MAC address, the MAC address of the router to be identified is used as the basis, and the classifier is combined to achieve high coverage of router classification; and the product identifier is weighted by the organization unique identifier, which can not only reduce the noise caused by directly using the organization unique identifier for router classification, but also transfer the effective information represented by the organization unique identifier to the product identifier, thereby improving the accuracy of router classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A flowchart of an embodiment of a router classification method of the present application;

[0046] Figure 2 This is a detailed flow chart of step S20 in one embodiment;

[0047] Figure 3 A schematic diagram of a model optimization and deployment process in an embodiment;

[0048] Figure 4 is a schematic diagram of an execution scenario of step S20 in another embodiment;

[0049] Figure 5 This is a functional module diagram of an embodiment of a router classification device of the present application;

[0050] Figure 6 This is a schematic diagram of the hardware structure of the router classification device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] First, some technical terms in the present application are explained to facilitate those skilled in the art to understand the present application.

[0053] MAC address (Media Access Control Address) is a hardware address, also known as a physical address, which is a unique identifier used to distinguish different devices in a network. The length of a MAC address is a 48-bit binary number, usually expressed in hexadecimal, and consists of 6 bytes, such as: 00:11:22:33:44:55. The first 3 bytes are called the organizational unique identifier, which is used to identify the manufacturer's information; the last 3 bytes (i.e., the product identifier) ​​are assigned by the manufacturer and are used to distinguish different products or devices from the same manufacturer.

[0054] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0055] In a first aspect, an embodiment of the present application provides a method for classifying routers.

[0056] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of the router classification method of the present application. Figure 1 As shown, the router classification methods include:

[0057] Step S10, weighting the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified;

[0058] In this embodiment, based on the current MAC address naming convention, the MAC address is composed of an organization-unique identifier and a product identifier, wherein the organization-unique identifier is the first 3 bytes in the MAC address. For ease of explanation, the first 3 bytes are represented by MAC1, MAC2, and MAC3 respectively; the product identifier is the last 3 bytes in the MAC address. For ease of explanation, the last 3 bytes are represented by MAC4, MAC5, and MAC6 respectively.

[0059] It should be noted that with the development of network technology, the number of bytes corresponding to the organization's unique identifier and product identifier or the position in the MAC address may change. Therefore, the above is only an illustrative description and does not constitute a limitation on the solution of this embodiment.

[0060] MAC4, MAC5 and MAC6 are weighted by MAC1, MAC2 and MAC3, and MAC1, MAC2 and MAC3 are mapped by a mapping network to obtain weighted coefficients corresponding to MAC4, MAC5 and MAC6. MAC4, MAC5 and MAC6 are multiplied by the corresponding weighted coefficients respectively to obtain weighted MAC4, MAC5 and MAC6, which are recorded as MAC4', MAC5' and MAC6'.

[0061] Step S20: input the weighted product identifier into a classifier, and determine the category of the router to be identified based on the output of the classifier.

[0062] In this embodiment, as described above, after obtaining MAC4', MAC5' and MAC6', all weighted product identifiers can be input into the classifier, that is, MAC4', MAC5' and MAC6' are input into the classifier, or part of the weighted product identifiers can be input into the classifier, for example, MAC4' and MAC5' are input into the classifier, MAC4' and MAC6' are input into the classifier, and MAC5' and MAC6' are input into the classifier.

[0063] The classifier is obtained through training, and a group of samples for training the classifier is constructed based on the MAC address of a router of a known category. For example, it is known that the category of router A is any one of a single-frequency router (indicated by label 00), a dual-frequency router (indicated by label 01), and a triple-frequency router (indicated by label 11). The result obtained by weighting the product identifier in the MAC address based on the organization unique identifier in the MAC address of router A is MAC4_ 样本 ', MAC5_ 样本 ' and MAC6_ 样本 '.

[0064] If the input format of the classifier is all weighted product identifiers, the set of samples constructed is:

[0065] Input = MAC4_ 样本 ', MAC5_ 样本 ' and MAC6_ 样本 '; Label = any one of 00, 01, 11.

[0066] If the input format of the classifier is weighted MAC4 and MAC5, the constructed set of samples is:

[0067] Input = MAC4_ 样本 ' and MAC5_ 样本 '; Label = any one of 00, 01, 11.

[0068] If the input format of the classifier is weighted MAC4 and MAC6, the constructed set of samples is:

[0069] Input = MAC4_ 样本 ' and MAC6_ 样本 '; Label = any one of 00, 01, 11.

[0070] If the input format of the classifier is weighted MAC5 and MAC6, the constructed set of samples is:

[0071] Input = MAC5_ 样本 ' and MAC6_ 样本 '; Label = any one of 00, 01, 11.

[0072] By analogy, a classifier can be obtained by training based on the MAC addresses of all known types of routers and the input formats of the routers. The training process of the classifier is referred to in the prior art and will not be described in detail here.

[0073] Combined with the above description, based on the requirements of the classifier input format, all and / or part of the weighted product identifiers are input into the classifier to obtain the output of the classifier, and the category of the router to be identified is determined according to the output of the classifier. For example, if the classifier is a three-category classifier, its output can only be any one of 00, 01, and 11. After all and / or part of the weighted product identifiers are input into the classifier, if its output is 00, the category of the router to be identified can be determined as a single-frequency router; similarly, if its output is 01, the category of the router to be identified can be determined as a dual-frequency router; similarly, if its output is 11, the category of the router to be identified can be determined as a tri-frequency router.

[0074] Referring to the above explanation about MAC address, it can be understood that the first 3 bytes of MAC address identify the manufacturer information. If it is directly applied to the classification task, it will bring a lot of noise; the last 3 bytes of MAC address are closely related to the router category, but because the last 3 bytes are allocated by the manufacturer, it may cause the last 3 bytes of MAC address of routers of different categories to be the same. Therefore, only using the last 3 bytes for classification task may be inaccurate. Based on the above considerations, in the embodiment of the present application, the product identifier is weighted by the organization unique identifier, which can not only reduce the noise caused by directly using the organization unique identifier for router classification, but also transfer the effective information represented by the organization unique identifier to the product identifier, thereby improving the accuracy of router classification; in addition, the router classification is realized by the classifier, and only part of the samples are needed to train the classifier in the early stage, so that the trained classifier learns the MAC address features corresponding to each router category, thereby improving the coverage of router classification.

[0075] Further, in one embodiment, the organization unique identifier includes Q organization unique identification bytes, the product identifier includes Q product identification bytes, and weighting the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified includes:

[0076] Input Q organization unique identification bytes into the trained fully connected network to obtain an m-dimensional vector corresponding to each product identification byte; for each product identification byte of the Q product identification bytes, multiply it with the corresponding m-dimensional vector to obtain a weighted product identification byte.

[0077] In this embodiment, for the sake of convenience, referring to the current MAC address naming convention, the value of Q is 3.

[0078] The fully connected network has multiple fully connected layers, each fully connected layer has multiple channels, and m is the dimension of the output vector of the fully connected network.

[0079] The fully connected network is trained together with the above classifier. During the training process, the parameters of the classifier and the fully connected network are adjusted based on the classification accuracy of the classifier for the samples until the training end condition is reached. Since the purpose of training is to improve the classification accuracy, after MAC1, MAC2 and MAC3 are input into the trained fully connected network, the m-dimensional vector corresponding to MAC4 (recorded as weight 1), the m-dimensional vector corresponding to MAC5 (recorded as weight 2) and the m-dimensional vector corresponding to MAC6 (recorded as weight 3) can be obtained.

[0080] Multiply MAC4 by weight 1 to get MAC4'; multiply MAC5 by weight 2 to get MAC5'; multiply MAC6 by weight 3 to get MAC6'.

[0081] Furthermore, in one embodiment, the classifier is a trained random forest model, and the trained random forest model includes a plurality of first-class decision trees. Figure 2 , Figure 2 FIG. 1 is a detailed flow chart of step S20 in an embodiment. Figure 2 As shown, step S20 includes:

[0082] Step S201, inputting Q weighted product identification bytes into each first-category decision tree, and obtaining the first-category voting results output by each first-category decision tree;

[0083] In this embodiment, for the sake of convenience, it is assumed that a plurality of first-type decision trees include decision trees A1 to A2. s0 , s0 is the number of the first type of decision trees, decision tree A1 ~ decision tree A s0 The input format is Q weighted product identification bytes. Each decision tree is used to output a first category voting result based on the input, and the first category voting result is any one of a single-band router, a dual-band router, and a triple-band router.

[0084] Step S202, determining a target first category voting result having the largest number of repetitions from a plurality of first category voting results;

[0085] Step S203: determining the category of the router to be identified based on the target first category voting result.

[0086] In this embodiment, assuming that s0 is 100, there are a total of 100 first-category voting results. Assuming that 88 first-category voting results are dual-band routers, 10 first-category voting results are tri-band routers, and 2 first-category voting results are single-frequency routers, then the target first-category voting result with the largest number of repetitions is determined to be a dual-band router, and the category of the router to be identified can be determined to be a dual-band router.

[0087] Among them, the trained random forest model is obtained through training. The training process is the process of determining the parameters in each decision tree included in the random forest model. Taking determining the parameters in a decision tree as an example:

[0088] The specific calculation method of decision tree parameters is based on dividing multiple groups of samples into different subtrees according to their input. When all samples in the subtree belong to the same category, the division is stopped and the parameters of the decision tree are solidified. Referring to the above description, when training and determining any decision tree in the first category of decision trees, the sample input is MAC4_ 样本 ', MAC5_ 样本 ' and MAC6_ 样本 Among them, the commonly used feature partitioning algorithms include ID3, C4.5 and CART, which use information gain, information gain ratio and Gini index as the criteria for feature selection respectively.

[0089] Information entropy is the most commonly used indicator to measure the geometric purity of samples. Assume that the proportion of the k-th class of samples in the sample set D is:

[0090] p k (k=1,2,......,n)

[0091] Then the information entropy of the sample set D is defined as:

[0092]

[0093] Assume that a discrete attribute a has v possible values ​​{a 1 , a 2 ,......,a v}, if a is used to divide the sample set D, V subsets will be generated, where the vth subset contains all the samples in D whose value on attribute a is a v The sample is denoted as D v , and calculate D v Considering that different subsets contain different numbers of samples, weights are assigned to the subsets. That is, the more samples a subset has, the greater its influence. Therefore, the information gain obtained by dividing the sample set D by attribute a is calculated as:

[0094]

[0095] The information gain ratio is:

[0096]

[0097] The Gini index is:

[0098]

[0099] Combined with the above description, we can determine decision tree A1~decision tree A s0 Parameters.

[0100] Reference Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a model optimization and deployment process in an embodiment. Figure 3 As shown, the constructed model is trained using the existing data, and the trained model is deployed on the target hardware. Specifically, for ease of explanation, the current MAC address naming convention is taken as an example:

[0101] First, the upper three MACs are input into the mapping weighting algorithm to obtain the weighted lower three MACs (for the specific process, see the embodiment of step S10); then the latter are input into the improved random forest. If the output router classification result reaches the target accuracy, the model and its parameters are saved. Specifically, n MAC addresses of the training set are input into the model; n router model prediction results are obtained, and these n prediction results are compared with n real router models, and m correct prediction results can be obtained. At this time, m / n is the accuracy of the model. The accuracy is compared with the target accuracy. If it is greater than the target accuracy, it is considered to have reached the target accuracy; otherwise, the parameters such as the number of decision trees of the improved random forest algorithm are adjusted, and the model parameters of the mapping network (such as the fully connected network mentioned above) are optimized using the back propagation algorithm.

[0102] Among them, the parameter adjustment of the decision tree includes: using the weighted MAC vector output by the mapping network to input into the improved random forest algorithm to build a new decision tree; the number, depth and other hyperparameters of the decision tree need to be adjusted manually and tried in sequence according to the actual situation and engineering experience; the model parameters of the mapping network are optimized: the loss value can be calculated between the result output by the random forest and the real result, and the mapping network can be back-propagated according to the loss value to optimize its parameters.

[0103] After the training is completed, a model with the same structure is created on the target hardware. After importing the solidified weights, the category of the router to be identified can be determined based on the MAC address of the router to be identified.

[0104] Furthermore, in one embodiment, after step S201, the method further includes:

[0105] Determine a first confidence level based on the number of repetitions of the target first category voting results and the total number of first category decision trees; detect whether the first confidence level is greater than or equal to a first threshold; if the first confidence level is greater than or equal to the first threshold, determine the category of the router to be identified based on the target first category voting results.

[0106] In this embodiment, in combination with the above example, the first confidence level = the number of repetitions of the target first category voting result / the total number of first category decision trees = 88 / 100 = 0.88.

[0107] Assuming that the first threshold is set to 0.8, it can be determined that the category of the router to be identified is a dual-band router. The first threshold is set based on actual needs and is only illustrated here.

[0108] Through confidence judgment, the reliability of router category identification results is further guaranteed.

[0109] Furthermore, in one embodiment, the trained random forest model also includes several second-type decision trees corresponding to each weighted product identification byte combination, wherein each weighted product identification byte combination includes (QP) weighted product identification bytes, P is the number of noise bytes in the Q product identification bytes that are not used to characterize the product category, and P<Q.

[0110] In this embodiment, taking Q=3 as an example, considering that only two bytes among MAC4, MAC5 and MAC6 may be used to represent the product category, that is, there is a noise byte that is not used to represent the product category, then the category of the router needs to be identified by partially weighted product identification bytes, and the weighted product identification byte combinations are as follows:

[0111] Combination 1, consisting of MAC4' and MAC5';

[0112] Combination 2, consisting of MAC4' and MAC6';

[0113] Combination 3, consisting of MAC5' and MAC6'.

[0114] Among them, several second-class decision trees corresponding to combination 1 are recorded as decision trees B1~B s1 , the second type of decision trees corresponding to combination 2 are recorded as decision trees C1~C s2, the second type of decision trees corresponding to combination 3 are recorded as decision trees D1~D s3 The values ​​of s1, s2, and s3 represent quantities and are set according to actual needs.

[0115] Decision tree B1~B s1 The input format is MAC4' and MAC5', and the decision tree B1~B s1 The process of determining the parameters of decision tree A1 to decision tree A s0 The process of training parameters is similar, except that the input is MAC4_ 样本 ' and MAC5_ 样本 '.

[0116] Similarly, decision trees C1 to C s2 The input format is MAC4' and MAC6', and the decision tree C1~C s2 The process of determining the parameters of decision tree A1 to decision tree A s0 The process of training parameters is similar, except that the input is MAC4_ 样本 ' and MAC6_ 样本 '.

[0117] Similarly, decision trees D1 to D s3 The input format is MAC5' and MAC6', and the decision tree D1~D s3 The process of determining the parameters of decision tree A1 to decision tree A s0 The process of training parameters is similar, except that the input is MAC5_ 样本 ' and MAC6_ 样本 '.

[0118] It should be noted that the above values ​​of Q and P are for illustrative purposes only and do not constitute limitations on the present application.

[0119] Based on the above description, after detecting whether the first confidence level is greater than or equal to the first threshold, the method further includes:

[0120] If the first confidence level is less than the first threshold, a weighted product identification byte combination is selected according to a preset order and input into each corresponding second-category decision tree, and a second-category voting result output by each second-category decision tree is obtained;

[0121] determining a target second category voting result having the largest number of repetitions from a plurality of second category voting results;

[0122] Determining a second confidence level based on the number of repetitions of the target second category voting result and the total number of second category decision trees corresponding to the currently selected weighted product identification byte combination;

[0123] Detecting whether the second confidence level is greater than or equal to a second threshold;

[0124] If the second confidence level is greater than or equal to the second threshold, determining the category of the router to be identified based on the target second category voting result;

[0125] If the second confidence level is less than the second threshold, detecting whether all product identification byte combinations have been selected;

[0126] If not, return to execute the step of selecting a weighted product identification byte combination according to a preset order and inputting it into each corresponding second-category decision tree, and obtaining the second-category voting result output by each second-category decision tree;

[0127] If so, it is determined that the category of the router to be identified is an unknown category.

[0128] In this embodiment, the preset order is set based on actual needs. For example, the preset order is:

[0129] First combine 1, then combine 2, and finally combine 3. That is, first input MAC4' and MAC5' into decision tree B1~B s1 , from decision tree B1 to B s1 The target second category voting result with the largest number of repetitions is determined from the output second category voting results, and the ratio of the number of repetitions of the target second category voting result to the total number of second category decision trees corresponding to combination 1 is calculated to obtain a second confidence level; the second confidence level is then compared with the second threshold value; if it is greater than or equal to the second threshold value, the category of the router to be identified is determined based on the target second category voting result; if it is less than the second threshold value, MAC4' and MAC6' are input into the decision trees C1 to C2. s2 , and so on.

[0130] If the second confidence corresponding to each combination is less than the second threshold, it means that an accurate category recognition result cannot be obtained by relying on the current random forest model, and the category of the router to be identified is determined to be an unknown category.

[0131] Furthermore, in one embodiment, the number of second-type decision trees corresponding to different weighted product identification byte combinations is the same.

[0132] In this embodiment, since different manufacturers have different naming conventions for the last three digits of the MAC address, it is unclear where the noise byte in the product identification byte that is not used to represent the product category is located. In order to avoid the error caused by this situation, it is necessary to ensure that the number of second-type decision trees corresponding to different weighted product identification byte combinations is the same. That is, the values ​​of s1, s2, and s3 are equal.

[0133] Further, in one embodiment, the classifier is a trained random forest model, and the trained random forest model includes a plurality of first-class decision trees and a plurality of second-class decision trees corresponding to each weighted product identification byte combination, wherein each weighted product identification byte combination includes (QP) weighted product identification bytes, P is the number of noise bytes in the Q product identification bytes that are not used to characterize the product category, P<Q, and step S20 specifically includes:

[0134] Inputting Q weighted product identification bytes into each first-category decision tree, obtaining the first-category voting results output by each first-category decision tree, determining a target first-category voting result having the largest number of repetitions from the plurality of first-category voting results, and determining a first confidence level based on the number of repetitions of the target first-category voting result and the total number of first-category decision trees;

[0135] For each weighted product identification byte combination, input the weighted product identification byte combination into each corresponding second category decision tree, obtain the second category voting result output by each second category decision tree, determine the target second category voting result with the largest number of repetitions from multiple second category voting results, and determine the second confidence corresponding to each weighted product identification byte combination based on the number of repetitions of the target second category voting result and the total number of second category decision trees corresponding to the weighted product identification byte combination;

[0136] Selecting a maximum value from the first confidence level and all second confidence levels;

[0137] The category of the router to be identified is determined based on the category voting result corresponding to the maximum value.

[0138] In this embodiment, refer to Figure 4 , Figure 4 FIG. 2 is a schematic diagram of an execution scenario of step S20 in another embodiment. Figure 4 As shown, considering that in some engineering practices, computing resources are sufficient, MAC4', MAC5' and MAC6' can be input into decision trees A1 to A1. s0 ; Input MAC4' and MAC5' into decision tree B1~decision tree B s1 ; Input MAC4' and MAC6' into decision tree C1~decision tree C s2 ; Input MAC5' and MAC6' into decision tree D1~decision tree D s3 .

[0139] According to decision tree A1~decision tree A s0 The output of , determine the voting result with the largest number of repetitions and the confidence level 1 of voting result 1; according to decision tree B1 ~ decision tree B s1The output of , determine the voting result with the largest number of repetitions and the confidence level 2 of voting result 2; according to decision tree C1 ~ decision tree C s2 The output of , determine the confidence level 3 of voting result 2 and voting result 3 with the largest number of repetitions; according to decision tree D1 ~ decision tree D s3 The output of determines the confidence level 4 of voting result 2 and voting result 4 with the largest number of repetitions.

[0140] A maximum confidence level is selected from confidence levels 1 to 4, and the category of the router to be identified is determined based on the voting result corresponding to the maximum confidence level.

[0141] In a second aspect, an embodiment of the present application also provides a router classification device.

[0142] In one embodiment, referring to Figure 5 , Figure 5 This is a functional module diagram of an embodiment of the router classification device of the present application. Figure 5 As shown, the router classification device includes:

[0143] A weighting module 10, configured to weight the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified;

[0144] The classification module 20 is used to input the weighted product identifier into a classifier, and determine the category of the router to be identified based on the output of the classifier.

[0145] Further, in one embodiment, the organization unique identifier includes Q organization unique identification bytes, the product identifier includes Q product identification bytes, and the weighting module 10 is used to:

[0146] Input Q unique organization identification bytes into the trained fully connected network to obtain an m-dimensional vector corresponding to each product identification byte;

[0147] For each product identification byte of the Q product identification bytes, multiply it by the corresponding m-dimensional vector to obtain a weighted product identification byte.

[0148] Furthermore, in one embodiment, the classifier is a trained random forest model, and the trained random forest model includes a plurality of first-class decision trees, and the classification module 20 is used to:

[0149] Inputting Q weighted product identification bytes into each first-category decision tree, and obtaining first-category voting results output by each first-category decision tree;

[0150] Determining a target first category voting result having the largest number of repetitions from a plurality of first category voting results;

[0151] The category of the router to be identified is determined based on the target first category voting result.

[0152] Furthermore, in one embodiment, the classification module 20 is used to:

[0153] Determining a first confidence level based on the number of repetitions of the target first category voting results and the total number of first category decision trees;

[0154] Detecting whether the first confidence level is greater than or equal to a first threshold;

[0155] If the first confidence level is greater than or equal to the first threshold, the category of the router to be identified is determined based on the target first category voting result.

[0156] Further, in one embodiment, the trained random forest model also includes a plurality of second-type decision trees corresponding to each weighted product identification byte combination, wherein each weighted product identification byte combination includes (QP) weighted product identification bytes, P is the number of noise bytes in the Q product identification bytes that are not used to characterize the product category, P<Q, and the classification module 20 is further used to:

[0157] If the first confidence level is less than the first threshold, a weighted product identification byte combination is selected according to a preset order and input into each corresponding second-category decision tree, and a second-category voting result output by each second-category decision tree is obtained;

[0158] determining a target second category voting result having the largest number of repetitions from a plurality of second category voting results;

[0159] Determining a second confidence level based on the number of repetitions of the target second category voting result and the total number of second category decision trees corresponding to the currently selected weighted product identification byte combination;

[0160] Detecting whether the second confidence level is greater than or equal to a second threshold;

[0161] If the second confidence level is greater than or equal to the second threshold, determining the category of the router to be identified based on the target second category voting result;

[0162] If the second confidence level is less than the second threshold, detecting whether all product identification byte combinations have been selected;

[0163] If not, return to execute the step of selecting a weighted product identification byte combination according to a preset order and inputting it into each corresponding second-category decision tree, and obtaining the second-category voting result output by each second-category decision tree;

[0164] If so, it is determined that the category of the router to be identified is an unknown category.

[0165] Further, in one embodiment, the classifier is a trained random forest model, and the trained random forest model includes a plurality of first-type decision trees and a plurality of second-type decision trees corresponding to each weighted product identification byte combination, wherein each weighted product identification byte combination includes (QP) weighted product identification bytes, P is the number of noise bytes in the Q product identification bytes that are not used to characterize the product category, P<Q, and the classification module 20 is used to:

[0166] Inputting Q weighted product identification bytes into each first-category decision tree, obtaining the first-category voting results output by each first-category decision tree, determining a target first-category voting result having the largest number of repetitions from the plurality of first-category voting results, and determining a first confidence level based on the number of repetitions of the target first-category voting result and the total number of first-category decision trees;

[0167] For each weighted product identification byte combination, input the weighted product identification byte combination into each corresponding second category decision tree, obtain the second category voting result output by each second category decision tree, determine the target second category voting result with the largest number of repetitions from multiple second category voting results, and determine the second confidence corresponding to each weighted product identification byte combination based on the number of repetitions of the target second category voting result and the total number of second category decision trees corresponding to the weighted product identification byte combination;

[0168] Selecting a maximum value from the first confidence level and all second confidence levels;

[0169] The category of the router to be identified is determined based on the category voting result corresponding to the maximum value.

[0170] Furthermore, in one embodiment, the number of second-type decision trees corresponding to different weighted product identification byte combinations is the same.

[0171] Among them, the functional implementation of each module in the above-mentioned router classification device corresponds to each step in the above-mentioned router classification method embodiment, and its functions and implementation processes are no longer repeated here.

[0172] In a third aspect, an embodiment of the present application provides a router classification device, which may be a device having a data processing function, such as a personal computer (PC), a laptop computer, or a server.

[0173] Reference Figure 6 , Figure 6 The hardware structure diagram of the router classification device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the router classification device may include a processor, a memory, a communication interface, and a communication bus.

[0174] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0175] The communication interface includes input / output (I / O) interface, physical interface and logical interface, etc., which are used to realize the interconnection of devices inside the router classification device, and the interface used to realize the interconnection between the router classification device and other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.

[0176] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0177] The processor may be a general-purpose processor, and the general-purpose processor may call the router classification program stored in the memory and execute the router classification method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the router classification program is called may refer to the various embodiments of the router classification method of the present application, and will not be repeated here.

[0178] Those skilled in the art will understand that Figure 6 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0179] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.

[0180] The computer-readable storage medium of the present application stores a router classification program, wherein when the router classification program is executed by a processor, the steps of the above-mentioned router classification method are implemented.

[0181] Among them, the method implemented when the router classification program is executed can refer to the various embodiments of the router classification method of the present application, and will not be repeated here.

[0182] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0183] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0184] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0185] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0186] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0188] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A router classification method, characterized in that: The router classification method comprises: weighting the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified; The weighted product identifier is input into a classifier, and the category of the router to be identified is determined based on the output of the classifier.

2. The router classification method according to claim 1, characterized in that: The organization unique identifier includes Q organization unique identification bytes, the product identifier includes Q product identification bytes, and weighting the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified includes: Input Q unique organization identification bytes into the trained fully connected network to obtain an m-dimensional vector corresponding to each product identification byte; For each product identification byte of the Q product identification bytes, multiply it by the corresponding m-dimensional vector to obtain a weighted product identification byte.

3. The router classification method according to claim 2, characterized in that: The classifier is a trained random forest model, the trained random forest model includes a plurality of first-class decision trees, the inputting of the weighted product identifier into the classifier, and determining the category of the router to be identified based on the output of the classifier includes: Inputting Q weighted product identification bytes into each first-category decision tree, and obtaining first-category voting results output by each first-category decision tree; Determining a target first category voting result having the largest number of repetitions from a plurality of first category voting results; The category of the router to be identified is determined based on the target first category voting result.

4. The router classification method according to claim 3, characterized in that: After determining the target first category voting result having the largest number of repetitions from the plurality of first category voting results, the method further includes: Determining a first confidence level based on the number of repetitions of the target first category voting results and the total number of first category decision trees; Detecting whether the first confidence level is greater than or equal to a first threshold; If the first confidence level is greater than or equal to the first threshold, the category of the router to be identified is determined based on the target first category voting result.

5. The router classification method according to claim 4, characterized in that: The trained random forest model also includes a plurality of second-type decision trees corresponding to each weighted product identification byte combination, wherein each weighted product identification byte combination includes (QP) weighted product identification bytes, P is the number of noise bytes in the Q product identification bytes that are not used to characterize the product category, P<Q, and after detecting whether the first confidence is greater than or equal to the first threshold, further includes: If the first confidence level is less than the first threshold, a weighted product identification byte combination is selected according to a preset order and input into each corresponding second-category decision tree, and a second-category voting result output by each second-category decision tree is obtained; determining a target second category voting result having the largest number of repetitions from a plurality of second category voting results; Determining a second confidence level based on the number of repetitions of the target second category voting result and the total number of second category decision trees corresponding to the currently selected weighted product identification byte combination; Detecting whether the second confidence level is greater than or equal to a second threshold; If the second confidence level is greater than or equal to the second threshold, determining the category of the router to be identified based on the target second category voting result; If the second confidence level is less than the second threshold, detecting whether all product identification byte combinations have been selected; If not, return to execute the step of selecting a weighted product identification byte combination according to a preset order and inputting it into each corresponding second-category decision tree, and obtaining the second-category voting result output by each second-category decision tree; If so, it is determined that the category of the router to be identified is an unknown category.

6. The router classification method according to claim 1, characterized in that: The classifier is a trained random forest model, and the trained random forest model includes a plurality of first-class decision trees and a plurality of second-class decision trees corresponding to each weighted product identification byte combination, wherein each weighted product identification byte combination includes (QP) weighted product identification bytes, P is the number of noise bytes in the Q product identification bytes that are not used to characterize the product category, and P<Q, and the step of inputting the weighted product identifier into the classifier and determining the category of the router to be identified based on the output of the classifier includes: Inputting Q weighted product identification bytes into each first-category decision tree, obtaining the first-category voting results output by each first-category decision tree, determining a target first-category voting result having the largest number of repetitions from the plurality of first-category voting results, and determining a first confidence level based on the number of repetitions of the target first-category voting result and the total number of first-category decision trees; For each weighted product identification byte combination, input the weighted product identification byte combination into each corresponding second category decision tree, obtain the second category voting result output by each second category decision tree, determine the target second category voting result with the largest number of repetitions from multiple second category voting results, and determine the second confidence corresponding to each weighted product identification byte combination based on the number of repetitions of the target second category voting result and the total number of second category decision trees corresponding to the weighted product identification byte combination; Selecting a maximum value from the first confidence level and all second confidence levels; The category of the router to be identified is determined based on the category voting result corresponding to the maximum value.

7. The router classification method according to claim 5 or 6, characterized in that: The number of second-type decision trees corresponding to different weighted product identification byte combinations is the same.

8. A router classification device, characterized in that: The router classification device comprises: A weighting module, configured to weight the product identifier in the MAC address of the router to be identified based on the organization unique identifier in the MAC address of the router to be identified; The classification module is used to input the weighted product identifier into a classifier, and determine the category of the router to be identified based on the output of the classifier.

9. A router classification device, characterized in that: The router classification device comprises a processor, a memory, and a router classification program stored in the memory and executable by the processor, wherein when the router classification program is executed by the processor, the steps of the router classification method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a router classification program, wherein when the router classification program is executed by a processor, the steps of the router classification method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • WLAN (Wireless Local Area Network) access gateway as well as billing system and method by scenes

    CN101877845A

  • New equipment identification method and device, server and computer readable storage medium

    CN109446791A

  • Terminal device identification method and device, and computer readable storage medium

    CN111177483A

  • Address recognition method and device, and storage medium

    CN113609290A

  • Router model identification method and device, equipment and storage medium

    CN116915649A