Unknown protocol parsing method and system based on OSRBLS and embedded annotation

Through the method of OSRBLS and embedded annotation, combined with matrix n-gram and width learning, it solves the problem that traditional industrial control protocol parsing methods cannot identify and parse privatized protocols in complex industrial environments, achieving efficient protocol identification and parsing, and adapting to industry Changes in the production environment.

CN118353984BActive Publication Date: 2024-09-06HANGZHOU FUSION INTELLIGENT MFG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410777348.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-06
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Traditional industrial control protocol parsing methods cannot adapt to the complex industrial production environment, especially in the face of the high workload and difficulty caused by the diversification of privatized protocols and the identification and parsing of unknown protocols.

Method used

The unknown protocol parsing method based on OSRBLS and embedded annotation is used to realize the identification and parsing of unknown industrial control protocols through matrix n-gram data transformation, width learning and open set recognition combined with natural language processing.

Benefits of technology

It reduces the calculation cost, improves the accuracy of protocol identification and analysis, can adapt to the identification and classification of privatized protocols in complex industrial environments, and reduces the workload and difficulty of developers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118353984B
    Figure CN118353984B
Patent Text Reader

Abstract

The present invention discloses an unknown protocol parsing method and system based on OSRBLS and embedded annotation, belonging to the field of communication technology. It includes: obtaining target protocol message information and processing it into matrixed message data; using the OSRBLS protocol recognition model to obtain the embedded features of the matrixed message data and identify the protocol category; when it is identified as a known category, generating a parsing result in accordance with the standard format; when it is identified as an unknown protocol, updating the new category of unknown protocol to the OSRBLS protocol recognition model, and using the field parsing model to generate the field parsing result of the new category of unknown protocol, and recording the new category of unknown protocol standard format; the field parsing model uses matrixed message data and similar embedded matrices as input, and uses the matrixed field parsing result as output. The present invention solves the problem that the traditional industrial control protocol parsing method is no longer applicable due to the complexity of the current production environment and the privatization of industrial control protocols.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of communication technology, and in particular relates to an unknown protocol parsing method and system based on OSRBLS and embedded annotation. Background Art

[0002] In the traditional industrial Internet of Things, if each device or component of industrial production wants to correctly use a certain industrial control protocol, it is necessary to have an accurate understanding of the corresponding format and specifications of the protocol. Therefore, it is necessary to select the corresponding protocol in advance when configuring the corresponding device or component, and specify the corresponding parsing algorithm according to the selected protocol. However, with the diversification of production situations, the openness of industrial networks, and the complexity of IIoT networks, more and more protocols are being used in industrial production. At the same time, due to different production needs, a large number of private and non-open industrial protocols are also emerging to meet the needs of production situations, new technologies, and industrial production. However, with the development of the privatization and diversification of industrial control protocols, the cost of use has increased. If a new protocol is generated and applied, the corresponding developers need to learn the new protocol and configure the corresponding parsing solution, which brings two obvious problems to the application link: one is that it will bring a huge workload to the developers; the other is that the format and specifications of some private protocols are unknown, which further increases the difficulty of development.

[0003] Based on the above situation, the traditional industrial control protocol parsing solution is no longer suitable for the current complex production environment. A more adaptable and usable industrial control protocol parsing solution is needed. The realization of industrial control protocol parsing mainly includes two steps: protocol identification and protocol parsing. In terms of protocol identification methods, common methods include port-based protocol identification, payload-based protocol identification, and machine learning-based protocol identification. However, private protocols no longer comply with the default port and load format, making port-based and payload-based identification methods no longer applicable. The current methods are mainly based on machine learning methods. In machine learning methods, classifiers are mainly constructed based on similarity or word vector methods to achieve protocol identification. However, traditional classification methods (such as KNN, K-Mean, clustering methods, etc.) can only realize the identification of existing known methods. New protocols cannot be accurately classified and can only be classified into known protocol categories. In addition, machine learning methods require a lot of resources when training. In terms of protocol parsing, commonly used methods include protocol parsing methods based on the protocol execution process and protocol parsing methods based on data. The method based on the protocol execution process needs to convert the information in the industrial control protocol into an execution chain, and determine the protocol content by comparing it with the existing execution chain. It requires more resources and corresponding professional knowledge. Therefore, current protocol parsing is mainly based on data-based protocol parsing methods, but the accuracy of complex protocol parsing needs to be further improved.

