Communication protocol data analysis method and device

By preconfiguring the key fields of the communication protocol in the configuration file, the problem of flexibility and low efficiency in automotive communication protocol analysis is solved, and efficient analysis of dynamic protocol data is achieved to adapt to the needs of protocol changes.

CN119254861APending Publication Date: 2025-01-03NEUSOFT REACH AUTOMOBILE TECH (SHENYANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411447244.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art has low flexibility and efficiency in the analysis of automotive communication protocols, especially when the protocol changes, the parsing tools need to be adjusted, resulting in low parsing efficiency.

Method used

By preconfiguring the key fields of the communication protocol in the configuration file, reading the latest configuration file content and storing it in memory, determining the message type of the data packet and parsing the target data based on the configuration file content, avoiding the impact of protocol changes on the parsing tool , realizes general analysis of dynamic protocol data.

Benefits of technology

It improves the analysis efficiency of communication protocol data, reduces the need for adjustment of analysis tools, and can flexibly respond to changes in different communication protocols, ensuring the reliability and efficiency of data packet resolution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254861A_ABST
    Figure CN119254861A_ABST
Patent Text Reader

Abstract

The invention provides a communication protocol data analysis method and device, and relates to the technical field of vehicle communication analysis, and the method comprises the steps: responding to a received loading command, reading the content of a configuration file, and storing the content of the configuration file in a memory; capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determining the message type of each data packet according to the content of the configuration file; if the message type is a target message type, analyzing target data from a data packet corresponding to each target message type based on the configuration file content; by pre-configuring the key field of the corresponding communication protocol positioning target data in the configuration file, the analysis of the communication protocol data can be realized according to the updated configuration file content under the condition that the communication protocol changes, and the problem that the analysis tool needs to be adjusted whenever the protocol changes in the prior art is solved. And the analysis efficiency is relatively low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle communication analysis, and in particular to a method and device for analyzing communication protocol data. Background Art

[0002] In automotive communication programming, we often encounter investigations into communication problems, which involve public and private protocols. Generally speaking, the protocol format of public protocols is fixed, and can be directly captured and viewed through packet capture tools. However, in actual applications, public protocols are also customized to different manufacturers and project requirements to form customized protocols. When this customized protocol is extracted through packet capture tools, it is generally converted into other types of data formats and cannot be directly viewed. At the same time, since the format of private protocols is often not fixed, the data captured by packet capture tools is binary data, which is not convenient for direct viewing.

[0003] In practical applications, when investigating whether there are abnormalities in vehicle communications, the captured data packets need to be directly displayed in a visual way. Currently, corresponding protocol parsers are often developed based on known public protocols, private protocols, customized protocols, and specificity. When private protocols or customized protocols change, the program code needs to be readjusted and a new protocol parser needs to be regenerated. This parsing method has low flexibility and parsing efficiency. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a method and device for parsing communication protocol data, by pre-configuring the key fields of the corresponding communication protocol to locate the target data in the configuration file, so that when the communication protocol changes, the communication protocol data can be parsed according to the updated configuration file content, thereby alleviating the technical problem in the prior art that every time the protocol changes, the parsing tool needs to be adjusted, resulting in low parsing efficiency.

[0005] In a first aspect, an embodiment provides a method for parsing communication protocol data, comprising:

[0006] Reading the configuration file content in response to the received load command, and storing the configuration file content in the memory; wherein the configuration file content is pre-configured with a key field for locating the target data to be parsed; the key field includes a field content of a target communication protocol corresponding to at least one target message type, and a plurality of elements for constituting the target communication protocol;

[0007] Capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determining a message type of each of the data packets according to the content of the configuration file;

[0008] If the message type is the target message type, target data is parsed from each data packet corresponding to the target message type based on the content of the configuration file.

[0009] In an optional implementation, the step of reading the configuration file content in response to the received load command and storing the configuration file content in the memory includes:

[0010] When receiving a load command sent by a configuration tool, reading the content of the configuration file; wherein the configuration tool changes the configuration file when there is a change in the element used to locate the target data, the target communication protocol and / or the target message type, and sends the load command when the change is completed;

[0011] The configuration file content is stored in the memory in the form of a preset data structure.

[0012] In an optional embodiment, the elements include the position of the target data to be parsed corresponding to the target communication protocol in the data packet, the position of the message type corresponding to the target communication protocol in the data packet, and the data content transmitted corresponding to each target message type based on the target communication protocol.

[0013] In an optional implementation, the step of capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determining the message type of each data packet according to the content of the configuration file includes:

[0014] Capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol;

[0015] According to the elements in the configuration file content, the message type corresponding to each of the data packets is determined from the corresponding position of each of the data packets.

[0016] In an optional implementation, if the message type is the target message type, before the step of parsing the target data from each of the data packets based on the configuration file content, the method further includes:

[0017] Determine whether the message type of each data packet has a successfully matched target message type in the configuration file content;

[0018] If the current data packet matches successfully, then executing the step of parsing the target data from the data packets corresponding to each of the target message types based on the content of the configuration file;

[0019] If the current data packet fails to match, the current data packet is ignored; wherein the current data packet does not contain target data to be parsed.

[0020] In an optional implementation, the step of parsing the target data from the data packets corresponding to each of the target message types based on the content of the configuration file includes:

[0021] Determine, according to the content of the configuration file, an element corresponding to each of the target message types;

[0022] Based on the elements, corresponding field contents are extracted from each data packet of the target message type to determine target data.

[0023] In an optional embodiment, the method further comprises:

[0024] A communication problem between the first target application process and the second target application process is determined according to the target data parsed from at least one data packet.

[0025] In a second aspect, an embodiment provides a communication protocol data parsing device, including:

[0026] A reading module, in response to a received load command, reads the configuration file content and stores the configuration file content in a memory; wherein the configuration file content is pre-configured with a key field for locating the target data to be parsed; the key field includes a field content of a target communication protocol corresponding to at least one target message type, and a plurality of elements for constituting the target communication protocol;

[0027] A determination module, capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determining a message type of each of the data packets according to the content of the configuration file;

[0028] The parsing module parses the target data from each data packet corresponding to the target message type based on the content of the configuration file if the message type is the target message type.

[0029] In a third aspect, an embodiment provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method described in any of the aforementioned implementation methods are implemented.

[0030] In a fourth aspect, an embodiment provides a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the steps of the method described in any one of the aforementioned implementations.

[0031] A communication protocol data parsing method and device provided by an embodiment of the present invention reads the latest configuration file content according to a load command and stores it in a memory. Based on the configuration file content stored in the memory, the message type of each data packet transmitted between any two target application processes based on a target communication protocol can be quickly determined; if the data packet belongs to a target message type pre-configured in the configuration file content, the target data is parsed according to key fields in the configuration file content; and the modification of the content in the configuration file can alleviate the adverse effects of dynamic changes in the communication protocol on the parsing of data packets by a parsing tool, without the need to adjust the parsing tool, thereby ensuring the efficiency of data packet parsing.

[0032] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.

[0033] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 A flow chart of a method for parsing communication protocol data provided by an embodiment of the present invention;

[0036] Figure 2 A flow chart of another communication protocol data parsing method provided by an embodiment of the present invention;

[0037] Figure 3 A functional module diagram of a communication protocol data parsing device provided by an embodiment of the present invention;

[0038] Figure 4 A schematic diagram of the hardware architecture of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] The vehicle's public protocols, customized protocols, and private protocols require specific programs to parse. If such communication protocols change, the specific parsing program needs to be adjusted accordingly, resulting in low efficiency in communication protocol data parsing.

