Internet of Things communication protocol identification method and device based on KNN-Alexnet

By using the KNN-Alexnet model combined with the time domain waveform graph recognition method in the identification of IoT communication protocols, the problems of low accuracy and high computational complexity in the prior art are solved, and efficient and accurate identification of IoT communication protocols are achieved.

CN119922251AActive Publication Date: 2025-05-02ANHUI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art has low accuracy and high computational complexity in the identification of IoT communication protocols, and cannot fully meet the needs of practical applications.

Method used

Using the KNN-Alexnet-based IoT communication protocol identification method, the data sequence transmitted by the Internet of Things devices is converted into a time domain waveform diagram, preprocessed and divided into a training set, a test set and a verification set. The KNN model is used to identify the communication protocol of the time domain waveform graph, and the time domain waveform graph with the lowest prediction probability is input to the Alexnet model, and the results of the two models are combined for final identification.

Benefits of technology

It realizes efficient and accurate communication protocol identification, reduces the amount of computing, improves the recognition efficiency and accuracy, and is suitable for IoT communication protocol identification scenarios with high real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922251A_ABST
    Figure CN119922251A_ABST
Patent Text Reader

Abstract

The invention relates to an Internet of Things communication protocol identification method based on KNN-Alexnet, and the method comprises the steps: converting a data sequence transmitted by Internet of Things equipment into a time domain oscillogram, and carrying out the preprocessing; carrying out communication protocol identification on the time domain oscillogram by using a KNN model to obtain each protocol identification result, and carrying out statistics on a prediction probability; 20% of the time domain oscillogram with the lowest prediction probability is taken to enter an Alexnet model, and a prediction result is obtained; and obtaining a final result in combination with each protocol identification result under the condition of preferentially selecting the prediction result. According to the method, the data preprocessing and feature extraction steps are simplified, the calculation amount is reduced, and the communication protocol identification efficiency is improved; the advantages of the KNN model and the Alexnet model are combined, the advantages of the two models are brought into full play, and the recognition accuracy is improved; an identification result can be quickly given, and the actual application requirement is met; through reasonable utilization of time domain oscillogram information, efficient and accurate communication protocol identification is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet of Things communication technology, and in particular to an Internet of Things communication protocol identification method and device based on KNN-Alexnet. Background Art

[0002] When building its huge and complex ecosystem, 6G IoT requires efficient and accurate communication protocol identification, which is the key to ensure seamless connection and smooth interaction of various smart devices. Whether it is smart home, smart city, telemedicine or autonomous driving, it is necessary to rely on accurate and fast communication protocol identification to ensure the security and stability of data transmission, and this identification capability is essential to achieve seamless collaboration between devices and provide high-quality user experience.

[0003] So far, four mainstream technologies have emerged in the field of network protocol identification, namely port-based traffic identification technology, deep packet inspection, analysis based on network traffic behavior patterns, and deep packet analysis technology with the help of machine learning. However, these technologies are tailored for wired communication protocols in traditional computer networks. Compared with the wireless communication protocols widely used in the Internet of Things, they are fundamentally different in data format, transmission characteristics, etc. Therefore, these traditional identification methods are powerless when facing the Internet of Things communication protocols and cannot be directly applied.

[0004] In the actual application of IoT communication, the communication data captured by the tester needs to be accurately analyzed to determine the type of communication protocol. However, most existing testers rely on the configuration of professionals, resulting in complex operation and low efficiency. A related patent "Identifying IoT communication protocols by combining KNN model in time-frequency domain" proposes a method for intelligently identifying communication protocols. This method can automatically adjust parameters according to the actual situation of the terminal device, thereby greatly simplifying the operation process and improving test efficiency. However, this patent still has shortcomings in recognition accuracy and computational complexity, and cannot fully meet the needs of practical applications. Summary of the invention

[0005] In order to solve the problems of low accuracy and high computational complexity in the prior art for IoT communication protocol identification, the primary purpose of the present invention is to provide an IoT communication protocol identification method based on KNN-Alexnet, which can reduce the amount of calculation, improve the efficiency of communication protocol identification, and achieve efficient and accurate communication protocol identification.

[0006] To achieve the above object, the present invention adopts the following technical solution: a method for identifying the Internet of Things communication protocol based on KNN-Alexnet, the method comprising the following steps in order:

[0007] (1) Converting the data sequence transmitted by the IoT device into a time domain waveform graph, preprocessing the time domain waveform graph, forming a data set after the preprocessing, and dividing the data set into a training set, a test set, and a validation set;

