CN113923268B - Resolution method, device and storage medium for multi-version communication protocol - Google Patents

Resolution method, device and storage medium for multi-version communication protocol Download PDF

Info

Publication number
CN113923268B
CN113923268B CN202111049201.7A CN202111049201A CN113923268B CN 113923268 B CN113923268 B CN 113923268B CN 202111049201 A CN202111049201 A CN 202111049201A CN 113923268 B CN113923268 B CN 113923268B
Authority
CN
China
Prior art keywords
rule
initial
rule set
communication protocol
rules
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111049201.7A
Other languages
Chinese (zh)
Other versions
CN113923268A (en
Inventor
马景行
蔡富东
孔志强
李在学
陈雷
王海慧
朱朋
韩振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Senter Electronic Co Ltd
Original Assignee
Shandong Senter Electronic Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Senter Electronic Co Ltd filed Critical Shandong Senter Electronic Co Ltd
Priority to CN202111049201.7A priority Critical patent/CN113923268B/en
Publication of CN113923268A publication Critical patent/CN113923268A/en
Application granted granted Critical
Publication of CN113923268B publication Critical patent/CN113923268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The embodiment of the application provides an analysis method, equipment and a storage medium for a multi-version communication protocol, which solve the technical problem that a large amount of analysis resources are wasted in the existing multi-version communication protocol analysis method. The method comprises the following steps: dividing an initial rule in the multi-version communication protocol into a plurality of initial rule sets; determining a difference rule set and the same rule set in a plurality of initial rule sets, and determining a first rule set based on the difference rule set; generalizing the initial rules in the first rule set to obtain a second rule set; instantiating the second rule set based on instantiation parameters corresponding to the communication protocol version to be resolved stored in a preset difference rule parameter library to obtain a difference rule set to be resolved; the protocol analysis model analyzes the difference rule set to be analyzed and the solidification rule set, and achieves analysis of the communication protocol version to be analyzed. The method solves the problem that the multi-version communication protocol analysis method wastes analysis resources.

Description

Resolution method, device and storage medium for multi-version communication protocol
Technical Field
The present application relates to the field of communications protocols, and in particular, to a method, an apparatus, and a storage medium for resolving a multi-version communication protocol.
Background
The communication protocol is a series of conventions that two parties should commonly adhere to in order to ensure that two parties in communication in a data communication system can communicate efficiently and reliably, comprising: data format, sequence and rate, link management, flow regulation, error control, etc. With the development of modern communication technology and computer network technology, communication protocols are also iterating continuously with the development of technology.
The existing multi-version communication protocol analysis method is that communication protocols of different versions are dispersed in different protocol analysis models, so that a large amount of protocol analysis model resources are wasted, and the later maintenance cost is increased. In addition, when a new version of the communication convention needs to be developed, the new version of the convention needs to be developed from scratch, resulting in a great deal of repetitive work.
Disclosure of Invention
The embodiment of the application provides an analysis method, equipment and a storage medium for a multi-version communication protocol, which solve the technical problem that a large amount of analysis resources are wasted in the existing multi-version communication protocol analysis method.
In a first aspect, an embodiment of the present application provides a method for parsing a multi-version communication protocol, where the method includes: analyzing and extracting initial rules in a preset number of communication protocol versions, and dividing the initial rules in the preset number of communication protocol versions into a plurality of initial rule sets based on preset rule identifiers in the initial rules; determining a difference rule set and the same rule set in a plurality of initial rule sets, adding any one of the difference rule sets into the first rule set, and adding any one of the same rule sets into the solidification rule set; performing generalization processing on the initial rules in the first rule set, and adding the obtained generalization rules into the second rule set; under the condition that the protocol analysis model needs to analyze the communication protocol version to be analyzed, carrying out instantiation processing on generalized rules in the second rule set based on instantiation parameters corresponding to the communication protocol version to be analyzed stored in a preset difference rule parameter library so as to obtain a difference rule set to be analyzed; resolving the difference rule set to be resolved and the solidification rule set based on the protocol resolution model so as to achieve resolution of the communication protocol version to be resolved; the difference rule set to be analyzed and the solidification rule set jointly form a communication protocol version to be analyzed.
According to the embodiment of the application, the initial rules in the multi-version communication protocol are extracted, and the initial rules in the multi-version communication protocol are processed to obtain the generalized rule set corresponding to the initial rules with differences, namely the second rule set, and the solidified rule set with the same rule content in each version of communication protocol, so that the protocol analysis model is separated from the constraint of the version, and analysis can be performed on the multi-version communication protocol.
In one implementation of the present application, analyzing and extracting an initial rule in a preset number of communication protocol versions, and dividing the initial rule in the preset number of communication protocol versions into a plurality of initial rule sets based on a preset rule identifier in the initial rule, specifically including: analyzing the initial rules in any communication protocol version to determine corresponding preset rule identifiers contained in each initial rule in any communication protocol version, and establishing a plurality of initial rule sets named by the preset rule identifiers based on the preset rule identifiers in each initial rule; extracting initial rules in any communication protocol version into a plurality of corresponding initial rule sets; traversing other communication protocol versions except any one of the preset number of communication protocol versions to extract initial rules in the other communication protocol versions into a plurality of corresponding initial rule sets; under the condition that preset rule identifiers corresponding to any one of the preset initial rule are in the preset number of communication protocol versions and cannot be matched with a plurality of initial rule sets, an initial rule set named by the preset rule identifier corresponding to any one of the initial rule is established based on the preset rule identifiers corresponding to any one of the initial rule, and any one of the initial rule is extracted into the initial rule set.
In one implementation of the present application, determining a difference rule set and the same rule set in a plurality of initial rule sets specifically includes: determining the number of the initial rules in any initial rule set, and matching the rule content of any initial rule in any initial rule set with the rule content of other initial rules one by one; under the condition that the number of the initial rules in any initial rule set is smaller than the preset number, determining any initial rule set as a difference rule set; determining any initial rule set as a difference rule set under the condition that the rule contents of any two initial rules are different and the number of the initial rules is equal to the preset number in any initial rule set; and under the condition that the rule content of all the initial rules in any initial rule set is the same and the number of the initial rules is equal to the preset number, determining any initial rule set as the same rule set.
In one implementation of the present application, before generalizing the initial rule in the first rule set, the method further comprises: word classification is carried out on the initial rules in the first rule set so as to determine a plurality of word corresponding to the initial rules; wherein the types of the word cards comprise any one or more of the following: words, numbers, symbols, marks; performing aggregation processing on a plurality of word cards corresponding to the initial rule to generate a first word card sequence; the word card sequence comprises a plurality of word cards and association relations among the word cards.
In one implementation of the present application, generalizing the initial rule in the first rule set specifically includes: determining a first parameter word in the first word sequence based on the association relation among the words in the first word sequence; generalizing the first parameter word to generate a second word sequence; the generalization processing is to replace the first parameter word with the parameter to be instantiated; and performing inverse word processing on the second word card sequence to convert the second word card sequence into a generalization rule.
In one implementation of the present application, after adding the resulting generalized rule to the second rule set, the method further comprises: classifying the initial rules in the difference rule set to determine second parameter word cards corresponding to the initial rules in the difference rule set; classifying the second parameter word corresponding to the difference rule set according to the communication protocol version, generating a preset number of difference rule parameter sets, and storing the preset number of difference rule parameter sets in a preset difference rule parameter library.
In one implementation manner of the present application, based on an instantiation parameter corresponding to a communication protocol version to be resolved stored in a preset difference rule parameter library, instantiating a generalization rule in a second rule set to obtain a difference rule set to be resolved, including: responding to a communication protocol version analysis signal to be analyzed, determining a generalization rule to be instantiated in a second rule set, and determining a corresponding difference rule parameter set in a preset difference rule parameter library; and carrying out instantiation assignment on parameters to be instantiated in the generalization rule to be instantiated based on the parameter values stored in the difference rule parameter set so as to obtain a difference rule set to be analyzed.
In one implementation of the present application, the method further comprises: in the case that a new version of the communication protocol needs to be developed, determining whether an initial rule contained in the solidified rule set is the same as a rule needed in the communication protocol to be developed or not based on the requirement information corresponding to the communication protocol to be developed, and determining whether all generalized rules needed by the communication protocol to be developed are contained in the second rule set or not; under the condition that the initial rules contained in the solidified rule set are the same as the rules required in the communication protocol to be developed, and the second rule set contains all generalization rules required by the communication protocol to be developed, determining a difference rule parameter set corresponding to the communication protocol to be developed based on the requirement information corresponding to the communication protocol to be developed, and storing the difference rule parameter set in a preset difference rule parameter library; under the condition that the initial rules contained in the solidified rule set are different from the rules required in the communication protocol to be developed, performing generalization processing on the corresponding initial rules in the solidified rule set, adding the corresponding generalization rules into the second rule set, and deleting the corresponding initial rules in the solidified rule set; and under the condition that the second rule set does not contain all the generalization rules of the requirements of the communication protocol to be developed, determining new generalization rules based on the requirement information corresponding to the communication protocol to be developed, and adding the new generalization rules into the second rule set.
The analysis of the multi-version communication protocol provided by the embodiment of the application can also simplify the development of the new version communication protocol, does not need to carry out a great deal of repeated work like the development of the version communication protocol, gradually improves the second rule set along with the addition of the version of the realized communication protocol, and reduces the generalization rules and even does not need to improve the second rule set when a communication protocol is newly added. When the rule set is not required to be perfected, a new communication protocol is added, and only the parameters to be instantiated are required to be added into a preset difference rule parameter library, so that the addition of a new version of communication protocol can be realized.
In a second aspect, an embodiment of the present application further provides an parsing apparatus for a multi-version communication protocol, which is characterized by including: a processor; and a memory having executable code stored thereon that, when executed, causes the processor to perform a method of developing a communication protocol as claimed in any one of claims 1 to 8.
In a third aspect, embodiments of the present application further provide a non-volatile computer storage medium storing computer executable instructions for resolution of a multi-version communication protocol, wherein the computer executable instructions are configured to: analyzing and extracting initial rules in a preset number of communication protocol versions, and dividing the initial rules in the preset number of communication protocol versions into a plurality of initial rule sets based on preset rule identifiers in the initial rules; determining a difference rule set and the same rule set in a plurality of initial rule sets, adding any one of the difference rule sets into the first rule set, and adding any one of the same rule sets into the solidification rule set; performing generalization processing on the initial rules in the first rule set, and adding the obtained generalization rules into the second rule set; under the condition that the protocol analysis model needs to analyze the communication protocol version to be analyzed, carrying out instantiation processing on generalized rules in the second rule set based on instantiation parameters corresponding to the communication protocol version to be analyzed stored in a preset difference rule parameter library so as to obtain a difference rule set to be analyzed; resolving the difference rule set to be resolved and the solidification rule set based on the protocol resolution model so as to achieve resolution of the communication protocol version to be resolved; the difference rule set to be analyzed and the solidification rule set jointly form a communication protocol version to be analyzed.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a flow chart of an analysis method for multi-version communication protocol according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an parsing device for multi-version communication protocol according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The embodiment of the application provides an analysis method, equipment and a storage medium for a multi-version communication protocol, which solve the technical problem that a large amount of analysis resources are wasted in the existing multi-version communication protocol analysis method.
The following describes the technical scheme provided by the embodiment of the application in detail through the attached drawings.
Fig. 1 is a flowchart of an parsing method for a multi-version communication protocol according to an embodiment of the present application. As shown in fig. 1, the method for resolving multi-version communication protocols provided by the embodiment of the application specifically includes the following steps:
step 101, analyzing and extracting initial rules in a preset number of communication protocol versions, and dividing the initial rules in the preset number of communication protocol versions into a plurality of initial rule sets based on preset rule identifiers in the initial rules.
It should be noted that, in the embodiment of the present application, the number of resolved versions of the multi-version communication protocol should be greater than or equal to two. Because the compatibility problem is not required to be considered under the condition that the communication protocol has only one version, the communication protocol is processed through a protocol analysis model, and therefore, the analysis method of the multi-version communication protocol provided by the application is not required.
A communication protocol, which is a series of conventions that two parties of a communication in a data communication system should commonly adhere to in order to ensure that the parties can communicate efficiently and reliably, comprising: data format, sequence and rate, link management, flow regulation, error control, etc. Therefore, the communication protocol is composed of a plurality of rules, each rule corresponds to a unique rule type in the communication protocol version, and a preset rule identifier corresponding to the type is also arranged in the rules. In the embodiment of the application, the rules in the preset number of communication protocol versions are called initial rules, namely rules which are not processed by the method provided by the embodiment of the application.
Under the condition that the analysis versions of the communication protocol are the preset number (the preset number is more than or equal to two), the establishment of the initial rule set can firstly analyze any one of the preset number of communication protocol versions, then obtain a plurality of preset rule identifications according to analyzing any one of the communication protocol versions, and establish a plurality of initial rule sets based on the preset rule identifications. Then extracting the initial rule in any communication protocol version into a plurality of corresponding initial rule sets; and traversing other communication protocol versions except any one of the preset number of communication protocol versions to extract the initial rules in the other communication protocol versions into a corresponding plurality of initial rule sets. When preset rule identifiers corresponding to any one of the initial rule are in the preset number of communication protocol versions, and cannot be matched with the plurality of initial rule sets, an initial rule set named by the preset rule identifier corresponding to any one of the initial rule is established based on the preset rule identifier corresponding to any one of the initial rule, and any one of the initial rule is extracted into the initial rule set.
In the embodiments of the present application, the following examples are explained in detail.
Example one: the preset number of the analysis versions of the communication protocol is two, and the two versions of the communication protocol are respectively named as communication protocol 1.0 and communication protocol 2.0. The communication protocol 1.0 comprises two rules, and preset rule identifiers are respectively in a data format and a network connection mode; the communication protocol 2.0 comprises three rules, and preset rule identifiers are respectively a data format, a network connection mode and a verification mode. When the initial rule set is established, firstly, any communication protocol version in the communication protocol 1.0 and the communication protocol 2.0 is analyzed, and if the any communication protocol version is the communication protocol 1.0, the communication protocol version is analyzed to obtain two preset protocol identification data formats and network connection modes. Then, two initial rule sets are established according to the two preset protocol identifications, the two initial rule sets are respectively named as a data format rule set and a network connection mode rule set, and then the two rules in the communication protocol 1.0 are respectively added into the corresponding initial rule sets. The remaining communication protocol version, in this case communication protocol 2.0, is then traversed. Analyzing the communication protocol 2.0, determining that two initial rules of a data format and a network connection mode exist in the communication protocol 2.0, and respectively adding the two initial rules into two corresponding data format rule sets and network connection mode rule sets. An initial rule with a preset rule identifier as a verification mode also exists in the communication protocol 2.0, and the preset rule identifier is not matched with the data format and the network connection mode, so that an initial rule set named as a rule set of the verification mode is established based on the preset rule identifier of the verification mode to store the initial rule.
Step 102, determining a difference rule set and the same rule set in a plurality of initial rule sets, adding any one of the difference rule sets into the first rule set, and adding any one of the same rule sets into the solidified rule set.
In one embodiment of the present application, after dividing the initial rules in the preset number of communication protocol versions into a plurality of initial rule sets, it is necessary to determine whether each initial rule set is a difference rule set or the same rule set. It should be noted that the same rule set is a corresponding initial rule set in which the rule content of all initial rules in the rule set is the same and the number of the initial rules is equal to the preset number; the set of difference rules includes two types: the number of the initial rules is smaller than the preset number of the corresponding initial rule sets, and the corresponding initial rule sets with different rule contents of the two initial rules exist.
Specifically, the number of initial rules in any initial rule set is first determined, and if the number of initial rules in any initial rule set is smaller than a preset number, any initial rule set is determined to be a difference rule set.
It will be appreciated that, since the number of initial rules in any of the above initial rule sets is less than the preset number, there are at least one communication protocol version for which there is no initial rule corresponding to any of the above initial rule sets, and thus, the initial rule of this type is not applicable to all communication protocol versions, and thus, the initial rule set is a difference rule set.
And under the condition that the number of the initial rules in any initial rule set is equal to the preset number, matching the rule content of any initial rule in any initial rule set with the rule content of other initial rules one by one. When the rule content of all the initial rules in any initial rule set is the same, determining that any initial rule set is the same rule set; when the rule content of any two initial rules in any initial rule set is different, determining that any initial rule set is a difference rule set.
In the embodiment of the present application, the following second embodiment is used for explanation. The second example is an extension of the first example.
Example two: assume that the rule contents of two initial rules in the communication protocol 1.0 are respectively: "data type: the data type is ' message type ', and the message comprises ' message sequence number ', ' message content ', ' message tail ', ' network connection mode: the terminals are connected by 'TCP'. Assume that the rule contents of three initial rules in the communication protocol 2.0 are respectively: "data type: the data type is ' message type ', and the message comprises ' message sequence number ', ' message content ', ' message tail ', ' network connection mode: the terminals adopt ' UDP connection ' "and ' check mode: the checking mode is 'cyclic redundancy check'. Thus, the two initial rules contained in the data type rule set are: "data type: the data type is 'message type', and the message comprises 'message sequence number', 'message content', 'message tail', 'data type': the data type is 'message type', and the message comprises 'message sequence number', 'message content', 'message tail'; the two initial rules contained in the network connection mode rule set are: "network connection mode: the terminals adopt ' TCP connection ' "and ' network connection modes: the terminals are connected by adopting UDP connection'; one rule contained in the check mode rule set is: the "check mode is 'cyclic redundancy check'. Therefore, the number of the initial rules in the check mode rule set is smaller than the preset number two, and the check mode rule set is determined to be a difference rule set. Because the number of the initial rules in the data type rule set and the network connection mode rule set is equal to the preset number two, the initial rules in the two initial rule sets are respectively and randomly matched and judged, and whether two initial rules with different rule contents exist or not. Because the data type rule set and the network connection mode rule set have only two rules, the rule contents of the two initial rules in the data type rule set are the same through matching, and the rule contents of the two initial rules in the network connection mode rule set are different. Therefore, the data type rule set is determined to be the same rule set, and the network connection mode rule set is determined to be the difference rule set.
After determining a difference rule set of the plurality of initial rule sets and the same rule set, adding any one of the difference rule sets to the first rule set, and adding any one of the same rule sets to the solidified rule set.
In the embodiment of the present application, the following example three is explained in detail. The third example is an extension of the second example.
Example three: since the initial rules in the same rule set are all the same, the set of curing rules contains one initial rule: "data type: the data type is 'message type', and the message comprises 'message serial number', 'message content', 'message tail'. Since any one of the initial rules in the difference rule set is selected to be added to the first rule set, one initial rule may be optionally extracted into the first rule set, where the initial rules included in the first rule set are set as follows: "network connection mode: the terminals adopt ' UDP connection ' "and ' check mode: the checking mode is 'cyclic redundancy check'.
And 103, performing generalization processing on the initial rules in the first rule set, and adding the obtained generalization rules into the second rule set.
In one embodiment of the present application, before generalizing an initial rule in a first rule set, word classification is first required for the initial rule in the first rule set to determine a plurality of word corresponding to the initial rule in the first rule set; wherein the types of the word cards comprise any one or more of the following: words, numbers, symbols, marks; after classifying the word cards in the first rule set, the first rule set is in a disordered state, so that a plurality of word cards corresponding to the initial rule are required to be subjected to aggregation processing to generate a first word card sequence. It should be noted that, the aggregation processing is to integrate a plurality of word cards corresponding to the same initial rule to obtain a first word card sequence with a sequence of existence; the word card sequence comprises a plurality of word cards and the association relation among the word cards; the association relation among the word cards at least comprises the front-back sequence among the word cards.
In one embodiment of the present application, the generalization process is performed after the initial rule in the first rule set is classified into a word or a tablet, specifically: determining a first parameter word in the first word sequence based on the association relation among the words in the first word sequence; generalizing the first parameter word to generate a second word sequence; the generalization processing is to replace the first parameter word with the parameter to be instantiated; and then performing inverse word processing on the second word card sequence to convert the second word card sequence into a generalization rule. It should be noted that, the parameter word is a word representing an initial rule parameter in the first word sequence; reverse word processing is the process of converting a second word sequence into generalized rules.
In the embodiment of the present application, the following example four is explained in detail. The fourth example is an extension of the third example.
Example four: since the initial rules contained in the first rule set are: "network connection mode: the terminals adopt ' UDP connection ' "and ' check mode: the checking mode is 'cyclic redundancy check'. The word cards in the first rule set after word card classification are included in the first rule set: ", network connection mode,": terminal, gateway, use, ', UDP, connection,', ", check mode,: verification means, ', cyclic, redundant, verification,', ". In this example, the leading number of the double leading number may be used as the first word sign of the first word sign sequence, so that two first word sign sequences may be obtained: ", network connection mode,": terminal, gateway, application, ', UDP, connection,', "and" check mode,: verification means, ', cyclic, redundant, verification,', ". In this example, two mono-quotation marks are used as the front and back marks of the parameter marks, and the mark content between the two mono-quotation marks is determined to be the parameter mark. It should be noted that, as can be understood from the above word classification, since the word classification process is based on the meaning and type of the word, there is a case where the parameter is divided into a plurality of words, and therefore, when the generalization processing is performed, a plurality of words between two mono-numbered words may be replaced by one word. In this example, two second word sequences obtained by the following alternatives are given: ", network connection mode,": terminal, gateway, adoption, ', network connection mode parameters 1, ' AND ', verification mode,: checking mode, i.e., checking mode parameters 1,', ". And performing inverse word processing on the two second word card sequences to convert the second word card sequences into generalization rules, and adding the generalization rules to the second rule set. In this example, the two generalization rules are: "network connection mode: the terminals adopt network connection mode parameters 1' "and check modes: the verification mode is 'verification mode parameter 1' ".
It should be further noted that, because the instantiation parameters in the initial rule cannot be directly determined in the processing process of the processor, the embodiment of the application enables the processor to determine the instantiation parameters in the initial rule by using the word-board classification method, thereby realizing the process of replacing the instantiation parameters in the initial rule with the parameters to be instantiated, and generating the generalization rule. Wherein the instantiation parameter is a parameter with specific assignment; the parameters to be instantiated are parameters that have no specific assignment.
In one embodiment of the present application, after the obtained generalization rule is added to the second rule set, parameters in the difference rule set need to be extracted and stored in a preset difference rule parameter library, so that the generalization rule can replace parameters to be instantiated with instantiation parameters during parsing.
Specifically: firstly, classifying word cards of initial rules in a difference rule set to determine second parameter word cards corresponding to each initial rule in the difference rule set; and classifying the second parameter word corresponding to the difference rule set according to the communication protocol version to generate a preset number of difference rule parameter sets, and storing the preset number of difference rule parameter sets in a preset difference rule parameter library.
In the embodiment of the present application, the following fifth embodiment is explained in detail. The fifth embodiment is an extension of the second embodiment.
Example five: the two difference rule sets are respectively a network connection mode rule set: "network connection mode: the terminals adopt ' TCP connection ' "and ' network connection modes: the terminals adopt 'UDP connection' "and a check mode rule set: the "check mode is 'cyclic redundancy check'. The word classification process of the difference rule set is not performed any more, and it can be understood that the second parameter word obtained after word classification includes: TCP connection, UDP connection, cyclic redundancy check. Because the three parameter word cards respectively correspond to the two versions of the communication protocol, the three parameter word cards need to be classified according to the versions of the communication protocol, and a preset number of difference rule parameter sets are generated for distinguishing. In this example, two differential rule parameter sets are determined to be a communication protocol 1.0 differential rule parameter set and a communication protocol 2.0 differential rule parameter set, respectively, so that the communication protocol 1.0 differential rule parameter set includes one instantiation parameter of a TCP connection, and the communication protocol 2.0 differential rule parameter set includes two instantiation parameters of a UDP connection and a cyclic redundancy check. After determining the communication protocol 1.0 difference rule parameter set and the communication protocol 2.0 difference rule parameter set, the two parameter sets are stored in a preset difference rule parameter library. The preset difference rule parameter library is a database for storing the instantiation parameters corresponding to each initial rule in the difference rule set.
Step 104, under the condition that the protocol analysis model needs to analyze the communication protocol version to be analyzed, carrying out instantiation processing on the generalized rule in the second rule set based on the instantiation parameter corresponding to the communication protocol version to be analyzed stored in the preset difference rule parameter library so as to obtain the difference rule set to be analyzed.
In one embodiment of the application, when two terminals need to communicate according to the communication protocol version to be resolved, responding to the analysis signal of the communication protocol version to be resolved, determining a generalization rule to be instantiated in a second rule set, and determining a corresponding difference rule parameter set in a preset difference rule parameter library; and carrying out instantiation assignment on parameters to be instantiated in the generalization rule to be instantiated based on the parameter values stored in the difference rule parameter set so as to obtain a difference rule set to be analyzed. It should be noted that the communication protocol version analysis signal to be analyzed includes required rule information for determining a required generalization rule in the second rule set and a corresponding difference rule parameter set in the preset difference rule parameter library.
In the embodiment of the present application, the following example six is explained in detail. The sixth embodiment is an extension of the fourth and fifth embodiments.
Example six: assuming that the version of the communication protocol to be analyzed is 1.0 of the communication protocol, after the analysis signal of the communication protocol 1.0 is obtained, determining that the generalization rule to be instantiated in the second rule set is a network connection mode based on the generalization rule requirement information in the analysis signal of the communication protocol 1.0: and the terminals adopt a network connection mode parameter 1' ", and the difference rule parameter set is determined to be a communication protocol 1.0 difference rule parameter set. And carrying out instantiation assignment on parameters to be instantiated in the generalization rule to be instantiated so as to obtain a difference rule set to be analyzed. It can be understood that, in this example, the to-be-parsed difference rule set includes only one rule "network connection mode: the terminals are connected by 'TCP'.
And 105, analyzing the difference rule set to be analyzed and the solidification rule set based on the protocol analysis model so as to realize analysis of the communication protocol version to be analyzed.
It can be appreciated that the instantiated set of difference rules to be resolved and the solidified set of rules together form a version of the communication protocol to be resolved. The protocol analysis model analyzes the difference rule set to be analyzed and the solidification rule set according to the rule set to be analyzed, and the effect of analyzing the communication protocol version to be analyzed can be achieved.
Based on the same inventive concept, the embodiment of the application also provides a parsing device for multi-version communication protocol, and the internal structure of the parsing device is shown in fig. 2.
Fig. 2 is a schematic diagram of an internal structure of an parsing device for multi-version communication protocol according to an embodiment of the present application. As shown in fig. 2, the apparatus includes: a processor 201; the memory 202 has stored thereon executable instructions that, when executed, cause the processor 201 to perform a parsing method for multi-version communication protocols as described above.
In one embodiment of the present application, the processor 201 is configured to parse and extract an initial rule in a preset number of communication protocol versions, and divide the initial rule in the preset number of communication protocol versions into a plurality of initial rule sets based on a preset rule identifier in the initial rule; determining a difference rule set and the same rule set in a plurality of initial rule sets, adding any one of the difference rule sets into the first rule set, and adding any one of the same rule sets into the solidification rule set; performing generalization processing on the initial rules in the first rule set, and adding the obtained generalization rules into the second rule set; under the condition that the protocol analysis model needs to analyze the communication protocol version to be analyzed, carrying out instantiation processing on generalized rules in the second rule set based on instantiation parameters corresponding to the communication protocol version to be analyzed stored in a preset difference rule parameter library so as to obtain a difference rule set to be analyzed; resolving the difference rule set to be resolved and the solidification rule set based on the protocol resolution model so as to achieve resolution of the communication protocol version to be resolved; the difference rule set to be analyzed and the solidification rule set jointly form a communication protocol version to be analyzed.
Some embodiments of the application provide a non-volatile computer storage medium corresponding to the resolution of fig. 1 for a multi-version communication protocol, storing computer executable instructions configured to:
analyzing and extracting initial rules in a preset number of communication protocol versions, and dividing the initial rules in the preset number of communication protocol versions into a plurality of initial rule sets based on preset rule identifiers in the initial rules;
determining a difference rule set and the same rule set in a plurality of initial rule sets, adding any one of the difference rule sets into the first rule set, and adding any one of the same rule sets into the solidification rule set;
performing generalization processing on the initial rules in the first rule set, and adding the obtained generalization rules into the second rule set;
under the condition that the protocol analysis model needs to analyze the communication protocol version to be analyzed, carrying out instantiation processing on generalized rules in the second rule set based on instantiation parameters corresponding to the communication protocol version to be analyzed stored in a preset difference rule parameter library so as to obtain a difference rule set to be analyzed;
Resolving the difference rule set to be resolved and the solidification rule set based on the protocol resolution model so as to achieve resolution of the communication protocol version to be resolved; the difference rule set to be analyzed and the solidification rule set jointly form a communication protocol version to be analyzed.
The embodiments of the present application are described in a progressive manner, and the same and similar parts of the embodiments are all referred to each other, and each embodiment is mainly described in the differences from the other embodiments. In particular, for the internet of things device and the medium embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and the relevant points are referred to in the description of the method embodiment.
The system, the medium and the method provided by the embodiment of the application are in one-to-one correspondence, so that the system and the medium also have similar beneficial technical effects to the corresponding method, and the beneficial technical effects of the method are explained in detail above, so that the beneficial technical effects of the system and the medium are not repeated here.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (10)

1. A method of parsing a multi-version communication protocol, the method comprising:
analyzing and extracting initial rules in a preset number of communication protocol versions, and dividing the initial rules in the preset number of communication protocol versions into a plurality of initial rule sets based on preset rule identifiers in the initial rules;
Determining a difference rule set and the same rule set in the plurality of initial rule sets, adding any one of the difference rule sets into the first rule set, and adding any one of the same rule sets into the solidification rule set;
the same rule set is a corresponding initial rule set with the same rule content of all initial rules in the rule set and the number of the initial rules being equal to the preset number; the set of difference rules includes two types: corresponding initial rule sets with the initial rule number smaller than the preset number and corresponding initial rule sets with different rule contents of the two initial rules; the solidification rule set comprises any one initial rule in the same rule set;
performing generalization processing on the initial rules in the first rule set, and adding the obtained generalization rules into a second rule set;
under the condition that the protocol analysis model needs to analyze the communication protocol version to be analyzed, carrying out instantiation processing on generalized rules in the second rule set based on instantiation parameters corresponding to the communication protocol version to be analyzed stored in a preset difference rule parameter library so as to obtain a difference rule set to be analyzed;
Analyzing the difference rule set to be analyzed and the solidification rule set based on the protocol analysis model so as to realize analysis of the communication protocol version to be analyzed; the to-be-analyzed difference rule set and the solidification rule set jointly form the to-be-analyzed communication protocol version.
2. The method for resolving multi-version communication protocol according to claim 1, wherein resolving and extracting initial rules in a preset number of communication protocol versions, and dividing the initial rules in the preset number of communication protocol versions into a plurality of initial rule sets based on preset rule identifications in the initial rules, specifically comprises:
analyzing initial rules in any communication protocol version to determine corresponding preset rule identifiers contained in each initial rule in any communication protocol version, and establishing a plurality of initial rule sets named by the preset rule identifiers based on the preset rule identifiers in each initial rule;
extracting initial rules in any communication protocol version into a plurality of corresponding initial rule sets;
traversing other communication protocol versions except any one of the preset number of communication protocol versions to extract initial rules in the other communication protocol versions into a plurality of corresponding initial rule sets;
Under the condition that preset rule identifiers corresponding to any one of the preset number of communication protocol versions cannot be matched with the plurality of initial rule sets, an initial rule set named by the preset rule identifier corresponding to any one of the initial rules is established based on the preset rule identifier corresponding to any one of the initial rules, and any one of the initial rules is extracted into the initial rule set.
3. The method for resolving multi-version communication protocol according to claim 1, wherein determining a difference rule set and a same rule set in the plurality of initial rule sets specifically comprises:
determining the number of initial rules in any initial rule set, and matching the rule content of any initial rule in any initial rule set with the rule content of other initial rules one by one;
determining that any initial rule set is a difference rule set under the condition that the number of the initial rules in any initial rule set is smaller than the preset number;
determining any initial rule set as a difference rule set under the condition that the rule contents of any two initial rules are different and the number of the initial rules is equal to the preset number in any initial rule set;
And determining that any initial rule set is the same rule set under the condition that the rule content of all initial rules in any initial rule set is the same and the number of the initial rules is equal to the preset number.
4. The method of claim 1, wherein prior to generalizing the initial rules in the first rule set, the method further comprises:
word classification is carried out on the initial rules in the first rule set so as to determine a plurality of word cards corresponding to the initial rules; wherein the types of the word cards comprise any one or more of the following: words, numbers, symbols, marks;
performing aggregation processing on a plurality of word cards corresponding to the initial rule to generate a first word card sequence; the word card sequence comprises a plurality of word cards and association relations among the word cards.
5. The method for resolving multi-version communication protocol according to claim 4, wherein generalizing the initial rule in the first rule set specifically comprises:
determining a first parameter word in the first word sequence based on the association relation among the words in the first word sequence;
Generalizing the first parameter word card to generate a second word card sequence; the generalization processing is to replace the first parameter word with a parameter to be instantiated;
and performing inverse word processing on the second word card sequence to convert the second word card sequence into a generalization rule.
6. The method of claim 5, wherein after adding the generalized rule to the second rule set, the method further comprises:
word classification is carried out on the initial rules in the difference rule set so as to determine second parameter word corresponding to each initial rule in the difference rule set;
classifying the second parameter word corresponding to the difference rule set according to the communication protocol version, generating a preset number of difference rule parameter sets, and storing the preset number of difference rule parameter sets in a preset difference rule parameter library.
7. The method for resolving a multi-version communication protocol according to claim 6, wherein the method for resolving a generalized rule in the second rule set based on an instantiation parameter corresponding to a version of the communication protocol to be resolved stored in a preset difference rule parameter library, comprises:
Responding to a communication protocol version analysis signal to be analyzed, determining a generalization rule to be instantiated in the second rule set, and determining a corresponding difference rule parameter set in the preset difference rule parameter library;
and carrying out instantiation assignment on parameters to be instantiated in the generalization rule to be instantiated based on the parameter values stored in the difference rule parameter set so as to obtain a difference rule set to be analyzed.
8. The method of claim 1, further comprising:
in the case that a new version of the communication protocol needs to be developed, determining whether an initial rule contained in the solidified rule set is the same as a rule required in the communication protocol to be developed or not based on requirement information corresponding to the communication protocol to be developed, and determining whether all generalized rules required by the communication protocol to be developed are contained in the second rule set or not;
under the condition that the initial rules contained in the solidified rule set are the same as the rules required in the communication protocol to be developed, and the second rule set contains all generalization rules required by the communication protocol to be developed, determining a difference rule parameter set corresponding to the communication protocol to be developed based on the requirement information corresponding to the communication protocol to be developed, and storing the difference rule parameter set in a preset difference rule parameter library;
Under the condition that the initial rules contained in the solidified rule set are different from the rules required in the communication protocol to be developed, performing generalization processing on the corresponding initial rules in the solidified rule set, adding the corresponding generalization rules into a second rule set, and deleting the corresponding initial rules in the solidified rule set;
and under the condition that the second rule set does not contain all generalization rules of the requirements of the communication protocol to be developed, determining newly added generalization rules based on the requirement information corresponding to the communication protocol to be developed, and adding the newly added generalization rules into the second rule set.
9. A resolution device for a multi-version communication protocol, comprising:
a processor;
and a memory having executable code stored thereon that, when executed, causes the processor to perform a parsing method for a multi-version communication protocol as claimed in any one of claims 1 to 8.
10. A non-volatile computer storage medium storing computer executable instructions for resolution of a multi-version communication protocol, the computer executable instructions configured to:
Analyzing and extracting initial rules in a preset number of communication protocol versions, and dividing the initial rules in the preset number of communication protocol versions into a plurality of initial rule sets based on preset rule identifiers in the initial rules;
determining a difference rule set and the same rule set in the plurality of initial rule sets, adding any one of the difference rule sets into the first rule set, and adding any one of the same rule sets into the solidification rule set;
the same rule set is a corresponding initial rule set with the same rule content of all initial rules in the rule set and the number of the initial rules being equal to the preset number; the set of difference rules includes two types: corresponding initial rule sets with the initial rule number smaller than the preset number and corresponding initial rule sets with different rule contents of the two initial rules; the solidification rule set comprises any one initial rule in the same rule set;
performing generalization processing on the initial rules in the first rule set, and adding the obtained generalization rules into a second rule set;
Under the condition that the protocol analysis model needs to analyze the communication protocol version to be analyzed, carrying out instantiation processing on generalized rules in the second rule set based on instantiation parameters corresponding to the communication protocol version to be analyzed stored in a preset difference rule parameter library so as to obtain a difference rule set to be analyzed;
analyzing the difference rule set to be analyzed and the solidification rule set based on the protocol analysis model so as to realize analysis of the communication protocol version to be analyzed; the to-be-analyzed difference rule set and the solidification rule set jointly form the to-be-analyzed communication protocol version.
CN202111049201.7A 2021-09-08 2021-09-08 Resolution method, device and storage medium for multi-version communication protocol Active CN113923268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111049201.7A CN113923268B (en) 2021-09-08 2021-09-08 Resolution method, device and storage medium for multi-version communication protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111049201.7A CN113923268B (en) 2021-09-08 2021-09-08 Resolution method, device and storage medium for multi-version communication protocol

Publications (2)

Publication Number Publication Date
CN113923268A CN113923268A (en) 2022-01-11
CN113923268B true CN113923268B (en) 2023-11-14

Family

ID=79234178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111049201.7A Active CN113923268B (en) 2021-09-08 2021-09-08 Resolution method, device and storage medium for multi-version communication protocol

Country Status (1)

Country Link
CN (1) CN113923268B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116540978A (en) * 2022-01-21 2023-08-04 华为云计算技术有限公司 Formal specification recommendation method, device and system
CN115022422B (en) * 2022-06-16 2023-05-30 上海博般数据技术有限公司 Real-time data processing system and method for Internet of things

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104142888A (en) * 2014-07-14 2014-11-12 北京理工大学 Regularization state machine model design method with stateful protocol
CN108390877A (en) * 2018-02-26 2018-08-10 阳光电源股份有限公司 Communication protocol conversion method and communication protocol converter
CN109325058A (en) * 2018-09-03 2019-02-12 中国平安人寿保险股份有限公司 Regular batch comparison method, device, computer equipment and storage medium
CN109597652A (en) * 2018-10-31 2019-04-09 益和电气集团股份有限公司 Specification analytic method, system, computer readable storage medium and communication manager
CN110008266A (en) * 2019-03-13 2019-07-12 平安信托有限责任公司 Data interchange file analysis method and device
CN111796830A (en) * 2020-06-08 2020-10-20 成都数之联科技有限公司 Protocol analysis processing method, device, equipment and medium
CN112287663A (en) * 2020-11-25 2021-01-29 平安数字信息科技(深圳)有限公司 Text parsing method, equipment, terminal and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9270782B2 (en) * 2012-06-12 2016-02-23 Intermec Ip Corp. System and method for managing network communications between server plug-ins and clients
US9424521B2 (en) * 2013-09-27 2016-08-23 Transvoyant, Inc. Computer-implemented systems and methods of analyzing spatial, temporal and contextual elements of data for predictive decision-making
GB2521406A (en) * 2013-12-18 2015-06-24 Ibm Transforming rules into generalised rules in a rule management system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104142888A (en) * 2014-07-14 2014-11-12 北京理工大学 Regularization state machine model design method with stateful protocol
CN108390877A (en) * 2018-02-26 2018-08-10 阳光电源股份有限公司 Communication protocol conversion method and communication protocol converter
CN109325058A (en) * 2018-09-03 2019-02-12 中国平安人寿保险股份有限公司 Regular batch comparison method, device, computer equipment and storage medium
CN109597652A (en) * 2018-10-31 2019-04-09 益和电气集团股份有限公司 Specification analytic method, system, computer readable storage medium and communication manager
CN110008266A (en) * 2019-03-13 2019-07-12 平安信托有限责任公司 Data interchange file analysis method and device
CN111796830A (en) * 2020-06-08 2020-10-20 成都数之联科技有限公司 Protocol analysis processing method, device, equipment and medium
CN112287663A (en) * 2020-11-25 2021-01-29 平安数字信息科技(深圳)有限公司 Text parsing method, equipment, terminal and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
电力信息采集的通用型通信规约解析系统研究与设计;蒋湘涛;贺建飚;李楠;;电力系统保护与控制(第09期);118-122 *
电力系统通信规约库抽象设计与实现;冯利虎;时谊;丘慧龙;徐玉洁;张红跃;苗智峰;;测控技术(第07期);123-126+129 *

Also Published As

Publication number Publication date
CN113923268A (en) 2022-01-11

Similar Documents

Publication Publication Date Title
US10296307B2 (en) Method and system for template extraction based on source code similarity
CN109343857B (en) Method, apparatus and storage medium for deploying machine learning model on line
CN113923268B (en) Resolution method, device and storage medium for multi-version communication protocol
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
US20210049711A1 (en) Method of automatically transmitting data information and device of automatically transmitting data information
US20140237554A1 (en) Unified platform for big data processing
CN110221824B (en) Method and device for generating component
CN109146095A (en) The treating method and apparatus of multiservice system problem
CN112307262A (en) Image identification method and server
CN111355696A (en) Message identification method and device, DPI (deep packet inspection) equipment and storage medium
CN111078573A (en) Test message generation method and device
CN114490641A (en) Industrial Internet data sharing method, equipment and medium
CN111338716A (en) Data processing method and device based on rule engine and terminal equipment
CN112765217A (en) Data processing method and system based on edge calculation and path analysis
CN111984666A (en) Database access method and device, computer readable storage medium and computer equipment
CN111193631B (en) Information processing method, system, and computer-readable storage medium
CN110928941A (en) Data fragment extraction method and device
CN116233164A (en) Method, apparatus, storage medium and processor for collecting device data
CN114492324A (en) Component data statistical method and device
CN114168149A (en) Data conversion method and device
CN114499759B (en) Message generation method and device, electronic equipment and storage medium
CN117032844B (en) Cooperative link tracking device and method and intelligent vehicle
CN113852602B (en) File reconstruction method, device, transmission equipment, electronic equipment and medium
CN110716746B (en) Method and device for converting RN style code into applet style code
CN114386398A (en) Message parsing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant