Analyzing method of industrial communication protocol

By dividing standard and non-standard protocol frames in the industrial communication protocol analysis method, analyzing their consistency and compatibility, and judging the resolution strategy update requirements, data analysis errors and communication interruptions in the existing technology in the coexistence of multiple protocols and dynamically changing environments, improving the stability and reliability of the analysis method.

CN119697295APending Publication Date: 2025-03-25QINGDAO YIJIEHONGLI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411859903.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art is difficult to adapt to the industrial communication environment of multi-protocol coexistence and dynamic changes, resulting in data parsing errors or communication interruptions, and lacks systematic analysis methods to evaluate and optimize the reliability of the analytical strategy.

Method used

By receiving data frames in the industrial network, and dividing them into standard protocol frames and non-standard protocol frames according to frame header information, control codes and addressing methods, analyzing the consistency of key communication parameters in standard protocol frames and frame structure compatibility in non-standard protocol frames, determining whether the parsing strategy needs to be updated, and evaluating the impact of parsing rule adjustment on accuracy.

Benefits of technology

It improves the stability, adaptability and reliability of the industrial communication protocol analysis method, and can more accurately evaluate and optimize the analysis strategy to meet the needs of complex industrial communication environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697295A_ABST
    Figure CN119697295A_ABST
Patent Text Reader

Abstract

The invention discloses an analysis method of an industrial communication protocol, and particularly relates to the field of industrial communication. Dividing the data frame into a standard protocol frame and a non-standard protocol frame through an industrial communication protocol specification; performing consistency evaluation on key communication parameters in the standard protocol frame to ensure the logic rationality of the data frame; dynamic fields in the non-standard protocol frame are analyzed, the compatibility of a frame structure to industrial communication protocol variation is evaluated, and the adaptive capacity of an analysis strategy is improved; and judging whether the current analysis strategy needs to be updated or not according to the consistency and compatibility results, evaluating the adjustment adaptability of the analysis rule, and quantifying the influence degree of rule adjustment on the analysis precision. Through comprehensive analysis of the consistency score, the compatibility coefficient and the accuracy coefficient, the reliability of the current analysis strategy is determined, challenges of multi-protocol coexistence and dynamic change in a complex industrial communication environment are effectively dealt with, and a technical guarantee is provided for stable and efficient operation of an industrial network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial communication technology, and more specifically, to a method for parsing an industrial communication protocol. Background Art

[0002] Traditional industrial communication protocol parsing methods are usually designed for a single protocol or fixed structure, and are difficult to adapt to the coexistence of multiple protocols and dynamically changing communication environments, especially in industrial scenarios, which are more likely to cause data parsing errors or communication interruptions. In addition, when industrial communication protocols are updated or expanded, the protocol frame structure, field definition, and data length may change, and the difficulty of parsing non-standard protocol frames is further increased. At the same time, the lack of consistency of key communication parameters in standard protocol frames will also have a negative impact on parsing accuracy and logical reliability. The prior art lacks a systematic parsing method that can comprehensively analyze the consistency of standard protocol frames, the compatibility of non-standard protocol frames, and the adaptability of parsing rules, making it impossible to comprehensively evaluate and optimize the reliability of current parsing strategies, limiting the efficiency and stability of industrial network communications.

[0003] In order to solve the above problems, a technical solution is now provided. Summary of the invention

[0004] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a method for parsing an industrial communication protocol to solve the problems raised in the above-mentioned background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A method for parsing an industrial communication protocol comprises the following steps:

[0007] Based on the industrial communication protocol specification, the data frames in the industrial network are received, and the data frames are divided into standard protocol frames and non-standard protocol frames according to the frame header information, control code and addressing mode;

[0008] Analyze the key communication parameters in the standard protocol frame and evaluate the consistency of the key communication parameters in the standard protocol frame;

[0009] Analyze the dynamic fields in non-standard protocol frames and evaluate the compatibility of the frame structure in non-standard protocol frames with industrial communication protocol variations;

[0010] According to the consistency of key communication parameters in the standard protocol frame and the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, determine whether the current industrial communication protocol parsing strategy needs to be updated;

[0011] Analyze the adaptability of industrial communication protocol parsing rules and evaluate the impact of industrial communication protocol parsing rule adjustments on the accuracy of industrial communication protocol parsing;

[0012] A comprehensive analysis is conducted on the consistency of key communication parameters in standard protocol frames, the compatibility of frame structures in non-standard protocol frames with industrial communication protocol variations, and the impact of adjustments to industrial communication protocol parsing rules on the accuracy of industrial communication protocol parsing to determine the reliability of the current industrial communication protocol parsing strategy.

[0013] In a preferred embodiment, based on the industrial communication protocol specification, data frames in the industrial network are received, and the data frames are divided into standard protocol frames and non-standard protocol frames according to the frame header information, control code and addressing mode, specifically:

