Communication protocol analysis method and device based on graph theory, equipment and medium

By blocking and adjacency matrix establishment of the ICD protocol based on graph theory, the solution order of multiplexed identifiers is determined, and the problem of inconsistent dependence and data flow in multiframe ICD analysis is solved, and efficient and accurate ICD analysis is achieved.

CN120455567AActive Publication Date: 2025-08-08CHENGDU AIRCRAFT INDUSTRY GROUP
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202510654199.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-08
Estimated Expiration
2045-05-21

AI Technical Summary

Technical Problem

In the prior art, when the dependency between multiplexed identifiers during analysis is inconsistent with the data flow, it cannot be parsed correctly, resulting in parsing errors.

Method used

Using a graph theory-based method, by blocking the ICD protocol, establishing a directed graph adjacency matrix, determining the solution order of multiplexed identifiers, establishing a pointer and data buffer area, and calculating the values of multiplexed identifiers in turn, combining protocol blocks to form a dedicated analytical protocol.

Benefits of technology

The correct analysis of complex ICDs is realized, and the error problem is avoided when the multiplexed identification dependencies are inconsistent with the data flow, and the accuracy and efficiency of the analysis are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455567A_ABST
    Figure CN120455567A_ABST
Patent Text Reader

Abstract

The invention discloses a terminal identification method, device and equipment based on an OCR (Optical Character Recognition) technology and a medium, and belongs to the technical field of automatic testing. Comprising the following steps of: 1, partitioning an ICD protocol according to an ICD multiplexing identifier; step 2, establishing an adjacent matrix of the graph according to a relation between multiple frames in ICD; step 3, determining a calculation sequence of each multiplexing identifier according to the adjacent matrix; 4, establishing a pointer pointing to the multiplexing identifier, and providing a basis for setting the cache size of the data stream and positioning the multiplexing identifier; and 5, according to the data stream, calculating the value of each multiplexing identifier in sequence, selecting corresponding protocol blocks, and combining the protocol blocks to form a special analysis protocol of the current data frame. And step 6, repeating the step 5 until the analysis of all data streams is completed. According to the method and the device, a solution is provided for complex ICD analysis containing multiple frames, and the problem of error reporting when the dependency relationship between multiplexing identifiers is inconsistent with the data flow can be well solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated testing, and in particular to a communication protocol parsing method, device, equipment and medium based on graph theory. Background Art

[0002] Multiframing refers to the process of multiplexing a byte, several bytes, or a bit in a communication protocol (Interface Control File ICD) to improve the compactness of the ICD and facilitate design and maintenance. For ease of description, we call these bytes or bits multiplexing identifiers.

[0003] If the dependencies between reused identifiers are consistent with the data flow, the situation is relatively simple, such as Figure 1 As shown, a, b, c, and d are multiplexing identifiers. The selection of the level 1 multiplexing block depends on the values of a and d respectively. The value of d is determined by b and c. The order of the values of a, b, c, and d is consistent with the data stream.

[0004] However, when the dependency between reused identifiers is inconsistent with the data flow, traditional parsing methods will fail to parse, such as Figure 2 As shown in the figure, a is determined by b, and b is determined by c. That is, the order of the values of a to c is c, b, a, while the order of the data stream is a, b, c. Therefore, it is impossible to perform data stream parsing using traditional methods.

[0005] In the prior art, patent CN107306256A discloses a communication protocol parsing method based on string-type data. This patent matches a specific protocol and does not address the issue of communication protocol reuse. Patent CN113364732A discloses a vehicle-mounted terminal communication protocol parsing method and device. This patent involves protocol matching, but only initially selects based on the protocol's identification bit and does not reuse bytes or bits within the protocol. Summary of the Invention

[0006] The present invention aims to solve the problem in the prior art of parsing an ICD containing multiple frames, in which a parsing error occurs when the dependency between multiplexing identifiers is inconsistent with the data stream. A communication protocol parsing method, apparatus, equipment and medium based on graph theory are proposed, which can realize the correct parsing of complex ICDs.

[0007] In order to achieve the above-mentioned object of the invention, the technical solution of the present invention is as follows: A communication protocol parsing method based on graph theory includes the following steps: Step 1: Divide the ICD protocol into blocks according to the ICD multiplexing identifier and extract them separately; Step 2: Establish a directed graph adjacency matrix based on the relationship between the multiframes in the ICD; Step 3: Determine the order of solving each reuse identifier according to the adjacency matrix; Step 4: Create a pointer to the reuse identifier and a data buffer; Step 5: Load the data stream, calculate the value of each multiplexing identifier in turn according to the data stream, select the corresponding protocol block for combination, and form a dedicated parsing protocol for the current data frame; Step 6: Repeat step 5 until all data streams are parsed.

