Automatic driving test method and system based on CAN message parsing operation

Through the Pandas function library to parse and reconstruct CAN messages, extract and analyze timestamps and data fields, it solves the problem of low efficiency of CAN message monitoring and analysis in autonomous driving tests, and achieves efficient test result analysis and report generation.

CN114401203BActive Publication Date: 2024-10-15JILUO TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111450657.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2024-10-15
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

The efficiency of CAN message monitoring and analysis in the existing technology is low, and it is difficult to match the requirements of autonomous driving testing, resulting in low efficiency of test report analysis.

Method used

By parsing and reconstructing the test requirement data CAN Matrix and original CAN messages based on the Pandas function library, extracting timestamps and data fields, sorting and performing analysis and secondary operations, calculating physical values ​​and data processing results, and supporting image visualization and reporting generate.

Benefits of technology

It achieves rapid location and analysis of test parameters in CAN messages, improves the efficiency of autonomous driving test result analysis and report generation, and provides a flexible and universal testing method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114401203B_ABST
    Figure CN114401203B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of autonomous driving technology, and provides an autonomous driving test method and system based on CAN message parsing operations. The method includes: determining test parameters according to the requirements of the autonomous driving test, and obtaining a test CAN message through a vehicle of the autonomous driving test; extracting a test data set corresponding to the test parameters in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field; sorting the data field according to the timestamp, and successively parsing and performing secondary operations on the data field to obtain the physical value of the test parameter and the data processing result. The present invention effectively improves the efficiency of autonomous driving testing, especially the test result analysis and test report issuance process; at the same time, it eliminates the complex calculations for different test requirements, and provides a more flexible and universal autonomous driving test method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving technology, and in particular to an autonomous driving test method and system based on CAN message parsing operation. Background Art

[0002] CAN (Controller Area Network) messages are frames that send data from a sending unit to a receiving unit. Generally speaking, CAN messages in vehicle systems are hexadecimal messages received on CAN lines (internal CAN, vehicle CAN, charging CAN) using ECUs and CAN cards.

[0003] During the autonomous driving test, CAN messages can be used as the basis for verifying the test results. However, the autonomous driving domain controller has the characteristics of short software development iteration cycle and fast version update. Compared with traditional controllers, the autonomous driving domain controller needs to form a system with multiple controllers to control the vehicle. Therefore, the CAN message monitoring of the autonomous driving domain controller needs to be efficient, fast, and the test report readability is highly required.

[0004] In the prior art, CAN message monitoring is usually performed based on commercial CAN message parsing tools. Since the output format of mainstream commercial CAN message parsing tools is difficult to match various test requirements, the process in which test engineers issue test reports based on the output analysis of the CAN message parsing tools has the problem of low analysis efficiency.

[0005] Therefore, how to provide a more efficient and flexible autonomous driving testing method and system has become a technical problem that needs to be urgently solved in the industry. Summary of the invention

[0006] The present invention provides an autonomous driving test method and system based on CAN message parsing operation, so as to solve the defect of low efficiency of test result analysis in the prior art and realize efficient and flexible autonomous driving test.

[0007] The present invention provides an automatic driving test method based on CAN message parsing operation, comprising:

[0008] Determine test parameters according to the requirements of the autonomous driving test, and obtain test CAN messages through the vehicle of the autonomous driving test;

[0009] Extracting a test data set corresponding to the test parameters in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field;

[0010] The data fields are sorted according to the timestamps, and the data fields are analyzed and recalculated in sequence to obtain the physical values ​​of the test parameters and the data processing results.

[0011] According to an automatic driving test method based on CAN message parsing operation provided by the present invention, the step of determining test parameters according to the requirements of the automatic driving test and obtaining the test CAN message through the vehicle of the automatic driving test includes:

[0012] Based on the Pandas function library, the test requirement data CAN Matrix is ​​parsed and reconstructed to obtain a test parameter set; the test parameter set includes the ID of the test parameter, the start bit of the test parameter, the data length of the test parameter, the physical value conversion factor, and the physical value offset factor;

[0013] The original CAN message is parsed and reconstructed based on the Pandas function library to obtain a test CAN message; the original CAN message is an ASCII format message obtained by the autonomous driving test vehicle.

[0014] According to an automatic driving test method based on CAN message parsing operation provided by the present invention, the step of sorting the data field according to the timestamp, parsing the data field, and obtaining the physical value of the test parameter includes:

[0015] Converting the data field in the hexadecimal ASCII format in the test data set into a binary data field;

[0016] According to the start bit of the test parameter and the data length of the test parameter, intercept the binary data field to obtain binary parsed data and convert it into decimal parsed data;

[0017] The physical value of the test parameter is calculated based on the physical value conversion factor, the physical value offset factor and the decimal parsing data.