[0014] Receive data frames from industrial networks and extract frame header information, control codes and addressing methods;

[0015] Verify the protocol type and basic format of the data frame based on the frame header information;

[0016] Analyze the functional attributes of the data frame based on the control code to determine whether the functional attributes of the data frame are normal;

[0017] Check the protocol compatibility of the target address according to the addressing mode and filter the protocol frame type;

[0018] Based on the frame header information, control code and addressing results, the frames are divided into standard protocol frames and non-standard protocol frames: when the frame header information is legal, the functional attributes of the data frame are normal and the addressing method is compatible, the data frame is divided into a standard protocol frame; any data frame that does not meet the above conditions is divided into a non-standard protocol frame.

[0019] In a preferred embodiment, the key communication parameters in the standard protocol frame are analyzed to evaluate the consistency of the key communication parameters in the standard protocol frame, specifically:

[0020] Extract key communication parameters from standard protocol frames, create parameter sets and mark types;

[0021] Perform protocol consistency checks on extracted parameters based on industrial communication protocol specifications;

[0022] Compare the value differences between parameters of the same type and calculate the consistency index;

[0023] Analyze the matching of consistency indicators and protocol tolerance ranges, and calculate the consistency scores of key communication parameters: Compare the consistency indicators with the tolerance ranges of each parameter type defined in the industrial network protocol specification, and calculate the consistency matching results; Based on the consistency indicators and consistency matching results, calculate the consistency scores of key communication parameters, the expression is:

[0024] Among them, CS is the consistency score of key communication parameters; Ip is the consistency index; M p is the consistency matching result; Z p is the importance weight of the pth parameter group; B is the total number of parameter groups.

[0025] In a preferred embodiment, the dynamic fields in the non-standard protocol frame are analyzed to evaluate the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, specifically:

[0026] Extract dynamic fields from non-standard protocol frames and check the structure and value range of dynamic fields based on the variation rules of industrial communication protocols;

[0027] Compare the key matches of the dynamic fields and the variation rules of the industrial communication protocol, and quantify the compatibility index: define the compatibility coefficient, the expression of the compatibility coefficient is:

[0028] Where CCF is the compatibility coefficient; C(d k,j ) is used to determine whether the structure of the dynamic field conforms to the variation rules of the industrial communication protocol; R(d k,j ) is used to determine whether the value range of the dynamic field conforms to the variation rules of the industrial communication protocol; n is the total number of non-standard protocol frames; m is the number of dynamic fields in the kth non-standard frame; d k,j Indicates the jth dynamic field in the kth non-standard frame.

[0029] In a preferred embodiment, according to the consistency of key communication parameters in the standard protocol frame and the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, it is determined whether the current industrial communication protocol parsing strategy needs to be updated, specifically:

[0030] Preset consistency score threshold and compare the consistency score with the consistency score threshold:

[0031] When the consistency score is greater than or equal to the consistency score threshold, the current industrial communication protocol parsing strategy does not need to be updated;

[0032] When the consistency score is less than the consistency score threshold, the current industrial communication protocol parsing strategy needs to be updated;

[0033] Preset the compatibility coefficient threshold and compare the compatibility coefficient with the compatibility coefficient threshold:

[0034] When the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, the current industrial communication protocol parsing strategy does not need to be updated;

[0035] When the compatibility coefficient is less than the compatibility coefficient threshold, the current industrial communication protocol parsing strategy needs to be updated;

[0036] When the consistency score is greater than or equal to the consistency score threshold, and the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, the current industrial communication protocol parsing strategy does not need to be updated; except for all cases where the consistency score is greater than or equal to the consistency score threshold, and the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, the current industrial communication protocol parsing strategy needs to be updated.

[0037] In a preferred embodiment, the adaptability of the industrial communication protocol parsing rules is analyzed to evaluate the impact of the adjustment of the industrial communication protocol parsing rules on the accuracy of the industrial communication protocol parsing, specifically:

[0038] Extract the current industrial communication protocol parsing rules and the corresponding protocol field information set;

[0039] Introduce adjustment strategies into protocol parsing rules and perform simulation tests on protocol field parsing behaviors;

[0040] Compare the parsing accuracy indicators before and after the adjustment to quantify the impact of the parsing rule adjustment: define the accuracy coefficient, the expression is: Where ACO is the accuracy coefficient; L is the number of industrial communication protocols; ACC(P b ) is the analytical accuracy index; the adjusted analytical accuracy index ACC(P b ) ∧ .

[0041] In a preferred embodiment, the consistency of key communication parameters in the standard protocol frame, the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, and the influence of the adjustment of the industrial communication protocol parsing rules on the accuracy of the industrial communication protocol parsing are comprehensively analyzed to determine the reliability of the current industrial communication protocol parsing strategy, specifically:

