Reverse analysis method for communication protocol of electric power internet of things

By constructing and optimizing the Bi-LSTM model, combined with the detection results of the atom detector, the problems of security risks and insufficient adaptability in the reverse analysis of the power Internet of Things communication protocol are solved, and more efficient protocol analysis and security improvement are achieved.

CN118612124APending Publication Date: 2024-09-06HUAIAN OF JIANGSU ELECTRIC POWER CO POWER SUPPLY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410633200.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

The existing power Internet of Things communication protocols lack security mechanisms, and there are security risks that Internet of Things control commands can easily be forged. Moreover, the traditional communication protocol reverse analysis method is complex and has insufficient adaptability to unknown protocols, making it difficult to determine the input and output of the model.

Method used

By acquiring protocol data, building an atom detector to obtain label data sets, adding multi-atom features, building and optimizing the bidirectional long short-term memory neural network model Bi-LSTM, training the model to obtain effective fields and integrating them, improving the reverse analysis capabilities of unknown protocols .

Benefits of technology

It improves the automation of protocol analysis, improves security, performance and maintainability, shows strong generalization ability, and improves the adaptability and versatility of reverse analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612124A
    Figure CN118612124A
Patent Text Reader

Abstract

The invention provides a reverse analysis method for a communication protocol of an electric power internet of things, and the method comprises the steps: obtaining an existing protocol message and a design specification of the electric power internet of things as samples; after preprocessing, constructing an atom detector to identify a data set of floating-point numbers, timestamps, variable-length data lengths and the like as feature input of a bidirectional long-short-term memory network model; by setting one or more bidirectional LSTM layers and setting the number of LSTM units, an activation function and other hyper-parameters, a bidirectional long-short term memory neural network model Bi-LSTM is improved, the model is trained by using a model.fit () method, a final model is obtained, an unknown protocol is predicted and integrated, and a reverse analysis result is obtained. According to the method, reverse analysis is carried out on the communication protocol of the electric power Internet of Things through a deep learning mode, an unknown communication protocol is deconstructed, the security, performance and stability of the existing communication protocol are analyzed, and guarantee is provided for maintaining the network and equipment security of the electric power Internet of Things.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of reverse engineering of power Internet of Things communication protocols, and in particular to a reverse analysis method of power Internet of Things communication protocols. Background Art

[0002] The power Internet of Things is an application scenario that applies the Internet of Things technology to the power sector, aiming to achieve intelligent, automated and efficient management of power systems. It involves establishing connections between power equipment, sensors, control systems and communication networks to achieve real-time data monitoring, remote control, fault diagnosis, energy management and optimized operation of power networks. It has great potential to improve the reliability, availability and maintainability of power systems, and is expected to bring higher efficiency and sustainability to the power industry.

[0003] Some typical existing power Internet of Things communication protocols (IEC61850 / 60870) lack documented security mechanisms. The current power Internet of Things communication protocols focus on real-time performance, and there are security risks such as IoT control commands being easily forged. They cannot guarantee the safe operation of power Internet of Things devices, threatening the safe and stable operation of power Internet of Things devices.

[0004] Traditional communication protocol reverse analysis methods are relatively complex, lack dynamism, and lack adaptability to unknown protocols. For unknown communication protocols, their structure and message format are unpredictable, making it difficult to determine the input and output of the model, and there is no known labeled data for supervised learning of the model.

[0005] Technical Solution

[0006] Purpose of the invention: To solve the above problems, the present invention provides a reverse analysis method for an electric power Internet of Things communication protocol, which obtains protocol data and builds an atomic detector to obtain a label data set, adds multi-atom features, builds and optimizes a bidirectional long short-term memory neural network model Bi-LSTM and trains it, obtains and integrates valid fields through the final model, and obtains reverse analysis results of unknown electric power Internet of Things communication protocols, thereby improving the problems of insufficient adaptability to unknown protocols, high complexity, and shallow analysis level in the prior art.

[0007] Technical solution:

[0008] The present invention discloses a reverse analysis method for a power Internet of Things communication protocol, the method comprising the following steps:

[0009] S1 obtains the protocol data and performs preprocessing to obtain the original data;

[0010] S2 obtains the power Internet of Things protocol message and design specification as a sample message set;

[0011] S2.1 builds an atomic detector, inputs a sample message set, and identifies the common parts of the data set such as floating point numbers, timestamps, and variable length data;