[0018] According to an automatic driving test method based on CAN message parsing operation provided by the present invention, the step of sorting the data field according to the timestamp, performing secondary operation on the data field, and obtaining the data processing result of the test parameter includes:

[0019] Taking the timestamp and the physical value as input, an analysis value is calculated based on an analysis formula;

[0020] Visualizing the analysis value based on a graphical standard, and outputting the analysis value and a visualization result of the analysis value as a data processing result;

[0021] The analysis formula is determined according to the requirements of the autonomous driving test; the visualization standard is determined according to the requirements of the autonomous driving test.

[0022] According to an automatic driving test method based on CAN message parsing operation provided by the present invention, the step of calculating the physical value of the test parameter according to the physical value conversion factor, the physical value offset factor and the decimal parsing data includes:

[0023] Calculate the physical value V of the test parameter based on the physical value formula physical :

[0024] V physical =V raw ×factor+offset

[0025] Where V raw is the binary parsed data; factor is the physical value conversion factor; offset is the physical value offset factor.

[0026] According to an automatic driving test method based on CAN message parsing operation provided by the present invention, the step of extracting a test data set corresponding to the test parameter in the test CAN message includes:

[0027] The message length corresponding to the test parameter in the test CAN message is recorded as parameter message and a judgment is made:

[0028] If the parameter message includes a parameter group number, it is known that the parameter message is a J1939 CAN message, the parameter group number of the test parameter is determined, the data row where the parameter group number is located in the test CAN message is extracted, and the timestamp column and the data field column in the data row are output;

[0029] If the parameter message does not include a parameter group number, it is determined that the parameter message is a non-J1939 CAN message, the message identifier of the test parameter is determined, the data row where the message identifier is located in the test CAN message is extracted, and the timestamp column and data field column in the data row are output.

[0030] The present invention also provides an automatic driving test system based on CAN message parsing operation, comprising:

[0031] An acquisition module, used to determine test parameters according to the requirements of the autonomous driving test, and acquire a test CAN message through the vehicle of the autonomous driving test;

[0032] An extraction module, used to extract a test data set corresponding to the test parameter in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field;

[0033] The output module is used to sort the data field according to the timestamp, and analyze and perform secondary operations on the data field in sequence to obtain the physical value of the test parameter and the data processing result.