[0042] The consistency score corresponding to the consistency of key communication parameters in the standard protocol frame, the compatibility coefficient corresponding to the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, and the accuracy coefficient corresponding to the degree of influence of the adjustment of the industrial communication protocol parsing rules on the accuracy of the industrial communication protocol parsing are normalized respectively, and the consistency score, compatibility coefficient and accuracy coefficient obtained after the normalization process are calculated to obtain the reliability index;

[0043] The calculation formula of reliability index is:

[0044] Among them, RI is the reliability index; ACO is the accuracy coefficient; CCF is the compatibility coefficient; CS is the consistency score of key communication parameters; α, β, γ are weight coefficients;

[0045] A reliability index threshold is preset, and the reliability index is compared with the reliability index threshold:

[0046] When the reliability index is greater than or equal to the reliability index threshold, the reliability of the industrial communication protocol parsing strategy is high reliability;

[0047] When the reliability index is less than the reliability index threshold, the reliability of the industrial communication protocol parsing strategy is low reliability.

[0048] Technical effects and advantages of an industrial communication protocol analysis method of the present invention:

[0049] By dividing data frames into standard protocol frames and non-standard protocol frames, the processing logic of different protocol frames is clarified to ensure the pertinence of parsing; the consistency of key communication parameters of standard protocol frames is analyzed to help ensure the logical rationality of standard protocol frames; the compatibility evaluation of dynamic fields of non-standard protocol frames effectively responds to the variation and expansion of industrial communication protocols and enhances the adaptability of parsing strategies to protocol variation; based on consistency and compatibility, the update requirements of parsing strategies are comprehensively judged to identify the applicability of parsing strategies; by evaluating the impact of parsing rule adjustments on accuracy, the adaptability of parsing rules to complex industrial scenarios is optimized. The three indicators of consistency, compatibility and accuracy are comprehensively analyzed to determine the reliability of the parsing strategy, which improves the stability, adaptability and reliability of the industrial communication protocol parsing method and meets the needs of complex industrial communication environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of a method for parsing an industrial communication protocol according to the present invention. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] Example 1

[0053] Figure 1 The present invention provides a method for parsing an industrial communication protocol, which comprises the following steps:

[0054] Based on the industrial communication protocol specification, the data frames in the industrial network are received, and the data frames are divided into standard protocol frames and non-standard protocol frames according to the frame header information, control code and addressing mode;

[0055] Analyze the key communication parameters in the standard protocol frame and evaluate the consistency of the key communication parameters in the standard protocol frame;

[0056] Analyze the dynamic fields in non-standard protocol frames and evaluate the compatibility of the frame structure in non-standard protocol frames with industrial communication protocol variations;

[0057] According to the consistency of key communication parameters in the standard protocol frame and the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, determine whether the current industrial communication protocol parsing strategy needs to be updated;

[0058] Analyze the adaptability of industrial communication protocol parsing rules and evaluate the impact of industrial communication protocol parsing rule adjustments on the accuracy of industrial communication protocol parsing;

[0059] A comprehensive analysis is conducted on the consistency of key communication parameters in standard protocol frames, the compatibility of frame structures in non-standard protocol frames with industrial communication protocol variations, and the impact of adjustments to industrial communication protocol parsing rules on the accuracy of industrial communication protocol parsing to determine the reliability of the current industrial communication protocol parsing strategy.

[0060] Specifically, based on the industrial communication protocol specification, the data frames in the industrial network are received, and the data frames are divided into standard protocol frames and non-standard protocol frames according to the frame header information, control code and addressing mode, including:

[0061] Receive data frames from the industrial network and extract frame header information, control codes and addressing methods. Specifically, in industrial communication protocols, data frames are the basic units used to transmit and parse core information. Each data frame usually contains fields such as frame header information, control codes, addressing methods, data segments, and checksums. By capturing data frames in the network and performing preliminary parsing on them, frame header information, control codes, and addressing methods can be extracted.

[0062] The network interface module captures the data frames in transmission, generates a data frame set, parses each data frame, and extracts the following key fields:

[0063] Frame header information: indicates the identifier and protocol type of the data frame;

[0064] Control code: identifies the functional attributes or instruction type of the data frame;

[0065] Addressing mode: describes the target address and path information of the data frame.

[0066] The field contains the frame header information of the data frame, the control code of the data frame, the addressing information of the data frame, the data segment content and the check code.

[0067] The protocol type and the legality of the basic format of the data frame are verified according to the frame header information. Specifically, the frame header information H of the data frame includes the key identifier of the protocol type and format. By verifying the legality of the frame header information, data frames that do not comply with the industrial communication protocol specifications can be excluded.

[0068] The frame header information contains a protocol type identifier, and by comparing it with a predefined set of protocol types, it is verified whether the frame header information complies with the specification.

[0069] Verify the format fields of the data frame to ensure that the format fields of the data frame meet the following requirements: the frame header length meets the specification; the frame header content contains necessary fields such as the protocol identifier and version information.