[0041] Based on this, an embodiment of the present invention provides a method and device for parsing communication protocol data. By pre-configuring the key fields of the communication protocol positioning target data in a configuration file, it is convenient for a parsing tool to read and parse the data packet. Even if the communication protocol changes, it is only necessary to modify the content of the configuration file without adjusting the parsing tool. Therefore, various types of dynamic communication protocol data can be universally parsed, thereby improving parsing efficiency.

[0042] To facilitate understanding of this embodiment, a communication protocol data parsing method disclosed in an embodiment of the present invention is first introduced in detail. The method can be applied to a parsing tool, which may include a host computer, a controller, a server and other control devices.

[0043] In actual applications, the analysis tool can be used to capture and analyze data packets transmitted between any two application processes with communication problems, and determine what specific communication anomalies exist in the above application processes based on the analyzed target data.

[0044] The above two application processes can communicate through local session socket, network, shared memory, etc.; if it is preliminarily predicted that there is a communication problem in a certain communication protocol A between the above two application processes, the data packets transmitted by the communication protocol A are captured through the parsing program, and the key fields of the communication protocol A are read from the configuration file in advance and stored in the memory of the parsing tool. The parsing tool parses the captured data packets according to the content of the configuration file. If the content of the communication protocol A changes, modify the configuration file again, and then notify the parsing tool to read the latest configuration file and parse the data to ensure parsing efficiency.