[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the autonomous driving test method based on CAN message parsing operation as described in any one of the above are implemented.

[0035] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the autonomous driving test method based on CAN message parsing operation as described in any of the above-mentioned methods are implemented.

[0036] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned autonomous driving test methods based on CAN message parsing operations.

[0037] The autonomous driving test method and system based on CAN message parsing operation provided by the present invention realizes the rapid positioning of the parameters to be analyzed by extracting the timestamp and data field corresponding to the test parameters in the test CAN message, effectively improving the efficiency of the autonomous driving test, especially the test result analysis and the test report issuance process; at the same time, by sorting, parsing and performing secondary operations on the located timestamps and data fields in sequence, the abstract information in the CAN message is converted into readable information, eliminating the complex calculations for different test requirements, and providing a more flexible and universal autonomous driving test method. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 It is a flow chart of an automatic driving test method based on CAN message parsing operation provided by the present invention;

[0040] Figure 2 It is a schematic diagram of the CAN signal analysis process provided by an embodiment of the present invention;

[0041] Figure 3 It is a schematic diagram of the conversion process from ASCII data field to physical value provided by an embodiment of the present invention;

[0042] Figure 4 It is a structural schematic diagram of an automatic driving test system based on CAN message parsing operation provided by the present invention;

[0043] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention.

[0044] Reference numerals:

[0045] 1: Acquisition module; 2: Extraction module; 3: Output module;

[0046] 510: processor; 520: communication interface; 530: memory;

[0047] 540: Communication bus. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. 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.

[0049] Combine the following Figure 1-Figure 3 The present invention describes an automatic driving test method based on CAN message parsing operation.

[0050] like Figure 1 As shown, an embodiment of the present invention provides an automatic driving test method based on CAN message parsing operation, comprising:

[0051] Step 102, determining test parameters according to the requirements of the autonomous driving test, and obtaining a test CAN message through the vehicle of the autonomous driving test;

[0052] Step 104, extracting a test data set corresponding to the test parameter in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field;

[0053] Step 106, sorting the data fields according to the timestamps, and sequentially analyzing and performing secondary operations on the data fields to obtain the physical values ​​of the test parameters and the data processing results.

[0054] In step 106 of this embodiment, the physical value of the test parameter is both an input value of the secondary operation and, together with the data processing result, serves as a test result of the autonomous driving test.

[0055] It is worth noting that the data processing result can be a numerical operation on the data of a single CAN (such as differentiation, integration, etc.); it can also be a numerical operation on the related data between different CANs; it can also be a secondary operation of the judgment type (for example, when the A signal is a certain value, the judgment that the B, C, and D signals should be a certain value).

[0056] That is to say, executing the method of this embodiment can obtain a test data set of different CANs in a common format, and the analysis and secondary calculation performed on this basis can directly provide a test analysis conclusion across CANs.

[0057] In a preferred implementation, the test result should also provide basic information of the test parameters and basic information of the test CAN message.

[0058] In a preferred implementation, the method of this embodiment can be applied to the following autonomous driving performance test scenarios:

[0059] 1. The fuel consumption of the whole vehicle needs to be counted, but the CAN message data only contains the percentage value of the fuel tank of the whole vehicle. To calculate the fuel consumption, it is necessary to perform differential processing on the offline data;

[0060] 2. It is necessary to collect data statistics and analyze the thermal power of the autonomous driving domain controller, but the CAN message only contains the real-time ADU internal temperature. It is necessary to perform numerical calculations on the ADU temperature to obtain the ADU thermal power.

[0061] 3. Electric trucks collect data and analyze their energy consumption (power consumption rate), but CAN messages only contain real-time internal battery power (SOC), and the power signal value needs to be differentiated.

[0062] In the above test scenario, the required data includes:

[0063] Test parameters (such as CAN matrix file): message length, start byte, start bit, signal length, data type, ratio, compensation.

[0064] Test the CAN message (ASCII file): timestamp (time), channel number (channel), message identifier (Msg_ID), send and receive direction (Orient), data segment bytes 1-8 (byte1-8).

[0065] The beneficial effects of this embodiment are:

[0066] By extracting the timestamps and data fields corresponding to the test parameters in the test CAN message, the parameters to be analyzed can be quickly located, effectively improving the efficiency of autonomous driving testing, especially the test result analysis and the process of issuing test reports. At the same time, by sorting, parsing and performing secondary operations on the located timestamps and data fields in sequence, the abstract information in the CAN message is converted into readable information, eliminating the complex calculations for different test requirements and providing a more flexible and universal autonomous driving test method.

[0067] According to the above embodiment, in this embodiment:

[0068] The step of determining the test parameters according to the requirements of the autonomous driving test and obtaining the test CAN message through the vehicle of the autonomous driving test includes:

[0069] Based on the Pandas function library, the test requirement data CAN Matrix is ​​parsed and reconstructed to obtain a test parameter set; the test parameter set includes the ID of the test parameter, the start bit of the test parameter, the data length of the test parameter, the physical value conversion factor, and the physical value offset factor;

[0070] In a preferred embodiment, the test parameter set is a set in DataFrame format obtained after the Python program calls the Pandas function library for parsing, data cleaning, and data reconstruction; the data cleaning includes outlier processing, irrelevant value exclusion, and string writing format specification, wherein irrelevant values ​​are determined based on the autonomous driving test requirements.

[0071] The original CAN message is parsed and reconstructed based on the Pandas function library to obtain a test CAN message; the original CAN message is an ASCII format message obtained by the autonomous driving test vehicle.

[0072] In a preferred embodiment, the test CAN message is a message in DataFrame format obtained after the Python program calls the Pandas function library for parsing, data cleaning, and data reconstruction; the data cleaning includes abnormal value processing, irrelevant value exclusion, and string writing format specification, wherein irrelevant values ​​are determined according to the autonomous driving test requirements.

[0073] The CAN messages and CANMatrix are processed by the Pandas library (for example, the Pandas library in the Python language), which has higher parsing efficiency than other CAN message processing tools such as MATLAB and LabVIEW.

[0074] It is worth noting that the parsing of CAN messages in the prior art is often performed based on commercial tools. On the basis of providing a general CAN message parsing method, being able to discover the difference in CAN message parsing efficiency itself requires creative work by technical personnel in this field. That is to say, this embodiment is based on providing a general CAN message parsing method, and further considers the issue of parsing efficiency.

[0075] The step of sorting the data field according to the timestamp and parsing the data field to obtain the physical value of the test parameter includes:

[0076] Converting the data field in the hexadecimal ASCII format in the test data set into a binary data field;

[0077] According to the start bit of the test parameter and the data length of the test parameter, intercept the binary data field to obtain binary parsed data and convert it into decimal parsed data;

[0078] The physical value of the test parameter is calculated based on the physical value conversion factor, the physical value offset factor and the decimal parsing data.

[0079] The step of sorting the data field according to the timestamp and performing a secondary operation on the data field to obtain the data processing result of the test parameter includes:

[0080] Taking the timestamp and the physical value as input, an analysis value is calculated based on an analysis formula;

[0081] Visualizing the analysis value based on a graphical standard, and outputting the analysis value and a visualization result of the analysis value as a data processing result;

[0082] The analysis formula is determined according to the requirements of the autonomous driving test; the visualization standard is determined according to the requirements of the autonomous driving test.

[0083] The step of calculating the physical value of the test parameter according to the physical value conversion factor, the physical value offset factor and the decimal parsing data comprises:

[0084] Calculate the physical value V of the test parameter based on the physical value formula physical :

[0085] V physical =V raw ×factor+offset

[0086] Where V raw is the binary parsed data; factor is the physical value conversion factor; offset is the physical value offset factor.

[0087] The step of extracting a test data set corresponding to the test parameter in the test CAN message comprises:

[0088] The message length corresponding to the test parameter in the test CAN message is recorded as parameter message and a judgment is made:

[0089] If the parameter message includes a parameter group number, it is known that the parameter message is a J1939 CAN message, the parameter group number of the test parameter is determined, the data row where the parameter group number is located in the test CAN message is extracted, and the timestamp column and the data field column in the data row are output;

[0090] If the parameter message does not include a parameter group number, it is determined that the parameter message is a non-J1939 CAN message, the message identifier of the test parameter is determined, the data row where the message identifier is located in the test CAN message is extracted, and the timestamp column and data field column in the data row are output.

[0091] Furthermore, there are long frame format messages in both J1939CAN messages and non-J1939CAN messages. For long frame format messages, they need to be spliced ​​and then step 104 or step 106 is executed. Therefore, this embodiment also includes a long frame format determination step:

[0092] If the length of the parameter message is greater than 8, it is known that the parameter message is a long frame format message. After splicing the parameter message in a set method, step 104 or step 106 is executed;

[0093] If the length of the parameter message is equal to 8, it is known that the parameter message is a single-frame format message, and step 104 or step 106 is executed;

[0094] If the length of the parameter message is less than 8, it is known that the format of the parameter message is incorrect, and the parameter message is excluded and an error is reported.

[0095] On the basis of providing a general CAN message parsing operation method, this embodiment further takes into account the characteristics of CAN messages of autonomous driving vehicles, such as multiple transmission channels, mixed transmission of J1939CAN messages and ordinary CAN messages, and coexistence of single-frame messages and multi-frame messages. Due to the above problems, the whole vehicle CAN message test for autonomous driving vehicles has difficulties such as high complexity, large number, and inconsistent judgment criteria for different messages. Being able to discover these problems itself requires creative labor from technical personnel in this field.

[0096] This embodiment provides a solution for the above problem of distinguishing J1939 CAN messages from ordinary CAN messages so as to perform different processing, thereby avoiding the shortcomings of low efficiency and high misjudgment rate in manual detection and making the analysis efficiency higher during testing.

[0097] Based on any of the above embodiments, another embodiment will be given below in combination with the actual application of autonomous driving truck testing.

[0098] First, the technical problem solved by this embodiment is described as follows.

[0099] In the testing of vehicle-mounted embedded systems, CAN message parsing and analyzing signal values ​​are important parts of the testing work. When recording CAN message information, test engineers need to observe the changes in CAN message signals over a period of time and have the need for secondary development, such as signal integration, differentiation and other operations.

[0100] Compared with traditional vehicles, trucks equipped with autonomous driving domain controllers are more complex, with more CAN message sending and receiving nodes and multiple CAN formats (J1939 and ordinary CAN). In the secondary development of system testing for CAN message parsing and signal values, it is often necessary to perform calculations or logical judgments on multiple CAN signals as input. The mainstream CAN message parsing tools on the market need to be secondary developed in C language or C-like language, which places high programming requirements on the operator.

[0101] Since the CAN signals of self-driving trucks transmit key information of each ECU in the self-driving system, testers often need to draw charts of the signals when performing data analysis, as well as perform numerical calculations (such as differentiation, integration, etc.) on specified signals and draw charts. The above operations cannot be obtained through manual calculations.

[0102] The mainstream CAN message recording tools on the market all support storing CAN message information as ASCII format files. ASCII files have large data volumes, and when processing data, computer languages ​​such as C and C++ have low efficiency.

[0103] After the test engineer completes the signal data analysis, he needs to write a corresponding test report. The report on CAN message signal analysis and data processing needs to be converted into a Word or Excel file. Manual writing will result in low efficiency, high error rate, and high programming ability requirements for the tester.

[0104] To solve the above problems, the solutions adopted in the prior art include:

[0105] 1. Use the mainstream CAN detection tools on the market to record all messages on the CAN road of the vehicle, and use the chart drawing toolkit that comes with the tool to draw data on the CAN signal.

[0106] 2. Use C or C-like languages ​​to process CAN signals. If logical judgment is required on multiple CAN signals, the user needs to perform additional operations.

[0107] 3. Complete the chart drawing work through software such as Excel and manually complete the report production.

[0108] Different from the prior art, the solution adopted in this embodiment has the following differences:

[0109] 1. The CAN message input file is ASCII. Currently, all mainstream CAN parsing tools support this format, breaking through tool limitations and supporting CAN message data recorded by multiple tools;

[0110] 2. Using the pandas library function in Python language, the huge amount of CAN signals can be effectively processed (compared with Python programs that do not use Pandas, the processing speed is increased by 10 times);

[0111] 3. It can support automatic report generation, with optional formats of Excel or Word, and attached signal value change curve of specific CAN message signal within the total recording time;

[0112] 4. Support multi-channel CAN message inspection, support multiple formats of CAN messages (J1939, ordinary CAN), support analysis of J1939 long frame messages;

[0113] 5. Support integration, differentiation, addition, subtraction, multiplication and division operations on specific CAN signals, and draw charts;

[0114] 6. Supports logical judgment with multiple CAN signals as input, such as when signal A is a certain value, signals B, C, and D should also be a certain value.

[0115] That is to say, compared with the prior art, this embodiment has the following beneficial effects:

[0116] 1. Aiming at the testing needs of on-site diagnostic engineers, fast and efficient CAN message detection is achieved;

[0117] 2. Automatic monitoring of multiple CAN channels reduces software configuration time and facilitates centralized testing in fixed CAN channels;

[0118] 3. Perform secondary operations (integration, differentiation) on the CAN signal values ​​within the specified time, and provide an interface for users to perform custom operations on the values;

[0119] 4. Supports periodic type, event type; detection of ordinary CAN messages and J1939 multi-frame messages, and comes with corresponding instructions for easy reading by users.

[0120] The following is a brief description of the solution of this embodiment.

[0121] This embodiment involves CAN message signal analysis and chart drawing as well as numerical calculation of CAN signals (such as differentiation, integration, etc.), which is one of the important contents of vehicle controller testing. This embodiment innovatively uses python pandas library functions to process ASCII files that record CAN messages, greatly improving data reading efficiency, allowing testers to get rid of the hardware limitations of CAN tools, and can freely draw specific CAN signal numerical change curves and perform numerical operations on them. In the present invention, the specific algorithms for signal differentiation and integration can be customized by the user. It makes up for the deficiency of subsequent data processing that users need to define in traditional CAN analysis tools. And after completing all operations, it supports outputting charts to word or excel, or generating test reports according to user needs, helping testers to quickly locate whether the logical changes of CAN signals meet the needs.

[0122] This embodiment can parse ordinary CAN messages and J1939 CAN messages, and can parse J1939 long frame messages.

[0123] Specifically, this embodiment provides a CAN message parsing tool for parsing the ASCII file storing the real CAN communication signal of the whole vehicle and supporting data processing of the signal, as well as data visualization processing thereof, to avoid the problems of low efficiency in manual calculation and high programming ability requirements of the tester. This embodiment supports the parsing of ordinary CAN messages and J1939 messages, and supports the parsing of J1939 long frames.

[0124] This embodiment introduces the data processing library function Pandas in Python to process the CAN message data. In view of the large storage capacity of the CAN message record file and the inconsistent data structure in daily testing, data cleaning, merging and other operations are adopted. After completing the data processing, for the specific CAN message signal input by the user, it can output whether the CAN signal appears in the ASCII data, the CAN signal change curve within the specified time, the result image of the user-defined function and other results, and output it to the Word or Excel file specified by the user. This embodiment has currently helped system test engineers analyze whether the CAN signal changes meet the functional document definition in daily vehicle testing work, and the icon report generated by the present invention has become an important part of the test engineer's test report.

[0125] The following is a brief background on the autonomous truck segment.

[0126] The CAN messages of self-driving trucks have the characteristics of multiple sending channels, mixed sending of J1939CAN messages and ordinary CAN messages, coexistence of single-frame messages and multi-frame messages, etc. Due to the above problems, the vehicle CAN message signal analysis for self-driving trucks has many test nodes, many CAN message parsing files (DBC), a large number of CAN signals, and complex sending and receiving relationships.

[0127] The autonomous driving domain controller of an autonomous driving truck has the characteristics of short software development iteration cycle and fast software version update. Compared with traditional controllers, the autonomous driving domain controller needs to form a system with multiple controllers to control the vehicle. Therefore, the CAN message detection of the autonomous driving domain controller needs to be efficient, fast, and the test report needs to be highly readable. For the analysis of CAN message signals, a chart that clearly reflects the changes in CAN signals is required to facilitate testers to quickly observe whether the CAN signals change according to the functional definition.

[0128] Currently, mainstream CAN message analysis tools do not have a toolkit for performing secondary operations on CAN message signals. If the signal is processed such as integration and differentiation, engineers need to use C or C++ to process the signal. For offline large amounts of data, there is a problem of low processing efficiency and high programming skills required of testers. Python's Pandas library function can convert large ASCII files into Dataframe format

[0129] Data visualization of CAN signal values ​​is an important step in CAN signal analysis. Matplotlib is a drawing library function in Python that provides powerful data visualization capabilities and has good interactivity with data in dataframe format, which can improve the efficiency of chart drawing.

[0130] The specific scheme of this embodiment will be described below.

[0131] One of the inputs of this embodiment is an ASCII file generated by a CAN parsing tool, which stores the CAN message information observed by the test engineer during the test period. Currently, mainstream CAN parsing tools on the market support recording CAN messages in ASCII files. ASCII files refer to ASCII files that record CAN message information. Unparsed ASCII files contain the following key information: timestamp, message identifier (Msg_ID), designated channel in the CAN message parsing tool, CAN message data field, and CAN message sending and receiving direction. Among them, the CAN message data field information is divided into byte1-8 columns, which need to be merged to represent the data field data under the ID.

[0132] This embodiment uses the CAN matrix file, which is used as a guidance file when generating the CAN message parsing file DBC, as an input of the program. In this file, the following information of the CAN message is defined: message name (MSg_Name), message type (Msg_Type), message identifier (Msg_ID), parameter group number (PGN), message sending type (Msg_send_Type), message sending cycle (Msg_Cycle_time) and other information. This information will be used as the basis for parsing and performing data parsing on the ASCII file containing the original information of the CAN message.

[0133] The process of parsing CAN signal values ​​in this embodiment can be as follows: Figure 2 It indicates that the analysis of CAN signals can be roughly divided into the following steps: 1. Process the CAN matrix file data, and find the ID, message name and other message information corresponding to the signal according to the CAN signal specified by the user, as well as the following information required for signal analysis: data start bit, signal length, signal ratio, offset, accuracy, maximum / minimum physical value, etc. 2. According to the signal given by the user, find the corresponding CAN message ID (J1939 long frame is PGN) through CAN Matrix, filter the lines containing the ID or PGN in the ASCII file, perform data analysis, and output the timestamp and physical value. 3. Perform data processing on the timestamp and physical value, and output the merged data to the report.

[0134] After reconstructing the ASCII file and the CAN matrix file, this embodiment outputs the result, wherein the Dataframe format data output after the CAN matrix file is processed includes: message name (MSg_Name), message type (Msg_Type), message identifier (Msg_ID), parameter group number (PGN), message sending type (Msg_send_Type), message sending cycle (Msg_Cycle_time), and the data start bit, signal length, signal ratio, offset, precision, and maximum / minimum physical value of all signals under the ID. The ASCII file after data processing includes the following information: timestamp (time), channel number (channel), message identifier (Msg_ID), transceiver direction (Orient), and data segment bytes 1-8 (byte1-8).

[0135] The principle of parsing CAN signals in this embodiment is as follows: the data in the data field is in hexadecimal (hex), and in the CAN matrix, the start bit and data length of the signal data segment for signal parsing are in binary. In summary, the principle of obtaining the original data of the CAN message signal in the data field of the ASCII file is as follows: Figure 3 shown.

[0136] In this embodiment, obtaining the specified data row of the ASCII file through CAN ID or PGN is implemented through the contains function of the Pandas library function in Python. This function can quickly select the data row containing the character of the specific value. After completing the data screening, all the data are sorted by timestamp. After parsing according to the above CAN signal parsing method, the physical value of the CAN signal is obtained, and the timestamp column and the physical value column are merged and output to prepare for the subsequent data visualization and secondary processing of the signal value.

[0137] The processing principle of CAN signals in this embodiment is as follows: after obtaining the timestamp and physical value, the program user can specify the algorithm as required. Commonly used numerical operations, such as differentiation, integration and other functions, are already included in the program and can be called directly. If the user has a custom algorithm to execute on the data, the timestamp and data column can be directly exported for secondary processing.

[0138] After all data processing is completed, the program will output the image to a Word document to generate a CAN signal analysis report. According to the needs of the actual vehicle on-site test engineers, the program is optimized for readability.

[0139] The following is a description of the autonomous driving test device based on CAN message parsing operation provided by the present invention. The autonomous driving test device based on CAN message parsing operation described below and the autonomous driving test method based on CAN message parsing operation described above can be referenced to each other.

[0140] The embodiment of the present invention further provides an automatic driving test system based on CAN message parsing operation, comprising:

[0141] An acquisition module 1 is used to determine test parameters according to the requirements of the autonomous driving test, and obtain a test CAN message through the vehicle of the autonomous driving test;

[0142] Extraction module 2, used to extract the test data set corresponding to the test parameters in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field;

[0143] The output module 3 is used to sort the data field according to the timestamp, and analyze and perform secondary operations on the data field in sequence to obtain the physical value of the test parameter and the data processing result.

[0144] Furthermore, the acquisition module 1 includes:

[0145] A test parameter set unit is used to parse and reconstruct the test requirement data CANMatrix based on the Pandas function library to obtain a test parameter set; the test parameter set includes the ID of the test parameter, the start bit of the test parameter, the data length of the test parameter, the physical value conversion factor, and the physical value offset factor;

[0146] The test CAN message unit is used to parse and reconstruct the original CAN message based on the Pandas function library to obtain a test CAN message; the original CAN message is an ASCII format message obtained by the autonomous driving test vehicle.

[0147] The output module 3 comprises:

[0148] A binary unit, used for converting the data field in the hexadecimal ASCII format in the test data set into a binary data field;

[0149] An interception unit, used to intercept the binary data field according to the start bit of the test parameter and the data length of the test parameter, obtain binary parsed data and convert it into decimal parsed data;

[0150] The physical value unit is used to calculate the physical value of the test parameter according to the physical value conversion factor, the physical value offset factor and the decimal parsing data.

[0151] An analysis value unit, used to take the timestamp and the physical value as input and calculate the analysis value based on the analysis formula;

[0152] A visualization unit, configured to visualize the analysis value based on a graphical standard, and output the analysis value and a visualization result of the analysis value as a data processing result;

[0153] The analysis formula is determined according to the requirements of the autonomous driving test; the visualization standard is determined according to the requirements of the autonomous driving test.

[0154] The physical value unit is specifically used for:

[0155] Calculate the physical value V of the test parameter based on the physical value formula physical :

[0156] V physical =V raw ×factor+offset

[0157] Where V raw is the binary parsed data; factor is the physical value conversion factor; offset is the physical value offset factor.

[0158] The extraction module 2 comprises:

[0159] A judging unit is used to judge, based on the message length corresponding to the test parameter in the test CAN message, recorded as a parameter message:

[0160] If the parameter message includes a parameter group number, it is known that the parameter message is a J1939 CAN message, the parameter group number of the test parameter is determined, the data row where the parameter group number is located in the test CAN message is extracted, and the timestamp column and the data field column in the data row are output;

[0161] If the parameter message does not include a parameter group number, it is determined that the parameter message is a non-J1939 CAN message, the message identifier of the test parameter is determined, the data row where the message identifier is located in the test CAN message is extracted, and the timestamp column and data field column in the data row are output.

[0162] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the automatic driving test method based on the CAN message parsing operation, the method comprising: determining the test parameters according to the requirements of the automatic driving test, and obtaining the test CAN message through the vehicle of the automatic driving test; extracting the test data set corresponding to the test parameters in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field; sorting the data field according to the timestamp, and successively parsing and performing secondary operations on the data field to obtain the physical value of the test parameter and the data processing result.

[0163] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0164] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the autonomous driving test method based on CAN message parsing operation provided by the above-mentioned methods, and the method includes: determining test parameters according to the requirements of the autonomous driving test, and obtaining a test CAN message through the vehicle of the autonomous driving test; extracting a test data set corresponding to the test parameters in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field; sorting the data field according to the timestamp, and parsing and re-operating the data field in turn to obtain the physical value of the test parameter and the data processing result.