[0070] Use function G(H) to indicate the legitimacy of the frame header:

[0071] When G(H) = 0, it is marked as an illegal data frame and excluded. By verifying the legitimacy of the frame header information, candidate data frames that meet the basic requirements of the industrial communication protocol specification are screened out.

[0072] Based on the control code, the functional attributes of the data frame are analyzed to determine whether the functional attributes of the data frame are normal. Specifically, the functional attributes of the data frame are analyzed through the control code and classified into types such as data request, status report, and control instruction. According to the specifications of the industrial communication protocol and the expected behavior of the functional attributes, the control code is verified to be in accordance with the definition and usage rules of the functional attributes to determine whether it is normal. If the verification control code is in accordance with the definition and usage rules of the functional attributes, the functional attributes of the data frame are judged to be normal; if the verification control code is not in accordance with the definition and usage rules of the functional attributes, the functional attributes of the data frame are judged to be abnormal.

[0073] Check the protocol compatibility of the target address according to the addressing mode and filter the protocol frame type. Specifically, the addressing mode indicates the target address of the data frame and its routing information with the sender. Checking the protocol compatibility of the addressing mode helps to determine the communication validity of the data frame.

[0074] Extract the addressing mode from the data frame and parse it into a set of target addresses. Verify whether each target address meets the compatibility requirements of the industrial communication protocol specification. For example, check whether the address format, address range, and routing table are consistent with the protocol. Use the compatibility function V(W) to determine the addressing result:

[0075] For data frames with V(W)=0, they are directly marked as non-standard protocol frames.

[0076] Based on the frame header information, control code and addressing results, it is divided into standard protocol frames and non-standard protocol frames. Specifically, when the frame header information is legal, the functional attributes of the data frame are normal and the addressing method is compatible, the data frame is divided into a standard protocol frame. Any data frame that does not meet the above conditions is divided into a non-standard protocol frame.

[0077] Specifically, the key communication parameters in the standard protocol frame are analyzed to evaluate the consistency of the key communication parameters in the standard protocol frame, including:

[0078] Extract key communication parameters from the standard protocol frame, establish a parameter set and mark the type. Specifically, extract the fields defined as key communication parameters from the standard protocol frame, including function code, data length, checksum and target address, etc. Each parameter is marked and classified according to the protocol specification to form a parameter set.

[0079] Perform protocol consistency check on the extracted parameters based on the industrial communication protocol specification, specifically: check each extracted parameter in accordance with the requirements of the industrial communication protocol specification to ensure that it is consistent with the standard defined by the protocol. According to the definition of parameter format, value range and field relationship in the industrial communication protocol specification, match parameters such as function code, data length, check code and target address to verify whether the parameters are within the allowable range specified in the protocol specification, such as whether the function code belongs to the standard function definition, whether the data length is consistent with the actual size of the data area, whether the target address is within the valid address range supported by the protocol, and whether the check code is calculated correctly.

[0080] Compare the value differences between parameters of the same type and calculate the consistency index. Specifically, group the parameters after the protocol consistency check according to the parameter type tag, and calculate the standard deviation and average value of each group of parameters. Based on the standard deviation and average value, define the consistency index, the expression is:

[0081] Among them, I p is the consistency index, which ranges from 0 to 1. The closer the value of the consistency index is to 1, the higher the consistency of the group of parameters; σ p ; is the standard deviation of the group of parameters; μ is the mean value of the group of parameters.

[0082] Analyze the matching of consistency indicators and protocol tolerance range, and calculate the consistency score of key communication parameters. Specifically, compare the consistency indicators with the tolerance range of each parameter type defined in the industrial network protocol specification. When the consistency indicators do not meet the tolerance range of each parameter type, the consistency matching result value is 0; when the consistency indicators meet the tolerance range of each parameter type, the consistency matching result value is 1.

[0083] Based on the consistency index and consistency matching results, the consistency score of key communication parameters is calculated, and the expression is:

[0084] Among them, CS is the consistency score of key communication parameters; I p is the consistency index; M p is the consistency matching result; Z p is the importance weight of the pth parameter group; B is the total number of parameter groups.

[0085] The higher the consistency score of the key communication parameters, the higher the consistency of the key communication parameters in the standard protocol frame. When the consistency score is higher, it means that the key communication parameters in the standard protocol frame have higher coordination with each other, for example, the matching relationship between the function code and the data length is more reasonable, the target address complies with the addressing rules of the protocol, the check code is verified, and the logical consistency between the parameter values ​​is strong. A higher consistency score also indicates that the deviation of the key parameters in the standard protocol frame is small, and the parameters are distributed within the protocol tolerance range. At the same time, a higher consistency score also indicates that the standard protocol frame has strong reliability and stability, and can effectively support subsequent industrial communication operations.

[0086] Specifically, the dynamic fields in the non-standard protocol frames are analyzed to evaluate the compatibility of the frame structure in the non-standard protocol frames with industrial communication protocol variations, including:

[0087] Extract dynamic fields from non-standard protocol frames. Specifically, dynamic fields in non-standard protocol frames refer to fields whose values ​​and structures may change between different environments, functions or devices, such as custom identifiers, dynamic data payloads, etc. By parsing the frame header, data segment and check segment of the non-standard protocol frame, the fields that may change are identified and classified into a dynamic field set.

[0088] The structure and value range of the dynamic field are checked based on the variation rules of the industrial communication protocol. Specifically, the variation rules of the industrial communication protocol are the definition standards for the extensibility and dynamic adaptability of non-standard protocol frames, which are used to determine whether the structure and value of the dynamic field comply with the variation rules of the industrial communication protocol.

[0089] Structural rule checking: Use the function C(d k,j )Verify the structure of the dynamic field:

[0090] Value range validation: for each dynamic field d k,j , according to the function R(d k,j) Compare the value of the dynamic field with the legal range defined by the mutation rule: when the value of the dynamic field is within the legal range defined by the mutation rule, it is defined as 1; when the value of the dynamic field is not within the legal range defined by the mutation rule, it is defined as 0.

[0091] Compare the key matches of the dynamic fields and the variation rules of the industrial communication protocol, and quantify the compatibility index, specifically: define the compatibility coefficient, which is used to evaluate the compatibility of the frame structure in the non-standard protocol frame with the variation of the industrial communication protocol. The expression of the compatibility coefficient is:

[0092] Where CCF is the compatibility coefficient; C(d k,j ) is used to determine whether the structure of the dynamic field conforms to the variation rules of the industrial communication protocol; R(d k,j ) is used to determine whether the value range of the dynamic field conforms to the variation rules of the industrial communication protocol; n is the total number of non-standard protocol frames; m is the number of dynamic fields in the kth non-standard frame; d k,j Indicates the jth dynamic field in the kth non-standard frame.

[0093] The larger the compatibility coefficient, the more compatible the frame structure in the non-standard protocol frame is with the variation of the industrial communication protocol. It also shows that the data domain distribution, field definition, and length variation in the frame structure are highly compatible with the mutated industrial communication protocol, which can effectively reduce the impact of protocol updates or expansions on the communication system. A higher compatibility coefficient also means that the structural design of the non-standard protocol frame has greater flexibility and adaptability, and can adapt to the diverse communication needs in complex industrial environments, thereby improving the success rate of protocol parsing and the communication efficiency of industrial networks.

[0094] Specifically, based on the consistency of key communication parameters in the standard protocol frame and the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, it is determined whether the current industrial communication protocol parsing strategy needs to be updated, including:

[0095] Preset consistency score threshold and compare the consistency score with the consistency score threshold:

[0096] When the consistency score is greater than or equal to the consistency score threshold, it means that the key communication parameters in the standard protocol frame meet the consistency requirements of the industrial communication protocol specification, the matching relationship between the key communication parameters is relatively reasonable, and the current industrial communication protocol parsing strategy does not need to be updated. For example, the function code and data length are strictly matched, the target address fully complies with the addressing rules, and the checksum verification is passed without deviation. This shows that the logical consistency of the frame is strong, the distribution of key communication parameters is within the protocol tolerance range, the reliability and stability of the standard protocol frame are high, it can be used for industrial communication operations, and can effectively support complex control and data interaction tasks;

[0097] When the consistency score is less than the consistency score threshold, it means that the key communication parameters in the standard protocol frame may not comply with the industrial communication protocol specifications, and the current industrial communication protocol parsing strategy needs to be updated. For example, the function code does not match the data length, the target address does not fully comply with the addressing rules, or the checksum verification fails, resulting in a deviation in the logical relationship between the key communication parameters. This may reduce the reliability and stability of the protocol frame, resulting in parsing errors or communication failures.

[0098] The setting of the consistency score threshold is determined based on the tolerance range of the industrial communication protocol, the key performance requirements of the application scenario, and the environmental complexity of the actual communication network.

[0099] Preset the compatibility coefficient threshold and compare the compatibility coefficient with the compatibility coefficient threshold:

[0100] When the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, it means that the frame structure in the non-standard protocol frame can adapt well to the variation characteristics of the industrial communication protocol, and the current industrial communication protocol parsing strategy does not need to be updated. For example, the distribution flexibility of the data domain, the universality of the field definition, and the dynamic adaptation capability of the length change have all reached a high level. This shows that the frame structure can maintain good parsing capabilities in the case of protocol updates, extensions, or variations, avoiding parsing failures or communication interruptions caused by variations. At the same time, a higher compatibility coefficient means that the non-standard protocol frame has better support capabilities for diversified industrial communication needs, thereby improving the stability of the industrial network and overall communication efficiency.