[0004] In summary, how to combine machine learning or further deep learning methods to achieve an accurate identification method for existing and unknown protocols and a parsing method for unknown protocols is an issue of great significance. Summary of the invention

[0005] In view of the complexity of the current production environment and the privatization of industrial control protocols, the huge workload and difficulty faced by industrial control analysis, the existing protocol analysis methods can no longer adapt to the current production status. The present invention proposes an unknown protocol analysis method and system based on OSRBLS and embedded annotation. In the data processing stage, since the industrial control protocol message data does not have a clear segmentation reference symbol, the present invention first proposes a matrix n-gram data transformation method so that the transformed data can contain various segmented data information. Subsequently, considering the requirements of the computing level under the background of industrial production, the Broad Learning System (BLS) method is adopted to reduce the computational cost of the entire algorithm, and further combined with the idea of ​​Open Set Recognition (Open Set Recognition) to propose an OSRBLS method that can be used for unknown industrial control protocol identification. Furthermore, the embedded features obtained by the OSRBLS method are combined with the idea of ​​part-of-speech tagging in natural language processing (Natural Language Processing, NLP) to establish a parsing scheme for unknown industrial control protocols with an embedded annotation method, which solves the problem that the traditional industrial control protocol analysis method is no longer applicable due to the complexity of the current production environment and the privatization of industrial control protocols.

[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0007] In a first aspect, the present invention discloses a method for parsing an unknown protocol based on OSRBLS and embedded annotations, comprising:

[0008] Obtain target protocol message information and process it into matrix message data;

[0009] The OSRBLS protocol recognition model is used to obtain the embedded features of the matrix message data, and the protocol category to which the matrix message data belongs is identified according to the similarity between the embedded features and the feature centers of the known category protocol messages;

[0010] When a known category protocol is identified, a parsing result is generated according to the corresponding category protocol specification format; when an unknown protocol category is identified, the new category unknown protocol is updated to the OSRBLS protocol identification model, and the field parsing model is used to generate the field parsing result of the new category unknown protocol, and the new category unknown protocol specification format is recorded;

[0011] The field parsing model takes matrixed message data and a similarity embedding matrix as input and takes a matrixed field parsing result as output. The similarity embedding matrix is ​​obtained by splicing the feature centers of several known category protocol messages with the highest similarity to the matrixed message data.

[0012] Furthermore, the step of obtaining target protocol message information and processing it into matrix message data includes:

[0013] Set a message length threshold, truncate the message data that exceeds the message length threshold and use the first piece of data, and fill in the message data that is less than the message length threshold;

[0014] Split the truncated or padded message data into bytes and convert them into decimal numbers;

[0015] The decimal message data is regarded as a vector and transformed using the n-gram method. The n-gram results of each message are then concatenated into a matrix and padded with 0 to obtain the matrixed message data.

[0016] Furthermore, the OSRBLS protocol recognition model is pre-trained based on known category protocol message data, and the pre-training process includes:

[0017] Obtain known category protocol message information and process it into matrix message data as a protocol identification training set, group them according to protocol category, and obtain the feature center of each group of protocols;

[0018] According to the protocol categories in the protocol recognition training set, the number of embedded features, the number of initialized feature nodes and the number of enhanced nodes are set;

[0019] Each message data in the protocol recognition training set is mapped through a two-dimensional convolutional network to obtain a preset number of feature nodes and enhanced nodes, and then the set of feature nodes and enhanced nodes corresponding to the message data are mapped to obtain the embedded features of the message data. The loss is calculated based on the embedded features and the feature center of the known category protocol message, and the current enhanced node weight parameters are updated with the goal of minimizing the training loss;

[0020] If the minimized training loss is greater than the threshold, the number of enhanced nodes is increased by one, and the enhanced node weight parameters after increasing the number of enhanced nodes are updated according to the current enhanced node weight parameters, and the minimized training loss is recalculated until the minimized training loss is less than or equal to the threshold, and the pre-trained OSRBLS protocol recognition model is obtained.

