Complex protocol message analysis method and analysis system
By using an XML-formatted structured protocol message configuration file and a visual interactive interface, combined with a communication bus driver, the problem of low efficiency in parsing complex protocol messages is solved, achieving efficient protocol message sending, receiving, and parsing, thus improving the development efficiency of testing software and the efficiency of product debugging and testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, the process of parsing complex protocol messages is inefficient, time-consuming and labor-intensive to develop and modify, and prone to errors, making it impossible to quickly and flexibly adapt to product protocol message updates.
It adopts a structured protocol message configuration file in Extensible Markup Language (XML) format, combined with a communication bus driver, to provide a visual interactive interface, enabling rapid development and modification of protocol messages. Through the protocol configuration management unit, communication bus control unit, downlink message processing unit, and uplink message processing unit, it realizes visual debugging and efficient parsing of protocol messages.
It improves the efficiency of test software development, simplifies the sending and receiving parsing process of complex protocol messages, realizes real-time protocol sending and receiving parsing, and meets the high-efficiency communication needs of electronic equipment products in extreme environments.
Smart Images

Figure CN121644707A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data communication technology and is applied to the automated testing process of electronic equipment products. Specifically, it relates to a method and system for parsing complex protocol messages. Background Technology
[0002] Communication bus technology is increasingly being used in the debugging and testing of new-generation electronic equipment products. Communication bus technology refers to the technology for transmitting data and information between different devices or systems, typically used to achieve interconnection and communication between devices. Communication bus technology is particularly important in electronic equipment products because they need to operate in environments requiring high reliability, high security, and high real-time performance. Furthermore, these electronic equipment products often need to operate in extreme environments, such as high temperature, low temperature, high humidity, and high vibration. Communication bus technology must be able to withstand these harsh environmental conditions to ensure the stability and reliability of data transmission.
[0003] With the development of electronic information technology, the complexity of electronic equipment products is gradually increasing, involving more and more types of buses, and the communication protocols between products and the external environment are becoming increasingly complex. The electrical performance testing of most products is mainly achieved through automatic parsing of protocol messages by test software. During the product testing process, it is necessary to control various types of communication buses to communicate with the product under test, sending, receiving, and parsing protocol messages. A typical automated testing framework for products using bus communication is as follows: Figure 1 As shown.
[0004] In the current production and commissioning environment, the protocol message parsing method used by electrical performance testing software still relies on software personnel to perform bus transmission and reception control, such as packet grouping and subpacketizing of data for individual products. Data management is not iterative or reusable, and changes to protocol messages require the cooperation of specialized software personnel, which is labor-intensive and resource-intensive, resulting in low efficiency. Specifically, the following factors mainly affect the protocol message parsing efficiency of products: 1. The process of parsing product protocol messages is currently developed separately as a functional unit in the test software, which is not reusable and most of them do not have a visual human-computer interaction debugging interface. The development and debugging of test software is time-consuming and labor-intensive.
[0005] 2. Current product protocol messages are mostly precise to the bit level, with many defined data fields and large data volume, with some product protocol messages reaching thousands or tens of thousands of bytes. During the test software development process, the soft delivery or parsing of protocol messages requires arithmetic operations on the corresponding data of the messages, which is complex and prone to errors.
[0006] 3. During the product debugging and testing phase, the protocol messages may undergo some adjustments and changes; as the product protocol messages change, the testing software will be repeatedly modified; the protocol messages and testing software are strongly coupled, with many modifications and a lot of content, making it impossible to quickly and flexibly adjust and adapt the protocol message updates to the product. Summary of the Invention
[0007] The purpose of this invention is to address the problems encountered in the development and modification of electrical performance testing software, such as the lack of a human-computer interaction interface for the transmission and reception parsing of complex protocol messages, time-consuming and labor-intensive development and modification, complex development processes prone to errors, and the inability to quickly and flexibly adapt to products. Therefore, this invention proposes a method and system for parsing complex protocol messages, enabling rapid development and iterative modification of testing software. Simultaneously, this invention provides a visual debugging and interactive interface for complex protocol messages, effectively improving the efficiency of debugging and testing the electrical performance indicators of electronic equipment products.
[0008] The present invention employs the following technical solutions to achieve its objective: A method for parsing complex protocol messages, the method comprising the following steps: S1. Obtain and parse the structured protocol message configuration file, wherein the definition of the configuration file includes at least the communication bus type, the protocol structure of the downlink message frame and the uplink message frame; S2. Based on the communication bus type provided in the configuration file, select and configure the corresponding communication bus driver to establish a communication connection with the product under test. S3. In response to the downlink message transmission command, according to the protocol structure of the downlink message frame defined in the configuration file, the data to be transmitted is assembled into a complete downlink message frame that conforms to the protocol structure, and transmitted to the product under test through the communication bus. S4. Receive uplink message frames from the product under test through the communication bus driver, and parse the received uplink message frames according to the protocol structure of the uplink message frames defined in the configuration file, and extract the data values corresponding to each field.
[0009] Preferably, in step S1, the structured protocol message configuration file adopts the Extensible Markup Language (XML) format. The configuration file includes at least protocol header information and protocol body information. The protocol header information defines the identification information of the product to which the protocol is adapted. The protocol body information includes a communication bus definition part and a protocol frame definition part. The protocol frame definition part defines each protocol frame to the level of bits and includes at least one of the following: field name, bit width, actual value or default value, and mathematical operation expression.
[0010] Preferably, in step S2, selecting and configuring the corresponding communication bus driver specifically includes: loading and displaying the communication bus type defined in the configuration file and its corresponding configurable parameters and default values through a visual interactive interface; receiving parameter modification instructions input by the user through the visual interactive interface to update the communication bus configuration; and establishing a communication connection with the product under test by calling the startup interface provided by the communication bus driver according to the updated configuration.
[0011] Specifically, in step S3, assembling the data to be sent into a complete downlink message frame conforming to the protocol structure includes: obtaining the protocol structure definition of the target downlink message frame from the configuration file, wherein the protocol structure definition contains one or more fields, each field having a preset bit width and a default value; replacing the corresponding default values with the actual values set by the user for the one or more fields; concatenating the replaced field values according to the order and bit width of the protocol structure definition, and supplementing the message header and / or trailer data in a fixed format as needed to form a complete downlink message frame byte sequence.
[0012] Preferably, replacing the corresponding default values with the actual values set by the user for one or more fields specifically includes: in response to the user's selection operation of a target message frame in the downlink message list on the visual interactive interface, displaying all fields contained in the message frame and their default values; receiving the actual value input by the user for at least one of the fields; wherein, if the field is configured with a mathematical operation expression, the actual value is the result value calculated by the mathematical operation expression after being input by the user; and replacing the default value used by the field when assembling the packet with the actual value or the result value.
[0013] Specifically, in step S4, the received uplink message frame is parsed, which includes: obtaining the protocol structure definition that matches the received uplink message frame from the configuration file; extracting the original data corresponding to each field from the byte sequence of the uplink message frame according to the frame start position, field order, bit width of each field and endianness information specified in the protocol structure definition; and converting the original data into real values with physical meaning according to the preset parsing rules of each field in the protocol structure definition.
[0014] Preferably, after parsing out the actual values corresponding to each field in the uplink message frame, the name of at least one field and its corresponding parsed actual value are displayed together through a visual interactive interface; the visual interactive interface also provides a function to filter by message frame identifier or name, allowing users to select and view the parsing details of a specific uplink message frame.
[0015] Preferably, after establishing a communication connection with the product under test in step S2, data monitoring of the communication bus is initiated; when raw byte data from the communication bus is detected, the protocol frame type to which the raw byte data belongs is automatically determined according to the identification characteristics of each uplink message frame defined in the configuration file; based on the determination result, the parsing process corresponding to the protocol frame type is automatically invoked, and step S4 is executed to complete the parsing and field value mapping of the uplink message frame.
[0016] Preferably, the method provides an application programming interface (API) to external testing software, which is then invoked to execute steps S1 to S4. The API includes at least: an interface for obtaining the configuration of the loaded protocol messages, an interface for setting downlink message field values and triggering transmission, an interface for starting or stopping the communication bus connection, and an interface for registering uplink message reception callback events. The external testing software calls the API to achieve protocol message-based communication and parsing with the product under test, thereby eliminating the need to implement bit-level message assembly and disassembly logic within the testing software.
[0017] This invention also provides a parsing system for implementing the aforementioned method for parsing complex protocol messages, the system comprising the following functional units: The protocol configuration management unit is used to acquire and parse structured protocol message configuration files based on the Extensible Markup Language (XML) format, providing bit-level protocol structure definitions for communication bus types, downlink message frames, and uplink message frames; The communication bus control unit is used to load and configure the corresponding communication bus driver based on the communication bus type provided by the protocol configuration management unit, and control the start and stop of the communication bus driver to establish or disconnect the communication connection with the product under test. The downlink message processing unit is used to respond to the sending command, assemble the user-provided field data into a complete downlink message frame according to the protocol structure definition of the target downlink message frame provided by the protocol configuration management unit, and drive it to be sent to the product under test through the communication bus control unit; The uplink message processing unit is used to receive uplink message frames from the product under test through the communication bus control unit, and parse the uplink message frames according to the corresponding protocol structure definition provided by the protocol configuration management unit, and extract the data values corresponding to each field therein; The human-computer interaction unit is connected to the protocol configuration management unit, the communication bus control unit, the downlink message processing unit, and the uplink message processing unit. It provides a visual operation interface to receive user configuration operations on protocol files, communication bus parameters, and downlink message field values, and to display the parsing results of uplink messages.
[0018] In summary, due to the adoption of this technical solution, the beneficial effects of this invention are as follows: 1. This invention uses Extensible Markup Language (XML) structured text editing combined with a communication bus driver to achieve structured definition and parsing of product protocol messages.
[0019] 2. This invention realizes the control and debugging of product protocol message sending and receiving in the form of a visual interface, and the process is clear and controllable.
[0020] 3. In addition to the visual interactive interface, this invention also provides the test software with a communication bus control and message transmission and parsing interface; the test software does not need bit operations to parse uplink and downlink messages through the system of this invention, and the granularity of message transmission and parsing is at the bit level, realizing real-time protocol transmission and reception parsing.
[0021] 4. As an advantage of the present invention, when sending downlink messages, the test software uses the communication bus driver to combine the valid data and fixed header and footer data into a complete frame for transmission; when parsing uplink messages, the test software uses the communication bus driver to unpack the complete frame into valid data and parse and map it to the protocol fields.
[0022] 5. This invention solves the problems of long test software development cycles and complex debugging processes caused by the complexity of protocol messages during the debugging and testing of electronic equipment products, thereby improving the efficiency of test software development and product debugging and testing, and gradually meeting the growing testing needs. Attached Figure Description
[0023] The present invention is described in detail with reference to the following figures, which include nine figures as follows: Figure 1 This is a schematic diagram of an automated testing framework for products currently using bus communication. Figure 2 This is a simplified flowchart illustrating the overall process of the complex protocol message parsing method of the present invention; Figure 3 This is a schematic diagram illustrating the development of a structured protocol message configuration file, as exemplified by the present invention. Figure 4 This is a schematic diagram illustrating the data communication bus driver development interface as an example of the present invention; Figure 5 This is a schematic diagram illustrating how external testing software calls the method of this invention, as an example of this invention. Figure 6 This is a schematic diagram of the interface of the parsing system of the present invention; Figure 7 This is a schematic diagram illustrating the working principle of the analytical system of the present invention; Figure 8 This is a schematic diagram illustrating the selection of protocol message files in the parsing system of this invention; Figure 9 This is a schematic diagram illustrating the protocol message sending and receiving debugging in the parsing system of this invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0025] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0026] Example 1 A method for parsing complex protocol messages. Figure 2 This document provides a brief overview of the overall process of the method, which can be viewed concurrently. The key steps of the method can be summarized as follows: S1. Obtain and parse the structured protocol message configuration file. The configuration file definition includes at least the communication bus type, the protocol structure of downlink message frames and uplink message frames. S2. Based on the communication bus type provided in the configuration file, select and configure the corresponding communication bus driver to establish a communication connection with the product under test. S3. In response to the downlink message transmission command, according to the protocol structure of the downlink message frame defined in the configuration file, the data to be transmitted is assembled into a complete downlink message frame that conforms to the protocol structure, and then sent to the product under test via the communication bus. S4. Receive uplink message frames from the product under test via the communication bus driver, and parse the received uplink message frames according to the protocol structure of the uplink message frames defined in the configuration file, extracting the data values corresponding to each field.
[0027] This embodiment will provide a detailed description of the specific details and preferred methods for each step of the method.
[0028] In step S1, the structured protocol message configuration file adopts the Extensible Markup Language (XML) format. The configuration file includes at least protocol header information and protocol body information. The protocol header information defines the identification information of the product to which the protocol is adapted. The protocol body information includes a communication bus definition part and a protocol frame definition part. The protocol frame definition part defines each protocol frame to the bit level and includes at least one of the following: field name, bit width, actual value or default value, and mathematical operation expression.
[0029] In this embodiment, as Figure 3 As shown, an XML editor is used to develop the structured protocol message configuration file corresponding to the product. The protocol header information can specifically define the following elements: applicable product drawing number, applicable product name, and protocol name. The protocol frame definition section in the protocol body information can specifically define the following elements: frame ID, frame name, frame direction, and endianness.
[0030] The above information constitutes the basic information of a frame. Due to message requirements, the specific information within the frame is preferably accurate to the bit level. Therefore, the internal information of the frame is divided into the following levels: UInt, UShort, Byte, and Bit. Bit-level information may be contained within the other three levels, but cannot exist independently in the frame information. Each bit contains the following information: name, code value, bit width, actual value, mathematical expression, precision, unit, and remarks.
[0031] In step S2, the corresponding communication bus driver is selected and configured, which specifically includes: loading and displaying the communication bus type defined in the configuration file and its corresponding configurable parameters and default values through a visual interactive interface; receiving parameter modification instructions input by the user through the visual interactive interface to update the communication bus configuration; and establishing a communication connection with the product under test by calling the startup interface provided by the communication bus driver according to the updated configuration.
[0032] In this embodiment, as Figure 4 The diagram shows the interfaces that need to be implemented for data communication bus driver development, which may further include interfaces for the following functional units: The bus parameter setting function interface allows you to set bus parameters. The bus parameter reading function interface reads bus parameters. An interface for obtaining a list of supported parameters; Data sending function interface (data packet sending structure); Data sending function interface (send raw byte array); Data monitoring function event interface; Bus startup function interface; Bus release function interface.
[0033] In step S3, the data to be sent is assembled into a complete downlink message frame that conforms to the protocol structure. Specifically, this includes: obtaining the protocol structure definition of the target downlink message frame from the configuration file. The protocol structure definition contains one or more fields, each with a preset bit width and a default value; replacing the corresponding default values with the actual values set by the user for one or more fields; concatenating the replaced field values according to the order and bit width defined in the protocol structure definition, and supplementing the message header and / or trailer data in a fixed format as needed to form a complete downlink message frame byte sequence.
[0034] As a preferred embodiment, the actual values set by the user for one or more fields are used to replace the corresponding default values. Specifically, this includes: in response to the user's selection of a target message frame in the downlink message list on the visual interactive interface, displaying all fields contained in the message frame and their default values; receiving the actual value input by the user for at least one of the fields; wherein, if the field is configured with a mathematical expression, the actual value is the result value calculated by the mathematical expression after the user inputs it; and replacing the default value used by the field when assembling the packet with the actual value or the result value.
[0035] In step S4, the received uplink message frame is parsed, specifically including: obtaining the protocol structure definition that matches the received uplink message frame from the configuration file; extracting the original data corresponding to each field from the byte sequence of the uplink message frame according to the frame start position, field order, bit width of each field and endianness information specified in the protocol structure definition; and converting the original data into real values with physical meaning according to the preset parsing rules of each field in the protocol structure definition.
[0036] As a preferred embodiment, after parsing the actual values corresponding to each field in the uplink message frame, the name of at least one field and its corresponding parsed actual value are displayed together through a visual interactive interface. The visual interactive interface also provides a function to filter by message frame identifier or name, allowing users to select and view the parsing details of a specific uplink message frame.
[0037] In a preferred embodiment, after establishing a communication connection with the product under test in step S2, data monitoring of the communication bus is initiated; when raw byte data from the communication bus is detected, the protocol frame type to which the raw byte data belongs is automatically determined according to the identification characteristics of each uplink message frame defined in the configuration file; based on the determination result, the parsing process corresponding to the protocol frame type is automatically invoked, and step S4 is executed to complete the parsing and field value mapping of the uplink message frame.
[0038] In this embodiment, the parsing method provides an application programming interface (API) to the external testing software, thereby being invoked to execute steps S1 to S4. The API includes at least: an interface for obtaining the configuration of the loaded protocol message, an interface for setting downlink message field values and triggering transmission, an interface for starting or stopping the communication bus connection, and an interface for registering uplink message reception callback events. The external testing software realizes communication and parsing with the product under test based on protocol messages by calling the API, thereby eliminating the need to implement bit-level message assembly and disassembly logic within the testing software.
[0039] In this embodiment, as Figure 5 As shown, functions such as communication bus acquisition, communication bus startup, downlink message sending, and uplink message parsing can be achieved through simple interface code calls. The method in this embodiment greatly reduces the development difficulty and cycle of complex protocol message sending, receiving, and parsing in test software, and improves the development efficiency of test software and product debugging efficiency.
[0040] Example 2 Based on Embodiment 1, this embodiment provides a parsing system for implementing the parsing method for complex protocol messages in Embodiment 1. The system includes the following functional units: The protocol configuration management unit is used to acquire and parse structured protocol message configuration files based on the Extensible Markup Language (XML) format, providing bit-level protocol structure definitions for communication bus types, downlink message frames, and uplink message frames; The communication bus control unit is used to load and configure the corresponding communication bus driver based on the communication bus type provided by the protocol configuration management unit, and to control the start and stop of the communication bus driver to establish or disconnect the communication connection with the product under test. The downlink message processing unit is used to respond to the sending command, assemble the user-provided field data into a complete downlink message frame according to the protocol structure definition of the target downlink message frame provided by the protocol configuration management unit, and drive it to be sent to the product under test through the communication bus control unit; The uplink message processing unit is used to receive uplink message frames from the product under test through the communication bus control unit, and parse the uplink message frames according to the corresponding protocol structure definition provided by the protocol configuration management unit, and extract the data values corresponding to each field. The human-machine interaction unit is connected to the protocol configuration management unit, the communication bus control unit, the downlink message processing unit, and the uplink message processing unit. It provides a visual operation interface to receive user configuration operations on protocol files, communication bus parameters, and downlink message field values, and displays the parsing results of uplink messages.
[0041] In this embodiment, the main functions of the system are implemented by the aforementioned five units. Users can manage message file content through XML text configuration and perform communication interaction and debugging with electronic equipment products through the system's function buttons. The visual operation interface provided by the system with the support of the human-machine interaction unit can be found here. Figure 6 This is an illustration. The specific descriptions of the functions of each part of the system are as follows: Protocol Bus Selection: After entering the system, the system automatically reads the structured protocol message configuration file from a fixed path and parses its corresponding information into structured data, supporting the selection of relevant protocol files. In the protocol file selection section, clicking the search button allows you to select the protocol file corresponding to a specific product for configuration. After selecting the protocol file, the bus configuration section allows you to select different communication buses corresponding to the selected protocol file. The system will then automatically load the configuration parameters and default values of the communication buses, which users can modify. After setting up, clicking the "Connect" button will start the selected communication bus.
[0042] Uplink Message Selection: After the user selects the protocol file and communication bus, the system will automatically load the corresponding uplink messages and display them according to their ID and name. After establishing a communication connection with the product under test, if an uplink message sent by the product under test is received, clicking on the corresponding uplink message entry will display the message's specific information in the uplink message listening area, including message name, actual value, value type, bit width, and remarks.
[0043] Downlink message selection: Similar to uplink message selection. After the user selects the protocol message and communication bus, the system automatically loads the corresponding downlink messages and displays them by ID and name. After establishing a communication connection with the product under test, the user can select the downlink message to be sent, set the actual value of the downlink message, and click the "Send" button to send the downlink message to the product under test via the communication bus.
[0044] Message configuration distribution and readback monitoring: Selecting "Downlink message sending" will display the downlink messages to be sent. After clicking send, the downlink message with the configured real values will be sent. Selecting "Uplink message monitoring" will automatically assign values to each field of the message and display them on the interface after the system receives the uplink message reported by the product under test.
[0045] The usage method of this system can therefore be summarized as follows: First, according to the specified format, complete the editing and development of a structured protocol message configuration file in XML format corresponding to a product. Then, based on the specific format and characteristics of the transmit and receive protocol messages defined in the file, develop the data communication bus driver for the product under test. The system will centrally transmit and receive messages through the communication bus according to the format defined in the XML file. Finally, the human-computer interaction debugging interface provided by the system can be used to select the protocol message, communication bus, and configure the communication bus parameters for the corresponding product under test. The system can also select the corresponding downlink message for transmission and simultaneously monitor uplink messages in real time. All process records are displayed in real time in the log area.
[0046] Meanwhile, the system in this embodiment also provides complete software interfaces for protocol message acquisition, protocol message settings, communication bus startup / shutdown, and protocol message transmission / reception. Users can utilize these interfaces during software development to significantly improve the processing efficiency of protocol message transmission / reception and parsing, shorten software development time, and increase debugging efficiency. Figure 7 The system's operating principle is illustrated below. During the debugging process of the product under test (DUT) using the test software, the test software calls the communication bus to send downlink messages. The system parses the downlink messages into corresponding byte arrays and sends them to the DUT. The DUT communicates with the test software via the communication bus. Upon receiving the downlink messages, the DUT generates an output signal under the action of the input excitation source and sends uplink messages. The test software calls the system, parses the uplink messages into specific values of corresponding fields via the communication bus, and combines this with the test logic to complete the electrical performance index test of the DUT.
[0047] For a specific example of selecting the protocol message file in this embodiment, please refer to [link / reference]. Figure 8 In the system function interface, under the Protocol File button, click the Search button and select the "Example Product 1" protocol file. After selecting the protocol file corresponding to the product, click the Bus Configuration button. The system function interface will then load the bus configuration items DestIP, DestPort, and IsServer, along with their default values. Simultaneously, the uplink message list will load the specific uplink messages: "Uplink Message 1", "Uplink Message 2", "Uplink Message 3", "Uplink Message 4", "Uplink Message 5", and "Uplink Message 6"; the downlink message list will load the specific downlink messages: "Downlink Message 1", "Downlink Message 2", "Downlink Message 3", "Downlink Message 4", "Downlink Message 5", and "Downlink Message 6". Select "Downlink Message 2" and click on its entry. The "Downlink Message Sending" area will expand the specific content of "Downlink Message 2", as shown in the figure, including "Field 1", "Field 2 (including Information 1 and Information 2)", and "Field 3 (including Information 3 and Information 4)".
[0048] For a specific example of debugging protocol message sending and receiving in this embodiment, please refer to [link / reference]. Figure 9 In the system function interface, under bus configuration, change the parameter "DestIP" to "192.168.1.10" and the parameter "DestPort" to "1000". Click the "Connect" button; the button indicator light will turn green, and the log area will indicate a successful bus connection. Use SOCKETTESTDLG software to simulate product communication with the system. After modifying the value of the downlink message "Downlink Message 2", click the "Send" button to send the byte array corresponding to "Downlink Message 2," and the log area will record the relevant information. Use SOCKETTESTDLG software to edit the content of the uplink message and send it; the system will receive the uplink message, and the log area will record the relevant information.
Claims
1. A method for parsing a complex protocol packet, characterized in that, The method comprises the following steps: S1, obtaining and parsing a structured protocol message configuration file, the definition of the configuration file comprising at least a communication bus type, a protocol structure of a downlink message frame and an uplink message frame; S2, based on the communication bus type provided by the configuration file, selecting and configuring a corresponding communication bus driver to establish a communication connection with a product under test; S3, in response to a downlink message sending instruction, assembling data to be sent into a complete downlink message frame conforming to the protocol structure according to the protocol structure of the downlink message frame defined in the configuration file, and sending the downlink message frame to the product under test through the communication bus driver; S4, receiving an uplink message frame from the product under test through the communication bus driver, and parsing the received uplink message frame according to the protocol structure of the uplink message frame defined in the configuration file to extract data values corresponding to each field in the uplink message frame.
2. The resolution method according to claim 1, characterized in that: In step S1, the structured protocol message configuration file is in an extensible markup language (XML) format, and the configuration file comprises at least protocol header information and protocol body information; the protocol header information defines identification information of a product to which the protocol is adapted, and the protocol body information comprises a communication bus definition part and a protocol frame definition part; the protocol frame definition part defines each protocol frame to a bit level, and contains at least one of a field name, a bit width, a real value or a default value, and a mathematical operation expression.
3. The resolution method according to claim 1, wherein, In step S2, the corresponding communication bus driver is selected and configured, specifically comprising: loading and displaying the communication bus types defined in the configuration file and their corresponding configurable parameters and default values through a visual interactive interface; receiving a parameter modification instruction input by a user through the visual interactive interface to update the communication bus configuration; and establishing a communication connection with the product under test by calling a start interface provided by the communication bus driver according to the updated configuration.
4. The resolution method according to claim 1, wherein, In step S3, the data to be sent is assembled into a complete downlink message frame conforming to the protocol structure, specifically comprising: obtaining a protocol structure definition of a target downlink message frame from the configuration file, the protocol structure definition containing one or more fields, each field having a preset bit width and a default value; replacing the corresponding default values with real values set by a user for the one or more fields; and concatenating the replaced field values in the order and bit width defined by the protocol structure definition, and supplementing fixed format message header and / or tail data as needed to form a complete downlink message frame byte sequence.
5. The resolution method according to claim 4, wherein, The real values set by the user for the one or more fields are respectively replaced with the corresponding default values, specifically comprising: in response to a selection operation of a target message frame in a downlink message list by a user on a visual interactive interface, displaying all fields contained in the message frame and their default values; receiving a real value input by the user for at least one of the fields; wherein if a field is configured with a mathematical operation expression, the real value is a result value calculated by the mathematical operation expression after the user input; and replacing the default value used when the field is packed with the real value or the result value.
6. The resolution method according to claim 1, wherein, In step S4, the received uplink message frame is parsed, specifically including: obtaining the protocol structure definition matched with the received uplink message frame from the configuration file; extracting the original data corresponding to each field from the byte sequence of the uplink message frame according to the frame starting position, field order, field bit width and size end sequence information specified in the protocol structure definition; and converting the original data into real values with physical meaning according to the preset parsing rules of each field in the protocol structure definition.
7. The resolution method of claim 6, wherein: After parsing the real values corresponding to each field in the uplink message frame, the name of at least one field and its corresponding parsed real value are associated and displayed through a visual interactive interface; the visual interactive interface also provides a filtering function according to message frame identification or name, allowing users to select and view the parsing details of specific uplink message frames.
8. The resolution method according to claim 6, characterized in that: When the communication connection with the product under test is established in step S2, data listening on the communication bus is started; when the original byte data from the communication bus is listened to, the protocol frame type to which the original byte data belongs is automatically judged according to the identification features of each uplink message frame defined in the configuration file; According to the judgment result, the parsing process corresponding to the protocol frame type is automatically called to execute step S4 to complete the parsing and field value mapping of the uplink message frame.
9. The resolution method of claim 1, wherein: The method provides an application programming interface to external test software, so as to be called to execute steps S1 to S4; The application programming interface at least includes: an interface for obtaining the loaded protocol message configuration, an interface for setting the downlink message field value and triggering sending, an interface for starting or closing the communication bus connection, and an interface for registering the uplink message receiving callback event; the external test software realizes the protocol message based communication with the product under test by calling the application programming interface.
10. A parsing system for implementing the parsing method of any one of claims 1-9, wherein, The system includes the following functional units: A protocol configuration management unit is configured to obtain and parse a structured protocol message configuration file in extensible markup language (XML) format, and provide bit-level protocol structure definitions of communication bus types, downlink message frames and uplink message frames. A communication bus control unit is configured to load and configure a corresponding communication bus driver based on the communication bus types provided by the protocol configuration management unit, and control the start and stop of the communication bus driver to establish or disconnect the communication connection with the product under test. A downlink message processing unit is configured to assemble field data provided by a user into a complete downlink message frame according to the protocol structure definition of a target downlink message frame provided by the protocol configuration management unit in response to a sending instruction, and drive the downlink message frame to be sent to the product under test through the communication bus control unit. An uplink message processing unit is configured to receive an uplink message frame from the product under test through the communication bus control unit, and parse the uplink message frame according to the corresponding protocol structure definition provided by the protocol configuration management unit to extract the data values corresponding to each field. The human-computer interaction unit is connected with the protocol configuration management unit, the communication bus control unit, the downlink message processing unit and the uplink message processing unit, and is configured to provide a visual operation interface to receive user configuration operations on a protocol file, communication bus parameters and downlink message field values, and display the analysis result of the uplink message.