[0008] (2) For each IQ data sequence in the test set, the KNN model is used to identify the communication protocol of the time domain waveform, obtain the identification results of each protocol, and calculate the prediction probability;

[0009] (3) Take the 20% time domain waveforms with the lowest prediction probability and enter them into the Alexnet model to obtain the prediction results;

[0010] (4) Under the priority selection of prediction results, the final result is obtained by combining the identification results of each protocol.

[0011] Step (1) specifically refers to: first, sampling the communication data after QAM modulation of Bluetooth, C-V2X, ETC, WIFI-20MHZ, WIFI-40MHZ, 5G, LTE, and NB-IOT protocols to obtain multiple IQ data sequences of each protocol, and for each IQ data sequence, drawing a time domain waveform corresponding to each IQ data sequence, and preprocessing the time domain waveform, the preprocessing includes blanking, center cropping, conversion to tensor format and normalization, the preprocessed time domain waveform forms a data set, and the data set is randomly divided into a training set, a test set and a validation set in a ratio of 6:2:2.

[0012] Step (2) specifically includes the following steps in order:

[0013] (2a) First, the Euclidean distance between the time domain waveform of an IQ data sequence to be classified in the test set and each time domain waveform in the training set is calculated:

[0014] (2b) Sort the Euclidean distances in ascending order;

[0015] (2c) Select the 10 time domain waveforms with the smallest Euclidean distance;

[0016] (2d) Count the occurrence frequencies of the protocol types to which these 10 time domain waveforms belong;

[0017] (2e) The protocol type with the highest occurrence frequency is selected as the recognition result of the IQ data sequence to be classified, and the occurrence frequency of the protocol type with the highest occurrence frequency is used as the prediction probability of the KNN model for the time domain waveform of the IQ data sequence to be classified.

[0018] Step (3) specifically includes the following steps in order:

[0019] (3a) Training the AlexNet model: Use the training set to train the AlexNet model; after 100 rounds of training, the trained AlexNet model and the corresponding model parameter file are obtained;

[0020] (3b) Define the image file path list: prepare the file path for each time domain waveform image, and then generate a list including the paths of all time domain waveform images to be classified;

[0021] (3c) Loading ImageNet class label file: Obtain and load the ImageNet class label file of each time domain waveform. The ImageNet class label file contains the protocol type recognized by the model.

[0022] (3d) The 20% of time domain waveforms with the lowest prediction probability are input into the trained AlexNet model, and the trained AlexNet model outputs a prediction result, which includes the protocol type and the probability corresponding to each protocol type.

[0023] Step (4) specifically means: for the recognition of the time domain waveform graph, the recognition result of the AlexNet model, i.e. the prediction result, is preferentially used; for the other time domain waveform graphs that have not been recognized by the AlexNet model, the recognition result of the KNN model, i.e. the recognition result of each protocol, is used as the basis.

[0024] Another object of the present invention is to provide an electronic device, comprising:

[0025] Processor; and

[0026] A memory, in which computer program instructions are stored, and when the computer program instructions are executed by the processor, the processor executes the Internet of Things communication protocol identification method based on KNN-Alexnet as described above.

[0027] The present invention also provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the processor executes the Internet of Things communication protocol identification method based on KNN-Alexnet as described above.

[0028] It can be seen from the above technical scheme that the beneficial effects of the present invention are: first, high recognition efficiency: simplifying data preprocessing and feature extraction steps, reducing the amount of calculation, and improving the efficiency of communication protocol recognition; second, high accuracy: combining the advantages of the KNN model and the Alexnet model, giving full play to the strengths of the two models and improving the recognition accuracy; third, good real-time performance: suitable for IoT communication protocol recognition scenarios with high real-time requirements, and can quickly give recognition results to meet actual application needs; fourth, by rationally utilizing time domain waveform information and combining the advantages of the KNN model and the Alexnet model, efficient and accurate communication protocol recognition is achieved. Compared with the prior art, the present invention has significant improvements in accuracy and time complexity, and has broad application prospects and important practical significance. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a flow chart of the method of the present invention;

[0030] Figure 2 It is the processing flow chart of the KNN model;

[0031] Figure 3 This is the processing flow chart of the Alexnet model;

[0032] Figure 4 is a schematic diagram of the final result. DETAILED DESCRIPTION

[0033] like Figure 1 As shown, a method for identifying IoT communication protocols based on KNN-Alexnet includes the following steps in order:

[0034] (1) The data sequence transmitted by the IoT device is converted into a time domain waveform graph. The time domain waveform graph can intuitively reflect the temporal variation law of the data and provide basic data for the subsequent recognition process. The time domain waveform graph is preprocessed to form a data set after the preprocessing. The data set is divided into a training set, a test set, and a validation set.