[0012] S3 extracts valid data features of the original data, assigns labels to the identified fields of the atomic detector, manually examines and verifies the unidentified fields, and creates corresponding labeled data sets. The split data sets are the training set and the test set.

[0013] S4 builds and optimizes the bidirectional long short-term memory neural network model Bi-LSTM;

[0014] S4.1 Set up the LSTM layer, set the number of LSTM units, activation function and hyperparameters;

[0015] S4.2 After the Bi-LSTM layer, add at least one fully connected layer for further feature extraction and mapping;

[0016] S4.3 uses an output layer with a softmax activation function;

[0017] S4.4 Select loss function and optimizer;

[0018] S5 passes in the training data and labels and trains the model using the model.fit() method. It monitors the training process and uses an early stopping strategy to prevent overfitting.

[0019] S6 uses the final trained model to make predictions, identify and infer field boundaries and variable-length sequences, and integrate fields.

[0020] Furthermore, in step S1, the preprocessing is detailed as follows: decrypting the encrypted protocol data and filtering the data to retain as much valid data as possible.

[0021] Furthermore, the valid data field retained after preprocessing is aligned according to bytes, and the minimum width is set to one byte.

[0022] Furthermore, in step S2.1, the atomic detector is specifically:

[0023] Floating point detector: Identifies floating point numbers based on the fact that floating point values ​​in a message set tend to be clustered in a relatively small range and the inherent structural features of the IEEE 754 floating point structure.

[0024] Timestamp detector: Based on the start and end datetimes of captured data, interpret the values ​​of data slices according to supported timestamp formats and infer the timestamp field if all slice values ​​are within the specified time range;

[0025] Variable data length: Based on the unsigned integer length of the encoded data and data encoding conventions, a constant header size is determined by comparing the difference between the slice value and the message length to infer the length field.

[0026] Furthermore, the characteristics are concentrated in a relatively small range: adjacent real values ​​have the same exponent value but different significant values ​​when encoding IEEE 754 floating point numbers;

[0027] Furthermore, in step 4.1, the LSTM layer is initially set to 64 LSTM units, and the number of units is gradually increased or decreased according to the performance of the verification model to obtain the optimal value.

[0028] Furthermore, the LSTM layer neural unit activation function selects the tanh function, and the output range is [-1, 1].

[0029] Furthermore, the number of LSTM layer iterations is set to 50, and an early stopping strategy is used to prevent overfitting.

[0030] Furthermore, step S6 is specifically as follows:

[0031] Divide the field boundaries according to the identified fields and identify adjacent fields using the same mechanism;

[0032] Inferring variable-length fields through iterative deepening searches, guided by common serialization patterns;

[0033] The detection results of the integrated atomic detectors are used to resolve the conflicts caused by the results returned by each detector through an integration algorithm, and the sample data volume is used to the maximum extent to return the most accurate integrated results.

[0034] Beneficial effects:

[0035] 1. The present invention improves the automation level of protocol analysis, improves security, performance and maintainability by constructing a main bidirectional long short-term memory neural network prediction model Bi-LSTM, and exhibits strong generalization ability when processing different types of protocols.

[0036] 2. The present invention uses a loss function and an optimizer to select an output layer with a softmax activation function, optimizes the bidirectional long short-term memory neural network prediction model Bi-LSTM, further improves the model convergence speed and escapes from the local optimum.

[0037] 3. The present invention combines the atomic detector with the bidirectional long short-term neural network Bi-LSTM, and uses the detection results of the atomic detector as features as the input of the deep model, which improves the problem of the single detection type of the atomic detector and provides the necessary features for the training of the model, thereby improving the efficiency and performance of the model prediction.

[0038] 4. The present invention identifies and derives field boundaries and variable-length sequences, aggregates the detection results of atomic detectors and integrates the fields to obtain reverse analysis results, further improving the adaptability and versatility of the reverse method. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a schematic diagram of the process of the present invention Figure 1 ;

[0040] Figure 2 This is a schematic diagram of the process of the present invention Figure 2 ;

[0041] Figure 3 It is an example of a top-level message format for an unknown protocol in the present invention with common header fields and two encapsulation payload formats. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0043] This embodiment provides a reverse analysis method for the power Internet of Things communication protocol based on multi-atom features and Bi-LSTM. Figure 1 , including the following steps:

[0044] 1. Preprocess the protocol data. If there is encrypted protocol data, the data needs to be decrypted and the encrypted data needs to be restored to the original data.

[0045] The data preprocessing step also includes data filtering and exception handling, deleting unnecessary data, processing lost data packets, duplicate data packets, and non-standard data packets, ensuring that the data contains only valid data as much as possible;

[0046] The processed data fields are byte-aligned with a minimum width of one byte. While complying with the communication protocol, data alignment can be used to improve the convergence speed of subsequent models.

[0047] Second, obtain the public power Internet of Things protocol messages and design specifications as sample message set input, and build an atomic detector to identify floating point numbers, timestamps, and variable data lengths. Among them, the unknown protocol format has the following structure:

[0048] like Figure 3As shown, first comes the 1-byte message type, then the 16-bit message length, then the 32-bit Unix timestamp, and finally the payload of one or more length-value pairs. Atomic detectors are constructed to recognize specific types of data. Each detector takes as input a collection of sample messages and returns a partial description of any fields it recognizes. It works by iteratively passing different byte slices to the inference function.

[0049] The atomic detector is composed of:

[0050] Floating point detector: A heuristic-based approach to identify floating point numbers based on the fact that floating point values ​​in a message set tend to be clustered in a relatively small range and based on the structural features inherent in the IEEE 754 floating point structure;

[0051] The floating point detector needs to identify floating point numbers based on the characteristics of the floating point message set and the structural characteristics of IEEE 754 floating point numbers. IEEE 754 floating point numbers consist of three areas: a single sign bit, an 8-bit binary-coded exponent, and a 23-bit binary-coded mantissa or significant digit. A real number is approximately represented by a floating point number in the following form: sign*2 exponent * Valid bits. Specific features are:

[0052] The characteristic is concentrated in a relatively small range: adjacent real values ​​have the same exponent value when encoding IEEE 754 floating point numbers, but different significant values;

[0053] Floating point structure features: Floating point numbers consist of a sign bit, an eight-bit binary-coded exponent, and a 23-bit binary-coded mantissa or significant digit;

[0054] Timestamp detector: Based on the start and end datetimes of captured data, interpret the values ​​of data slices according to supported timestamp formats and infer the timestamp field if all slice values ​​are within the specified time range;

[0055] Variable data length: Based on the encoding convention of encoding the unsigned integer length of the data first, and then the data itself, a constant header size is determined by comparing the difference between the slice value and the message length to infer the length field.

[0056] 3. Extract useful features from the raw data, assign labels to the identified fields, and split the dataset into training and test sets;

[0057] Among them, in step 2, corresponding label data sets are created for the recognized floating point number and timestamp fields; the unrecognized fields are manually identified and corresponding data sets are created, and the corresponding field features are extracted.

[0058] The preprocessed dataset is divided into 70% training set, 15% validation set and 15% test set.

[0059] 4. Construct a bidirectional long short-term memory neural network prediction model Bi-LSTM and improve and optimize the model;

[0060] Since communication protocols are usually transmitted in the form of sequences, Bi-LSTM is a powerful sequence modeling tool that can effectively capture long-term dependencies in sequences and help understand the data structure and process in the protocol. In addition, it can consider not only past context information, but also future context information. This is very useful for analyzing communication protocols because the meaning of a certain data packet may depend on the content of previous and subsequent data packets. The specific operations of constructing the bidirectional long short-term memory neural network prediction model Bi-LSTM are:

[0061] ① Set up one or more bidirectional LSTM layers, set the number of LSTM units, activation function and other hyperparameters;

[0062] A bidirectional LSTM layer is initially set with 64 LSTM units, and the number of units is gradually increased or decreased according to the verified performance to find the optimal value;

[0063] The default tanh function is selected as the activation function, whose output range is between -1 and 1, which helps to control the propagation of the gradient; the number of iterations is set to 50, and the early stopping strategy is used to prevent overfitting.

[0064] ②After the Bi-LSTM layer, add one or more fully connected layers for further feature extraction and mapping;

[0065] ③Use the output layer with softmax activation function;

[0066] ④Choose the appropriate loss function and optimizer;

[0067] ⑤ Use the model.fit() method to train the model, pass in the training data and labels, monitor the loss and performance indicators during training, and consider using an early stopping strategy to prevent overfitting;

[0068] ⑥ Adjust the model according to the evaluation results and the needs of reverse analysis, including the number of model units and function parameters.