[0021] Furthermore, the enhanced nodes are obtained by mapping the feature nodes according to the enhanced node weight parameters and random bias.

[0022] Furthermore, the step of identifying the protocol category to which the matrixed message data belongs based on the similarity between the embedded features and the feature centers of the known category protocol messages includes:

[0023] The OSRBLS protocol recognition model is used to obtain the embedded features of the target protocol, and the similarity between the embedded features and the feature centers of the recorded protocols of each category is calculated; the feature center refers to the cluster center of the matrixed message data under the same category;

[0024] If the similarity is greater than the threshold, the protocol category is determined based on the maximum similarity;

[0025] If the similarity is less than or equal to the threshold, it is determined as an unknown protocol category.

[0026] Further, when the unknown protocol category is identified, updating the new category unknown protocol to the OSRBLS protocol identification model includes:

[0027] Obtain the similarity between the embedded features of the matrixed message data identified as an unknown protocol category and the feature centers of each category of protocols that have been recorded, and take the average of several feature centers with the highest similarity as the feature center of the new category of unknown protocol;

[0028] The number of embedded features of the current OSRBLS protocol recognition model is increased by one, the matrixed message data of the new category of unknown protocol is added to the protocol recognition training set, and the current OSRBLS protocol recognition model is retrained using the updated protocol recognition training set to complete the adaptive update of the OSRBLS protocol recognition model.

[0029] Furthermore, the field parsing model is trained based on the matrixed message data and the matrixed field annotation results thereof, and the training process includes:

[0030] Acquire protocol message information and process it into matrix message data as a field parsing training set, annotate the matrix message data with functional fields, and generate matrix field annotation results;

[0031] The OSRBLS protocol recognition model is used to generate the embedded features of each message data in the field parsing training set, and several feature centers with the highest similarity to the embedded features are selected to obtain the embedding matrix;

[0032] The matrixed message data is concatenated with the embedded matrix, and the field parsing model is used to extract the features of the concatenated results and generate matrixed field parsing results. The loss is calculated based on the matrixed field labeling results, and the field parsing model is updated.

[0033] In a second aspect, the present invention discloses an unknown protocol parsing system based on OSRBLS and embedded annotations, which is used to implement the above-mentioned unknown protocol parsing method based on OSRBLS and embedded annotations.

[0034] In a third aspect, the present invention discloses an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned unknown protocol parsing method based on OSRBLS and embedded annotations.

[0035] In a fourth aspect, the present invention discloses a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, they are used to implement the above-mentioned unknown protocol parsing method based on OSRBLS and embedded annotations.

[0036] The beneficial effects of the present invention are:

[0037] The present invention combines the ideas of width learning, incremental learning and open set learning to construct an OSRBLS model that can be used for unknown industrial control protocol identification. The width learning method can solve the problem of high computational cost of machine learning or deep learning, and the incremental learning method can make timely adjustments to the model to avoid the problem of poor computational effect due to improper model settings. Finally, the idea of ​​open set learning can solve the problem that traditional classification methods can only be classified in limited categories, and it can also identify and classify more and more privatized unknown industrial control protocols. At the same time, based on the embedded features obtained by the above protocol identification, combined with the processing idea of ​​part-of-speech tagging in NLP, a more flexible embedded tagging industrial control protocol parsing method is realized. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a schematic diagram of metric enhanced width learning shown in an embodiment of the present invention;

[0039] Figure 2 is a schematic diagram of OSRBLS framework training shown in an embodiment of the present invention;

[0040] Figure 3 It is a schematic diagram of a message parsing process shown in an embodiment of the present invention;

[0041] Figure 4 is a schematic diagram of the field parsing model structure shown in an embodiment of the present invention;

[0042] Figure 5 It is a flow chart of an unknown protocol parsing method based on OSRBLS and embedded annotations shown in an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0044] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.

[0045] refer to Figure 5 The unknown protocol identification method based on OSRBLS and embedded annotation proposed in the present invention specifically includes the following steps:

[0046] S1, construct a data set for protocol identification and perform data processing. Since industrial control protocol message data does not have clear stop words like traditional text data, how to segment the protocol message data is also a problem that needs to be solved. In this regard, the present invention proposes a matrix n-gram extraction data processing method to achieve full extraction of information from different segmentation methods. The overall data processing steps are as follows:

[0047] Step 1: For the industrial production environment to be applied, collect the industrial control protocol message data generated in the environment, and group the known industrial control protocol messages according to their categories. For known categories of protocol messages, it is generally believed that there are standard parsing methods for the corresponding categories.

[0048] Step 2: Since the message information is expressed in hexadecimal, in order to avoid some message information being too long, half a byte is used as a length unit, and the maximum message length is set to L. When the message length exceeds L, it is truncated, and only the part with a length of L is retained after truncation; the message information that is less than the length of L is padded with 0 (when applied, in order to parse the message more accurately, L can be selected as the maximum length of the message). Secondly, in order to facilitate the calculation of the OSRBLS method, the message is split into half a byte, and then each data is converted into a decimal number. Taking the message "000c00000005010402003cabd2" as an example, the following processing results can be obtained:

[0049]

[0050] Step 3: Consider the final result of Step 2 as a vector, and transform the message by taking n=1, 2, 3, 4, 5 with the help of n-gram idea, and then concatenate the n-gram results of each message into a matrix and fill it with 0. To show the processing process more intuitively, suppose that L=26 is selected in Step 2 of Step S1, then the processing result of Step 2 in Step S1 becomes: 1 1 1 13 1 1 1 1 1 1 1 6 1 2 1 5 1 5 1 1 4 13 11 12 14 3

[0052] Treat it as a vector:

[0053] (1111311111116121515114131112143) can further obtain the matrix n-gram extraction result:

[0054]

[0055] Finally, the matrix n-gram extraction results are merged into the following form:

[0056]

[0057] Step 4: Process the collected protocol message information according to the above Steps 1 to 3 to obtain matrixed message data, and then classify and label the collected industrial control message data according to the category, that is, obtain the corresponding training set. In the training set, each matrixed message data is regarded as a sample and the message category is labeled.

[0058] Step 5: Cluster the training set to obtain the feature center of each category.

[0059] S2, construct an open set incremental width learning method that can be used for unknown industrial control protocol identification. The width learning method is as follows Figure 1 As shown, the characteristic nodes, enhancement nodes, and incremental enhancement nodes corresponding to the protocol message are calculated, and then these nodes are mapped to obtain embedded features. Width learning can reduce computing and training costs. At the same time, in order to avoid poor computing results due to model setting problems, this embodiment adopts an incremental width learning method. In order to adapt to unknown protocols, the incremental width learning method is combined with the open set learning idea, and the classification category output is changed to the embedded features of the industrial control protocol message. By comparing the embedded features with the feature centers of different categories, the category is determined. The specific process is as follows:

[0060] Step 1: Map the matrixed industrial control protocol message data after n-gram transformation through a two-dimensional convolutional network to obtain a corresponding number of feature nodes, where the number of feature nodes is a preset value; initialize the number of enhanced nodes and the number of embedded features, where the number of enhanced nodes is a preset value, and the number of embedded features is set according to the collected protocol category.

[0061] Step 2: After determining the target category in Step 1 in step S2, use the training set to train the open set incremental width learning model, update the weight parameters from feature nodes to enhanced nodes and the number of enhanced nodes. The specific training and application process will be introduced in step S3.

[0062] Step 3: Since the idea of ​​open set learning is introduced into width learning, it is necessary to replace the loss function in the original width learning from the form of mean square error and L1 regularization penalty term to the following form:

[0063]

[0064] Among them, K represents the number of current protocol message categories, E a represents the embedded features calculated from the a-th protocol message data, C a Denotes the characteristic center of the a-type protocol message data, D p (E a ,C b )=||E a -C b || p represents the p-norm.