[0035] (2) For each IQ data sequence in the test set, the KNN model is used to identify the communication protocol of the time domain waveform, obtain the identification results of each protocol, and calculate the prediction probability;

[0036] (3) Take the 20% time domain waveforms with the lowest prediction probability and enter them into the Alexnet model to obtain the prediction results;

[0037] (4) Under the priority selection of prediction results, the final result is obtained by combining the identification results of each protocol.

[0038] Step (1) specifically refers to: firstly, sampling the communication data after QAM modulation of Bluetooth, C-V2X, ETC, WIFI-20MHZ, WIFI-40MHZ, 5G, LTE, and NB-IOT protocols to obtain multiple IQ data sequences of each protocol, and for each IQ data sequence, drawing the time domain waveform corresponding to each IQ data sequence, and preprocessing the time domain waveform, the preprocessing includes blanking, center cropping, conversion to tensor format and normalization, and the preprocessed time domain waveform forms a data set, and the data set is randomly divided into a training set, a test set and a validation set in a ratio of 6:2:2. This process does not require complex feature extraction, simplifies the data preprocessing steps, and reduces the amount of calculation.

[0039] like Figure 2 As shown, step (2) specifically includes the following steps in order:

[0040] (2a) First, the Euclidean distance between the time domain waveform of an IQ data sequence to be classified in the test set and each time domain waveform in the training set is calculated:

[0041] (2b) Sort the Euclidean distances in ascending order;

[0042] (2c) Select the 10 time domain waveforms with the smallest Euclidean distance;

[0043] (2d) Count the occurrence frequencies of the protocol types to which these 10 time domain waveforms belong;

[0044] (2e) The protocol type with the highest frequency of occurrence is selected as the recognition result of the IQ data sequence to be classified, and the frequency of occurrence of the protocol type with the highest frequency of occurrence is used as the prediction probability of the KNN model for the time domain waveform of the IQ data sequence to be classified. The prediction probability reflects the confidence of the KNN model in the recognition result of the time domain waveform, which provides a basis for the subsequent Alexnet model recognition.

[0045] like Figure 3 As shown, step (3) specifically includes the following steps in order:

[0046] (3a) Training the AlexNet model: Use the training set to train the AlexNet model; after 100 rounds of training, the trained AlexNet model and the corresponding model parameter file are obtained; the AlexNet model is a deep convolutional neural network with powerful feature extraction and classification capabilities. For the selected time domain waveform, the AlexNet model extracts deep features through its multi-layer convolutional layer and pooling layer, and then performs classification and recognition through the fully connected layer.

[0047] (3b) Define the image file path list: prepare the file path for each time domain waveform image, and then generate a list including the paths of all time domain waveform images to be classified;

[0048] (3c) Loading ImageNet class label file: Obtain and load the ImageNet class label file of each time domain waveform. The ImageNet class label file contains the protocol type recognized by the model.

[0049] (3d) The 20% of time domain waveforms with the lowest prediction probability are input into the trained AlexNet model, and the trained AlexNet model outputs a prediction result, which includes the protocol type and the probability corresponding to each protocol type.

[0050] Step (4) specifically means: for the recognition of the time domain waveform, the recognition result of the AlexNet model, i.e. the prediction result, is used first; for the other time domain waveforms that have not been recognized by the AlexNet model, the recognition result of the KNN model, i.e. the recognition result of each protocol, is used as the standard. The recognition result of the Alexnet model is combined with the recognition result of the KNN model to obtain the final result. This process makes full use of the rapidity of the KNN model and the accuracy of the Alexnet model, and improves the overall recognition performance.

[0051] The embodiment of the present application may also be an electronic device, including:

[0052] Processor; and

[0053] A memory stores computer program instructions, which, when executed by the processor, cause the processor to perform the method.

[0054] The embodiment of the present application may also be a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the method as described above.

[0055] Advantages of KNN model:

[0056] (1) Simple and easy to implement: The KNN model is very simple and easy to understand and implement. It does not require complex mathematical models and a large number of parameter adjustments. It is suitable for rapid prototyping and classification tasks of small-scale data sets. For a small image classification task, KNN can be quickly implemented and provide preliminary classification results, helping developers quickly verify the feasibility of the data set and the complexity of the classification task.

[0057] (2) Non-parametric: KNN is a non-parametric algorithm that does not require assumptions about the distribution of data. This gives it certain advantages when dealing with complex data distributions, especially when the data distribution is unclear or does not conform to common distribution assumptions. For some images with complex textures and shapes, KNN can better capture the local features of the data without relying on global distribution assumptions.