[0045] It should be noted that if data parsing is performed for another communication protocol B between application processes, it can also be achieved by modifying the configuration content in the configuration file to ensure the universality of data of various communication protocols.

[0046] Figure 1 A flow chart of a communication protocol data parsing method provided by an embodiment of the present invention.

[0047] like Figure 1 As shown, the method comprises the following steps:

[0048] Step S102: Read the configuration file content in response to the received load command, and store the configuration file content in the memory.

[0049] Among them, the key fields for locating the target data to be parsed are pre-configured in the configuration file content; the key fields include the field content of the target communication protocol corresponding to at least one target message type, and multiple elements for constituting the target communication protocol;

[0050] It can be understood that the first field content of the target communication protocol corresponding to the target message type C and the second field content of the target communication protocol corresponding to each element under the action of the target message type C together constitute the target communication protocol of the target message type C; based on the key field, the target communication protocol data packet that meets the message type requirements can be parsed to obtain the target data;

[0051] The embodiment of the present invention is applicable to protocol parsing in which the length of an element is fixed, but is not applicable to protocol content in which the length of an element is variable. In most protocol contents, the length of protocol elements is fixed.

[0052] In actual applications, the content of the communication protocol or the requirements of the target data may change. In this case, the configuration tool can modify the configuration file and send a load command to the parsing tool when the modification is completed so that the parsing tool can read the latest configuration file content.

[0053] Step S104: capture at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determine the message type of each data packet according to the content of the configuration file.

[0054] Among them, the first target application process and the second target application process can be understood as at least one target communication protocol of the two being preliminarily predicted to have an abnormality. At this time, the two application processes with the abnormalities are selected as targets, and the problems of the first target application process and the second target application process are learned by parsing the data packets transmitted by the two using the target communication protocol with the abnormality; the first target application process and the second target application process may exist in the same ECU or in different ECUs, that is, the abnormality may be the internal communication of the ECU or the communication between ECUs;

[0055] It is understandable that in order to more accurately determine the problems existing in the first target application process and the second target application process, at least one data packet may be captured for analysis to ensure the reliability of the target data used for problem determination;

[0056] Furthermore, based on the pre-configured elements in the configuration file content, the message type corresponding to the target communication protocol in each data packet can be determined.

[0057] Step S106: If the message type is a target message type, target data is parsed from data packets corresponding to each target message type based on the configuration file content.

[0058] Among them, the target data can be understood as the target communication protocol field and application data used to identify the specific abnormalities in the target communication protocol of the first target application process and the second target application process; for example, one type of target data is port number: 23; the target communication protocol field is "port number" and the application data is "23".

[0059] In a preferred embodiment of actual application, the latest configuration file content is read according to the load command and stored in the memory, and based on the configuration file content stored in the memory, the message type of each data packet transmitted between any two target application processes based on the target communication protocol can be quickly determined; if the data packet belongs to the target message type pre-configured in the configuration file content, the target data is parsed according to the key fields in the configuration file content; the modification of the content in the configuration file can alleviate the adverse effects of the dynamic changes of the communication protocol on the parsing of the data packet by the parsing tool, without adjusting the parsing tool, thereby ensuring the efficiency of data packet parsing.

[0060] In some embodiments, each type of communication protocol may configure key fields in a configuration file of a common format to achieve the purpose of locating target data that meets the requirements from a data packet, and when the content of each communication protocol changes and the configuration file needs to be changed, the latest configuration file content is read based on a load command to ensure the reliability of the analysis of the target data; this step S102 may specifically include:

[0061] Step 1.1), when receiving the loading command sent by the configuration tool, read the configuration file content.

[0062] Among them, the configuration tool changes the configuration file when there are changes in the elements used to locate the target data, the target communication protocol and / or the target message type, and sends a load command when the change is completed; it can be known that the configuration file content read based on the load command response is the latest configuration file content; the configuration file can be in json format, and the key automation of various communication protocols such as SOMEIP, DDS, etc. can be configured through json format configuration files.

[0063] Step 1.2), storing the configuration file content in the memory in the form of a preset data structure.

[0064] The preset data structure is a hierarchical structure consistent with the json format, such as a map table. There is a one-to-one correspondence between the elements in the map table and the elements in the json file. Based on the elements in the map table (read from the configuration file content), the various fields included in the target communication protocol in each data packet and the length of each field can be represented, and then the target data can be parsed.

[0065] The elements include the position Position of the target data to be parsed corresponding to the target communication protocol in the data packet, the position Length of the message type corresponding to the target communication protocol in the data packet, the character description data_struct of the data content transmitted corresponding to each target message type based on the target communication protocol, the length Length of the transmitted data content, the number of nested message bodies of the transmitted data content isarray, etc. Here, the target communication protocol can be constituted based on the type value in the first field content message of the target communication protocol corresponding to at least one target message type and the second field content of the corresponding target communication protocol parsed from the data packet by the above elements.

[0066] Specifically, the key fields in the configuration file are described as follows:

[0067] Position: indicates the starting position of the target communication protocol data to be parsed in the data packet, that is, the starting position of the target communication protocol data in the data packet;

[0068] Length: indicates how many bytes are spanned from the above starting position Position to represent the message type, that is, the position of the message type data in the data packet.

[0069] message: is an array, in json format, representing the expression of the target communication protocol fields corresponding to each message type of the target communication protocol data, including:

[0070] type_value: the value corresponding to the specific message type, based on which the message type of each data packet is determined;

[0071] type: A string describing the message type, i.e., the message type represented by the field content based on the target communication protocol.

[0072] data_struct: represents an array, which contains descriptions of various fields of application data transmitted by the target communication protocol, including:

[0073] key: description of each field of the application data transmitted by the target communication protocol;

[0074] length: Each field occupies several bytes of data, that is, the length of the data.

[0075] isarray: Depending on the message type, this field presents different states (true, false or empty); if the current field is equal to true, it means that there is still an array in the current node. This json format is designed to solve the parsing of the protocol structure of the message body of the protocol nested in the message type; if the current field is equal to false or empty, this field is invalid.

[0076] To facilitate understanding of the above key fields, here is an example using the following code:

[0077] struct register_event{

[0078] uint8_t msg_type;

[0079] uint16_t client;

[0080] uint32_t its_size;

[0081] uint16_t serviceid;

[0082]

[0083]

[0084]

[0085] Among them, the starting position of position 4 is determined from the data packet for parsing, and the specific value of the message type of the target communication protocol of the data packet is obtained at the position where the length is 1 away from the starting position, that is, the value of the message type is 10, and the message type with the value 10 is the service type; based on the service type provided, the corresponding application data of the data packet is extracted according to the data structure data_struct; for example, key, type is the IP address (which may also include port or topic) is 3, length is the length of the IP address 3, that is, 1; for example, if the message type is a registration event, and the data packet corresponds to multiple events that need to be registered at one time, it can be achieved by nesting multiple message bodies; for example: inside the message body register_event of the target communication protocol, a message body eventgroups and eventgroups_info are also nested, and isarray is true at this time; for example, if the message type is the method method, and the data packet is the transmitted tire pressure data, then isarray is false at this time, there is no message body nesting, and the isarray field is not effective.

[0086] In some embodiments, data packets between the first target application process and the second target application process with predicted communication anomalies may be captured, and the message type of each data packet may be obtained based on the content of the configuration file, and then subsequent parsing operations may be performed based on the message type; illustratively, step S104 may be implemented by the following steps, specifically including:

[0087] Step 2.1), capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol.