[0065] S3, using the training set obtained in step S1 to train the open set incremental width learning model. When no unknown protocol appears, the training of the model mainly focuses on whether to increase the number of enhanced nodes and the update of weight parameters after changing the number of enhanced nodes. The main process is as follows Figure 2 As shown, with X=[X1,X2,…,X N ] represents training data, Z=[Z1,Z2,…,Z J ] represents the feature node set, HM=[H1,H2,…,H M ] represents the current enhanced node set, Hp=[H1,H2,…,H M ,H M+1 ,…,H M+p ] represents the enhanced node set after adding p nodes, E=[E1,E2,…,E K ] represents the embedded features of the output, and the training process of the model is as follows:

[0066] Step 1: For X = [X1, X2, …, X N ] Each X in iExecution: Randomly generate weights W for the 2D convolution E,j , bias β E,j , calculate the characteristic node Z j =Φ(X i W E,j +β E,j ), where Φ(.) represents the activation function; obtain X i The characteristic node set Z=[Z1,Z2,…,Z J ].

[0067] Step 2: Preset the number of enhanced nodes M, and execute when m=1,2,…,M: Randomly generate the corresponding weight W H,m , bias β H,m , compute enhancement nodes in, Represents the activation function; after traversing m=1,2,…,M, the current enhanced node set HM=[H1,H2,…,H M ].

[0068] Step 3: According to the feature node set and the current enhanced node set, calculate the normal equation for parameter solution and obtain the set A of feature nodes and enhanced nodes when the enhanced node is M. M , and A M The optimal solution of the normal equation (A M ) + , define the following operations:

[0069] A M =[X|HM]

[0070] =[Z1,Z2,…,Z J ,H1,H2,…,H M ]

[0071] Further calculation can be made:

[0072]

[0073] Among them, λ represents the penalty parameter and I represents the identity matrix.

[0074] The above calculation process is used to obtain the corresponding parameters after the number of enhanced nodes is initialized. When a new enhanced node is added, Step 4.2 in Step S2 is used to update the parameters.

[0075] Step 4: Use the training set obtained in step S1 to train the open set incremental width learning model. During the training process, minimize the loss function shown in Step 3 in step S2 to obtain the weight of the enhanced node under the minimized loss function. In addition, the minimum loss function and the loss threshold T are determined lossWhen the loss function is less than T loss Before, repeat the following steps Step4.1-Step4.3 until the loss function meets the requirements:

[0076] Step 4.1: Add a new enhancement node (hereinafter referred to as incremental enhancement node) and randomly generate weight W H,M+1 , bias β H,M+1 , calculate the incremental enhancement node Further, we can get the set A of feature nodes and enhanced nodes (the above-mentioned incremental enhanced nodes also belong to enhanced nodes) when the enhanced node is M+1: M+1 =[A M |H M+1 ]=[Z1,Z2,…,Z J ,H1,H2,…,H M ,H M+1 ].

[0077] Step 4.2: Through the following calculation, according to renew

[0078] L=(A M ) + H M+1

[0079] C=H m+1 -A M L

[0080]

[0081]

[0082]

[0083] Among them, L, C, and B represent iterative update parameters, the superscript T represents transposition, and (C) + represents the optimal solution of the normal equation of C, and E represents the embedded feature set.

[0084] Step 4.3: M = M + 1.

[0085] Step 5: Based on the trained open set incremental width learning model, the number of incremental enhancement nodes added and the update of weight parameters are completed, as well as the mapping of feature nodes and enhancement node sets to embedded features is completed.

[0086] S4, after completing the above step S3, the open set incremental width learning model has the ability to classify and identify known protocols. In order to better apply it to situations where unknown protocols may appear in actual production environments, the main identification steps are as follows:

[0087] Step 1: Collect the message information of the industrial control protocol actually produced, and process it according to Step 2 and Step 3 in step S1 to obtain the input data of the model.

[0088] Step 2: Input the data of Step 1 in Step S4 into the model to obtain the embedded features of its output, and calculate the similarity between the embedded features and the feature centers under the existing categories obtained in Step 5 in Step S1.

[0089] Step 3: Set a similarity threshold, and compare the similarity calculated in Step 2 in Step S4 with the similarity of each type of feature center: if the similarity is greater than the threshold, the category to which the protocol belongs is determined based on the maximum similarity; if the similarity with each type of center is lower than the threshold, it is determined to be a new category of unknown protocol, and the adaptive learning of the open set incremental width learning model and the protocol parsing in step S5 are performed simultaneously. The adaptive learning of the open set incremental width learning model includes: taking the mean of the most similar first T existing feature centers as the feature center of the new category, updating the existing feature centers, adding the corresponding matrixed message data of the new category of unknown protocol to the original training set, returning to step S3, and completing the adaptation to the newly added category.