[0058] (3) Strong adaptability: The KNN model can adapt to different data sets and tasks. By adjusting the number of nearest neighbors k and the distance measurement method, the classification performance can be flexibly optimized. For different image classification tasks, the optimal k value can be selected through cross-validation to improve the classification accuracy.

[0059] (4) Processing small data sets: The KNN model performs well when processing small data sets because it does not require a large amount of training data to learn model parameters, which allows it to provide good classification results even when data is scarce. For image classification tasks in some specific fields, data collection may be very difficult, and KNN can provide effective classification using limited data.

[0060] Advantages of AlexNet model:

[0061] (1) Powerful feature extraction capability: AlexNet is a deep convolutional neural network with powerful feature extraction capabilities. It automatically learns the deep features of images through multiple convolutional layers and pooling layers, and can capture the complex texture, shape and semantic information in the image. For complex natural image classification tasks, AlexNet can automatically learn features such as edges, textures, shapes, etc. in the image, thereby improving the classification accuracy.

[0062] (2) High classification accuracy: AlexNet performs well in large-scale image classification tasks and can achieve high classification accuracy. It learns rich feature representations through a large amount of training data and a complex network structure, making it more accurate in classification. On the ImageNet dataset, AlexNet's classification accuracy is significantly higher than that of traditional machine learning algorithms.

[0063] (3) End-to-end learning: AlexNet uses an end-to-end learning approach, and the entire process from input image to output classification result is automated. This makes it more efficient in handling complex image classification tasks, without the need to manually design feature extractors. For large-scale image classification tasks, AlexNet can automatically learn the optimal feature representation without manual intervention.

[0064] (4) Processing large data sets: AlexNet is suitable for processing large data sets and can learn more robust feature representations through a large amount of training data. This enables it to better adapt to different data distributions when facing complex image classification tasks. For large-scale image classification tasks, such as ImageNet, AlexNet can use a large amount of training data to learn rich feature representations, thereby improving classification accuracy.

[0065] The complementary advantages of the KNN model and the AlexNet model are:

[0066] (1) Combining local and global features: The KNN model can capture the local features of the data, while AlexNet can learn the global features of the data. By combining these two models, local and global features can be used at the same time to improve the performance of classification and recognition. For some complex image classification tasks, KNN can capture the local texture and details in the image, while AlexNet can learn the overall shape and semantic information of the image. The combination of the two can provide a more comprehensive feature representation.

[0067] (2) Handling different data sizes: The KNN model performs well when processing small data sets, while AlexNet is suitable for processing large data sets. By combining these two models, we can flexibly cope with data sets of different sizes and improve the robustness of classification. For tasks with scarce data, we can first use KNN for preliminary classification, and then use AlexNet for further classification of uncertain samples, thereby improving the overall classification accuracy.

[0068] (3) Improve classification efficiency: The KNN model is relatively simple in calculation and is suitable for fast classification. Although AlexNet has a high computational complexity, its efficiency can be improved through parallel computing and optimization algorithms. By combining these two models, KNN can be used for fast classification first, and then AlexNet can be used for fine classification of uncertain samples, thereby improving the overall classification efficiency. For image classification tasks with high real-time requirements, KNN can be used for fast classification first, and for samples with unsatisfactory classification results, AlexNet can be used for further classification, thereby improving classification efficiency while ensuring classification accuracy.

[0069] (4) Reduce misclassification: The KNN model can provide preliminary classification results, while AlexNet can further verify and refine these results. By combining these two models, misclassification can be reduced and the reliability of classification can be improved. For some easily confused categories, KNN can provide preliminary classification results, and then AlexNet can further verify these results, thereby reducing misclassification and improving classification accuracy.

[0070] After testing, the recognition accuracy of the present invention reaches 95%, and the processing speed is 30% higher than that of the prior art. Here, the actual protocol of the randomly selected file is Bluetooth, which is consistent with the recognition result. Figure 4 As shown in the simulation experiment, Bluetooth, C-V2X, ETC, WIFI-20MHZ, WIFI-40MHZ, 5G, LTE, and NB-IOT are marked as categories 0, 1, 2, 3, 4, 5, 6, and 7 in turn. Figure 4 In the figure, the final result of the time domain waveform is category 1, namely C-V2X, with a predicted probability of 0.807.

[0071] From the above experimental results, it can be seen that the present invention realizes efficient and accurate communication protocol recognition by rationally utilizing the time domain waveform information and combining the advantages of KNN and Alexnet models. Compared with the prior art, the present invention has significant improvements in accuracy and time complexity, and has broad application prospects and important practical significance.