[0101] When the compatibility coefficient is less than the compatibility coefficient threshold, it means that the frame structure of the non-standard protocol frame is insufficient in adapting to the variation of the industrial communication protocol, and the current industrial communication protocol parsing strategy needs to be updated. For example, the distribution of the data field is not reasonable, the field definition lacks flexibility, or the range of variation of the frame length is limited. This may lead to inaccurate parsing, reduced communication efficiency, or frame loss when the protocol is updated or expanded. The low compatibility coefficient reflects that the adaptability of the frame structure is limited and cannot meet the flexibility requirements brought about by protocol variations in complex industrial environments. The frame design needs to be optimized to improve the parsing success rate and system performance.

[0102] The setting of the compatibility coefficient threshold is determined based on the historical variation characteristics of the industrial communication protocol, the complexity of the protocol extension requirements in different industrial environments, and the balance between flexibility and performance requirements in the design of non-standard protocol frames.

[0103] When the consistency score is greater than or equal to the consistency score threshold, and the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, the current industrial communication protocol parsing strategy does not need to be updated. In all cases except when the consistency score is greater than or equal to the consistency score threshold, and the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, the current industrial communication protocol parsing strategy needs to be updated.

[0104] Updates to the industrial communication protocol parsing strategy include: For the consistency issues of standard protocol frames, the verification logic of frame header information, control codes, and addressing methods can be optimized, such as strengthening the matching rules of function codes and data lengths, improving the verification accuracy of target addresses and protocol addressing rules, and enhancing the consistency of data field logic by introducing dynamic verification models. To improve compatibility with non-standard protocol frames, an adaptive parsing mechanism can be designed to support dynamic field definitions and frame structure changes in protocol variations by expanding the parsing rule base. A machine learning-based protocol frame feature prediction algorithm is added to identify potential variation trends based on historical data and adapt in advance. For environments where multiple protocols coexist, a real-time rule adjustment module can be added to dynamically adjust the rule priority during the parsing process according to the actual communication environment to improve the parsing success rate and efficiency.

[0105] Specifically, the adaptability of industrial communication protocol parsing rules is analyzed, and the impact of industrial communication protocol parsing rule adjustments on the accuracy of industrial communication protocol parsing is evaluated, including:

[0106] Extract the current industrial communication protocol parsing rules and the corresponding protocol field information set, specifically: the current industrial communication protocol parsing rules refer to the predefined logic and operation steps used when parsing the protocol field content.

[0107] Define the industrial communication protocol set {P1, P2, ...P L}, where each industrial communication protocol P b Contains a set of parsing rules R b The parsing rules include field format, length requirements, and verification methods. For industrial communication protocols, extract its field set F b ={f b,1 ,f b,2 ,...f b,g}, where f b,d Indicates industrial communication protocol P b Each field includes a type (such as integer, string), length (number of bytes) and content description.

[0108] Analyze the protocol field parsing results and record the parsing rule adaptability and parsing accuracy indicators. Specifically, use the parsing rules to parse the fields in the protocol and generate the field parsing results {V b,1 ,V b,2,...V b,g}; where V b,d Indicates field f b,d The parsed value of .

[0109] Define the fitness function A(f b,d ), check whether the parsing result complies with the industrial communication protocol specification. When the parsing result complies with the industrial communication protocol specification, the value is 1; when the parsing result does not comply with the industrial communication protocol specification, the value is 0.

[0110] Calculate the parsing accuracy and define the parsing accuracy index. The expression is: Among them, ACC(P b ) is the parsing accuracy indicator; g is the number of protocol fields.

[0111] Introduce adjustment strategies in the protocol parsing rules and simulate the protocol field parsing behavior. Specifically, define a set of parsing rule adjustment parameters. Each adjustment parameter represents an optimization direction, such as modifying the field length; changing the field verification rule; adjusting the parsing priority. Use the adjusted rules to parse the protocol in the simulation environment and generate simulation parsing results. Record the parsing adaptability function A(f b,d ) ∧ and the analytical accuracy index ACC(P b ) ∧ .

[0112] Compare the parsing accuracy indicators before and after the adjustment to quantify the impact of the parsing rule adjustment. Specifically, define the accuracy coefficient, which is expressed as: Where ACO is the accuracy coefficient; L is the number of industrial communication protocols.

[0113] The larger the accuracy coefficient, the greater the impact of the adjustment of the industrial communication protocol parsing rules on the accuracy of the industrial communication protocol parsing. The adjusted parsing rules can more efficiently match the actual application scenarios of the industrial communication protocol, improve the ability to identify protocol features and the accuracy of data parsing. The rule adjustment effectively improves the coverage and compatibility of the parsing system for protocol fields, and can more accurately identify and parse complex field contents, including boundary values, dynamic fields, and variable communication modes. At the same time, a higher accuracy coefficient also indicates that the adjusted parsing rules optimize details such as field verification, verification mechanism, and length tolerance processing, reducing parsing failures caused by rule mismatches.