[0088] Among them, the first target application process and the second target application process may realize data packet transmission through multiple communication protocols. By predicting in advance that there is an abnormality in the communication of a target communication protocol, the key fields of the target communication protocol are configured through the configuration file content. For example, the target communication protocol can be understood as SOMEIP or DDS; that is, the key fields of at least one target message type of a target communication protocol are configured in the configuration file content, so that the target data that meets the requirements can be parsed in the data packet.

[0089] Step 2.2), according to the elements in the configuration file content, determine the message type corresponding to each data packet from the corresponding position of each data packet.

[0090] Here, according to the above-mentioned embodiment, it can be known that the starting position of parsing and the position of the message type in the data packet can be known according to the elements in the configuration file content, and then the message type value of each data packet and the string description corresponding to the value can be known.

[0091] In some embodiments, each data packet between the first target application process and the second target application process corresponds to a message type, but the key field in the configuration file is used to locate the target data, that is, the key field corresponds to the target message type, that is, the analysis of the target data for some data packets that do not conform to the target message type is meaningless; therefore, in order to further improve the analysis efficiency, before step S106, the data packets that conform to the target message type are classified and corresponding operations are taken, and the method further includes:

[0092] Step 3.1), determine whether the message type of each data packet has a successfully matched target message type in the configuration file content.

[0093] Here, based on the key fields pre-configured in the configuration file content, that is, the field content of the target communication protocol corresponding to at least one target message type, the numerical value and string description corresponding to each target message type can be obtained, and based on the numerical value and description of the message type corresponding to each data packet obtained in the aforementioned embodiment, it can be determined whether the message type of each data packet matches the target message type.

[0094] Step 3.2), if the current data packet matches successfully, execute step S106 to parse the target data from the data packet corresponding to each target message type based on the configuration file content.

[0095] At this time, the data packet can be parsed to obtain target data that meets the requirements.

[0096] Step 3.3), if the current data packet fails to match, the current data packet is ignored.

[0097] Among them, there is no target data to be parsed in the current data packet, so such data packets are ignored to save unnecessary parsing operations.

[0098] Based on the above embodiment, if the message type of the data packet successfully matches the target message type in the configuration file content, step S106 may include:

[0099] Step 4.1), determine the element corresponding to each target message type according to the configuration file content.

[0100] It should be noted that for the same target communication protocol, each target message type may have slightly different corresponding elements. For example, the number of elements in data_struct may be different. The corresponding elements are determined from the configuration file content according to the target message type corresponding to each data packet.

[0101] Step 4.2), extract corresponding field contents from the data packet of each target message type based on the elements to determine the target data.

[0102] For example, according to the elements in the aforementioned embodiment, the starting position of the parsing in the data packet is known, and then the location of the message type is determined, and the message type value of each data packet is extracted to know its corresponding target message type. Then, according to the data structure corresponding to the target message type, the corresponding field content is extracted to determine the target data composed of part of the target communication protocol fields + application data.

[0103] In practical applications, the target data parsed in the above steps can be used to identify communication anomalies between the first target application process and the second target application process; the specific method also includes:

[0104] Step 5.1), determining a communication problem between the first target application process and the second target application process based on target data parsed from at least one data packet.

[0105] Exemplarily, in order to ensure the accuracy of communication problem identification, steps S104 to S106 of parsing the target data in the above-mentioned embodiment may be repeatedly executed until the preset requirements are met.

[0106] Among them, the preset requirements include reaching a preset parsing time, parsing a preset type or a preset number of target data contents, parsing a data packet corresponding to a preset type of message type, etc.; the preset requirements can be pre-configured in a configuration file; the preset requirements are determined based on a preliminary prediction problem between the first target application process and the second target application process.

[0107] Figure 2 A flow chart of another communication protocol data parsing method provided by an embodiment of the present invention.

[0108] First, read a configuration file in a unified format, such as a json file; according to the content of the file, build a standard data structure consistent with the configuration file in the memory, such as a map table; capture the data packet between the first target application process and the second target application process; according to the key fields in the configuration file, determine the starting parsing position data+postion from the original data of the data packet; read the content of length length from the data+postion position to determine the message type type; according to the message type type, search for a matching target message type in the map table; determine whether the message type type has a matching target message type in the map table, that is, match the message type type with at least one type_value of the message in the configuration file content to determine whether there is a matching target message type; if not, the data packet does not support the current target data parsing, and only stores the original data of the data packet without parsing operation; if so, search the corresponding message body data structure data_struct in the map table according to the target message type corresponding to the data packet, and according to the content of each protocol field of the data structure in the configuration file, that is, the detailed element content and element length, extract the corresponding data from the data packet starting from the data+postion+length position and parse them in sequence; store the parsed target data in the file.