[0069] 5. Prediction is performed through the final bidirectional long short-term memory neural network prediction model Bi-LSTM;

[0070] 6. Identify and deduce field boundaries and variable-length sequences, and integrate fields, specifically:

[0071] Identify and deduce field boundaries and variable-length sequences, and integrate fields; divide field boundaries based on identified fields, and identify adjacent fields using the same mechanism; infer variable-length fields through iterative deepening of searches, guided by common serialization patterns; aggregate detection results from various atomic detectors, and use integration algorithms to process returned data for further research and analysis.

[0072] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A reverse analysis method for a power Internet of Things communication protocol, characterized in that: The method comprises the following steps: S1 obtains the protocol data and performs preprocessing to obtain the original data; S2 obtains the power Internet of Things protocol message and design specification as a sample message set; S2.1 builds an atomic detector, inputs a sample message set, and identifies the common parts of the data set such as floating point numbers, timestamps, and variable length data; S3 extracts valid data features of the original data, assigns labels to the identified fields of the atomic detector, manually examines and verifies the unidentified fields, and creates corresponding labeled data sets. The split data sets are the training set and the test set. S4 builds and optimizes the bidirectional long short-term memory neural network model Bi-LSTM; S4.1 Set up the LSTM layer, set the number of LSTM units, activation function and hyperparameters; S4.2 After the Bi-LSTM layer, add at least one fully connected layer for further feature extraction and mapping; S4.3 uses an output layer with a softmax activation function; S4.4 Select loss function and optimizer; S5 passes in the training data and labels and trains the model using the model.fit() method. It monitors the training process and uses an early stopping strategy to prevent overfitting. S6 uses the final trained model to make predictions, identify and infer field boundaries and variable-length sequences, and integrate fields.

2. According to claim 1, a reverse analysis method of a power Internet of Things communication protocol is characterized in that: In step S1, the preprocessing is detailed as follows: decrypting the encrypted protocol data and filtering the data to retain as much valid data as possible.

3. According to claim 2, a reverse analysis method of a power Internet of Things communication protocol is characterized in that: The valid data fields retained after preprocessing are aligned according to bytes, and the minimum width is set to one byte.

4. According to claim 1, a reverse analysis method of a power Internet of Things communication protocol is characterized in that: In step S2.1, the atomic detector is specifically: Floating point detector: Identifies floating point numbers based on the fact that floating point values ​​in a message set tend to be clustered in a relatively small range and the inherent structural features of the IEEE 754 floating point structure. Timestamp detector: Based on the start and end datetimes of captured data, interpret the values ​​of data slices according to supported timestamp formats and infer the timestamp field if all slice values ​​are within the specified time range; Variable data length: Based on the unsigned integer length of the encoded data and data encoding conventions, a constant header size is determined by comparing the difference between the slice value and the message length to infer the length field.

5. According to claim 4, a reverse analysis method of a power Internet of Things communication protocol is characterized in that: The characteristics are concentrated in a relatively small range, and adjacent real values ​​have the same exponent value but different significant values ​​when encoding IEEE 754 floating point numbers.

6. According to claim 1, a reverse analysis method of a power Internet of Things communication protocol is characterized in that: In step 4.1, the LSTM layer is initially set to 64 LSTM units, and the number of units is gradually increased or decreased according to the performance of the verification model to obtain the optimal value.

7. A reverse analysis method for a power Internet of Things communication protocol according to claim 6, characterized in that: The LSTM layer neural unit activation function selects the tanh function, and the output range is [-1, 1].

8. A reverse analysis method for a power Internet of Things communication protocol according to claim 1 or 7, characterized in that: The number of LSTM layer iterations was set to 50, and an early stopping strategy was used to prevent overfitting.

9. A reverse analysis method for a power Internet of Things communication protocol according to claim 1, characterized in that: Step S6 is specifically as follows: Divide the field boundaries according to the identified fields and identify adjacent fields using the same mechanism; Inferring variable-length fields through iterative deepening searches, guided by common serialization patterns; The detection results of the integrated atomic detectors are used to resolve the conflicts caused by the results returned by each detector through an integration algorithm, and the sample data volume is used to the maximum extent to return the most accurate integrated results.

Citation Information

Cited By

  • Network protocol reverse analysis method based on deep learning and graph neural network

    CN120321322A