[0114] Specifically, the consistency of key communication parameters in standard protocol frames, the compatibility of frame structures in non-standard protocol frames with industrial communication protocol variations, and the impact of industrial communication protocol parsing rule adjustments on the accuracy of industrial communication protocol parsing are comprehensively analyzed to determine the reliability of the current industrial communication protocol parsing strategy, including:

[0115] The consistency score corresponding to the consistency of key communication parameters in the standard protocol frame, the compatibility coefficient corresponding to the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, and the accuracy coefficient corresponding to the influence of the adjustment of the industrial communication protocol parsing rules on the accuracy of the industrial communication protocol parsing are normalized respectively, and the consistency score, compatibility coefficient and accuracy coefficient obtained after the normalization are calculated to get the reliability index. The reliability of the current industrial communication protocol parsing strategy is determined by the reliability index.

[0116] The calculation formula of reliability index is:

[0117] Among them, RI is the reliability index; ACO is the accuracy coefficient; CCF is the compatibility coefficient; CS is the consistency score of key communication parameters; α, β, and γ are weight coefficients, and the specific values ​​are set according to the actual scenario.

[0118] A reliability index threshold is preset, and the reliability index is compared with the reliability index threshold:

[0119] When the reliability index is greater than or equal to the reliability index threshold, it means that the current industrial communication protocol parsing strategy can meet the needs of complex industrial communication environments. At this time, the reliability of the industrial communication protocol parsing strategy is high, which can effectively ensure the parameter consistency of the standard protocol frame, flexibly adapt to the variation characteristics of the non-standard protocol frame, and ensure the high accuracy and stability of the parsing results.

[0120] When the reliability index is less than the reliability index threshold, it indicates that the current industrial communication protocol parsing strategy is insufficient. At this time, the reliability of the industrial communication protocol parsing strategy is low, which may cause communication errors, data loss or performance degradation.

[0121] The setting of the reliability index threshold is determined based on the application scenario requirements of the industrial communication protocol, the complexity of different communication environments, and the key performance indicators of protocol parsing in actual industrial environments.

[0122] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.

[0123] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0124] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0125] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0126] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0127] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, and may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0128] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0129] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0130] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0131] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for parsing an industrial communication protocol, characterized in that: The steps include: Based on the industrial communication protocol specification, the data frames in the industrial network are received, and the data frames are divided into standard protocol frames and non-standard protocol frames according to the frame header information, control code and addressing mode; Analyze the key communication parameters in the standard protocol frame and evaluate the consistency of the key communication parameters in the standard protocol frame; Analyze the dynamic fields in non-standard protocol frames and evaluate the compatibility of the frame structure in non-standard protocol frames with industrial communication protocol variations; According to the consistency of key communication parameters in the standard protocol frame and the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, determine whether the current industrial communication protocol parsing strategy needs to be updated; Analyze the adaptability of industrial communication protocol parsing rules and evaluate the impact of industrial communication protocol parsing rule adjustments on the accuracy of industrial communication protocol parsing; A comprehensive analysis is conducted on the consistency of key communication parameters in standard protocol frames, the compatibility of frame structures in non-standard protocol frames with industrial communication protocol variations, and the impact of adjustments to industrial communication protocol parsing rules on the accuracy of industrial communication protocol parsing to determine the reliability of the current industrial communication protocol parsing strategy.

2. The method for parsing an industrial communication protocol according to claim 1, characterized in that: Based on the industrial communication protocol specification, the data frames in the industrial network are received and divided into standard protocol frames and non-standard protocol frames according to the frame header information, control code and addressing mode, specifically: Receive data frames from industrial networks and extract frame header information, control codes and addressing methods; Verify the protocol type and basic format of the data frame based on the frame header information; Analyze the functional attributes of the data frame based on the control code to determine whether the functional attributes of the data frame are normal; Check the protocol compatibility of the target address according to the addressing mode and filter the protocol frame type; Based on the frame header information, control code and addressing results, the frames are divided into standard protocol frames and non-standard protocol frames: when the frame header information is legal, the functional attributes of the data frame are normal and the addressing method is compatible, the data frame is divided into a standard protocol frame; any data frame that does not meet the above conditions is divided into a non-standard protocol frame.

3. The method for parsing an industrial communication protocol according to claim 1, characterized in that: Analyze the key communication parameters in the standard protocol frame and evaluate the consistency of the key communication parameters in the standard protocol frame, specifically: Extract key communication parameters from standard protocol frames, create parameter sets and mark types; Perform protocol consistency checks on extracted parameters based on industrial communication protocol specifications; Compare the value differences between parameters of the same type and calculate the consistency index; Analyze the matching of consistency indicators and protocol tolerance ranges, and calculate the consistency scores of key communication parameters: Compare the consistency indicators with the tolerance ranges of each parameter type defined in the industrial network protocol specification, and calculate the consistency matching results; Based on the consistency indicators and consistency matching results, calculate the consistency scores of key communication parameters, the expression is: Among them, CS is the consistency score of key communication parameters; I p is the consistency index; M p is the consistency matching result; Z p is the importance weight of the pth parameter group; B is the total number of parameter groups.