[0109] Among them, the data packet to be parsed transmitted by the target communication protocol obtains the corresponding key field representation from the map table in the memory according to its corresponding message type, that is, the corresponding message body data structure data_struct, and then parses the target data in sequence according to its configured elements;

[0110] In some embodiments, if there are additions, deletions, and adjustments to the target communication protocol, the field expression corresponding to the changed protocol in the JSON file can be adjusted accordingly. After the change, a signal is sent to the parsing tool to trigger the tool to read the changed JSON file content, so that a new map is generated in the memory; before updating the map in the memory, the parsing tool can implement communication protocol data parsing based on the old map in the memory, that is, changes in the communication protocol will not affect the parsing application of the parsing tool, further ensuring parsing efficiency.

[0111] The embodiments of the present invention enable the parsing of private protocols, public protocols, and customized protocols without the need to develop different parsing tools according to different protocols. Instead, the protocol format only needs to be changed into a format expressible by json according to the format content specified by the json file. The parsing tool reads the json file and configures the protocol format through the json file. Without encoding, the parsing tool can parse data packets of any format according to the format content of the protocol. When the format of the protocol content changes, the parsing of the new protocol data can be completed by only modifying the json file, which is convenient for communication data packet capture and parsing and investigation of communication problems.

[0112] In some embodiments, Figure 3 As shown, the embodiment of the present invention further provides a communication protocol data parsing device 200, comprising:

[0113] The reading module 201 reads the configuration file content in response to the received load command, and stores the configuration file content in the memory; wherein the configuration file content is pre-configured with a key field for locating the target data to be parsed; the key field includes a field content of a target communication protocol corresponding to at least one target message type, and a plurality of elements for constituting the target communication protocol;

[0114] A determination module 202 captures at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determines a message type of each data packet according to the content of the configuration file;

[0115] The parsing module 203 parses target data from each data packet corresponding to the target message type based on the content of the configuration file if the message type is the target message type.

[0116] Furthermore, the reading module 201 is also specifically used to read the content of the configuration file when receiving a load command sent by the configuration tool; wherein, the configuration tool changes the configuration file when there are changes in the elements used to locate the target data, the target communication protocol and / or the target message type, and sends the load command when the change is completed; and stores the content of the configuration file in the memory in the form of a preset data structure.

[0117] Furthermore, the elements include the position of the target data to be parsed corresponding to the target communication protocol in the data packet, the position of the message type corresponding to the target communication protocol in the data packet, and the data content corresponding to each target message type transmitted based on the target communication protocol.

[0118] Furthermore, the determination module 202 is also specifically used to capture at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol; and determine the message type corresponding to each data packet from the corresponding position of each data packet according to the elements in the configuration file content.

[0119] In some embodiments, before the step of parsing the target data from each of the data packets based on the configuration file content if the message type is the target message type, the device is also used to: determine whether the message type of each of the data packets has a successfully matched target message type in the configuration file content; if the current data packet matches successfully, execute the step of parsing the target data from each data packet corresponding to the target message type based on the configuration file content; if the current data packet fails to match, ignore the current data packet; wherein, there is no target data to be parsed in the current data packet.

[0120] Furthermore, the parsing module 203 is also specifically used to determine the element corresponding to each of the target message types according to the content of the configuration file; and extract the corresponding field content from the data packet of each of the target message types based on the element to determine the target data.

[0121] In some embodiments, the apparatus is further configured to determine a communication problem between a first target application process and a second target application process based on the target data parsed from at least one data packet.