[0165] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the autonomous driving test method based on CAN message parsing operation provided by the above-mentioned methods, the method comprising: determining test parameters according to the requirements of the autonomous driving test, and obtaining a test CAN message through the vehicle of the autonomous driving test; extracting a test data set corresponding to the test parameters in the test CAN message; the test data comprises a one-to-one corresponding timestamp and data field; sorting the data field according to the timestamp, and parsing and re-operating the data field in sequence to obtain the physical value of the test parameter and the data processing result.

[0166] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0167] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications 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.

Claims

1. An automatic driving test method based on CAN message parsing operation, characterized in that: include: Determine test parameters according to the requirements of the autonomous driving test, and obtain test CAN messages through the vehicle of the autonomous driving test; Extracting a test data set corresponding to the test parameters in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field; The data fields are sorted according to the timestamps, and the data fields are analyzed and recalculated in sequence to obtain the physical values ​​of the test parameters and the data processing results; the physical values ​​of the test parameters are both input values ​​of the recalculation and serve as the test results of the autonomous driving test together with the data processing results; Before extracting the test data set corresponding to the test parameter in the test CAN message, the method further includes: The message length corresponding to the test parameter in the test CAN message is recorded as a parameter message; If the length of the parameter message is greater than 8, it is known that the parameter message is a long frame format message, and after splicing the parameter message in a set method, the step of extracting the test data set corresponding to the test parameter in the test CAN message is performed; If the length of the parameter message is equal to 8, it is known that the parameter message is a single-frame format message, and the step of extracting the test data set corresponding to the test parameter in the test CAN message is performed; If the length of the parameter message is less than 8, it is known that the format of the parameter message is incorrect, and the parameter message is excluded and an error is reported; The step of extracting a test data set corresponding to the test parameter in the test CAN message comprises: If the parameter message includes a parameter group number, it is known that the parameter message is a J1939 CAN message, the parameter group number of the test parameter is determined, the data row where the parameter group number is located in the test CAN message is extracted, and the timestamp column and the data field column in the data row are output; If the parameter message does not include a parameter group number, it is determined that the parameter message is a non-J1939 CAN message, the message identifier of the test parameter is determined, the data row where the message identifier is located in the test CAN message is extracted, and the timestamp column and data field column in the data row are output.

