A method for identifying optical module communication protocol based on communication protocol conversion
Through the extraction algorithm and improved recognition algorithm model, the communication protocol is identified and converted, and the problems of slow identification speed and lack of unified standards in the prior art are solved, and efficient and secure communication protocol identification and conversion are achieved.
Patent Information
- Application Number
- CN202411047348.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The prior art has problems in the identification of communication protocols, the identification speed is too slow, and the lack of unified standards after identification, resulting in incomplete communication between devices.
The data features are extracted and a protocol recognition model is constructed through the extraction algorithm, and the feature values are identified and compared with the improved recognition algorithm model, the communication protocol standards are redefined, and the encryption algorithm is added to ensure the security of information transmission.
It improves the accuracy and speed of communication protocol identification, realizes unified communication standards between devices, and enhances the security of information transmission.
Smart Images

Figure CN118921413B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical module communication system communication protocol identification, and more specifically to a communication protocol identification method for an industrial production optical module communication system based on communication protocol conversion. Background Art
[0002] For network security devices, in order to protect and monitor these devices, identifying the industrial communication protocols used between them has become a top priority for control and protection measures. Nowadays, there are more and more problems in communication protocol identification, such as incomplete data processing due to too many communication devices, inability to identify the communication protocol of the optical module communication system, and incomplete communication between devices due to the lack of unified standards after identification.
[0003] In the existing recognition technology, the problem of too many communication devices being unable to process data has been well solved, and the capacity and speed of data processing have been improved; to a certain extent, the problem of communication protocols being unable to be recognized has been improved, but the recognition speed is too slow, and after recognition, it is not converted into a unified standard, which increases the difficulty of communication.
[0004] To solve the above problems, a protocol identification model is constructed. The characteristic values are identified and compared to confirm the protocol type through an improved identification algorithm model. The communication protocol standard is redefined after protocol conversion, and an encryption algorithm is added to provide security for information transmission between devices. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention discloses a method for identifying the communication protocol of an optical module based on communication protocol conversion. The method extracts data features through an extraction algorithm and constructs a protocol identification model. The improved identification algorithm model is used to identify the characteristic values and compare and confirm the type of protocol to which they belong. The communication protocol standard is redefined after protocol conversion, and an encryption algorithm is added to provide a workflow with security protection for information transmission between devices.
[0006] In order to achieve the above technical effects, the present invention adopts the following technical solutions:
[0007] A method for identifying an optical module communication protocol based on communication protocol conversion comprises the following steps:
[0008] Step 1: Collect data of communication equipment in industrial production through network packet capture methods and equipment documents;
[0009] Step 2: Preprocess the collected data through screening and filling methods;
[0010] Step 3: extract the data features of communication protocol type, data transmission rate, data length and check code through extraction algorithm;
[0011] Step 4: construct a protocol recognition model based on the communication protocol of the optical module communication system, wherein the protocol recognition model includes an information classification module, an instruction recognition module, a protocol conversion module, and a communication standard unification module; the instruction recognition module performs dimensionality reduction classification and recognition on the feature value based on the improved recognition algorithm model; the communication standard unification module redefines the communication protocol based on the standard communication protocol and data format of Modbus, and encrypts the transmission signal during the communication process through an encryption algorithm to ensure the security of device transmission; wherein the improved recognition algorithm model includes a data fusion module, a classification attribute setting module, an encoding module, a feature value mapping module, a weight setting module, a feature search module, and a data feature display module;
[0012] The output end of the information classification module is connected to the input end of the instruction recognition module; the output end of the instruction recognition module is connected to the input end of the protocol conversion module; the output end of the protocol conversion module is connected to the input end of the communication standard unification module;
[0013] Step 5: Train the protocol recognition model based on the known communication protocol to improve the recognition accuracy and recall rate;
[0014] Step 6: Integrate the monitoring system into the protocol recognition model to facilitate remote operation and management.
[0015] As a further technical solution of the present invention, the network packet capture method captures and records the data packets on the network through data acquisition and analysis of tcpdump packet capture, and allows the user to view the data information including source and destination addresses, protocol type and version, data packet structure, command and response format through a protocol analyzer; the device document collects data by viewing the communication interface, protocol list, data format and communication settings supported by the device in the document to collect information, and stores the information in a protocol database. The protocol analyzer includes an analysis control module and a network layer protocol diagnosis module, an application layer protocol diagnosis module, a network data packet search module, a data parsing module and a network data adjustment module connected to the analysis control module.
[0016] As a further technical solution of the present invention, the screening and filling method is implemented by removing duplicate data and filling missing values; the removal of duplicate values extracts non-duplicate data from the data source and saves it by finding an independent value unique method, and deletes the unextracted data; the filling of missing values is achieved by arranging the data group according to the format type and structure type, finding the location and data type of the missing values, and using the attribute mean of all data as the missing value to be filled according to the attributes of the given data group.
[0017] As a further technical solution of the present invention, the implementation steps of the extraction algorithm are:
[0018] 1) Data classification;
[0019] The data after screening and filling are grouped according to the data transmission destination address and the transmission response format to extract different data features;
[0020] 2) Extracting eigenvalues within the group;
[0021] Based on the extraction algorithm, the characteristic values contained in the data are selected and recorded. The expression for extracting the characteristic value of the data length is:
[0022]
[0023] In formula (1), M represents the extracted data length feature value, m represents the number of data, θ represents the algorithm parameter, i represents the operation order, and x represents the length of the extracted data. i Indicates the operation data. represents the average value of the data, represents the data normalization value, α represents the learning rate, λ represents the regularization parameter, and J represents the sampling frequency. Indicates partial derivative parameters;
[0024] The characteristic value expression for extracting the data transmission rate is:
[0025]
[0026] In formula (2), G represents the extracted data transmission rate characteristic value, m represents the number of data, θ represents the algorithm parameter, i represents the operation order, and v i Indicates the calculated value of the transmission rate. Indicates the normalized value of the transmission rate. represents the average transmission rate, α represents the learning rate, λ represents the regularization parameter, J represents the sampling frequency, Indicates partial derivative parameters;
[0027] 3) Characteristic value screening;
[0028] The extracted eigenvalues are arranged, and the eigenvalues with unclear and repeated feature data are removed by comparison and optimization. The comparison and optimization expression is:
[0029]
[0030] In formula (3), P represents the optimized eigenvalue, n represents the number of eigenvalues, i represents the operation order, and X i Indicates the data length characteristic value, Y i Indicates the characteristic value of the transmission rate, represents the average value of the data length characteristic value, Indicates the average value of the transmission rate characteristic value;
[0031] 4) eigenvalue set;
[0032] Based on the processed eigenvalues, the eigenvalues are arranged and combined in a matrix and stored in a database as a theoretical basis for building a protocol recognition model.
[0033] As a further technical solution of the present invention, the implementation method of the improved recognition algorithm model is:
[0034] 1) Eigenvalue mapping;
[0035] Map high-dimensional eigenvalues to low-dimensional ones to form a new feature matrix;
[0036] 2) Update weights;
[0037] The expression for calculating the weight value is:
[0038]
[0039] In formula (4), Q represents the weight value, n represents the number of eigenvalues, i represents the operation order, and X i Indicates the data length characteristic value, Y i Indicates the characteristic value of transmission rate;
[0040] The expression for weight value reorganization sorting is:
[0041]
[0042] In formula (5), Q X represents the weight of the data length feature value, Q represents the weight value, X mn The matrix value representing the data length eigenvalue, m, n represents the number of columns and rows of the matrix;
[0043]
[0044] In formula (6), Q Y represents the weight of the transmission rate characteristic value, Q represents the weight value, and Y mn The matrix value representing the transmission rate eigenvalue, m, n represents the number of columns and rows of the matrix;
[0045] 3) Feature fusion;
[0046] The feature values are fused into multi-modal features based on different weights, and then recognized by the recognition algorithm;
[0047] 4) Feature recognition;
[0048] The type of communication protocol is identified by comparing and matching the updated weight value and fusion feature value with the standard feature value; the identification algorithm expression is:
[0049]
[0050] In formula (7), T represents the output value of the recognition result, T X Indicates the data length recognition result, X max Indicates the maximum value of the data length characteristic value, X min Indicates the minimum value of the data length characteristic value, X i represents the characteristic value of data length, X′ represents the standard characteristic value of data length, Represents the normalized value of the data length characteristic value, T Y Indicates the transmission rate identification result, Y max Indicates the maximum value of the transmission rate characteristic value, Y min Indicates the minimum value of the transmission rate characteristic value, Y i represents the transmission rate characteristic value, Y′ represents the transmission rate standard characteristic value, represents the normalized value of the transmission rate characteristic value, and β represents the identification factor.
[0051] As a further technical solution of the present invention, the protocol conversion module converts different communication protocols in two ways; the two conversion methods are respectively for wired communication and wireless communication; the conversion method for wired communication is: parsing the data information of the communication protocol through a protocol converter and a gateway, and converting it into new communication protocol data by changing the encoding method and information form of the data information; the conversion method for wireless communication is: mapping data between different protocols through the communication protocol stack of the application programming interface API and the software development kit SDK to ensure that the semantics and structure of the data remain consistent during the conversion process, and allowing the definition of new extended functions to adapt to specific communication protocol conversion requirements.
[0052] As a further technical solution of the present invention, the implementation method of the encryption algorithm is:
[0053] 1) Arrange in random order;
[0054] Randomly scramble the transmitted data and generate an initialization vector for the encryption process to enhance the randomness and security of encryption;
[0055] 2) Generate a seed key;
[0056] Divide the transmitted data into small blocks and use the hash value to XOR with the data key to obtain the seed key;
[0057] 3) Encryption process;
[0058] The data is encrypted based on an encryption algorithm, the expression of the encryption algorithm is:
[0059]
[0060] In formula (8), J represents the encrypted output value, ε represents the entropy density, and z i Represents encrypted data, bin2dec represents data converted to binary, C represents the encryption operator, m represents the number of operations, and i represents the order of operations.
[0061] The beneficial positive effects of the present invention are:
[0062] Different from conventional technologies, the present invention discloses a method for identifying the communication protocol of an optical module based on communication protocol conversion. The method extracts data features through an extraction algorithm and constructs a protocol identification model. The method identifies feature values through an improved identification algorithm model and compares and confirms the type of protocol to which they belong. The method redefines the communication protocol standard after protocol conversion, and adds an encryption algorithm to provide a secure workflow for information transmission between devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0064] Figure 1 A flowchart of a method for identifying an optical module communication protocol based on communication protocol conversion;
[0065] Figure 2 A protocol identification model architecture diagram of an optical module communication protocol identification method based on communication protocol conversion;
[0066] Figure 3 A schematic diagram of feature fusion in a recognition algorithm of an optical module communication protocol recognition method based on communication protocol conversion;
[0067] Figure 4 A schematic diagram of a protocol conversion method for an optical module communication protocol identification method based on communication protocol conversion;
[0068] Figure 5 It is a flow chart of encryption algorithm of a method for identifying optical module communication protocol based on communication protocol conversion;
[0069] Figure 6 The present invention is a schematic diagram of the principle architecture of a protocol analyzer for an optical module communication protocol identification method based on communication protocol conversion. DETAILED DESCRIPTION
[0070] The following will be combined with the drawings in the embodiments of this article to clearly and completely describe the technical solutions in the embodiments of this article. Obviously, the described embodiments are only part of the embodiments of this article, not all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0071] like Figure 1 As shown, a method for identifying an optical module communication protocol based on communication protocol conversion comprises the following steps:
[0072] Step 1: Collect data of communication equipment in industrial production through network packet capture methods and equipment documents;
[0073] Step 2: Preprocess the collected data through screening and filling methods;
[0074] Step 3: extract the data features of communication protocol type, data transmission rate, data length and check code through extraction algorithm;
[0075] Step 4: construct a protocol recognition model based on the communication protocol of the optical module communication system, wherein the protocol recognition model includes an information classification module, an instruction recognition module, a protocol conversion module, and a communication standard unification module; the instruction recognition module performs dimensionality reduction classification and recognition on the feature value based on the improved recognition algorithm model; the communication standard unification module redefines the communication protocol based on the standard communication protocol and data format of Modbus, and encrypts the transmission signal during the communication process through an encryption algorithm to ensure the security of device transmission; wherein the improved recognition algorithm model includes a data fusion module, a classification attribute setting module, an encoding module, a feature value mapping module, a weight setting module, a feature search module, and a data feature display module;
[0076] The output end of the information classification module is connected to the input end of the instruction recognition module; the output end of the instruction recognition module is connected to the input end of the protocol conversion module; the output end of the protocol conversion module is connected to the input end of the communication standard unification module;
[0077] Step 5: Train the protocol recognition model based on the known communication protocol to improve the recognition accuracy and recall rate;
[0078] Step 6: Integrate the monitoring system into the protocol recognition model to facilitate remote operation and management.
[0079] In the above example:
[0080] Data Fusion Module The data fusion module is responsible for integrating data from different sources. This may include multiple data types, such as text, images, sounds, etc. Principle: Use a predetermined fusion strategy, such as feature-level fusion, decision-level fusion, or intermediate representation fusion, to merge information from different data sources.
[0081] Classification attribute setting module The classification attribute setting module determines the attributes or features for data classification. According to the task requirements, the most appropriate features are selected as the basis for classification. This may involve feature selection techniques such as statistical-based methods or model-based methods.
[0082] The encoding module is responsible for converting the data into a format suitable for subsequent processing. Using encoding techniques such as One-Hot Encoding, Label Encoding, or embedding techniques in deep learning, non-numerical data is converted into a numerical form that can be processed by machine learning algorithms.
[0083] The feature value mapping module maps data features to a new space or format. The principle is to apply mapping functions, such as hash functions, polynomial functions, etc., to change the distribution or format of features, which helps improve the performance of the model.
[0084] The weight setting module assigns different weights to different features using various methods such as model-based weight initialization, experience-based weight adjustment, or automatic learning of weights through optimization algorithms.
[0085] The feature search module is responsible for searching for the optimal feature combination. The principle is to use feature selection algorithms, such as recursive feature elimination (RFE) and model-based feature selection, to identify the features that contribute most to classification.
[0086] The data feature display module is responsible for visualizing the feature information. The principle is to use visualization techniques, such as feature importance graphs, scatter plots, 3D graphs, etc., to help users understand data features and model decisions. The working process of the entire improved recognition algorithm model is usually iterative and interactive, and multiple iterations may be required between modules to achieve the best model performance. This model is usually applied to complex classification tasks. In this invention, different types of data information are combined into a single
[0087] Furthermore, the network packet capture method captures and records the data packets on the network through data acquisition and analysis of tcpdump packet capture, and allows the user to view data information including source and destination addresses, protocol type and version, data packet structure, command and response format through a protocol analyzer; the device document collects data by viewing the communication interface, protocol list, data format and communication settings supported by the device in the document to collect information, and stores the information in a protocol database. The protocol analyzer includes an analysis control module and a network layer protocol diagnosis module, an application layer protocol diagnosis module, a network data packet search module, a data parsing module and a network data adjustment module connected to the analysis control module.
[0088] In a specific embodiment, the packet capture is performed by setting the network card of the communication device to promiscuous mode and using the network stack to capture the data packets flowing through the specified interface, extracting the header information of the captured data packets, and focusing on the specific communication flow according to specific conditions to facilitate filtering of data packets. The device document collection organizes the extracted information into a structured form and stores it in the protocol database for easy retrieval and use.
[0089] Furthermore, the screening and filling method is implemented by removing duplicate data and filling missing values; the removal of duplicate values extracts non-duplicate data from the data source and saves it by searching for independent values using a unique method, and deletes the unextracted data; the filling of missing values arranges the data group according to the format type and structure type, searches for the location and data type of the missing values, and uses the attribute mean of all the data as the missing value to be filled according to the attributes of the given data group.
[0090] In a specific embodiment, the implementation steps of the method for finding the unique value are:
[0091] 1) Compare each row or each data item in the data set to determine whether there are identical copies; in this step, finding independent values or deduplication is a common operation in data processing, aiming to ensure that each row or each data item in the data set is unique. In different application scenarios and data storage systems, the steps to achieve this goal may vary, but the following is a general implementation step:
[0092] 1. Determine the data set:
[0093] First determine the data set you want to process. This can be an Excel spreadsheet, a database table, a CSV file, or any other form of data.
[0094] 2. Select the deduplication method:
[0095] Choose the appropriate deduplication method based on the characteristics and requirements of the data set. In Excel, you can use the UNIQUE function; in a database, you can use the UNIQUE constraint or index; in a programming language, you can use data structures such as sets or dictionaries.
[0096] 3. Apply deduplication logic:
[0097] Perform a de-duplication operation. In Excel, this may involve using a function such as UNIQUE, in a database, this may involve executing a query to remove duplicate rows, or in programming, using loops and conditionals to eliminate duplicates.
[0098] 4. Handling Duplicates:
[0099] Identify and handle duplicates. This may include removing duplicate rows, marking duplicates, or updating existing data to reflect unique values.
[0100] 5. Verify the results:
[0101] Check the deduplicated data set to ensure that each row or each data item is unique. This is usually done through queries or statistical operations to ensure the accuracy and consistency of the data set.
[0102] 6. Store or output results:
[0103] Store the deduplicated dataset in a new data storage unit, or output it to the required format or location.
[0104] Taking Excel as an example, the specific steps to use the `UNIQUE` function to remove duplicates may be as follows:
[0105] 1. Select a data range that contains duplicate data.
[0106] 2. Enter the formula `=UNIQUE(data range)` and press Enter.
[0107] 3. Drag the fill handle and drag the formula down or to the right to apply it to the entire data set.
[0108] 4. Check the results to make sure each row is unique.
[0109] In a database, the steps to achieve deduplication may include:
[0110] 1. Use the `SELECT DISTINCT` statement to query unique values.
[0111] 2. Use `CREATE UNIQUE INDEX` to create a unique index to enforce that newly inserted data must be unique.
[0112] 3. When inserting or updating data, check the `UNIQUE` constraint to ensure that duplicate values are not inserted.
[0113] In a programming language, such as Python, the steps for deduplication might be as follows:
[0114] 1. Load the dataset into a list or collection.
[0115] 2. Use a set (`set`) or dictionary (`dict`) data structure to remove duplicates.
[0116] 3. Output or return the deduplicated data set.
[0117] The above steps can be adjusted according to specific data processing tools and requirements.
[0118] 2) Traverse the entire data set to extract unique data rows or data items and save them;
[0119] 3) Delete the extracted data sets to avoid misleading results during analysis and transformation;
[0120] These steps can improve the quality and availability of data sets, reduce unnecessary computational steps during information processing, and improve computing time.
[0121] Furthermore, the implementation steps of the extraction algorithm are:
[0122] 1) Data classification;
[0123] The data after screening and filling are grouped according to the data transmission destination address and the transmission response format to extract different data features;
[0124] 2) Extracting eigenvalues within the group;
[0125] Based on the extraction algorithm, the characteristic values contained in the data are selected and recorded. The expression for extracting the characteristic value of the data length is:
[0126]
[0127] In formula (1), M represents the extracted data length feature value, m represents the number of data, θ represents the algorithm parameter, i represents the operation order, and x represents the length of the extracted data. i Indicates the operation data. represents the average value of the data, represents the data normalization value, α represents the learning rate, λ represents the regularization parameter, and J represents the sampling frequency. represents the partial derivative parameter; in a further embodiment,
[0128] The characteristic value expression for extracting the data transmission rate is:
[0129]
[0130] In formula (2), G represents the extracted data transmission rate characteristic value, m represents the number of data, θ represents the algorithm parameter, i represents the operation order, and v i Indicates the calculated value of the transmission rate. Indicates the normalized value of the transmission rate. represents the average transmission rate, α represents the learning rate, λ represents the regularization parameter, J represents the sampling frequency, Indicates partial derivative parameters;
[0131] 3) Characteristic value screening;
[0132] The extracted eigenvalues are arranged, and the eigenvalues with unclear and repeated feature data are removed by comparison and optimization. The comparison and optimization expression is:
[0133]
[0134] In formula (3), P represents the optimized eigenvalue, n represents the number of eigenvalues, i represents the operation order, and X i Indicates the data length characteristic value, Y i Indicates the characteristic value of the transmission rate, represents the average value of the data length characteristic value, Indicates the average value of the transmission rate characteristic value;
[0135] 4) eigenvalue set;
[0136] Based on the processed eigenvalues, the eigenvalues are arranged and combined in a matrix and stored in a database as a theoretical basis for building a protocol recognition model.
[0137] In a specific embodiment, the extraction algorithm classifies the data and then extracts two data feature values, data length and transmission rate. The extracted feature values are screened to prevent duplicate or unclear data from affecting the operation quality. The remaining high-quality feature values are collected to form a matrix for easy recognition model use. The data length feature value is calculated by calculating the algorithm parameter θ and the data average value. And operation data x i The logarithm of the ratio plus the data normalization value The sum of is the learning rate α, divided by 3 times the number of data m, plus the partial derivative of the algorithm parameter θ divided by the partial derivative of the sampling frequency J and then multiplied by the regularization parameter λ to get This formula represents the extraction of characteristic values for data length; the data transmission rate characteristic value is obtained by multiplying the ratio of the algorithm parameter θ to the number of data m by the normalized value of the transmission rate. With the transmission rate v i The square difference divided by the transmission rate v i The square of the transmission rate is the average value The sum of the squares of the learning rate α, plus the partial derivative of the algorithm parameter θ divided by the partial derivative of the sampling frequency J and multiplied by the regularization parameter λ to obtain This formula represents a formula for extracting the characteristic value of the data transmission rate; the characteristic value screening is performed by calculating the characteristic value of the data length X i and the transmission rate characteristic value Y i The sum of the eigenvalues multiplied by the number of eigenvalues n divided by the number of eigenvalues n multiplied by the length of the data eigenvalue X i Multiply by the average value of the data length characteristic value and data length characteristic value X i Take the square root of the square difference, add the number of eigenvalues n multiplied by the transmission rate eigenvalue Y i Multiply by the average value of the transmission rate characteristic value and the transmission rate characteristic value Y i Then take the square root of the square difference and get Add the data length characteristic value X i And the transmission rate characteristic value Y i The total value is divided by the number of eigenvalues n, minus the average value of the data length eigenvalue and the average value of the transmission rate characteristic value Right now get This formula represents the optimal screening of two characteristic values, extracting data with more obvious characteristic quantities to speed up the recognition of communication data. Table 1 is a comparison of the calculation speed and effect between using the extraction algorithm and not using the extraction algorithm.
[0138] Table 1 Comparison between using extraction algorithm and not using extraction algorithm
[0139]
[0140]
[0141] It can be seen from Table 1 that the use of the extraction algorithm speeds up the extraction of feature quantities, increases the learning rate, and also improves the speed of subsequent protocol recognition.
[0142] Furthermore, the improved recognition algorithm model is implemented as follows:
[0143] 1) Eigenvalue mapping;
[0144] Map high-dimensional eigenvalues to low-dimensional ones to form a new feature matrix;
[0145] 2) Update weights;
[0146] The expression for calculating the weight value is:
[0147]
[0148] In formula (4), Q represents the weight value, n represents the number of eigenvalues, i represents the operation order, and X i Indicates the data length characteristic value, Y i Indicates the characteristic value of transmission rate;
[0149] The expression for weight value reorganization sorting is:
[0150]
[0151] In formula (5), Q X represents the weight of the data length feature value, Q represents the weight value, X mn The matrix value representing the data length eigenvalue, m, n represents the number of columns and rows of the matrix;
[0152]
[0153] In formula (6), Q Y represents the weight of the transmission rate characteristic value, Q represents the weight value, and Y mn The matrix value representing the transmission rate eigenvalue, m, n represents the number of columns and rows of the matrix;
[0154] 3) Feature fusion;
[0155] The feature values are fused into multi-modal features based on different weights, and then recognized by the recognition algorithm;
[0156] 4) Feature recognition;
[0157] The type of communication protocol is identified by comparing and matching the updated weight value and fusion feature value with the standard feature value; the identification algorithm expression is:
[0158]
[0159] In formula (7), T represents the output value of the recognition result, T X Indicates the data length recognition result, X max Indicates the maximum value of the data length characteristic value, X min Indicates the minimum value of the data length characteristic value, X i represents the characteristic value of data length, X′ represents the standard characteristic value of data length, Represents the normalized value of the data length characteristic value, T Y Indicates the transmission rate identification result, Y max Indicates the maximum value of the transmission rate characteristic value, Y minIndicates the minimum value of the transmission rate characteristic value, Y i represents the transmission rate characteristic value, X′ represents the transmission rate standard characteristic value, represents the normalized value of the transmission rate characteristic value, and β represents the identification factor.
[0160] The implementation process of the improved recognition algorithm model involves the hardware structure, which usually includes the following key parts: 1. Central processing unit (CPU) or graphics processing unit (GPU):
[0161] The CPU is responsible for executing the core computing tasks of the algorithm, processing data and running program code. The GPU is particularly suitable for processing parallel computing tasks, such as the large number of matrix operations in deep learning algorithms, which can significantly improve the algorithm processing speed.
[0162] 2. Memory (RAM):
[0163] Memory is used to store running programs, process data, and temporarily store algorithm calculation results.
[0164] 3. Storage devices:
[0165] Hard disk drives (HDD) or solid-state drives (SSD) are used to store large datasets and algorithm models.
[0166] 4. Input / output interface:
[0167] These interfaces allow the algorithm model to exchange data with external devices (such as cameras, sensors, scanners, etc.).
[0168] 5. Network interface:
[0169] If the algorithm model needs to obtain data from a remote database or server, or needs to upload the results to the cloud, a network interface is essential.
[0170] 6. Application-Specific Integrated Circuit (ASIC) or Field-Programmable Gate Array (FPGA):
[0171] For some specific applications, specially designed hardware accelerators, such as ASICs or FPGAs, may be used to optimize the performance of the algorithm.
[0172] 7. Power management unit: ensures stable power supply to the system, which is especially important for some high-performance computing devices.
[0173] 8. Cooling system: Especially for high-performance computing units such as GPUs, an effective cooling system is the key to ensuring long-term stable operation of the equipment.
[0174] When building the hardware structure, it is necessary to select appropriate hardware components according to the specific needs of the algorithm. For example, if the algorithm needs to process a large amount of image data, a powerful GPU and a large enough memory may be required to process multiple images at the same time. If the algorithm needs to frequently exchange data with external devices, a high-speed input / output interface will be necessary. In addition, hardware design also needs to consider factors such as cost-effectiveness, scalability, and maintainability. In some application scenarios, it may also be necessary to consider the safety and reliability of the hardware to ensure that it works stably in specific environments (such as high temperature, high pressure, or vibration).
[0175] In a specific embodiment, the recognition algorithm maps high-dimensional eigenvalues to low-dimensional ones, updates the weights of the eigenvalues and reorders them, and recognizes them through the recognition algorithm after merging the eigenvalues to achieve the recognition process; the weight value is calculated by calculating the data length eigenvalue X i and the transmission rate characteristic value Y i The sum of divided by 2 times the number of eigenvalues n and then divided by the number of eigenvalues n is obtained The weight value reorganization and sorting is performed by respectively sorting the weights of the data length eigenvalue and the transmission rate eigenvalue; by sorting the weight value Q and the matrix value X of the data length eigenvalue mn The convolution values are sorted by rows and columns to get the matrix of weight values, namely This formula represents the weight matrix Q for the data length eigenvalue X ; Through the weight value Q and the matrix value convolution value Y of the transmission rate eigenvalue mn The matrix of weight values is obtained by sorting rows and columns. This formula represents the weight matrix Q of the transmission rate eigenvalue. Y ; By calculating the maximum value of the data length characteristic value X max With the minimum value X min The difference multiplied by the data length characteristic value X i The difference from the standard characteristic value X' of the data length divided by the normalized value of the data length The difference between the standard characteristic value X′ of the data length and the power of the identification factor β is obtained by taking the logarithm This formula represents the recognition result of the data length; by calculating the maximum value of the transmission rate X max With minimum value Y min The difference multiplied by the transmission rate characteristic value Y i The difference from the standard characteristic value Y′ of the transmission rate divided by the normalized value of the transmission rate The difference between the transmission rate standard characteristic value Y′ and the identification factor β is then raised to the square and the logarithm is obtained (Y max ―Y min ) This formula represents the recognition result of the transmission rate; the recognition speed and effect are accelerated by fusion of the feature quantities. Table 2 is a comparison between the recognition algorithm and the conventional algorithm.
[0176] Table 2 Comparison of recognition algorithm and conventional algorithm
[0177]
[0178] It can be seen from Table 2 that the recognition algorithm is more accurate than the conventional algorithm. The improvement of weight update rate and feature value fusion rate improves the recognition accuracy.
[0179] Furthermore, the protocol conversion module converts different communication protocols in two ways; the two conversion methods are respectively for wired communication and wireless communication; the conversion method for wired communication is: parsing the data information of the communication protocol through a protocol converter and a gateway, and converting it into new communication protocol data by changing the encoding method and information form of the data information; the conversion method for wireless communication is: mapping data between different protocols through the communication protocol stack of the application programming interface API and the software development kit SDK to ensure that the semantics and structure of the data remain consistent during the conversion process, and allowing the definition of new extended functions to adapt to specific communication protocol conversion requirements.
[0180] In a specific embodiment, the wired communication conversion parses the data packet and extracts the source address, destination address and data content, converts the encoding form and information form of the data according to the target protocol, converts binary into ASCII text, and changes the format of the data packet to comply with the new protocol standard; the wireless communication conversion realizes the protocol conversion by mapping the commands, status information and data types of the source protocol to the corresponding concepts of the target protocol, and can also define new extension functions to adapt to the conversion requirements of specific communication protocols, thereby achieving flexibility and scalability of the conversion.
[0181] Furthermore, the encryption algorithm is implemented as follows:
[0182] 1) Arrange in random order;
[0183] Randomly scramble the transmitted data and generate an initialization vector for the encryption process to enhance the randomness and security of encryption;
[0184] 2) Generate a seed key;
[0185] Divide the transmitted data into small blocks and use the hash value to XOR with the data key to obtain the seed key;
[0186] 3) Encryption process;
[0187] The data is encrypted based on an encryption algorithm, the expression of the encryption algorithm is:
[0188]
[0189] In formula (8), J represents the encrypted output value, ε represents the entropy density, and z i Represents encrypted data, bin2dec represents data converted to binary, C represents the encryption operator, m represents the number of operations, and i represents the order of operations.
[0190] In a specific embodiment, in order to make the transmission between communication devices more secure, an encryption algorithm is added to the protocol identification model to protect the privacy of industrial production data; the encryption algorithm implements the encryption process by arranging the data in random order and generating a seed key; by calculating the difference between 1 and the entropy density ε and multiplying the encrypted data z i , plus the encryption operator C multiplied by the encrypted data and 2 10 Convert the sum of the ratios to binary and divide by 2 32 get This formula represents the output value after the transmission data is encrypted. Table 3 is the comparison data of the encryption algorithm during transmission.
[0191] Table 3 Comparison between encryption algorithm and conventional algorithm
[0192]
[0193] From Table 3, we can see that the entropy density of the encryption algorithm is closer to the ideal value "1", which means that the fluctuation is smaller when attacked. Increasing the value of the encryption operator makes the encryption rate higher. The cracking rate of the encryption algorithm is lower than that of the conventional algorithm, making the communication between devices more secure.
[0194] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that these specific embodiments are only illustrative, and those skilled in the art may omit, replace, and change the details of the above methods and systems in various ways without departing from the principles and essence of the present invention. For example, merging the above method steps so as to perform substantially the same functions in substantially the same manner to achieve substantially the same results is within the scope of the present invention. Therefore, the scope of the present invention is limited only by the appended claims.
Claims
1. A method for identifying an optical module communication protocol based on communication protocol conversion, characterized in that: The following steps are involved: Step 1: Collect data of communication equipment in industrial production through network packet capture methods and equipment documents; Step 2: Preprocess the collected data through screening and filling methods; Step 3: extract the data features of communication protocol type, data transmission rate, data length and check code through extraction algorithm; Step 4: construct a protocol recognition model based on the communication protocol of the optical module communication system, wherein the protocol recognition model includes an information classification module, an instruction recognition module, a protocol conversion module, and a communication standard unification module; the instruction recognition module performs dimensionality reduction classification and recognition on the feature value based on the improved recognition algorithm model; the communication standard unification module redefines the communication protocol based on the standard communication protocol and data format of Modbus, and encrypts the transmission signal during the communication process through an encryption algorithm to ensure the security of device transmission; wherein the improved recognition algorithm model includes a data fusion module, a classification attribute setting module, an encoding module, a feature value mapping module, a weight setting module, a feature search module, and a data feature display module; The output end of the information classification module is connected to the input end of the instruction recognition module; the output end of the instruction recognition module is connected to the input end of the protocol conversion module; the output end of the protocol conversion module is connected to the input end of the communication standard unification module; Step 5: Train the protocol recognition model based on the known communication protocol to improve the recognition accuracy and recall rate; Step 6: Integrate the monitoring system into the protocol recognition model to facilitate remote operation and management; The implementation steps of the extraction algorithm are: 1) Data classification; The data after screening and filling are grouped according to the data transmission destination address and the transmission response format to extract different data features; 2) Extracting eigenvalues within the group; Based on the extraction algorithm, the characteristic value contained in the data is selected and recorded, and the expression of the extracted data length characteristic value is: (1) In formula (1), Indicates the extracted data length feature value, Indicates the number of data. represents the algorithm parameters, Indicates the order of operations, Indicates the operation data. represents the average value of the data, represents the data normalization value, represents the learning rate, represents the regularization parameter, represents the sampling frequency, Indicates partial derivative parameters; The characteristic value expression of the extracted data transmission rate is: (2) In formula (2), represents the extracted data transmission rate characteristic value, Indicates the number of data. represents the algorithm parameters, Indicates the order of operations, The calculated transmission rate is shown. Indicates the normalized value of the transmission rate. Indicates the average transmission rate. represents the learning rate, represents the regularization parameter, represents the sampling frequency, Indicates partial derivative parameters; 3) Characteristic value screening; The extracted eigenvalues are arranged, and the eigenvalues with unclear and repeated feature data are removed by comparison and optimization. The comparison and optimization expression is: (3) In formula (3), represents the optimized eigenvalue, represents the number of eigenvalues, Indicates the order of operations, Indicates the data length characteristic value, Indicates the characteristic value of the transmission rate, represents the average value of the data length characteristic value, Indicates the average value of the transmission rate characteristic value; 4) Eigenvalue set; Based on the processed eigenvalues, the eigenvalues are arranged and combined in a matrix and stored in a database as a theoretical basis for building a protocol recognition model; The implementation method of the improved recognition algorithm model is: 1) Eigenvalue mapping; Map high-dimensional eigenvalues to low-dimensional ones to form a new feature matrix; 2) Update weights; The expression for calculating the weight value is: (4) In formula (4), represents the weight value, represents the number of eigenvalues, Indicates the order of operations, Indicates the data length characteristic value, Indicates the characteristic value of transmission rate; The expression for weight value reorganization sorting is: (5) In formula (5), Represents the weight of the data length feature value, represents the weight value, The matrix value representing the eigenvalue of the data length, , Indicates the number of columns and rows of the matrix; (6) In formula (6), represents the weight of the transmission rate characteristic value, represents the weight value, The matrix value representing the eigenvalue of the transmission rate, , Indicates the number of columns and rows of the matrix; 3) Feature fusion; The feature values are fused into multi-modal features based on different weights, and then recognized by the recognition algorithm; 4) Feature recognition; The type of communication protocol is identified by comparing and matching the updated weight value and fusion feature value with the standard feature value; the identification algorithm expression is: (7) In formula (7), Represents the output value of the recognition result, Indicates the data length recognition result. Indicates the maximum value of the data length characteristic value, Indicates the minimum value of the data length characteristic value, Indicates the data length characteristic value, Indicates the standard characteristic value of data length, Represents the normalized value of the data length characteristic value, Indicates the transmission rate identification result. Indicates the maximum value of the transmission rate characteristic value, Indicates the minimum value of the transmission rate characteristic value, Indicates the characteristic value of the transmission rate, Indicates the standard characteristic value of the transmission rate, represents the normalized value of the transmission rate characteristic value, Represents the identification factor.
2. According to a method for identifying an optical module communication protocol based on communication protocol conversion according to claim 1, it is characterized in that: The network packet capture method captures and records data packets on the network through data acquisition and analysis of tcpdump packet capture, and allows users to view data information including source and destination addresses, protocol types and versions, data packet structures, commands and response formats through a protocol analyzer; the device document collects data by viewing the communication interface, protocol list, data format and communication settings supported by the device in the document to collect information, and stores the information in a protocol database, wherein the protocol analyzer includes an analysis control module and a network layer protocol diagnosis module, an application layer protocol diagnosis module, a network data packet search module, a data parsing module and a network data adjustment module connected to the analysis control module.
3. According to the method for identifying the communication protocol of an optical module based on communication protocol conversion according to claim 1, it is characterized in that: The screening and filling method is implemented by removing duplicate data and filling missing values; the removal of duplicate values is achieved by extracting non-duplicate data from the data source and saving it through the unique method of finding independent values, and deleting the unextracted data; the filling of missing values is achieved by arranging the data group according to the format type and structure type, finding the location and data type of the missing values, and using the attribute mean of all data as the missing value to be filled according to the attributes of the given data group.
4. According to the method for identifying the communication protocol of an optical module based on communication protocol conversion according to claim 1, it is characterized in that: The protocol conversion module converts different communication protocols in two ways; the two conversion methods are respectively for wired communication and wireless communication; the conversion method for wired communication is: parsing the data information of the communication protocol through a protocol converter and a gateway, and converting it into new communication protocol data by changing the encoding method and information form of the data information; the conversion method for wireless communication is: mapping data between different protocols through the communication protocol stack of the application programming interface API and the software development kit SDK to ensure that the semantics and structure of the data remain consistent during the conversion process, and allowing the definition of new extended functions to adapt to specific communication protocol conversion requirements.
5. The method for identifying the communication protocol of an optical module based on communication protocol conversion according to claim 1, characterized in that: The implementation method of the encryption algorithm is: 1) Arrange in random order; Randomly scramble the transmitted data and generate an initialization vector for the encryption process to enhance the randomness and security of encryption; 2) Generate a seed key; Divide the transmitted data into small blocks and use the hash value to perform XOR with the data key to obtain the seed key; 3) Encryption process; The data is encrypted based on an encryption algorithm, the expression of the encryption algorithm is: (8) In formula (8), Represents the encrypted output value, represents the entropy density, Indicates encrypted data. Indicates that the data is converted to binary. represents the encryption operator, Indicates the number of operations. Indicates the order of operations.
Citation Information
Patent Citations
Method for extracting characteristics of application layer protocols
CN101753622A
Image data searching method and device, electronic equipment and storage medium
CN113094539A