[0008] Furthermore, the said segmenting of the ICD protocol into blocks according to the ICD multiplexing identifier includes: querying the smallest block where the multiplexing identifier is located, extracting it separately, and not operating on other blocks that do not contain the multiplexing identifier.

[0009] Furthermore, the establishment of a directed graph adjacency matrix based on the relationship between multiple frames in the ICD includes: first determining the size of the initial adjacency matrix as N×N based on the number of multiplexing identifiers N, then the number of adjacency matrices to be calculated is [N / 2], [N / 2] means N / 2 rounded down, and the sequence number m of the adjacency matrix is 1~[N / 2].

[0010] Furthermore, the determining of the order of solving each reuse identifier according to the adjacency matrix includes: First, by calculating the out-degree and in-degree of the current adjacency matrix, the priority of the reused identifier is determined in pairs. The priority of the out-degree is 0 is N-m+1, and the priority of the in-degree is 0 is m. The current adjacency matrix is pruned, and the rows and columns related to the two reuse identifiers whose priorities have just been determined are removed. A new adjacency matrix is constructed with a size of [N-2(m-1)]×[N-2(m-1)]. Repeat the above operation to calculate the out-degree and in-degree of [N / 2] adjacency matrices in total, and obtain the solution order of each reused identifier.

[0011] Furthermore, the content of the pointer pointing to the multiplexing identifier includes the start bit and length of the multiplexing identifier, and the size of the block where the multiplexing identifier is located. The sum of the sizes of the blocks where all multiplexing identifiers are located constitutes the size of the data buffer area.

[0012] Furthermore, when determining the order of solving each reuse identifier, if the calculation result of the adjacency matrix has multiple out-degrees or the in-degree is 0, one of them is selected.

[0013] Furthermore, the method of calculating the value of each multiplexing identifier in sequence according to the data stream and selecting the corresponding protocol block for combination includes: selecting matching protocol content in the protocol block extracted in step 1 according to the calculated value of the multiplexing identifier, and combining all matched protocol blocks with other protocols that do not contain multiplexing identifiers.

[0014] The present invention also provides a communication protocol parsing device based on graph theory, comprising: The protocol block module is used to block the ICD protocol according to the ICD multiplexing identifier and extract the smallest block where the multiplexing identifier is located separately; An adjacency matrix building module is used to build a directed graph adjacency matrix based on the relationship between the multiframes in the ICD; A priority determination module, configured to determine a solution order for each reuse identifier according to the adjacency matrix; A pointer establishment module is used to establish a pointer pointing to a reuse identifier and a data buffer area; The protocol generation module is used to load the data stream, calculate the value of each multiplexing identifier in turn according to the data stream, and select the corresponding protocol block for combination to form a dedicated parsing protocol for the current data frame.

[0015] The present invention also provides a communication protocol parsing device based on graph theory, comprising: memory for storing computer programs; A processor is used to implement the steps of the above-mentioned communication protocol parsing method based on graph theory when executing the computer program.