[0090] S5, after completing the identification task, the message parsing work can be further performed. Figure 3 As shown, for the result obtained in step S4, if the message is identified as a known protocol category, it can be parsed according to the known protocol standard specification. If it is identified as a new category of unknown protocol, the field annotation is identified through the field parsing model, and the parsing is completed and the standard format of this type of protocol is recorded and added to the known protocol standard specification.

[0091] In a specific implementation of the present invention, in order to better parse unknown messages, the present invention refers to the part-of-speech tagging idea to build a field parsing model for unknown messages. The main steps are as follows:

[0092] Step 1: Select common industrial control protocol fields as labels for annotation. Common industrial control protocol fields include: transaction unit identifier, protocol identifier, data information length, data length, sequence number, cyclic redundancy check code, function code, structure code, identifier, and data bit. The protocol parsing part is mainly used to identify identification fields other than data bits.

[0093] Step 2: Label the function fields of known message data. Take "000c00000005010402003cabd2" in step S1 as an example. This message actually comes from the MBAP message of the ModbusTCP protocol. According to its standard format, the above message should be decomposed as follows:

[0094]

[0095] The above segmentation can be represented as the following parts (underlined) in the result obtained in Step 3 of Step S1:

[0096]

[0097] Using 1 to 9 to identify the transaction unit identifier, protocol identifier, data information length, protocol length, sequence number, cyclic redundancy check code, function code, structure code, and identifier, the following annotation results can be obtained:

[0098]

[0099] This completes the data preparation.

[0100] Step 3: When it is determined to be an unknown protocol, extract the similarity results obtained in step S5, select the T feature centers with the highest similarity, and splice them into an embedding matrix by increasing the number of channels.

[0101] Step 4: Build a field parsing model. This model mainly uses two-dimensional convolution to obtain more message segmentation and combination information. The field parsing model structure is as follows: Figure 4 As shown, the structure includes a feature extraction module consisting of three network blocks and an output layer, wherein the structure of each network block in the feature extraction module is the same, consisting of a two-dimensional convolutional layer, a Relu function, and a MaxPooling layer. It should be noted that the structure of the feature extraction module is not limited to the structure of the present invention, and can be adjusted according to the characteristics of the data and the actual situation.

[0102] Step 5: Concatenate the matrixed message data with the embedded matrix, use the field parsing model to extract the features of the concatenated results and generate matrixed field parsing results, calculate the loss based on the matrixed field annotation results, and update the field parsing model.

[0103] In this embodiment, an unknown protocol parsing system based on OSRBLS and embedded annotations is also provided, which is used to implement the above embodiment. The terms "module", "unit", etc. used below can implement a combination of software and / or hardware for predetermined functions. Although the system described in the following embodiments is preferably implemented in software, it is also possible to implement hardware, or a combination of software and hardware.

[0104] This embodiment provides an unknown protocol parsing system based on OSRBLS and embedded annotations, including:

[0105] A protocol message data preprocessing module, which is used to obtain target protocol message information and process it into matrix message data;

[0106] An OSRBLS protocol identification module, which is used to obtain embedded features of matrixed message data using an OSRBLS protocol identification model, and identify the protocol category to which the matrixed message data belongs based on the similarity between the embedded features and the feature centers of known category protocol messages;

[0107] A protocol parsing module is used to generate protocol parsing results. When a known category protocol is identified, the parsing results are generated in accordance with the corresponding category protocol specification format; when an unknown protocol category is identified, the new category unknown protocol is updated to the OSRBLS protocol identification model, and the field parsing model is used to generate the field parsing results of the new category unknown protocol, and the new category unknown protocol specification format is recorded; the field parsing model takes matrixed message data and a similarity embedding matrix as input, and takes matrixed field parsing results as output, and the similarity embedding matrix is ​​obtained by splicing the feature centers of several known category protocol messages with the highest similarity to the matrixed message data.