2. The automatic driving test method based on CAN message parsing operation according to claim 1, characterized in that: The step of determining the test parameters according to the requirements of the autonomous driving test and obtaining the test CAN message through the vehicle of the autonomous driving test includes: Based on the Pandas function library, the test requirement data CAN Matrix is ​​parsed and reconstructed to obtain a test parameter set; the test parameter set includes the ID of the test parameter, the start bit of the test parameter, the data length of the test parameter, the physical value conversion factor, and the physical value offset factor; The original CAN message is parsed and reconstructed based on the Pandas function library to obtain a test CAN message; the original CAN message is an ASCII format message obtained by the autonomous driving test vehicle.

3. The automatic driving test method based on CAN message parsing operation according to claim 2 is characterized in that: The step of sorting the data field according to the timestamp and parsing the data field to obtain the physical value of the test parameter includes: Converting the data field in the hexadecimal ASCII format in the test data set into a binary data field; According to the start bit of the test parameter and the data length of the test parameter, intercept the binary data field to obtain binary parsed data and convert it into decimal parsed data; The physical value of the test parameter is calculated based on the physical value conversion factor, the physical value offset factor and the decimal parsing data.

4. The automatic driving test method based on CAN message parsing operation according to claim 3 is characterized in that: The step of sorting the data field according to the timestamp and performing a secondary operation on the data field to obtain the data processing result of the test parameter includes: Taking the timestamp and the physical value as input, an analysis value is calculated based on an analysis formula; Visualizing the analysis value based on a graphical standard, and outputting the analysis value and a visualization result of the analysis value as a data processing result; The analysis formula is determined according to the requirements of the autonomous driving test; the visualization standard is determined according to the requirements of the autonomous driving test.

