Communication message CRC checking method, device and equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CRSC URBAN RAIL TRANSIT TECH CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-08-07
AI Technical Summary
[0005]本发明提供一种通信报文CRC检验方法、装置、设备及存储介质,用于解决现有报文CRC校验在运行时自动进行,校验失败后丢弃数据且缺乏可视化结果展示,导致故障定位困难
Smart Images

Figure CN122533699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of communication technology and data processing technology, and in particular to a method, apparatus, device and storage medium for cyclic redundancy check (CRC) verification of communication messages. Background Technology
[0002] In safety-critical systems such as Communication Based Train Control (CBTC) and Computer Interlocking (CI), communication between devices typically employs specific secure communication protocols, such as the Railway Safety Security Protocol-I (RSSP-I). To ensure the integrity of data transmission, the sender usually performs a CRC calculation on the message and appends the result to the message.
[0003] Upon receiving a message, the receiving device recalculates the CRC of the data portion of the message according to the same protocol specifications and compares the result with the CRC value entered by the sender. If they match, the message is deemed to have not been tampered with during transmission and the data is valid; otherwise, the message is deemed invalid and discarded.
[0004] Currently, the CRC check of the aforementioned message data is automatically performed by the application software of the signal equipment during runtime, and the packet data is often discarded directly when the check fails. The check logic only works during software runtime. When a CRC calculation error occurs, it is impossible to intuitively obtain the CRC calculation result for comparison and analysis. Data analysts find it difficult to locate the cause of the message error, which brings inconvenience to the location and analysis of faults. Summary of the Invention
[0005] This invention provides a method, apparatus, device, and storage medium for CRC verification of communication messages, which solves the problem that existing message CRC verification is performed automatically during operation, data is discarded after verification failure, and there is a lack of visual result display, making fault location difficult.
[0006] This invention provides a CRC check method for communication messages, comprising: Obtain the target communication protocol message data to be tested, parse the frame structure of the target communication protocol message data to be tested, and extract the payload data from the message data; In response to a user-triggered verification command, the CRC calculation program is invoked to calculate the payload data, obtain the local CRC calculation result, and read the CRC value filled in by the sender from the message data; The local CRC calculation result is compared with the message CRC value, and the comparison result is output on the human-computer interaction interface to indicate the validity of the message data.
[0007] According to the present invention, a CRC check method for communication messages is provided, wherein the target communication protocol is the RSSP-I protocol, and the step of parsing the frame structure of the target communication protocol message data to be checked in order to extract payload data from the message data includes: Based on the frame structure of the RSSP-I protocol, identify the protocol identifier field in the message data. The protocol identifier field includes the 01 field and the 80 field in the RSSP-I protocol. The start and end positions of the data area of the message data are determined based on the frame structure and the identified protocol identifier field. The message data between the start and end positions is determined as the payload data.
[0008] According to a CRC check method for communication messages provided by the present invention, the step of obtaining the target communication protocol message data to be checked includes: Obtain network communication data streams using network packet capture tools; Filter data packets that conform to the target communication protocol format from the network communication data stream; The filtered data packets are identified as the target communication protocol message data to be examined.
[0009] According to the present invention, a CRC check method for communication messages is provided, wherein the network packet capture tool includes the Wireshark tool; the method is integrated into the Wireshark tool as a plugin, extended script or external associated tool; the human-computer interaction interface is integrated into the message details window of the Wireshark tool, or is displayed as a separate floating window.
[0010] According to the CRC check method for communication messages provided by the present invention, the step of responding to the user-triggered check command includes: Detect user clicks on the verification trigger control located on the human-computer interaction interface; When a user clicks on the verification trigger control, the verification instruction is generated and the CRC calculation program is invoked.
[0011] According to the CRC check method for communication messages provided by the present invention, the step of outputting the comparison result at the human-computer interaction interface includes: If the local CRC calculation result is consistent with the message CRC value, then the message data is marked as valid on the human-computer interaction interface, and a prompt message in a first preset color, as well as the local CRC calculation result and the message CRC value, are displayed. If the local CRC calculation result is inconsistent with the message CRC value, the message data is marked as invalid on the human-computer interaction interface, and a prompt message in a second preset color, along with the local CRC calculation result and the message CRC value, are displayed.
[0012] According to a CRC check method for communication messages provided by the present invention, the method further includes: Record the inspection result log for historical query or export. The inspection result log includes at least the timestamp of the message data, the inspection result, the local CRC calculation result, and the message CRC value.
[0013] The present invention also provides a communication message CRC verification device, comprising: The data extraction module is used to acquire the target communication protocol message data to be inspected, parse the frame structure of the target communication protocol message data to be inspected, and extract the payload data from the message data. The CRC calculation module is used to respond to the user-triggered verification command, call the CRC calculation program to calculate the payload data, obtain the local CRC calculation result, and read the message CRC value filled in by the sender from the message data; The comparison and visualization module is used to compare the local CRC calculation result with the message CRC value and output the comparison result on the human-computer interaction interface to indicate the validity of the message data.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the communication message CRC check method as described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the communication message CRC check method as described above.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the communication message CRC check method as described above.
[0017] The present invention provides a communication message CRC verification method, apparatus, device, and storage medium. First, it acquires the target communication protocol message data to be verified and parses the frame structure of the message data to extract payload data. In response to a user-triggered verification command, it calls a CRC calculation program to calculate the payload data, obtaining a local CRC calculation result, and reads the CRC value filled in by the sender from the message data. Finally, it compares the local CRC calculation result with the message CRC value and outputs the comparison result on a human-machine interface to indicate the validity of the message data. This invention locates and extracts payload data by parsing the frame structure of the target communication protocol message data, performs CRC calculation in response to a user-triggered verification command, compares the result with the CRC value in the message, and outputs the comparison result on a human-machine interface, achieving visualized analysis of the verification process. It can intuitively display the comparison between the local calculation result and the value carried in the message, effectively solving the problems of invisible verification results and difficulty in tracing messages after they are discarded in existing technologies, significantly improving the accuracy and efficiency of communication message fault location and analysis. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is one of the flowcharts illustrating the CRC check method for communication messages provided by the present invention.
[0020] Figure 2 This is the second flowchart illustrating the CRC check method for communication messages provided by the present invention.
[0021] Figure 3 This is the third flowchart illustrating the CRC check method for communication messages provided by the present invention.
[0022] Figure 4 This is a schematic diagram of the results of the CRC check device for communication messages provided by the present invention.
[0023] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] Existing methods, such as CRC checksum verification for RSSP-I messages, are automatically performed by the application software of the signaling device during runtime, meaning they are embedded in the system's background. The verification logic only operates during software operation, and when verification fails, the packet data is often discarded. Therefore, when CRC verification fails, the CRC calculation result cannot be directly obtained for comparison and analysis, making it difficult for data analysts to pinpoint the cause of the message error. This hinders the location and analysis of faults.
[0026] To address the aforementioned problems in existing technologies, this invention provides a method, apparatus, device, and storage medium for CRC verification of communication messages. The inventive concept of the CRC verification method for communication messages provided by this invention lies in decoupling CRC verification from runtime logic into an independent, visual analysis process. By parsing the frame structure of the message to extract the payload data, it then responds to user-triggered commands to calculate the local CRC value and compares it with the value carried in the message. The comparison result is then visually output on a human-computer interaction interface, enabling data analysts to intuitively obtain the CRC calculation result for error localization. This solves the problems of invisible verification results and difficulty in tracing and analyzing messages after they are discarded in existing technologies.
[0027] The following is combined with Figures 1 to 5 This invention describes the CRC verification method, apparatus, device, and storage medium for communication messages provided by this invention.
[0028] Figure 1 This is one of the flowcharts illustrating the CRC check method for communication messages provided by the present invention, such as... Figure 1 As shown, the method includes: S101. Obtain the target communication protocol message data to be inspected, and parse the frame structure of the target communication protocol message data to be inspected in order to extract the payload data from the message data.
[0029] The process involves acquiring the communication message data to be verified, extracting the valid data from the acquired communication message data, and using the valid data as the object of subsequent CRC verification. The valid data refers to the core information part of the message data that needs to be calculated and protected by CRC.
[0030] In some embodiments, obtaining the target communication protocol message data to be verified may include: By capturing real-time network communication data streams between signal system devices using network packet capture tools, raw network data is obtained. Then, from the massive amount of captured network data, data packets that conform to the target communication protocol format are filtered out based on the frame format characteristics or data length field of the target communication protocol. The filtered data packets are then identified as the target communication protocol message data to be examined, serving as the object of subsequent CRC check analysis, thus providing an accurate data source for subsequent extraction of payload data, calculation of CRC, and comparison results.
[0031] In some embodiments, the network packet capture tool can be, for example, Wireshark. The communication packet CRC check method provided by this invention can be integrated into Wireshark as a plugin, extended script, or external associated tool. For example, this method can be compiled as a plugin and embedded in the Wireshark main program, or an extended script such as Lua can be written to add a CRC check menu, or it can be used as an external tool to establish a calling association with Wireshark. Thus, through this integration method, data analysts can directly complete packet capture, filtering, and CRC check analysis within the familiar Wireshark interface without switching tools, significantly improving operational convenience and analysis efficiency.
[0032] In some embodiments, the target communication protocol is taken as the RSSP-I protocol. In step S101, the frame structure of the target communication protocol message data to be tested is parsed to extract the payload data from the message data. Possible implementation methods include... Figure 2 As shown. Figure 2 This is a second flowchart illustrating the CRC check method for communication messages provided by the present invention, as shown below. Figure 2 As shown, the method includes: S1011. Identify the protocol identifier field in the message data according to the frame structure of the RSSP-I protocol.
[0033] The protocol identifier field includes the 01 field and 80 field in the RSSP-I protocol.
[0034] For example, the RSSP-I protocol has a fixed frame structure, which includes specific identification fields used to distinguish message types or identify message boundaries. Identifying protocol identification fields in the acquired RSSP-I protocol message data, such as the 01 and 80 fields, are key features used in the RSSP-I protocol to identify the type of secure communication message. The 01 field typically identifies the start of the message or the protocol version, while the 80 field identifies a specific message type or security level. Together, they constitute the key location points for identifying the RSSP-I message data frame structure.
[0035] S1012. Determine the start and end positions of the data area of the message data based on the frame structure and the identified protocol identifier field.
[0036] The frame structure of the RSSP-I protocol explicitly defines the semantic position of protocol identification fields (such as 01 and 80 fields) in the message, as well as the boundary relationships between the protocol header, data area, and trailer CRC fields. Therefore, by combining the identified positions of the 01 and 80 fields, the starting boundary of the data area (i.e., the end position of the protocol header) and the ending boundary (i.e., the starting position of the trailer CRC field) can be accurately located according to the protocol specification.
[0037] S1013. Determine the message data between the start position and the end position as the payload data.
[0038] The data area located according to the protocol specifications and identification fields is extracted and used as the payload data for subsequent CRC calculations. This extracted data is the core content of the CRC encryption performed by the sending device when generating the message, and it is also the core content that the receiving device needs to recalculate the CRC for verification and comparison.
[0039] The CRC verification method for communication messages provided by this invention parses the frame structure of the target communication protocol message data to be verified in order to extract the payload data from the message data. Taking the RSSP-I protocol as an example, the method uses the standardized frame structure of the RSSP-I protocol as a basis and the protocol-specific 01 and 80 fields as positioning references to achieve automatic and accurate extraction of the payload data in the message. This provides an accurate and reliable data foundation for subsequent CRC calculation in response to user-triggered verification commands, avoiding errors or omissions that may occur during manual message parsing.
[0040] It should be noted that although this embodiment uses the RSSP-I protocol as an example for detailed description, it does not exclude the scope of applicable protocols. The CRC check method for communication messages provided by this invention is not limited to the RSSP-I protocol. For other communication protocols with similar frame structures, including protocol identifier fields and CRC check bits (such as RSSP-II or other rail transit safety communication protocols), those skilled in the art can refer to the logic of this embodiment and adjust the definition of the protocol identifier field and data extraction rules to achieve similar visual CRC check functions. Therefore, the protection scope of this invention should not be limited to the RSSP-I protocol. Any check method based on packet capture tools that manually triggers and visually compares the CRC calculation results with the CRC values carried in the message falls within the protection scope of this invention.
[0041] S102. In response to the user-triggered verification command, the CRC calculation program is called to calculate the payload data, obtain the local CRC calculation result, and read the message CRC value filled in by the sender from the message data.
[0042] Unlike related technologies where device applications automatically and in real-time perform CRC checks during runtime, the CRC calculation in this invention is not automatically triggered by the device. Instead, it is initiated by data analysts through active operation when they need to analyze relevant packets. This user-triggered mechanism allows data analysts to selectively check specific packets as needed, rather than passively accepting the check results generated by the device during runtime.
[0043] In some embodiments, a user-triggered verification command may include: The system detects user clicks on verification trigger controls located in the human-computer interaction interface. When such a click is detected, a verification command is generated, triggering the CRC calculation program. This hands over verification control to data analysts, who can then actively trigger the verification process by clicking the visual control, enabling on-demand analysis of specific packets. Furthermore, this click-based interactive method significantly lowers the barrier to entry compared to command-line operations, improving analytical efficiency.
[0044] It is worth noting that user operations on the verification trigger control when generating verification instructions include, but are not limited to, click operations, and can also include touch operations, etc.
[0045] Furthermore, after the CRC calculation program is triggered by the verification command, the preset CRC calculation program is called. The extracted payload data is used as the input of the CRC calculation program, and the calculation is performed according to the same CRC algorithm as the sending device (such as the CRC algorithm specified in the RSSP-I protocol), so as to obtain the locally recalculated CRC result, that is, the local CRC calculation result. This local CRC calculation result represents the CRC value that the message data should have from the perspective of the receiver.
[0046] At the same time, before, or after calling the CRC calculation program, the CRC value calculated by the sending device and attached to the end of the message can be located and read directly from the target communication protocol message data to be verified, based on its frame structure. In other words, the message CRC value filled in by the sender can be read from the message data, which represents the CRC value claimed by the sender.
[0047] Step S102, triggered by the user, executes the local recalculation of the CRC and the reading of the sender's CRC value in parallel or sequentially, providing a data foundation for the next step of comparing the two. Compared with related technologies where the device automatically completes the calculation and comparison without showing the intermediate results to the analysts, the communication message CRC verification method provided by this invention allows analysts to clearly understand the locally calculated results and the CRC value claimed by the sender, thus providing a prerequisite for subsequent visual comparison and error location.
[0048] S103. Compare the local CRC calculation result with the message CRC value, and output the comparison result on the human-machine interface to indicate the validity of the message data.
[0049] The local CRC calculation result is compared with the CRC value entered by the sender and read from the message data. The comparison result is then output visually through a human-computer interaction interface to clearly indicate the validity of the message data.
[0050] Unlike related technologies where devices simply discard messages after verification failures during online operation without showing any results to analysts, this step explicitly presents the comparison results to the user. This allows data analysts to intuitively obtain the local calculation results and the sender's original CRC value, providing direct evidence for locating the cause of verification failure, such as sender calculation errors, transmission tampering, or data extraction deviations. This effectively solves the technical problem of difficulty in problem analysis caused by verification failures in related technologies.
[0051] In some embodiments, the user interface can be integrated into the packet details window of the Wireshark tool, allowing data analysts to perform CRC checks while viewing detailed packet analysis. Alternatively, the user interface can be displayed as a separate floating window, maintaining interaction with the Wireshark tool but independently presenting the check results, providing greater interface flexibility.
[0052] The CRC check method for communication messages provided by this invention automatically extracts payload data by parsing the frame structure of message data, avoiding the tediousness and errors of manual parsing. It performs CRC calculation in response to user-triggered verification commands and visually outputs the comparison between the local CRC calculation result and the CRC value entered by the sender on a human-machine interface. This allows data analysts to intuitively obtain the verification results for comparison and analysis, effectively solving the technical problems in related technologies where CRC verification is automatically completed by the device in real time, messages are directly discarded after verification failure, verification results are not visible to analysts, and there is a lack of effective data extraction methods. This significantly improves the convenience and accuracy of message error location.
[0053] Figure 3This is the third flowchart illustrating the CRC check method for communication messages provided by the present invention, as shown below. Figure 3 As shown, the method includes: S201. Obtain the target communication protocol message data to be inspected, and parse the frame structure of the target communication protocol message data to be inspected in order to extract the payload data from the message data.
[0054] S202. In response to the user-triggered verification command, the CRC calculation program is called to calculate the payload data, obtain the local CRC calculation result, and read the message CRC value filled in by the sender from the message data.
[0055] The possible implementation methods, principles, and technical effects of steps S201 and S202 are similar to those of steps S101 and S102. For details, please refer to the foregoing introduction, and they will not be repeated here.
[0056] S203. Compare the local CRC calculation result with the message CRC value.
[0057] The local CRC calculation result is compared with the CRC value entered by the sender and read from the message data.
[0058] S204a. If the local CRC calculation result is consistent with the message CRC value, the message data is marked as valid on the human-machine interface, and a prompt message in the first preset color, as well as the local CRC calculation result and the message CRC value, are displayed.
[0059] The local CRC calculation result is compared with the message CRC value. If the local CRC calculation result is equal to the message CRC value, it indicates that the message data has not been tampered with during transmission, and the verification result is that the message data is valid. The comparison result can then be visualized and output on the human-computer interaction interface.
[0060] The message data can be marked as valid in the human-computer interaction interface, for example, using text labels or icon symbols. Additionally, a prompt message in a preset color can be displayed in the interface, such as a green background or green font, to visually distinguish and identify the verification result. Furthermore, the interface can simultaneously display the local CRC calculation result and the message CRC value, presenting both values so that the user can intuitively confirm their consistency.
[0061] S204b. If the local CRC calculation result is inconsistent with the message CRC value, the message data is marked as invalid on the human-machine interface, and a prompt message in the second preset color, as well as the local CRC calculation result and the message CRC value, are displayed.
[0062] The local CRC calculation result is compared with the message CRC value. If the local CRC calculation result is not equal to the message CRC value, it indicates that the message data may be erroneous. The verification result is that the message data is invalid. The comparison result can be visualized and output on the human-computer interaction interface.
[0063] The human-computer interface (HCI) can mark invalid message data, for example, using text labels or icons. Additionally, a second preset color can be displayed on the HCI, such as a red background or red font, to highlight the invalid data through strong contrast with the first preset color. Furthermore, the HCI can simultaneously display the local CRC calculation result and the message CRC value, presenting these two differing values so users can visually see the difference and provide a basis for subsequent error analysis.
[0064] This step presents the CRC check results to data analysts in the most intuitive way through visualization. Compared with the existing technology that only loses packets and does not display any information after a check fails, this invention allows data analysts to intuitively know whether the message data is valid or invalid. When the check is invalid, they can directly see the difference between the two CRC values, which facilitates quick identification of the root cause of the error, such as a calculation error by the sender, data tampering during transmission, or data extraction deviation by the receiver. This visualization output method can significantly reduce the difficulty of message analysis and improve the efficiency of troubleshooting.
[0065] Furthermore, the CRC verification method for communication messages provided by the present invention also includes step S205.
[0066] S205. Record the test results log for historical query or export.
[0067] For example, after each CRC check operation triggered by a user is completed, the relevant information for that check is recorded in the log, forming historical data that can be viewed or exported later. Thus, by recording the check results log, even after the tool is closed or the analysis object is switched after the check is completed, the previous check results can still be reviewed.
[0068] In some embodiments, the recorded test result logs can not only be queried and browsed within the tool interface, but can also be exported to external files, such as text files, comma-separated values (CSV) files, or database files, so that data analysts can perform offline archiving, batch analysis, or interface with other analysis tools.
[0069] In some embodiments, the verification result log may include at least the timestamp of the message data, the verification result, the local CRC calculation result, and the message CRC value. The timestamp of the message data refers to the point in time when the message data was captured or analyzed, facilitating traceability along a time dimension. The verification result includes the judgment conclusion of this verification, such as valid or invalid, facilitating rapid filtering of abnormal messages. The local CRC calculation result is the CRC value recalculated by the receiver. The message CRC value is the original CRC value appended to the end of the message by the sender.
[0070] This step provides historical traceability for CRC check analysis. Data analysts can not only see the results intuitively during the check, but also accumulate historical data through the log system, compare and analyze messages that have failed multiple checks, or conduct statistical evaluation of communication quality within a specific time period. This solves the problem of inconvenient problem analysis after a check error occurs in the existing technology, and further improves the efficiency and depth of fault diagnosis.
[0071] The CRC check method for communication messages provided by this invention extracts payload data by parsing the message data frame structure, avoiding the tediousness and errors of manual parsing. Furthermore, by responding to user-triggered check commands and invoking the CRC calculation program, it hands over check control to analysts, enabling on-demand analysis of specific messages. Further, it visualizes the local CRC calculation results and the message CRC value using color differentiation on a human-computer interaction interface, marking the message as valid or invalid when they match or differ, allowing data analysts to intuitively obtain the check conclusions and specific numerical differences. Simultaneously, it records a check result log containing timestamps, check results, and dual CRC values, providing a data foundation for historical tracing and batch analysis. This invention effectively solves the technical problems of existing technologies where CRC checks are automatically completed in real time by the device, check results are invisible, and messages cannot be traced after being discarded, significantly improving the immediate analysis capability for message error location and the efficiency of long-term troubleshooting.
[0072] The communication message CRC verification device provided by the present invention is described below. The communication message CRC verification device described below can be referred to in correspondence with the communication message CRC verification method described above.
[0073] Figure 4 This is a schematic diagram of the results of the CRC check device for communication messages provided by the present invention, as shown below. Figure 4 As shown, the communication message CRC check device 400 includes: The data extraction module 401 is used to acquire the target communication protocol message data to be inspected, parse the frame structure of the target communication protocol message data to be inspected, and extract the payload data from the message data.
[0074] The CRC calculation module 402 is used to respond to the user-triggered verification command, call the CRC calculation program to calculate the payload data, obtain the local CRC calculation result, and read the message CRC value filled in by the sender from the message data.
[0075] The comparison and visualization module 403 is used to compare the local CRC calculation result with the message CRC value and output the comparison result on the human-computer interaction interface to indicate the validity of the message data.
[0076] In one possible design, the target communication protocol is the RSSP-I protocol, and the data extraction module 401 is used for: Based on the frame structure of the RSSP-I protocol, identify the protocol identifier field in the message data. The protocol identifier field includes the 01 field and the 80 field in the RSSP-I protocol. The start and end positions of the data area of the message data are determined based on the frame structure and the identified protocol identifier field; The message data between the start and end positions is determined as the payload data.
[0077] In one possible design, the data extraction module 401 is also used for: Obtain network communication data streams using network packet capture tools; Filter data packets from network communication data streams that conform to the target communication protocol format; The filtered data packets are identified as target communication protocol message data to be examined.
[0078] In one possible design, the network packet capture tool includes the Wireshark tool; the communication message CRC check device provided by this invention is integrated into the Wireshark tool as a plug-in, extended script or external associated tool; the human-computer interaction interface is integrated into the message details window of the Wireshark tool, or displayed as a separate floating window.
[0079] In one possible design, the CRC calculation module 402 is used for: Detect user clicks on the verification trigger controls located in the human-computer interaction interface; When a user clicks on the verification trigger control, a verification command is generated and the CRC calculation program is invoked.
[0080] In one possible design, the comparison and visualization module 403 is used for: If the local CRC calculation result matches the message CRC value, the message data is marked as valid on the human-machine interface, and a prompt message in the first preset color, as well as the local CRC calculation result and the message CRC value, are displayed. If the local CRC calculation result is inconsistent with the message CRC value, the message data is marked as invalid on the human-machine interface, and a prompt message in a second preset color, along with the local CRC calculation result and the message CRC value, are displayed.
[0081] In one possible design, the communication message CRC check device 400 further includes a log recording module, which is used for: Record the inspection results log for historical query or export. The inspection results log should include at least the timestamp of the message data, the inspection result, the local CRC calculation result, and the message CRC value.
[0082] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540. The processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a communication message CRC check method. This method includes: acquiring the target communication protocol message data to be checked; parsing the frame structure of the target communication protocol message data to be checked to extract payload data from the message data; responding to a user-triggered check command, calling a CRC calculation program to calculate the payload data, obtaining a local CRC calculation result, and reading the message CRC value filled in by the sender from the message data; comparing the local CRC calculation result with the message CRC value, and outputting the comparison result on the human-machine interface to indicate the validity of the message data.
[0083] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0084] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the communication message CRC verification method provided by the above methods. The method includes: acquiring target communication protocol message data to be verified; parsing the frame structure of the target communication protocol message data to be verified to extract payload data from the message data; responding to a verification command triggered by a user, calling a CRC calculation program to calculate the payload data to obtain a local CRC calculation result, and reading the message CRC value filled in by the sender from the message data; comparing the local CRC calculation result with the message CRC value, and outputting the comparison result on a human-computer interaction interface to indicate the validity of the message data.
[0085] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the communication message CRC verification method provided by the above methods. The method includes: acquiring target communication protocol message data to be verified; parsing the frame structure of the target communication protocol message data to be verified to extract payload data from the message data; responding to a verification command triggered by a user, calling a CRC calculation program to calculate the payload data to obtain a local CRC calculation result, and reading the message CRC value filled in by the sender from the message data; comparing the local CRC calculation result with the message CRC value, and outputting the comparison result on a human-computer interaction interface to indicate the validity of the message data.
[0086] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0087] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A CRC check method for communication messages, characterized in that, include: Obtain the target communication protocol message data to be tested, parse the frame structure of the target communication protocol message data to be tested, and extract the payload data from the message data; In response to a user-triggered verification command, the CRC calculation program is invoked to calculate the payload data, obtain the local CRC calculation result, and read the CRC value filled in by the sender from the message data; The local CRC calculation result is compared with the message CRC value, and the comparison result is output on the human-computer interaction interface to indicate the validity of the message data.
2. The method according to claim 1, characterized in that, The target communication protocol is the RSSP-I protocol. Parsing the frame structure of the target communication protocol message data to be tested, in order to extract payload data from the message data, includes: Based on the frame structure of the RSSP-I protocol, identify the protocol identifier field in the message data. The protocol identifier field includes the 01 field and the 80 field in the RSSP-I protocol. The start and end positions of the data area of the message data are determined based on the frame structure and the identified protocol identifier field. The message data between the start and end positions is determined as the payload data.
3. The method according to claim 1, characterized in that, The acquisition of the target communication protocol message data to be inspected includes: Obtain network communication data streams using network packet capture tools; Filter data packets that conform to the target communication protocol format from the network communication data stream; The filtered data packets are identified as the target communication protocol message data to be examined.
4. The method according to claim 3, characterized in that, The network packet capture tool includes the Wireshark tool; the method is integrated into the Wireshark tool as a plugin, extended script, or external associated tool; the human-computer interaction interface is integrated into the packet details window of the Wireshark tool, or displayed as a separate floating window.
5. The method according to claim 1, characterized in that, The response to the user-triggered verification command includes: Detect user clicks on the verification trigger control located on the human-computer interaction interface; When a user clicks on the verification trigger control, the verification instruction is generated and the CRC calculation program is invoked.
6. The method according to claim 1, characterized in that, The step of outputting the comparison results on the human-computer interaction interface includes: If the local CRC calculation result is consistent with the message CRC value, then the message data is marked as valid on the human-computer interaction interface, and a prompt message in a first preset color, as well as the local CRC calculation result and the message CRC value, are displayed. If the local CRC calculation result is inconsistent with the message CRC value, the message data is marked as invalid on the human-computer interaction interface, and a prompt message in a second preset color, along with the local CRC calculation result and the message CRC value, are displayed.
7. The method according to claim 1, characterized in that, The method further includes: Record the inspection result log for historical query or export. The inspection result log includes at least the timestamp of the message data, the inspection result, the local CRC calculation result, and the message CRC value.
8. A CRC check device for communication messages, characterized in that, include: The data extraction module is used to acquire the target communication protocol message data to be inspected, parse the frame structure of the target communication protocol message data to be inspected, and extract the payload data from the message data. The CRC calculation module is used to respond to the user-triggered verification command, call the CRC calculation program to calculate the payload data, obtain the local CRC calculation result, and read the message CRC value filled in by the sender from the message data; The comparison and visualization module is used to compare the local CRC calculation result with the message CRC value and output the comparison result on the human-computer interaction interface to indicate the validity of the message data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the CRC check method for communication messages as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the CRC check method for communication messages as described in any one of claims 1 to 7.