[0108] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment, and the implementation methods of the remaining modules will not be repeated here. The system embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.

[0109] The embodiments of the system of the present invention can be applied to any device with data processing capabilities, and the device with data processing capabilities can be a device or apparatus such as a computer. The system embodiments can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, the corresponding computer program instructions in the non-volatile memory are read into the memory by the processor of any device with data processing capabilities and run.

[0110] An embodiment of the present invention further provides an electronic device, including a memory and a processor;

[0111] The memory is used to store computer programs;

[0112] The processor is used to implement the above-mentioned unknown protocol parsing method based on OSRBLS and embedded annotations when executing the computer program.

[0113] An embodiment of the present invention further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned unknown protocol parsing method based on OSRBLS and embedded annotations is implemented.

[0114] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capability. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.

[0115] Obviously, the above-described embodiments and drawings are only some examples of the present application. For those of ordinary skill in the art, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that, although the work done in this development process may be complicated and lengthy, for those of ordinary skill in the art, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application. Without departing from the concept of the present application, several variations and improvements can also be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. An unknown protocol parsing method based on OSRBLS and embedded annotations, characterized in that: include: Obtain target protocol message information and process it into matrix message data; The OSRBLS protocol recognition model is used to obtain the embedded features of the matrix message data, and the protocol category to which the matrix message data belongs is identified according to the similarity between the embedded features and the feature centers of the known category protocol messages; When a known category protocol is identified, a parsing result is generated according to the corresponding category protocol specification format; When an unknown protocol category is identified, the new category of unknown protocol is updated to the OSRBLS protocol identification model, and the field parsing model is used to generate the field parsing result of the new category of unknown protocol, and the specification format of the new category of unknown protocol is recorded; The field parsing model takes matrixed message data and a similarity embedding matrix as input and takes a matrixed field parsing result as output, wherein the similarity embedding matrix is ​​obtained by concatenating the feature centers of several known class protocol messages with the highest similarity to the matrixed message data; The OSRBLS protocol recognition model is pre-trained based on known category protocol message data, and the pre-training process includes: Obtain known category protocol message information and process it into matrix message data as a protocol identification training set, group them according to protocol category, and obtain the feature center of each group of protocols; According to the protocol categories in the protocol recognition training set, the number of embedded features, the number of initialized feature nodes and the number of enhanced nodes are set; Each message data in the protocol recognition training set is mapped through a two-dimensional convolutional network to obtain a preset number of feature nodes and enhanced nodes, and then the set of feature nodes and enhanced nodes corresponding to the message data are mapped to obtain the embedded features of the message data. The loss is calculated based on the embedded features and the feature center of the known category protocol message, and the current enhanced node weight parameters are updated with the goal of minimizing the training loss; If the minimized training loss is greater than the threshold, the number of enhanced nodes is increased by one, and the enhanced node weight parameters after increasing the number of enhanced nodes are updated according to the current enhanced node weight parameters, and the minimized training loss is recalculated until the minimized training loss is less than or equal to the threshold, and the pre-trained OSRBLS protocol recognition model is obtained.

2. The unknown protocol parsing method based on OSRBLS and embedded annotation according to claim 1 is characterized in that: The step of obtaining target protocol message information and processing it into matrix message data includes: Set a message length threshold, truncate the message data that exceeds the message length threshold and use the first piece of data, and fill in the message data that is less than the message length threshold; Split the truncated or padded message data into bytes and convert them into decimal numbers; The decimal message data is regarded as a vector and transformed using the n-gram method. The n-gram results of each message are then concatenated into a matrix and padded with 0 to obtain the matrixed message data.

3. The unknown protocol parsing method based on OSRBLS and embedded annotation according to claim 1 is characterized in that: The enhanced nodes are obtained by mapping the feature nodes according to the enhanced node weight parameters and random bias.

4. The unknown protocol parsing method based on OSRBLS and embedded annotation according to claim 1 is characterized in that: The method of identifying the protocol category to which the matrixed message data belongs based on the similarity between the embedded features and the feature centers of the known category protocol messages includes: The OSRBLS protocol recognition model is used to obtain the embedded features of the target protocol, and the similarity between the embedded features and the feature centers of the recorded protocols of each category is calculated; the feature center refers to the cluster center of the matrixed message data under the same category; If the similarity is greater than the threshold, the protocol category is determined based on the maximum similarity; If the similarity is less than or equal to the threshold, it is determined as an unknown protocol category.