4. The method for parsing an industrial communication protocol according to claim 1, characterized in that: Analyze the dynamic fields in the non-standard protocol frames and evaluate the compatibility of the frame structure in the non-standard protocol frames with industrial communication protocol variations, specifically: Extract dynamic fields from non-standard protocol frames and check the structure and value range of dynamic fields based on the variation rules of industrial communication protocols; Compare the key matches of the dynamic fields and the variation rules of the industrial communication protocol, and quantify the compatibility index: define the compatibility coefficient, the expression of the compatibility coefficient is: Where CCF is the compatibility coefficient; C9d k,j ) is used to determine whether the structure of the dynamic field complies with the variation rules of the industrial communication protocol; R9d k,j ) is used to determine whether the value range of the dynamic field conforms to the variation rules of the industrial communication protocol; n is the total number of non-standard protocol frames; m is the number of dynamic fields in the kth non-standard frame; d k,j Indicates the jth dynamic field in the kth non-standard frame.

5. The method for parsing an industrial communication protocol according to claim 1, characterized in that: According to the consistency of key communication parameters in the standard protocol frame and the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, it is determined whether the current industrial communication protocol parsing strategy needs to be updated. Specifically: Preset consistency score threshold and compare the consistency score with the consistency score threshold: When the consistency score is greater than or equal to the consistency score threshold, the current industrial communication protocol parsing strategy does not need to be updated; When the consistency score is less than the consistency score threshold, the current industrial communication protocol parsing strategy needs to be updated; Preset the compatibility coefficient threshold and compare the compatibility coefficient with the compatibility coefficient threshold: When the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, the current industrial communication protocol parsing strategy does not need to be updated; When the compatibility coefficient is less than the compatibility coefficient threshold, the current industrial communication protocol parsing strategy needs to be updated; When the consistency score is greater than or equal to the consistency score threshold, and the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, the current industrial communication protocol parsing strategy does not need to be updated; except for all cases where the consistency score is greater than or equal to the consistency score threshold, and the compatibility coefficient is greater than or equal to the compatibility coefficient threshold, the current industrial communication protocol parsing strategy needs to be updated.

6. The method for parsing an industrial communication protocol according to claim 1, characterized in that: The adaptability of industrial communication protocol parsing rules is analyzed, and the impact of industrial communication protocol parsing rule adjustments on the accuracy of industrial communication protocol parsing is evaluated, specifically: Extract the current industrial communication protocol parsing rules and the corresponding protocol field information set; Introduce adjustment strategies into protocol parsing rules and conduct simulation tests on protocol field parsing behaviors; Compare the parsing accuracy indicators before and after the adjustment to quantify the impact of the parsing rule adjustment: define the accuracy coefficient, the expression is: Where ACO is the accuracy coefficient; L is the number of industrial communication protocols; ACC(P b ) is the analytical accuracy index; the adjusted analytical accuracy index ACC(P b ) ∧ .

7. The method for parsing an industrial communication protocol according to claim 1, characterized in that: A comprehensive analysis is conducted on the consistency of key communication parameters in standard protocol frames, the compatibility of frame structures in non-standard protocol frames with industrial communication protocol variations, and the impact of industrial communication protocol parsing rule adjustments on the accuracy of industrial communication protocol parsing to determine the reliability of the current industrial communication protocol parsing strategy. Specifically: The consistency score corresponding to the consistency of key communication parameters in the standard protocol frame, the compatibility coefficient corresponding to the compatibility of the frame structure in the non-standard protocol frame with the industrial communication protocol variation, and the accuracy coefficient corresponding to the degree of influence of the adjustment of the industrial communication protocol parsing rules on the accuracy of the industrial communication protocol parsing are normalized respectively, and the consistency score, compatibility coefficient and accuracy coefficient obtained after the normalization process are calculated to obtain the reliability index; The calculation formula of reliability index is: Among them, RI is the reliability index; ACO is the accuracy coefficient; CCF is the compatibility coefficient; CS is the consistency score of key communication parameters; α, β, γ are weight coefficients; A reliability index threshold is preset, and the reliability index is compared with the reliability index threshold: When the reliability index is greater than or equal to the reliability index threshold, the reliability of the industrial communication protocol parsing strategy is high reliability; When the reliability index is less than the reliability index threshold, the reliability of the industrial communication protocol parsing strategy is low reliability.

Citation Information

Cited By

  • Pole-mounted circuit breaker primary and secondary fusion intelligent monitoring method based on Internet of Things

    CN120566693A

  • Iot-based pole-mounted circuit breaker primary and secondary fusion intelligent monitoring method

    CN120566693B