Data processing method and device, electronic equipment, storage medium and automobile
By obtaining the original Ethernet packets from the vehicle and analyzing real-time protocol packets, the problem of not being able to conveniently parse DDS data in the existing technology is solved, and real-time analysis and testing efficiency of DDS data are improved.
Patent Information
- Application Number
- CN202510094743.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, DDS data cannot be easily parsed, resulting in the impact of testing efficiency.
By obtaining the original Ethernet packets from the vehicle when the terminal device is connected to the vehicle, extracting real-time protocol packets, analyzing topic information and message types, and analyzing real-time protocol packets based on custom standard files to obtain the analysis results.
Real-time parsing of DDS data is realized, improving the analysis and testing efficiency of DDS data by testers.
Smart Images

Figure CN119906768A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, electronic equipment, storage medium and automobile. Background Art
[0002] DDS (Data Distribution Service) is a new generation of distributed real-time communication middleware protocol. It adopts a publish / subscribe architecture, emphasizes data-centricity, and provides a rich set of QoS (Quality of Service) strategies to ensure real-time, efficient, and flexible data distribution, and can meet the needs of various distributed real-time communication applications.
[0003] DDS can be used to solve the compatibility issues of a large number of software upgrades in complex network environments. At present, domestic OEMs use the DDS communication middleware protocol. DDS can support the future of automobiles facing the Internet of Everything and provide a higher-level user-defined function experience. Therefore, the DDS-based in-vehicle communication protocol will gradually be promoted in major OEMs.
[0004] Since the various components in the DDS integrated system provide low-latency data connection, high reliability and highly scalable architecture, they have been valued and applied by OEMs. The disadvantage brought about by the application of new technologies is that there is no mature DDS data analysis solution, which brings great inconvenience to testers when conducting data analysis and seriously affects the test efficiency. Therefore, the first problem that testers need to solve is how to realize the analysis of DDS data. Summary of the invention
[0005] One of the purposes of the present invention is to provide a data processing method to solve the problem in the prior art that DDS data cannot be easily parsed.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A data processing method, the method comprising:
[0008] When the terminal device and the vehicle are in communication connection, obtaining an Ethernet original message from the vehicle;
[0009] Extracting a real-time protocol message from the Ethernet original message;
[0010] Extracting subject information from the real-time protocol message;
[0011] Determining a message type corresponding to the real-time protocol message;
[0012] When it is determined according to the subject information that the real-time protocol message is valid data, the real-time protocol message is parsed according to the message type and a preset custom standard file to obtain a parsing result.
[0013] Furthermore, the vehicle includes at least one network card, and when the terminal device is connected to the vehicle, obtaining an Ethernet original message from the vehicle includes:
[0014] When the terminal device is connected to the vehicle, a network card option and a start option are displayed in a graphical user interface provided by the terminal device;
[0015] In response to a selection operation on the network card option, determining a target network card from the network cards;
[0016] In response to a selection operation on the start option, an Ethernet original message of the target network card is obtained from the vehicle.
[0017] Further, extracting the real-time protocol message from the Ethernet original message includes:
[0018] Extracting a communication protocol message from the Ethernet original message; wherein the communication protocol message at least includes a message of the UDP protocol and / or the TCP protocol;
[0019] A real-time protocol message is extracted from the communication protocol message data; the real-time protocol message at least includes a message of the RTPS protocol.
[0020] Furthermore, the Ethernet original message is a message of the DDS protocol, and whether the real-time protocol message is valid data is determined according to the subject information in the following manner:
[0021] Obtaining a preset topic cluster; the preset topic cluster is generated by collecting topic information of the DDS protocol;
[0022] When the topic information matches the topic information in the preset topic cluster, determining that the real-time protocol message is valid data;
[0023] When the topic information does not match the topic information in the preset topic cluster, it is determined that the real-time protocol message is invalid data.
[0024] Further, determining the message type corresponding to the real-time protocol message includes:
[0025] Extracting a sub-message from the real-time protocol message and determining a data structure of the sub-message;
[0026] When the data structure of the sub-message matches the message structure of the DDS protocol, the message type of the matched message structure of the DDS protocol is determined as the message type corresponding to the real-time protocol message.
[0027] Further, parsing the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result includes:
[0028] Extracting serialized data from the real-time protocol message according to a data structure corresponding to the message type;
[0029] Slicing the serialized data to obtain a vehicle interaction application data stream;
[0030] Obtaining a custom standard file; the custom standard file includes parsed content corresponding to the vehicle interactive application data stream;
[0031] Acquire parsed content matching the vehicle interactive application data stream from the custom standard file as a parsing result;
[0032] The analysis result is displayed in a graphical user interface provided by the terminal device.
[0033] Further, after obtaining parsing content matching the vehicle interactive application data stream from the custom standard file as a parsing result, the method further includes:
[0034] The parsing result is transmitted to an automated test script so as to perform automated testing on the vehicle through the automated test script.
[0035] Further, when it is determined according to the subject information that the real-time protocol message is valid data, after parsing the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result, the method further includes:
[0036] Displaying a stop option in a graphical user interface provided by the terminal device;
[0037] In response to a selection operation on the stop option, parsing the real-time protocol message according to the message type and the preset custom standard file to obtain the parsing result is stopped.
[0038] Furthermore, the terminal device communicates with the vehicle via a cabinet, and the cabinet is used to communicate with the vehicle using an on-board communication protocol, and to communicate with the terminal device using Ethernet.
[0039] Furthermore, a script project is deployed in the terminal device, and at least one function is deployed in the script project; when the terminal device is communicated with the vehicle, data processing is performed by calling the corresponding function in the script project.
[0040] The present invention also provides a data processing device, the device comprising:
[0041] An Ethernet original message acquisition module, used to acquire an Ethernet original message from the vehicle when the terminal device and the vehicle are in communication connection;
[0042] A real-time protocol message extraction module, used to extract the real-time protocol message from the Ethernet original message;
[0043] A subject information extraction module, used to extract subject information from the real-time protocol message;
[0044] A message type determination module, used to determine the message type corresponding to the real-time protocol message;
[0045] The real-time protocol message parsing module is used to parse the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result when the real-time protocol message is determined to be valid data according to the subject information.
[0046] The present invention also provides an electronic device, comprising:
[0047] processor;
[0048] a memory for storing instructions executable by the processor;
[0049] The processor is configured to execute the instructions to implement the data processing method as described in the first aspect.
[0050] The present invention also provides a computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the mobile terminal, the mobile terminal can execute the data processing method as described in the first aspect of the present application.
[0051] Beneficial effects of the present invention:
[0052] When the embodiment of the present invention is in communication connection between the terminal device and the vehicle, the Ethernet original message can be obtained from the vehicle, the real-time protocol message can be extracted from the Ethernet original message, and then the subject information can be extracted from the real-time protocol message and the message type corresponding to the real-time protocol message can be determined, wherein when the real-time protocol message is determined to be valid data according to the subject information, the real-time protocol message can be parsed according to the message type and the preset custom standard file to obtain the parsing result. The custom standard file of the embodiment of the present invention is formulated for DDS data, and the custom standard file includes the parsing content corresponding to the characters. When the terminal device obtains the Ethernet original message from the vehicle, that is, DDS data, after determining that the real-time protocol message is valid data according to the subject information, the real-time protocol message can be parsed into a parsing result that can be understood by the tester or the automated test tool based on the message type and the custom standard file, thereby achieving real-time parsing of the DDS data, which greatly facilitates the efficiency of the tester's analysis and testing of the DDS data. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is a flow chart of an embodiment of a data processing method provided in an embodiment of the present invention;
[0054] Figure 2 is a schematic diagram of an application environment provided in an embodiment of the present invention;
[0055] Figure 3 is a schematic diagram of a graphical user interface provided in an embodiment of the present invention;
[0056] Figure 4 It is a principle diagram of a real-time analysis process of DDS data provided in an embodiment of the present invention;
[0057] Figure 5 A schematic diagram of the structure of a data processing device embodiment provided in an embodiment of the present invention;
[0058] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0060] Reference Figure 1, is a flow chart of an embodiment of a data processing method provided in an embodiment of the present invention, such as Figure 1 As shown, the following steps are included:
[0061] Step 101, when the terminal device is in communication connection with the vehicle, obtaining an Ethernet original message from the vehicle;
[0062] Among them, the DDS data of the Ethernet original message vehicle. In an embodiment of the present invention, when the terminal device and the vehicle are in communication connection, the Ethernet original message (Ethernet message) can be obtained from the vehicle in real time. Exemplarily, the terminal device can be a PC (Personal Computer) or other device with certain computing capabilities.
[0063] In a specific implementation, vehicles usually communicate using an on-board communication protocol, such as CAN, LIN, SomeIP, etc. Based on the on-board communication protocol, the vehicle can obtain various data about the vehicle, such as the vehicle's rotation speed, the state of the door, the vehicle's ambient temperature, the vehicle's speed, the charging state, the steering angle, and other data about the vehicle. Terminal devices such as personal computers usually communicate using Ethernet, and there is no direct communication connection between the terminal device and the vehicle. Therefore, in an embodiment of the present invention, a cabinet can be deployed between the terminal device and the vehicle, so that the terminal device and the vehicle can communicate through the cabinet. The cabinet is used to communicate with the vehicle using the on-board communication protocol, and to communicate with the terminal device using Ethernet. Exemplarily, the cabinet can be a HIL (Hardware-In-the-Loop) test cabinet, which is a device used for automotive electronic control units (ECUs) and system-level testing.
[0064] In one embodiment of the present invention, referring to Figure 2 , is a schematic diagram of an application environment provided in an embodiment of the present invention, a script project is deployed in the terminal device, and at least one function is deployed in the script project; when the terminal device is in communication connection with the vehicle, the corresponding function in the script project is called to perform data processing. Specifically, the script project can be a script project written based on the python framework, and python 3.8 and above are deployed in the computer. A new python script project is created. For example, the python script project can be named "DDS decoding", and then, the Queue, Process, sniff, zerorpc, LogManager, time, Ether, UDP and other functions are introduced in the newly created "DDS decoding" python script project. It should be noted here that the sniff function is the most basic and most critical. The function of the sniff function is to obtain the original Ethernet message from the network port.
[0065] Step 102: extracting a real-time protocol message from the Ethernet original message;
[0066] In the specific implementation, the DDS protocol is a communication protocol developed based on the RTPS (Real-Time Publish-Subscribe) protocol specification, which is used to implement the data publishing and subscription mechanism. The original Ethernet message usually includes some useless data. Therefore, after obtaining the original Ethernet message, the real-time protocol message (RTPS message) can be extracted from the original Ethernet message, and then subsequent processing can be performed to avoid useless data affecting the subsequent analysis of DDS data.
[0067] Step 103: extracting subject information from the real-time protocol message;
[0068] In a specific implementation, in the RTPS protocol, Topic (topic information) is used to identify and classify data. Topic can be used to distinguish different data types or data streams. Each Topic has a unique name. Publishers and subscribers exchange data through Topic. In an embodiment of the present invention, the terminal device can extract topic information from the real-time protocol message based on script engineering.
[0069] Step 104: Determine the message type corresponding to the real-time protocol message;
[0070] In a specific implementation, a plurality of message types are defined in the DDS protocol, and different message types have corresponding data structures, and different data structures have different data lengths, start bits, etc. For example, message types such as Request, Reply, and Ntf are defined in the DDS protocol. In an embodiment of the present invention, the terminal device can determine the message type of the real-time protocol message based on the script engineering.
[0071] Step 105: When it is determined according to the subject information that the real-time protocol message is valid data, the real-time protocol message is parsed according to the message type and a preset custom standard file to obtain a parsing result.
[0072] Among them, the custom standard file is an arxml file customized by the car company. It can be understood that different car companies have different definitions of different strings. Therefore, a custom standard file is formulated in the embodiment of the present invention. Based on the custom standard file, the analysis content corresponding to each string can be determined, such as the door status, vehicle ambient temperature, etc.
[0073] In the embodiment of the present invention, when the subject information and the message type of the real-time protocol message are obtained, it can be first determined whether the real-time protocol message is valid data based on the subject information. If it is determined that the real-time protocol message is invalid data, it is not necessary to perform a parsing process and it can be directly discarded. If it is determined that the real-time protocol message is valid data, the real-time protocol message can be further parsed according to the data structure corresponding to the message type and the custom standard file to obtain a parsing result, and then the parsing result can be provided to the tester for corresponding processing.
[0074] The embodiment of the present invention proposes a DDS data analysis solution based on the python framework, which cleverly solves the problem of DDS data analysis, has no strong dependence on hardware, can be quickly deployed on terminal devices such as computers, and can be used for mastering. In addition, the embodiment of the present invention only needs to deploy a script project based on the python framework on the terminal device, which is low-cost, has no additional data acquisition hardware requirements, only requires a computer, and can also be extended to the analysis of DOIP (Diagnostic communication over Internet Protocol, diagnostic communication based on Internet protocol) Ethernet protocol, solving the purpose of real-time data analysis in OTA (Over-The-Air) and other test processes.
[0075] In the above data processing method, when the terminal device and the vehicle are in communication connection, the Ethernet original message can be obtained from the vehicle, the real-time protocol message can be extracted from the Ethernet original message, and then the subject information can be extracted from the real-time protocol message and the message type corresponding to the real-time protocol message can be determined, wherein, when the real-time protocol message is determined to be valid data according to the subject information, the real-time protocol message can be parsed according to the message type and the preset custom standard file to obtain the parsing result. The custom standard file of the embodiment of the present invention is formulated for DDS data, and the custom standard file includes the parsing content corresponding to the characters. When the terminal device obtains the Ethernet original message from the vehicle, that is, DDS data, after determining that the real-time protocol message is valid data according to the subject information, the real-time protocol message can be parsed into a parsing result that can be understood by the tester or the automated test tool based on the message type and the custom standard file, thereby realizing the convenient parsing of the DDS data and improving the test efficiency of the tester on the vehicle.
[0076] In one embodiment of the present invention, the vehicle includes at least one network card, and when the terminal device is connected to the vehicle, obtaining an Ethernet original message from the vehicle includes:
[0077] When the terminal device is connected to the vehicle, a network card option and a start option are displayed in a graphical user interface provided by the terminal device;
[0078] In response to a selection operation on the network card option, determining a target network card from the network cards;
[0079] In response to a selection operation on the start option, an Ethernet original message of the target network card is obtained from the vehicle.
[0080] In specific implementations, a vehicle can usually be equipped with multiple network cards to support different in-vehicle network communication needs. For example, a vehicle can be equipped with multiple network cards such as an in-vehicle Ethernet network card, a CAN network card, a LIN network card, etc., which can be used to transmit high-definition video and audio, control engine fuel injection and ignition, control windows, doors, seats, etc.
[0081] Since the process of parsing DDS data (Ethernet raw messages) consumes more memory in the personal computer and affects the operating efficiency of the personal computer, a graphical user interface is also designed in the embodiment of the present invention to facilitate the tester to manually control the parsing process of the DDS data, such as determining the network card that needs to be monitored and whether to start parsing the acquired DDS data.
[0082] Reference Figure 3 , is a graphical user interface (pyhon-UI interface) provided in an embodiment of the present invention, which can be displayed to the tester through the display screen of the terminal device. The graphical user interface can include network card options for the vehicle's network card. The tester first selects one or more network cards to be monitored as target network cards (of course, all network cards can also be selected), and then clicks the start option (the "Run" button in the graphical user interface, which becomes the "Stop" button after clicking the "Run" button), and then starts to parse the DDS data obtained from the vehicle in real time, and finally clicks stop to stop the parsing.
[0083] In the above embodiment, a graphical user interface is provided on the terminal device, so that the tester can select the network card on the vehicle to be monitored according to the graphical user interface, or select whether to start parsing the acquired DDS data according to the graphical user interface, so that the tester can grasp the process of the vehicle's DDS data according to needs, thereby lowering the usage threshold for the tester.
[0084] In one embodiment of the present invention, extracting the real-time protocol message from the Ethernet original message includes:
[0085] Extracting a communication protocol message from the Ethernet original message; wherein the communication protocol message at least includes a message of the UDP protocol and / or the TCP protocol;
[0086] A real-time protocol message is extracted from the communication protocol message data; the real-time protocol message at least includes a message of the RTPS protocol.
[0087] In the Python script project of the embodiment of the present invention, a sniffer function is customized, and a callback function pack_callback(packet) is customized in the sniffer function. The callback function is used to filter out UDP protocol messages and TCP protocol messages in the original Ethernet messages. The sniff function is introduced into the sniffer function, and the sniff function calls back pack_callback(packet). Based on the above structure, the customized sniffer function can filter out UDP protocol messages and TCP protocol messages from the original Ethernet data of the network port as communication protocol messages.
[0088] In the python script project of the embodiment of the present invention, a parse_rtps_message function is also customized, and its function is to further filter the communication protocol message, filter out the Ethernet data of the RTPS protocol, that is, the RTPS message (real-time protocol message), and then the real-time protocol message can be parsed to obtain the parsing result.
[0089] In one embodiment of the present invention, the Ethernet original message is a message of the DDS protocol, and whether the real-time protocol message is valid data is determined according to the subject information in the following manner:
[0090] Obtaining a preset topic cluster; the preset topic cluster is generated by collecting topic information of the DDS protocol;
[0091] When the topic information matches the topic information in the preset topic cluster, determining that the real-time protocol message is valid data;
[0092] When the topic information does not match the topic information in the preset topic cluster, it is determined that the real-time protocol message is invalid data.
[0093] In the python script project of the embodiment of the present invention, a data_provide_server function is further customized, and its function is to print the RTPS message filtered by the parse_rtps_message function in a file of a specified format in real time. For example, the file of the specified format may be a .txt (plain text file).
[0094] In the Python scripting project of the embodiment of the present invention, a custom
[0095] The parse_rtps_subMessage_DATA_PL function extracts the topic (topic information) from the RTPS message printed in real time in .txt, and compares the extracted topic with the established topic cluster (preset topic cluster). If the topic extracted from the RTPS message is contained in the topic cluster, that is, the topic extracted from the RTPS message has a match in the topic cluster, then this group of RTPS messages is valid DDS data, and then the RTPS message can be parsed. Otherwise, this group of RTPS messages is invalid DDS data and can be discarded without parsing.
[0096] It should also be added that in the DDS protocol, each service corresponds to a topic (each service contains N methods, Request, Reply, and Ntf are all methods in the service). There are hundreds of services used in vehicle communication, and it is difficult to count all topics at one time. In addition, services may change. Therefore, the embodiment of the present invention further defines a function in the python script project, namely the parse_rtps_subMessage_DATA_serializedData function, which is used to continuously collect topics and form topic clusters. The principle is to parse and extract topics from RTPS messages, and automatically compare and check the extracted topics with the original topic clusters. If the original topic cluster does not have the topic, the topic cluster absorbs it, otherwise it does not. It should be noted that only after each power failure and restart, due to the internal mechanism of DDS, a large number of topics will be issued at this time. The parse_rtps_subMessage_DATA_serializedData function in the python script project absorbs new topics in this process.
[0097] In one embodiment of the present invention, determining the message type corresponding to the real-time protocol message includes:
[0098] Extracting a sub-message from the real-time protocol message and determining a data structure of the sub-message;
[0099] When the data structure of the sub-message matches the message structure of the DDS protocol, the message type of the matched message structure of the DDS protocol is determined as the message type corresponding to the real-time protocol message.
[0100] In the Python scripting project of the embodiment of the present invention, a custom
[0101] The function of parse_rtps_subMessage_DATA_CDR is to further parse the RTPS message printed in real time in .txt and filter out the corresponding data structure. For example, it can be the data structure (structure) corresponding to different message types such as Request, Reply, Ntf, etc. The data length and start bit of the data structure corresponding to different message types such as Request, Reply, Ntf are different. It is possible that each car company will have a customized data length and start bit in the future. Therefore, the DDS communication protocol middleware developed based on the RTPS protocol specification also has the characteristics of differentiation and customization. Therefore, before the industry is forced to unify, the DDS analysis cannot be as universal as the CAN analysis in the industry, but the DDS analysis method is unified and can be fully referenced and quoted.
[0102] Specifically, the parse_rtps_subMessage_DATA_CDR function can extract sub-messages (subMessage) from the RTPS message. Each sub-message has a corresponding message type, and its sub-messages have specific types and formats, such as specific data lengths, start bits and other different data structures. Sub-messages are used to perform different functions. Therefore, the embodiment of the present invention can extract sub-messages from the RTPS message and then further determine the corresponding message type according to the data structure of the sub-message.
[0103] In one embodiment of the present invention, parsing the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result includes:
[0104] extracting serialized data from the real-time protocol message according to a data structure corresponding to the message type;
[0105] Slicing the serialized data to obtain a vehicle interaction application data stream;
[0106] Obtaining a custom standard file; the custom standard file includes parsed content corresponding to the vehicle interactive application data stream;
[0107] Acquire parsed content matching the vehicle interactive application data stream from the custom standard file as a parsing result;
[0108] The analysis result is displayed in a graphical user interface provided by the terminal device.
[0109] In an embodiment of the present invention, according to the message type, such as Request, Reply, Ntf and other message types, serialized data (serializeData) is extracted from the RTPS message, and then the extracted serializeData is sliced to obtain a vehicle interaction application data stream. The parsed content corresponding to the vehicle interaction application data stream (as a string) can be found in the custom standard file customized by the car manufacturer. The parsed content (usually the corresponding Chinese interpretation) that matches the vehicle interaction application data stream can be automatically searched in the custom standard file customized by the car manufacturer, and the matched parsed content is used as the parsing result, thereby realizing the parsing of the DDS data.
[0110] In some preferred schemes, after obtaining the analysis results of the DDS data, the analysis results of the DDS can be displayed in a graphical user interface displayed on the display screen of the terminal device, so that the tester can intuitively obtain the relevant data of the vehicle, and then test or repair the vehicle according to actual needs.
[0111] In one embodiment of the present invention, after obtaining parsed content matching the vehicle interactive application data stream from the custom standard file as a parsing result, the method further includes:
[0112] The parsing result is transmitted to an automated test script so as to perform automated testing on the vehicle through the automated test script.
[0113] In some preferred solutions, an automated test script may also be deployed in the terminal device.
[0114] In an embodiment of the present invention, the analysis result is a result that can be understood by the tester or the automated test script. Therefore, if the tester hopes to further obtain more information, the parsed analysis result can open an interface to the automated test script, thereby transmitting the analysis result to the automated test script to realize logical analysis and processing of DDS data during automated testing.
[0115] In one embodiment of the present invention, when it is determined according to the subject information that the real-time protocol message is valid data, after parsing the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result, the method further includes:
[0116] Displaying a stop option in a graphical user interface provided by the terminal device;
[0117] In response to a selection operation on the stop option, parsing the real-time protocol message according to the message type and the preset custom standard file to obtain the parsing result is stopped.
[0118] Reference Figure 3, is a graphical user interface (pyhon-UI interface) provided in an embodiment of the present invention. In addition to including a stop option (a "stop" button in the graphical user interface), if the tester selects the stop option, such as clicking the "stop" button, the parsing of the DDS data obtained from the vehicle in real time will be stopped.
[0119] In the above embodiment, through the graphical user interface, the tester can conveniently control when to start parsing the DDS data and when to stop parsing the DDS data, which can reduce the memory consumption of the personal computer and avoid affecting the operating efficiency of the personal computer.
[0120] The technical implementation principle of the embodiment of the present invention is: first, the sniff function is used to call back pack_callback() to capture the original Ethernet data of the TCP and UDP protocols and store the data in real time in txt format; secondly, the txt format is converted into json format; finally, the json format data is sliced and parsed based on the DDS protocol, and the automated test script can call the parsed value in json.
[0121] In order to enable those skilled in the art to better understand the embodiments of the present invention, a complete example is used below to illustrate the parsing process of DDS data in the embodiments of the present invention.
[0122] Reference Figure 4 , is a schematic diagram of a real-time analysis process of DDS data provided in an embodiment of the present invention, and the specific steps may include:
[0123] 401. The ECU under test sends an Ethernet original message;
[0124] 402. The computer is connected to the ECU via an Ethernet cable and collects the original Ethernet messages sent by the ECU;
[0125] 403. The sniff function in the Python script project deployed to the computer obtains the original Ethernet message monitored by the computer network port;
[0126] 404. Filter out communication protocol messages of UDP protocol and TCP protocol from the original Ethernet message;
[0127] 405. Further filter out the real-time protocol message (RTPS message) of the RTPS protocol from the communication protocol message;
[0128] 406. The filtered real-time protocol message is printed in real time in .txt;
[0129] 407. Slice the real-time protocol message printed in .txt, extract the topic, and identify whether the current real-time protocol message is a Request, Reply, or Ntf message type;
[0130] 408. Extract serializeData (serialized data) from the RTPS messages of the three message types of Request, Reply, and Ntf and slice them to obtain the vehicle interaction application data stream;
[0131] 409. According to the arxml file customized by the automobile enterprise, the vehicle interactive application data stream is automatically parsed to obtain the parsing result; before receiving an instruction to stop parsing (for example, clicking the stop option in the graphical user interface), it will return to step 402 to continue the parsing process of the DDS data.
[0132] In summary, the embodiment of the present invention proposes a method based on the python programming language framework to achieve the purpose of DDS data parsing. By introducing the sniff function, the sniff function can continuously capture the Ethernet original message (DDS data) at the network port end, and then customize a callback function pack_callback(). The function of the callback function is to filter out the TCP protocol and UDP protocol messages in the DDS data, and call back pack_callback() through the sniff function to capture the Ethernet original data of the TCP protocol and UDP protocol and store the data in real time in txt format. Finally, based on the DDS protocol specification, the Ethernet original message stored in txt format is sliced, matched, and other parsing processes are performed to achieve the purpose of real-time parsing of the vehicle's DDS data, which greatly facilitates the test personnel to analyze the DDS data. In addition, the parsing results after parsing the DDS data can also open interfaces to the automated test script to realize the logical analysis and processing of the DDS data during automated testing.
[0133] Reference Figure 5 , is a structural block diagram of an embodiment of a data processing device provided in an embodiment of the present invention, such as Figure 5 As shown, it includes the following modules:
[0134] The Ethernet original message acquisition module 501 is used to acquire the Ethernet original message from the vehicle when the terminal device and the vehicle are in communication connection;
[0135] A real-time protocol message extraction module 502, used to extract the real-time protocol message from the Ethernet original message;
[0136] The subject information extraction module 503 is used to extract subject information from the real-time protocol message;
[0137] A message type determination module 504, used to determine the message type corresponding to the real-time protocol message;
[0138] The real-time protocol message parsing module 505 is configured to parse the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result when the real-time protocol message is determined to be valid data according to the subject information.
[0139] In one embodiment of the present invention, the vehicle includes at least one network card, an Ethernet original message acquisition module 501, which is used to:
[0140] When the terminal device is connected to the vehicle, a network card option and a start option are displayed in a graphical user interface provided by the terminal device;
[0141] In response to a selection operation on the network card option, determining a target network card from the network cards;
[0142] In response to a selection operation on the start option, an Ethernet original message of the target network card is obtained from the vehicle.
[0143] In one embodiment of the present invention, the real-time protocol message extraction module 502 is used to:
[0144] Extracting a communication protocol message from the Ethernet original message; wherein the communication protocol message at least includes a message of the UDP protocol and / or the TCP protocol;
[0145] A real-time protocol message is extracted from the communication protocol message data; the real-time protocol message at least includes a message of the RTPS protocol.
[0146] In one embodiment of the present invention, the Ethernet original message is a message of the DDS protocol, and whether the real-time protocol message is valid data is determined according to the subject information in the following manner:
[0147] Obtaining a preset topic cluster; the preset topic cluster is generated by collecting topic information of the DDS protocol;
[0148] When the topic information matches the topic information in the preset topic cluster, determining that the real-time protocol message is valid data;
[0149] When the topic information does not match the topic information in the preset topic cluster, it is determined that the real-time protocol message is invalid data.
[0150] In one embodiment of the present invention, the message type determination module 504 is used to:
[0151] Extracting a sub-message from the real-time protocol message and determining a data structure of the sub-message;
[0152] When the data structure of the sub-message matches the message structure of the DDS protocol, the message type of the matched message structure of the DDS protocol is determined as the message type corresponding to the real-time protocol message.
[0153] In one embodiment of the present invention, the real-time protocol message parsing module 505 is used to:
[0154] Extracting serialized data from the real-time protocol message according to a data structure corresponding to the message type;
[0155] Slicing the serialized data to obtain a vehicle interaction application data stream;
[0156] Obtaining a custom standard file; the custom standard file includes parsed content corresponding to the vehicle interactive application data stream;
[0157] Acquire parsed content matching the vehicle interactive application data stream from the custom standard file as a parsing result;
[0158] The analysis result is displayed in a graphical user interface provided by the terminal device.
[0159] In one embodiment of the present invention, the device further comprises: an automated testing module, configured to:
[0160] The parsing result is transmitted to an automated test script so as to perform automated testing on the vehicle through the automated test script.
[0161] In one embodiment of the present invention, the device further comprises: a stopping module, for
[0162] Displaying a stop option in a graphical user interface provided by the terminal device;
[0163] In response to a selection operation on the stop option, parsing the real-time protocol message according to the message type and the preset custom standard file to obtain the parsing result is stopped.
[0164] In one embodiment of the present invention, the terminal device communicates with the vehicle via a cabinet, and the cabinet is used to communicate with the vehicle using an on-board communication protocol, and to communicate with the terminal device using Ethernet.
[0165] In one embodiment of the present invention, a script project is deployed in the terminal device, and at least one function is deployed in the script project; when the terminal device is communicated with the vehicle, data processing is performed by calling the corresponding function in the script project.
[0166] When the embodiment of the present invention is in communication connection between the terminal device and the vehicle, the Ethernet original message can be obtained from the vehicle, the real-time protocol message can be extracted from the Ethernet original message, and then the subject information can be extracted from the real-time protocol message and the message type corresponding to the real-time protocol message can be determined, wherein when the real-time protocol message is determined to be valid data according to the subject information, the real-time protocol message can be parsed according to the message type and the preset custom standard file to obtain the parsing result. The custom standard file of the embodiment of the present invention is formulated for DDS data, and the custom standard file includes the parsing content corresponding to the characters. When the terminal device obtains the Ethernet original message from the vehicle, that is, DDS data, after determining that the real-time protocol message is valid data according to the subject information, the real-time protocol message can be parsed into a parsing result that can be understood by the tester or the automated test tool based on the message type and the custom standard file, thereby achieving real-time parsing of the DDS data, which greatly facilitates the efficiency of the tester's analysis and testing of the DDS data.
[0167] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0168] The embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 801, a device interface 802, and a memory
[0169] 803 and bus 804;
[0170] Memory 803, used for storing computer programs;
[0171] The processor 801 is used to execute the program stored in the memory 803, and implements the following steps:
[0172] When the terminal device and the vehicle are in communication connection, obtaining an Ethernet original message from the vehicle;
[0173] Extracting a real-time protocol message from the Ethernet original message;
[0174] Extracting subject information from the real-time protocol message;
[0175] Determining a message type corresponding to the real-time protocol message;
[0176] When it is determined according to the subject information that the real-time protocol message is valid data, the real-time protocol message is parsed according to the message type and a preset custom standard file to obtain a parsing result.
[0177] The bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0178] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0179] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0180] The present invention also provides a storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the vehicle peak-shifting communication method of the aforementioned embodiment.
[0181] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0182] The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. According to the above description, it is obvious that the structure required for constructing this type of device is. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific language is to disclose the best mode of the present invention.
[0183] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0184] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0185] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0186] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0187] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0188] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0189] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0190] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0191] It should be noted that the various data-related processes in the embodiments of the present application are all carried out in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.
Claims
1. A data processing method, characterized in that: The method comprises: When the terminal device and the vehicle are in communication connection, obtaining an Ethernet original message from the vehicle; Extracting a real-time protocol message from the Ethernet original message; Extracting subject information from the real-time protocol message; Determining a message type corresponding to the real-time protocol message; When it is determined according to the subject information that the real-time protocol message is valid data, the real-time protocol message is parsed according to the message type and a preset custom standard file to obtain a parsing result.
2. The method according to claim 1, characterized in that The vehicle includes at least one network card, and when the terminal device is connected to the vehicle, obtaining an Ethernet original message from the vehicle includes: When the terminal device is connected to the vehicle, a network card option and a start option are displayed in a graphical user interface provided by the terminal device; In response to a selection operation on the network card option, determining a target network card from the network cards; In response to a selection operation on the start option, an Ethernet original message of the target network card is obtained from the vehicle.
3. The method according to claim 1, characterized in that Extracting a real-time protocol message from the Ethernet original message includes: Extracting a communication protocol message from the Ethernet original message; wherein the communication protocol message at least includes a message of the UDP protocol and / or the TCP protocol; A real-time protocol message is extracted from the communication protocol message data; the real-time protocol message at least includes a message of the RTPS protocol.
4. The method according to claim 1, characterized in that: The Ethernet original message is a message of the DDS protocol, and whether the real-time protocol message is valid data is determined according to the subject information in the following manner: Obtaining a preset topic cluster; the preset topic cluster is generated by collecting topic information of the DDS protocol; When the topic information matches the topic information in the preset topic cluster, determining that the real-time protocol message is valid data; When the topic information does not match the topic information in the preset topic cluster, it is determined that the real-time protocol message is invalid data.
5. The method according to claim 4, characterized in that Determining a message type corresponding to the real-time protocol message includes: Extracting a sub-message from the real-time protocol message and determining a data structure of the sub-message; When the data structure of the sub-message matches the message structure of the DDS protocol, the message type of the matched message structure of the DDS protocol is determined as the message type corresponding to the real-time protocol message.
6. The method according to claim 2, characterized in that Parsing the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result includes: extracting serialized data from the real-time protocol message according to a data structure corresponding to the message type; Slicing the serialized data to obtain a vehicle interaction application data stream; Obtaining a custom standard file; the custom standard file includes parsed content corresponding to the vehicle interactive application data stream; Acquire parsed content matching the vehicle interactive application data stream from the custom standard file as a parsing result; The analysis result is displayed in a graphical user interface provided by the terminal device.
7. The method according to claim 6, characterized in that After obtaining parsing content matching the vehicle interaction application data stream from the custom standard file as a parsing result, the method further includes: The parsing result is transmitted to an automated test script so as to perform automated testing on the vehicle through the automated test script.
8. The method according to claim 2, characterized in that: When it is determined according to the subject information that the real-time protocol message is valid data, after parsing the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result, the method further includes: Displaying a stop option in a graphical user interface provided by the terminal device; In response to a selection operation on the stop option, parsing the real-time protocol message according to the message type and the preset custom standard file to obtain the parsing result is stopped.
9. The method according to claim 1, characterized in that: The terminal device communicates with the vehicle via a cabinet, and the cabinet is used to communicate with the vehicle using an on-board communication protocol, and to communicate with the terminal device using Ethernet.
10. The method according to claim 1, characterized in that A script project is deployed in the terminal device, and at least one function is deployed in the script project; when the terminal device is connected to the vehicle for communication, data processing is performed by calling the corresponding function in the script project.
11. A data processing device, characterized in that: The device comprises: An Ethernet original message acquisition module, used to acquire an Ethernet original message from the vehicle when the terminal device and the vehicle are in communication connection; A real-time protocol message extraction module, used to extract the real-time protocol message from the Ethernet original message; A subject information extraction module, used to extract subject information from the real-time protocol message; A message type determination module, used to determine the message type corresponding to the real-time protocol message; The real-time protocol message parsing module is used to parse the real-time protocol message according to the message type and a preset custom standard file to obtain a parsing result when the real-time protocol message is determined to be valid data according to the subject information.
12. An electronic device, characterized in that: include: at least one processor; a memory communicatively coupled to the at least one processor; The memory has a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the data processing method according to any one of claims 1 to 10.
13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 10 is implemented.
14. A vehicle, characterized in that: The data processing device comprises the data processing device as claimed in claim 11.
Citation Information
Patent Citations
A method and system for extracting effective communication data from a log file
CN109039762A
DDS message processing method and device, vehicle and storage medium
CN116132514A
Data monitoring method and device, vehicle and medium
CN117544707A
Method and device for testing Ethernet communication protocol in vehicle, processor and vehicle
CN118677659A
Cited By
Airborne bus data analysis method and device based on RTPS protocol
CN120639886A
An airborne bus data parsing method and device based on an RTPS protocol
CN120639886B
Message protocol content analysis method capable of automatically generating codes
CN121691509A