[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the steps in the above-mentioned graph-theory-based communication protocol parsing method.

[0017] In summary, the present invention has the following advantages: 1. The present invention provides a solution for complex ICD parsing containing multiframes. By using graph theory to prioritize multiplexing identifiers, the error problem caused by the inconsistent dependency between multiplexing identifiers and data streams can be avoided, thereby improving the accuracy of complex ICD parsing. 2. The present invention quickly generates a dedicated ICD for the current frame by establishing a cache of the multiplexing associated part and quickly locating the multiplexing identifier, thereby improving the ICD parsing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram showing the consistency between the dependencies between reused identifiers and the data flow; Figure 2 This is a schematic diagram showing that the dependency between reused identifiers is inconsistent with the data flow; Figure 3 is a flow chart of the present invention; Figure 4 For example 1 of the present invention Figure 1 The directed graph created; Figure 5 For example 1 of the present invention Figure 2 Create a directed graph. DETAILED DESCRIPTION

[0019] In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with preferred embodiments and drawings. Those skilled in the art should understand that the following specific description is illustrative rather than restrictive and should not be used to limit the scope of protection of the present invention.

[0020] In order to solve the problem of parsing errors when the dependency between multiplexing identifiers is inconsistent with the data stream during parsing of ICD containing multi-frames, the present invention provides a communication protocol parsing method based on graph theory, such as Figure 3 As shown, the following steps are included: Step 1: Divide the ICD protocol into blocks according to the ICD multiplexing identifier and extract them separately; Step 2: Establish a directed graph adjacency matrix based on the relationship between the multiframes in the ICD; Step 3: Determine the order of solving each reuse identifier according to the adjacency matrix; Step 4: Establish a pointer to the reuse identifier and a data buffer area to provide a basis for setting the data stream buffer size and positioning the reuse identifier; Step 5: Load the data stream, calculate the value of each multiplexing identifier in turn according to the data stream, select the corresponding protocol block for combination, and form a dedicated parsing protocol for the current data frame; Step 6: Repeat step 5 until all data streams are parsed.

[0021] Example 1 This embodiment proposes a communication protocol parsing method based on graph theory, which includes the following steps: Step 1: Divide the ICD protocol into blocks according to the ICD multiplexing identifier and extract them separately; The specific operation method of this step is: query the smallest block where the reuse identifier is located, extract it separately, and do not operate on other blocks that do not contain the reuse identifier.

[0022] Step 2: Establish a directed graph adjacency matrix based on the relationship between the multiframes in the ICD; The specific operation method of this step is: first, determine the size of the initial adjacency matrix as N×N based on the number of reuse identifiers N. Then the number of adjacency matrices that need to be calculated is [N / 2], [N / 2] means N / 2 rounded down, and the sequence number m of the adjacency matrix is 1~[N / 2].

[0023] Step 3: Determine the order of solving each reuse identifier according to the adjacency matrix; The specific operation method of this step is: First, by calculating the out-degree and in-degree of the current adjacency matrix, the priority of the reused identifier is determined in pairs; the priority of the out-degree is 0 is N-m+1, and the priority of the in-degree is 0 is m; the higher the priority, the later the calculation order; Then, the current adjacency matrix is pruned, the rows and columns related to the two reuse identifiers whose priorities have just been determined are removed, and a new adjacency matrix is constructed with a size of [N-2(m-1)]×[N-2(m-1)]; Finally, repeat the above operation to calculate the out-degree and in-degree of [N / 2] adjacency matrices in total, and obtain the solution order of each reuse identifier.

[0024] Below Figure 1 The reuse identifier of is used as an example to illustrate how to determine the solution order of each reuse identifier based on the adjacency matrix: Depend on Figure 1 From the above, we can see that b is determined by a, c is determined by b, and d is determined by b and c together. Then we can draw the following Figure 4 The initial directed graph shown has N=4 and the value of m is 1,2.

[0025] When m=1, its adjacency matrix is: ; The first row, second column is 1, indicating that a points to b; the second row, third column is 1, indicating that b points to c; the second row, fourth column is 1, indicating that b points to d, and the third row, fourth column is 1, indicating that c points to d. Computing the row sum of the adjacency matrix yields the out-degrees of a, b, c, and d, which are 1, 2, 1, and 0, respectively. Since d's out-degree is 0, d's priority is 4-1+1=4. Computing the column sum of the adjacency matrix yields the in-degrees of a, b, c, and d, which are 0, 1, 1, and 2, respectively. Since a's in-degree is 0, a's priority is 1.

[0026] When m=2, remove the elements related to a and d in the adjacency matrix, and the size of the new adjacency matrix is 2×2, specifically , calculate the row sum of the adjacency matrix and get the out-degree of b and c, which are 1 and 0 respectively. It is found that the out-degree of c is 0, so the priority of c is 4-2+1=3. Then calculate the column sum of the adjacency matrix and get the in-degree of b and c, which are 0 and 1 respectively. It is found that the in-degree of b is 0, so the priority of b is 2.

[0027] So we can get the priorities of a, b, c, and d as 1, 2, 3, and 4.

[0028] Below Figure 2 The reuse identifier of is used as an example to illustrate how to determine the solution order of each reuse identifier based on the adjacency matrix: Depend on Figure 2 It can be seen that a is determined by b, and b is determined by c, so we can draw the following Figure 5In the directed graph shown, N=3 and the value of m is 1.

[0029] When m=1, its adjacency matrix is: , Among them, the first column of the second row is 1, which means b points to a; the second column of the third row is 1, which means c points to b; Computing the row sums of the adjacency matrix yields the out-degrees of a, b, and c, which are 0, 1, and 1, respectively. Since a's out-degree is 0, its priority is 3-1+1=3. Computing the column sums of the adjacency matrix yields the in-degrees of a, b, and c, which are 1, 1, and 0, respectively. Since c's in-degree is 0, its priority is 1. Thus, the priorities of a, b, and c are 3, 2, and 1.

[0030] Step 4: Create a pointer to the reuse identifier and a data buffer; In this step, the pointer to the multiplexing identifier contains the start bit and length of the multiplexing identifier, as well as the size of the block in which the multiplexing identifier is located. Preferably, the size of the data buffer is the sum of the sizes of all blocks containing multiplexing identifiers. It should be noted that not all data is cached here, which can improve system performance.

[0031] Step 5: Load the data stream, calculate the value of each multiplexing identifier in turn according to the data stream, select the matching protocol content in the protocol block extracted in step 1, and then combine all the matched protocol blocks with other protocols without multiplexing identifiers to form a dedicated parsing protocol for the current data frame.

[0032] Step 6: Repeat step 5 until all data streams are parsed.

[0033] The present invention provides a solution for complex ICD parsing containing multiple frames, which can effectively solve the error reporting problem when the dependency between multiplexing identifiers is inconsistent with the data stream. It not only improves the accuracy of complex ICD parsing, but also quickly generates a dedicated ICD for the current frame by establishing a cache of the multiplexing associated part and quickly locating the multiplexing identifier, thereby improving the ICD parsing efficiency.

[0034] Example 2 Based on the same inventive concept, this embodiment provides a communication protocol parsing device based on graph theory, including: a protocol block module, an adjacency matrix establishment module, a priority determination module, a pointer establishment module and a protocol generation module.

[0035] The protocol block module is configured to block the ICD protocol according to the ICD multiplexing identifier and separately extract the smallest block where the multiplexing identifier is located.

[0036] The adjacency matrix establishment module is configured to establish a directed graph adjacency matrix according to the relationship between the reuse identifiers in the ICD.

[0037] The priority determination module is configured to determine the solution order of each multiplexing identifier according to the adjacency matrix; specifically, the priority determination module is configured to determine the solution order of each multiplexing identifier according to the following method: first, by calculating the out-degree and in-degree of the current adjacency matrix, the priority of the multiplexing identifier is determined in pairs, the priority of the out-degree is 0 is N-m+1, the priority of the in-degree is 0 is m, and N is the number of multiplexing identifiers; then, the current adjacency matrix is pruned, the rows and columns related to the two multiplexing identifiers whose priorities have just been determined are removed, and a new adjacency matrix is constructed, the size of which is [N-2(m-1)]×[N-2(m-1)]; finally, the above operation is repeated to calculate the out-degree and in-degree of [N / 2] adjacency matrices in total to obtain the solution order of each multiplexing identifier.

[0038] The pointer establishment module is configured to establish a pointer pointing to the multiplexing identifier and a data buffer area; specifically, the pointer content pointing to the multiplexing identifier established by the pointer establishment module includes the starting bit and length of the multiplexing identifier, as well as the size of the block where the multiplexing identifier is located. The sum of the block sizes of all multiplexing identifiers constitutes the size of the data buffer area.

[0039] The protocol generation module is configured to load the data stream, calculate the value of each multiplexing identifier in sequence according to the data stream, and select the corresponding protocol block for combination to form a dedicated parsing protocol for the current data frame.

[0040] The functions of the above functional modules correspond one-to-one to the steps in the data processing method in Example 1, and the parts not fully described will be omitted.

[0041] Example 3 Based on the same inventive concept, an embodiment of the present invention further provides a communication protocol parsing device based on graph theory, comprising: Memory for storing computer programs; A processor is used to implement the steps of a communication protocol parsing method based on graph theory as described in the above embodiment 1 when executing the computer program.

[0042] Preferably, the computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units can be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in the device.

[0043] The processor can be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor. The processor is the control center of the device, and various parts of the device are connected using various interfaces and lines.

[0044] The memory mainly includes a program storage area and a data storage area. The program storage area can store the operating system, at least one application required for a function, etc., and the data storage area can store related data, etc. In addition, the memory can be a high-speed random access memory, or a non-volatile memory such as a plug-in hard disk, a smart memory card, a secure digital card, and a flash memory card, or the memory can also be other volatile solid-state memory devices.

[0045] Example 4 An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the graph-theory-based communication protocol parsing method described in the above-mentioned embodiment 1 are implemented.

[0046] Computer storage media may be tangible media that can contain or store programs for use by or in connection with an instruction execution system, apparatus, or device.

[0047] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the scope of protection of the present invention.

Claims

1. A communication protocol parsing method based on graph theory, characterized in that: The steps include: A communication protocol parsing method based on graph theory includes the following steps: Step 1: Divide the ICD protocol into blocks according to the ICD multiplexing identifier and extract them separately; Step 2: Establish a directed graph adjacency matrix based on the relationship between the reuse identifiers in the ICD; Step 3: Determine the order of solving each reuse identifier according to the adjacency matrix; Step 4: Create a pointer to the reuse identifier and a data buffer; Step 5: Load the data stream, calculate the value of each multiplexing identifier in turn according to the data stream, select the corresponding protocol block for combination, and form a dedicated parsing protocol for the current data frame; Step 6: Repeat step 5 until all data streams are parsed.

2. A communication protocol parsing method based on graph theory as claimed in claim 1, characterized in that: The said segmentation of the ICD protocol into blocks according to the ICD multiplexing identifier includes: querying the smallest block where the multiplexing identifier is located, extracting it separately, and not operating on other blocks that do not contain the multiplexing identifier.

3. The communication protocol parsing method based on graph theory according to claim 1, wherein: The method of establishing a directed graph adjacency matrix based on the relationship between multiple frames in the ICD includes: first, determining the size of the initial adjacency matrix as N×N based on the number N of multiplexing identifiers, and then the number of adjacency matrices to be calculated is [N / 2], [N / 2] means N / 2 is rounded down, and the sequence number m of the adjacency matrix is 1~[N / 2].

4. A communication protocol parsing method based on graph theory as claimed in claim 3, characterized in that: The determining of the order of solving each reuse identifier according to the adjacency matrix includes: First, by calculating the out-degree and in-degree of the current adjacency matrix, the priority of the reused identifier is determined in pairs. The priority of the out-degree is 0 is N-m+1, and the priority of the in-degree is 0 is m. The current adjacency matrix is pruned, and the rows and columns related to the two reuse identifiers whose priorities have just been determined are removed. A new adjacency matrix is constructed with a size of [N-2(m-1)]×[N-2(m-1)]. Repeat the above operation to calculate the out-degree and in-degree of [N / 2] adjacency matrices in total, and obtain the solution order of each reuse identifier.

5. The communication protocol parsing method based on graph theory according to claim 1, wherein: The content of the pointer pointing to the multiplexing identifier includes the starting bit and length of the multiplexing identifier, and the size of the block where the multiplexing identifier is located. The sum of the sizes of the blocks where all multiplexing identifiers are located constitutes the size of the data buffer area.

6. A communication protocol parsing method based on graph theory as claimed in claim 4, characterized in that: When determining the order of solving each reuse identifier, if the calculation result of the adjacency matrix has multiple out-degrees or the in-degree is 0, one of them is selected.

7. The communication protocol parsing method based on graph theory according to claim 1, characterized in that: The method of calculating the value of each multiplexing identifier in sequence according to the data stream and selecting the corresponding protocol block for combination includes: selecting matching protocol content in the protocol block extracted in step 1 according to the calculated value of the multiplexing identifier, and combining all matched protocol blocks with other protocols without multiplexing identifiers.

8. A communication protocol analysis device based on graph theory, characterized in that: include: The protocol block module is used to block the ICD protocol according to the ICD multiplexing identifier and extract the smallest block where the multiplexing identifier is located separately; An adjacency matrix building module is used to build a directed graph adjacency matrix based on the relationship between the multiframes in the ICD; A priority determination module, configured to determine a solution order for each reuse identifier according to the adjacency matrix; A pointer establishment module is used to establish a pointer pointing to a reuse identifier and a data buffer area; The protocol generation module is used to load the data stream, calculate the value of each multiplexing identifier in turn according to the data stream, and select the corresponding protocol block for combination to form a dedicated parsing protocol for the current data frame.

9. A communication protocol analysis device based on graph theory, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of a communication protocol parsing method based on graph theory as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the communication protocol parsing method based on graph theory as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Multi-level deep coupling navigation signal abnormity high-precision monitoring method

    CN113126130A

  • Task scheduling method and related device

    CN113535367A

  • Method and device for positioning task dependence bottleneck

    CN113703949A

  • Unmanned aerial vehicle communication method, device, equipment and storage medium

    CN113949438A

  • Collaborative flow scheduling numerical simulation method and system based on strict priority

    CN115951989A