[0122] Figure 4 Schematic diagram of the hardware architecture of the electronic device 300 provided in an embodiment of the present invention. Figure 4 As shown, the electronic device 300 includes: a machine-readable storage medium 301 and a processor 302, and may also include a non-volatile storage medium 303, a communication interface 304 and a bus 305; wherein the machine-readable storage medium 301, the processor 302, the non-volatile storage medium 303 and the communication interface 304 communicate with each other through the bus 305. The processor 302 can execute the communication protocol data parsing method described in the above embodiment by reading and executing the machine-executable instructions for parsing the communication protocol data in the machine-readable storage medium 301.

[0123] The machine-readable storage medium mentioned in this article can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.

[0124] The non-volatile medium may be a non-volatile memory, a flash memory, a storage drive (such as a hard drive), any type of storage disk (such as a CD, DVD, etc.), or a similar non-volatile storage medium, or a combination thereof.

[0125] It can be understood that the specific operation methods of each functional module in this embodiment can refer to the detailed description of the corresponding steps in the above method embodiment, and will not be repeated here.

[0126] The computer-readable storage medium provided in the embodiment of the present invention stores a computer program. When the computer program code is executed, the communication protocol data parsing method described in any of the above embodiments can be implemented. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0128] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0129] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0130] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the aforementioned embodiments, those of ordinary skill in the art should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed by the present invention, or can easily conceive of changes, or make equivalent replacements for some of the technical features therein. Such modifications, changes or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention.

Claims

1. A method for parsing communication protocol data, characterized in that: include: Reading the configuration file content in response to the received load command, and storing the configuration file content in the memory; wherein the configuration file content is pre-configured with a key field for locating the target data to be parsed; the key field includes a field content of a target communication protocol corresponding to at least one target message type, and a plurality of elements for constituting the target communication protocol; Capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determining a message type of each of the data packets according to the content of the configuration file; If the message type is the target message type, target data is parsed from each data packet corresponding to the target message type based on the content of the configuration file.

2. The method according to claim 1, characterized in that The step of reading the configuration file content in response to the received load command and storing the configuration file content in the memory comprises: When receiving a load command sent by a configuration tool, reading the content of the configuration file; wherein the configuration tool changes the configuration file when there is a change in the element used to locate the target data, the target communication protocol and / or the target message type, and sends the load command when the change is completed; The configuration file content is stored in the memory in the form of a preset data structure.

3. The method according to claim 1, characterized in that The elements include the position of the target data to be parsed corresponding to the target communication protocol in the data packet, the position of the message type corresponding to the target communication protocol in the data packet, and the data content corresponding to each target message type transmitted based on the target communication protocol.

4. The method according to claim 3, characterized in that The step of capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determining the message type of each data packet according to the content of the configuration file comprises: Capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol; According to the elements in the configuration file content, the message type corresponding to each of the data packets is determined from the corresponding position of each of the data packets.

5. The method according to claim 1, characterized in that Before the step of parsing target data from each of the data packets based on the content of the configuration file if the message type is the target message type, the method further includes: Determine whether the message type of each data packet has a successfully matched target message type in the configuration file content; If the current data packet matches successfully, then executing the step of parsing the target data from the data packets corresponding to each of the target message types based on the content of the configuration file; If the current data packet fails to match, the current data packet is ignored; wherein the current data packet does not contain target data to be parsed.

6. The method according to claim 1, characterized in that The step of parsing target data from a data packet corresponding to each target message type based on the content of the configuration file comprises: Determine, according to the content of the configuration file, an element corresponding to each of the target message types; Based on the elements, corresponding field contents are extracted from each data packet of the target message type to determine target data.

7. The method according to claim 1, characterized in that The method further comprises: A communication problem between the first target application process and the second target application process is determined according to the target data parsed from at least one data packet.

8. A communication protocol data parsing device, characterized in that: include: A reading module, in response to a received load command, reads the configuration file content and stores the configuration file content in a memory; wherein the configuration file content is pre-configured with a key field for locating the target data to be parsed; the key field includes a field content of a target communication protocol corresponding to at least one target message type, and a plurality of elements for constituting the target communication protocol; A determination module, capturing at least one data packet transmitted between the first target application process and the second target application process based on the target communication protocol, and determining a message type of each of the data packets according to the content of the configuration file; The parsing module parses the target data from each data packet corresponding to the target message type based on the content of the configuration file if the message type is the target message type.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the steps of the method described in any one of claims 1 to 7.