[0072] In summary, the present invention only uses the time domain waveform for identification, while the prior art needs to convert the time domain waveform into a frequency domain waveform, eliminating the frequency domain conversion step and simplifying the data processing flow. Since there is no need to perform frequency domain conversion and identification of the frequency domain waveform, the present invention has lower computational complexity and faster processing speed, and is suitable for the Internet of Things communication protocol identification scenario with high real-time requirements. Through the collaborative work of the KNN model and the Alexnet model, the present invention has also improved in accuracy, and can more accurately identify the Internet of Things communication protocol.

Claims

1. A method for identifying Internet of Things communication protocols based on KNN-Alexnet, characterized in that: The method comprises the following steps in order: (1) Converting the data sequence transmitted by the IoT device into a time domain waveform graph, preprocessing the time domain waveform graph, forming a data set after the preprocessing, and dividing the data set into a training set, a test set, and a validation set; (2) For each IQ data sequence in the test set, the KNN model is used to identify the communication protocol of the time domain waveform, obtain the identification results of each protocol, and calculate the prediction probability; (3) Take the 20% time domain waveforms with the lowest prediction probability and enter them into the Alexnet model to obtain the prediction results; (4) Under the priority selection of prediction results, the final result is obtained by combining the identification results of each protocol.

2. The Internet of Things communication protocol identification method based on KNN-Alexnet according to claim 1, characterized in that: Step (1) specifically refers to: first, sampling the communication data after QAM modulation of Bluetooth, C-V2X, ETC, WIFI-20MHZ, WIFI-40MHZ, 5G, LTE, and NB-IOT protocols to obtain multiple IQ data sequences of each protocol, and for each IQ data sequence, drawing a time domain waveform corresponding to each IQ data sequence, and preprocessing the time domain waveform, the preprocessing includes blanking, center cropping, conversion to tensor format and normalization, the preprocessed time domain waveform forms a data set, and the data set is randomly divided into a training set, a test set and a validation set in a ratio of 6:2:

2.

3. The method for identifying the Internet of Things communication protocol based on KNN-Alexnet according to claim 1, characterized in that: Step (2) specifically includes the following steps in order: (2a) First, the Euclidean distance between the time domain waveform of an IQ data sequence to be classified in the test set and each time domain waveform in the training set is calculated: (2b) Sort the Euclidean distances in ascending order; (2c) Select the 10 time domain waveforms with the smallest Euclidean distance; (2d) Count the occurrence frequencies of the protocol types to which these 10 time domain waveforms belong; (2e) The protocol type with the highest occurrence frequency is selected as the recognition result of the IQ data sequence to be classified, and the occurrence frequency of the protocol type with the highest occurrence frequency is used as the prediction probability of the KNN model for the time domain waveform of the IQ data sequence to be classified.

4. The method for identifying the Internet of Things communication protocol based on KNN-Alexnet according to claim 1, characterized in that: Step (3) specifically includes the following steps in order: (3a) Training the AlexNet model: Use the training set to train the AlexNet model; after 100 rounds of training, the trained AlexNet model and the corresponding model parameter file are obtained; (3b) Define the image file path list: prepare the file path for each time domain waveform image, and then generate a list including the paths of all time domain waveform images to be classified; (3c) Loading ImageNet class label file: Obtain and load the ImageNet class label file of each time domain waveform. The ImageNet class label file contains the protocol type recognized by the model. (3d) The 20% of time domain waveforms with the lowest prediction probability are input into the trained AlexNet model, and the trained AlexNet model outputs a prediction result, which includes the protocol type and the probability corresponding to each protocol type.

5. The method for identifying the Internet of Things communication protocol based on KNN-Alexnet according to claim 1, characterized in that: Step (4) specifically means: for the recognition of the time domain waveform graph, the recognition result of the AlexNet model, i.e. the prediction result, is preferentially used; for the other time domain waveform graphs that have not been recognized by the AlexNet model, the recognition result of the KNN model, i.e. the recognition result of each protocol, is used as the basis.

6. An electronic device comprising: processor; as well as A memory, wherein computer program instructions are stored in the memory, and when the computer program instructions are executed by the processor, the processor executes the Internet of Things communication protocol identification method based on KNN-Alexnet as described in any one of claims 1 to 5.

7. A computer-readable storage medium having computer program instructions stored thereon, wherein when the computer program instructions are executed by a processor, the processor executes the Internet of Things communication protocol identification method based on KNN-Alexnet as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method, system and device for determining shooting part of medical image

    CN115082733A

  • Internet of Things communication protocol identification method based on time-frequency domain combination

    CN118646687A