5. The automatic driving test method based on CAN message analysis and calculation according to claim 3 is characterized in that: The step of calculating the physical value of the test parameter according to the physical value conversion factor, the physical value offset factor and the decimal parsing data comprises: Calculate the physical value V of the test parameter based on the physical value formula physical : V physical =V raw ×factor+offset Where V raw is the binary parsed data; factor is the physical value conversion factor; offset is the physical value offset factor.

6. An automatic driving test system based on CAN message parsing operation, characterized in that: include: An acquisition module, used to determine test parameters according to the requirements of the autonomous driving test, and acquire a test CAN message through the vehicle of the autonomous driving test; An extraction module, used to extract a test data set corresponding to the test parameter in the test CAN message; the test data includes a one-to-one corresponding timestamp and data field; An output module, used for sorting the data field according to the timestamp, and sequentially analyzing and performing secondary operations on the data field to obtain the physical value of the test parameter and the data processing result; the physical value of the test parameter is both an input value of the secondary operation and, together with the data processing result, serves as a test result of the autonomous driving test; The extraction module is further used to record the message length corresponding to the test parameter in the test CAN message as a parameter message; If the length of the parameter message is greater than 8, it is known that the parameter message is a long frame format message, and after splicing the parameter message in a set method, the step of extracting the test data set corresponding to the test parameter in the test CAN message is performed; If the length of the parameter message is equal to 8, it is known that the parameter message is a single-frame format message, and the step of extracting the test data set corresponding to the test parameter in the test CAN message is performed; if the length of the parameter message is less than 8, it is known that the format of the parameter message is incorrect, and the parameter message is excluded and an error is reported; The extraction module is specifically used to, if the parameter message includes a parameter group number, determine that the parameter message is a J1939CAN message, determine the parameter group number of the test parameter, extract the data row where the parameter group number is located in the test CAN message, and output the timestamp column and data field column in the data row; if the parameter message does not include a parameter group number, determine that the parameter message is a non-J1939CAN message, determine the message identifier of the test parameter, extract the data row where the message identifier is located in the test CAN message, and output the timestamp column and data field column in the data row.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the autonomous driving test method based on CAN message parsing operation as described in any one of claims 1 to 5 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the autonomous driving test method based on CAN message parsing operation as described in any one of claims 1 to 5 are implemented.