5. The unknown protocol parsing method based on OSRBLS and embedded annotation according to claim 1 is characterized in that: When an unknown protocol category is identified, updating the new category unknown protocol to the OSRBLS protocol identification model includes: Obtain the similarity between the embedded features of the matrixed message data identified as an unknown protocol category and the feature centers of each category of protocols that have been recorded, and take the average of several feature centers with the highest similarity as the feature center of the new category of unknown protocol; The number of embedded features of the current OSRBLS protocol recognition model is increased by one, the matrixed message data of the new category of unknown protocol is added to the protocol recognition training set, and the current OSRBLS protocol recognition model is retrained using the updated protocol recognition training set to complete the adaptive update of the OSRBLS protocol recognition model.

6. The unknown protocol parsing method based on OSRBLS and embedded annotation according to claim 1 is characterized in that: The field parsing model is trained based on the matrixed message data and its matrixed field annotation results. The training process includes: Acquire protocol message information and process it into matrix message data as a field parsing training set, annotate the matrix message data with functional fields, and generate matrix field annotation results; The OSRBLS protocol recognition model is used to generate the embedded features of each message data in the field parsing training set, and several feature centers with the highest similarity to the embedded features are selected to obtain the embedding matrix; The matrixed message data is concatenated with the embedded matrix, and the field parsing model is used to extract the features of the concatenated results and generate matrixed field parsing results. The loss is calculated based on the matrixed field labeling results, and the field parsing model is updated.

7. An unknown protocol parsing system based on OSRBLS and embedded annotations, characterized in that: include: A protocol message data preprocessing module, which is used to obtain target protocol message information and process it into matrix message data; An OSRBLS protocol identification module, which is used to obtain embedded features of matrixed message data using an OSRBLS protocol identification model, and identify the protocol category to which the matrixed message data belongs based on the similarity between the embedded features and the feature centers of known category protocol messages; The OSRBLS protocol recognition model is pre-trained based on known category protocol message data, and the pre-training process includes: Obtain known category protocol message information and process it into matrix message data as a protocol identification training set, group them according to protocol category, and obtain the feature center of each group of protocols; According to the protocol categories in the protocol recognition training set, the number of embedded features, the number of initialized feature nodes and the number of enhanced nodes are set; Each message data in the protocol recognition training set is mapped through a two-dimensional convolutional network to obtain a preset number of feature nodes and enhanced nodes, and then the set of feature nodes and enhanced nodes corresponding to the message data are mapped to obtain the embedded features of the message data. The loss is calculated based on the embedded features and the feature center of the known category protocol message, and the current enhanced node weight parameters are updated with the goal of minimizing the training loss; If the minimized training loss is greater than the threshold, the number of enhanced nodes is increased by one, and the enhanced node weight parameters after the number of enhanced nodes is increased are updated according to the current enhanced node weight parameters, and the minimized training loss is recalculated until the minimized training loss is less than or equal to the threshold, and the pre-trained OSRBLS protocol recognition model is obtained; A protocol parsing module is used to generate protocol parsing results. When a known category protocol is identified, the parsing results are generated in accordance with the corresponding category protocol specification format; when an unknown protocol category is identified, the new category unknown protocol is updated to the OSRBLS protocol identification model, and the field parsing model is used to generate the field parsing results of the new category unknown protocol, and the new category unknown protocol specification format is recorded; the field parsing model takes matrixed message data and a similarity embedding matrix as input, and takes matrixed field parsing results as output, and the similarity embedding matrix is ​​obtained by splicing the feature centers of several known category protocol messages with the highest similarity to the matrixed message data.

8. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the unknown protocol parsing method based on OSRBLS and embedded annotations as described in any one of claims 1 to 6.

9. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions, which, when called and executed by a processor, are used to implement the unknown protocol parsing method based on OSRBLS and embedded annotations as described in any one of claims 1 to 6.