Test method, device, computer readable storage medium and ecu system for ecu
By parsing the protocol type and test information recorded in historical CAN messages, the testing of ECUs is automated, solving the problem of low efficiency in ECU testing and realizing the direct transmission of CAN messages and improving testing efficiency.
Patent Information
- Application Number
- CN202410755679.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-06-12
AI Technical Summary
In existing technologies, ECU testing efficiency is low, as CAN messages cannot be directly transmitted between tests as test results, resulting in low testing efficiency.
By acquiring the protocol type of historical CAN message records, parsing its test information, including test parameters and types, and automating the process to achieve the current test of the ECU, manual parsing and input are avoided.
It improves the testing efficiency of ECUs, enables the direct transmission of CAN messages between tests, frees up manpower, and enhances testing efficiency.
Smart Images

Figure CN118689199B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a test method, apparatus, computer-readable storage medium, and ECU system for an ECU. Background Technology
[0002] In the field of vehicle control, the Electronic Control Unit (ECU) is a lower-level computer. The ECU acquires vehicle status information such as motor speed, motor voltage, motor current, and fault information, and converts this information into digital signals, feeding them back to the upper-level computer. The upper-level computer can then display these digital signals, generate corresponding control commands, and send these commands to the ECU, enabling the ECU to control the vehicle's status based on these commands.
[0003] To achieve control precision, ECUs typically require testing and experimentation using testing equipment. During these tests, CAN messages serve as crucial evidence of the results. However, CAN messages cannot be directly transmitted between tests as test results, resulting in low testing efficiency. Summary of the Invention
[0004] The main objective of this application is to provide a testing method, apparatus, computer-readable storage medium, and ECU system for ECUs, so as to at least solve the problem of low testing efficiency in the prior art.
[0005] To achieve the above objectives, according to one aspect of this application, a testing method for an ECU is provided, comprising: acquiring the protocol type of historical CAN (Controller Area Network) message records, wherein the historical CAN message records are CAN message records obtained from historical testing of the ECU under test; parsing the historical CAN message records according to the protocol type to determine historical test information of the ECU under test, wherein the historical test information includes test parameters, corresponding test types, and test parameter values; and testing the ECU under test according to the historical test information.
[0006] Optionally, according to the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test, including: if an address instruction corresponding to the protocol type exists in the historical CAN message records, the address instruction is read from the historical CAN message records; the variable type corresponding to the address instruction is queried in the A2L file to obtain the test type of the historical CAN message records, the test type including calibration and measurement; according to the protocol type and the test type, at least the test parameter and the test parameter value corresponding to the test type are determined from the historical CAN message records to obtain the historical test information.
[0007] Optionally, the protocol type is one of the following: XCP (Universal Calibration Protocol), CCP (CAN Calibration Protocol), and UDS (Unified Diagnostic Services). Based on the protocol type and the test type, at least the test parameter and the test parameter value corresponding to the test type are determined from the historical CAN message records to obtain the historical test information. This includes: when the protocol type is the UDS protocol and the test type is the measurement, extracting the test parameter and the test parameter value from the historical CAN message records; when the protocol type is the XCP protocol or the CCP protocol and the test type is the measurement, determining the test parameter, the test parameter value, and auxiliary measurement information corresponding to the test parameter based on the measurement command extracted from the historical CAN message records and the measurement command library corresponding to the protocol type. The auxiliary measurement information includes at least one of the following: measurement method, measurement frequency, and measurement configuration parameters. The measurement method includes polling and DAQ (Data Acquisition). Command (data acquisition instruction) mode; when the test type is the calibration, the test parameters, the final test parameter value and the calibration method are determined according to the calibration instruction extracted from the historical CAN message record and the calibration instruction library corresponding to the protocol type. The calibration method includes reading mode and writing mode. The final test parameter value is the value of the last calibration of the test parameters.
[0008] Optionally, after reading the address instruction from the historical CAN message record, the method further includes: querying the description information corresponding to the address instruction from the A2L file, wherein the historical test information also includes the description information.
[0009] Optionally, according to the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test, including: if there is a flashing instruction corresponding to the protocol type in the historical CAN message records, the test type of the historical CAN message records is determined to be flashing; the flashing instruction is read from the historical CAN message records; and the test parameters and test parameter values corresponding to the test type are determined according to the flashing instruction and the flashing instruction library corresponding to the protocol type to obtain the historical test information.
[0010] Optionally, testing the ECU under test based on the historical test information includes: determining the test type corresponding to the current test parameter of the ECU under test as the target test type based on the protocol type and the historical test information, and determining the test parameter value corresponding to the current test parameter of the ECU under test as the target parameter value; testing the current test parameter according to the target test type and the target parameter value to obtain the test result, and displaying the test result on a display device.
[0011] Optionally, obtaining the protocol type of historical CAN message records includes: obtaining the first byte and the second byte in the historical CAN message record to obtain the instruction byte; based on the instruction byte, searching in the message instruction library for the message protocol corresponding to the same byte as the first byte or the second byte to obtain the protocol type, wherein the message instruction library includes multiple bytes and the message protocol corresponding to each byte, and the message protocol includes XCP protocol, CCP protocol and UDS protocol.
[0012] According to another aspect of this application, a testing apparatus for an ECU is provided, comprising: an acquisition unit, configured to acquire the protocol type of historical CAN message records, wherein the historical CAN message records are CAN message records obtained from historical testing of the ECU under test; a parsing unit, configured to parse the historical CAN message records according to the protocol type to determine the historical test information of the ECU under test, wherein the historical test information includes test parameters, corresponding test types, and test parameter values; and a testing unit, configured to test the ECU under test according to the historical test information.
[0013] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform any of the methods described.
[0014] According to another aspect of this application, an ECU system is provided, comprising: an ECU; and a test device for the ECU, the test device comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising methods for performing any one of the methods described.
[0015] The technical solution of this application first obtains the protocol type of historical CAN message records obtained from the ECU under test during historical testing; then, based on the obtained protocol type, the historical CAN message records are parsed to determine historical test information including test parameters, corresponding test types, and test parameter values; finally, the ECU under test is tested based on this historical test information. Compared to the problem that CAN messages cannot be directly transmitted as test results between tests, resulting in low testing efficiency, this application automatically parses historical CAN message records to obtain historical test information, which is then used for the current testing of the ECU. This allows CAN messages to be directly transmitted as test results between tests, eliminating the need for manual parsing of CAN messages to obtain test information and then manually inputting this test information into the testing equipment to test the ECU, thus freeing up manpower and improving the testing efficiency of the ECU. Attached Figure Description
[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 A hardware structure block diagram of a mobile terminal for performing a test method for an ECU according to an embodiment of this application is shown;
[0018] Figure 2 A schematic flowchart of a testing method for an ECU according to an embodiment of this application is shown;
[0019] Figure 3 A schematic flowchart of another ECU testing method provided according to an embodiment of this application is shown;
[0020] Figure 4 A schematic diagram of a test process for an ECU according to an embodiment of this application is shown;
[0021] Figure 5 A schematic diagram of a test process for another ECU provided according to an embodiment of this application is shown;
[0022] Figure 6A structural block diagram of a test apparatus for an ECU provided according to an embodiment of this application is shown.
[0023] The accompanying drawings include the following reference numerals:
[0024] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation
[0025] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be used interchangeably where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0029] CAN message: refers to a frame in which the transmitting unit transmits data to the receiving unit. It is usually a hexadecimal message received by the ECU and CAN card on the CAN line (such as internal CAN, vehicle CAN, charging CAN).
[0030] As described in the background section, the testing efficiency of ECUs in the prior art is low. In order to solve the above-mentioned technical problems, the embodiments of this application provide an ECU testing method, apparatus, computer-readable storage medium, and ECU system.
[0031] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0032] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for an ECU testing method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0033] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the ECU testing method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the method described. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of such networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0034] This embodiment provides a testing method for an ECU running on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0035] Figure 2 This is a flowchart of a test method for an ECU according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0036] Step S201: Obtain the protocol type of the historical CAN message record, wherein the historical CAN message record is the CAN message record obtained by the ECU under test in the past.
[0037] Specifically, the historical CAN message record can be the CAN message of the ECU under test obtained by the previous test ECU during the current ECU test. The protocol types include, but are not limited to, XCP protocol, CCP protocol, and UDS protocol.
[0038] Step S202: According to the protocol type, parse the historical CAN message records to determine the historical test information of the ECU under test. The historical test information includes test parameters, corresponding test types, and test parameter values.
[0039] Specifically, different protocol types of CAN messages correspond to different parsing methods. The test parameters are the items of the ECU to be tested, the test type is the method of testing the items, such as flashing, calibration, reading, etc., and the test parameter values are the test values corresponding to the items.
[0040] Step S203: Test the ECU under test according to the historical test information.
[0041] In this embodiment, the protocol type of historical CAN message records obtained from the ECU under test is first acquired. Then, based on the acquired protocol type, the historical CAN message records are parsed to determine historical test information, including test parameters, corresponding test types, and test parameter values. Finally, the ECU under test is tested based on this historical test information. Compared to the problem that CAN messages cannot be directly transmitted as test results between tests, resulting in low testing efficiency, this application automatically parses historical CAN message records to obtain historical test information, which is then used for the current testing of the ECU. This allows CAN messages to be directly transmitted as test results between tests, eliminating the need for manual parsing of CAN messages to obtain test information and then manually inputting this test information into the testing equipment to test the ECU. This frees up manpower and improves the testing efficiency of the ECU.
[0042] In one alternative, such as Figure 3 As shown, step S202: According to the protocol type, the specific implementation method of parsing the historical CAN message records to determine the historical test information of the ECU under test may include:
[0043] Step S2021: If an address instruction corresponding to the protocol type exists in the historical CAN message record, read the address instruction from the historical CAN message record;
[0044] Specifically, the protocol type is one of the following: XCP protocol, CCP protocol, and UDS protocol. Based on the address instructions corresponding to the protocol type, the historical CAN message records are searched for the existence of these address instructions, which are used to indicate address information. Taking the XCP protocol as an example, these address instructions include 0xF6 (Set Memory Transfer Address) and 0xE1 (WRITE_DAQ), etc.
[0045] Step S2022: Query the variable type corresponding to the address instruction in the A2L file to obtain the test type of the historical CAN message record. The test type includes calibration and measurement.
[0046] Specifically, the variable type indicates whether the variable is a calibration quantity or a measurement quantity. A calibration quantity corresponds to a calibration test type, while a measurement quantity corresponds to a measurement test type. Taking the XCP protocol as an example, if the variable type is CHARACTERISTIC, it is a calibration quantity; if it is MEASUREMENT, it is a measurement quantity.
[0047] Step S2023: Based on the protocol type and the test type, determine at least the test parameter and the test parameter value corresponding to the test type from the historical CAN message records to obtain the historical test information.
[0048] In the embodiment described above, the variable type is queried from the A2L file according to the address instruction corresponding to the protocol type, thereby obtaining the test type for the historical test of the ECU under test. Then, based on the protocol type and test type, at least the test parameters and test parameter values are obtained from the historical CAN message records. This further realizes the automatic parsing and reading of test information in CAN messages, and further achieves the effect of directly transmitting CAN messages as test results between tests.
[0049] To further address the technical problem of low testing efficiency caused by the inability of CAN messages to be directly transmitted as test results between tests, and to further improve the testing efficiency of the ECU, according to another embodiment of this application, the protocol type is one of the following: XCP protocol, CCP protocol, and UDS protocol. Step S2023: Based on the protocol type and the test type, at least the test parameters and test parameter values corresponding to the test type are determined from the historical CAN message records to obtain the historical test information, including:
[0050] Step S20231: When the protocol type is the UDS protocol and the test type is the measurement, extract the test parameters and the test parameter values from the historical CAN message records;
[0051] Step S20232: When the protocol type is the XCP protocol or the CCP protocol, and the test type is the measurement, determine the test parameters, the test parameter values, and the auxiliary measurement information corresponding to the test parameters based on the measurement instructions extracted from the historical CAN message records and the measurement instruction library corresponding to the protocol type. The auxiliary measurement information includes at least one of the following: measurement mode, measurement frequency, and measurement configuration parameters. The measurement mode includes Polling mode and DAQ mode.
[0052] Specifically, by analyzing multiple messages before and after the message corresponding to the address instruction in the historical CAN message record, if it matches the Polling measurement instruction library corresponding to the XCP or CCP protocol, the measurement method is determined to be Polling mode; if it matches the DAQ measurement instruction library corresponding to the XCP or CCP protocol, the measurement method is determined to be DAQ mode. When the measurement method is Polling mode, the historical test information includes the test parameters, the test parameter values, and the measurement method. When the measurement method is DAQ mode, the measurement frequency, such as DAQ-500ms, DAQ-100ms, DAQ-10ms, etc., is also acquired, along with measurement configuration parameters including the acquisition list number, the event channel number, and the transmission rate prescaler, etc. The historical test information includes the test parameters, the test parameter values, the measurement method, the measurement frequency, and the measurement configuration parameters.
[0053] Step S20233: When the test type is calibration, the test parameters, the final test parameter value, and the calibration method are determined according to the calibration instructions extracted from the historical CAN message records and the calibration instruction library corresponding to the protocol type. The calibration method includes a read method and a write (also known as calibration) method. The final test parameter value is the value of the last calibration of the test parameters.
[0054] Specifically, by analyzing multiple messages before and after the message corresponding to the address instruction in the historical CAN message record, if it corresponds to the read instruction library, the read mode is used for calibration; if it corresponds to the write instruction library, the write mode is used for calibration. Since there may be multiple calibration operations extracted from the calibration instructions, the last calibration operation is used as the reference, and the measurement parameter value corresponding to that operation is read.
[0055] In the embodiments described, when the protocol type is the UDS protocol and the test type is measurement, since the measurement quantity of the UDS protocol does not involve auxiliary measurement information such as measurement method and measurement frequency, the test parameters and the test parameter values can be directly extracted from the historical CAN message records. When the protocol type is the XCP protocol or the CCP protocol and the test type is measurement, historical test information including the test parameters, the test parameter values, and the auxiliary measurement information corresponding to the test parameters is obtained from the historical CAN message records, making the extracted historical test information more complete. When the test type is calibration, historical test information including the test parameters, the final test parameter values, and the calibration method is obtained from the historical CAN message records, ensuring the accuracy of the test information.
[0056] Specifically, after obtaining the historical test information, the information can be saved in groups according to variables.
[0057] To further ensure the completeness and accuracy of the obtained historical test information, in some embodiments of this application, after reading the address instruction from the historical CAN message record, the method further includes: querying the description information corresponding to the address instruction from the A2L file, whereby the historical test information also includes the description information. Since the historical CAN message record does not record all variable information, this application uses the A2L file to find the incomplete variable information, further ensuring the completeness of the historical test information. This facilitates the use of the LOG file during the current ECU test for calibrating, reading, monitoring, and rewriting the variables involved in the LOG file.
[0058] Specifically, the descriptive information includes, but is not limited to, the variable name, variable type (value, curve, map, ascii, axis, measurement, etc.), data type (byte, word, long, etc.), unit, format information, etc.
[0059] Optionally, based on the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test. This includes: if a flashing instruction corresponding to the protocol type exists in the historical CAN message records, determining that the test type of the historical CAN message records is flashing; reading the flashing instruction from the historical CAN message records; and determining the test parameters and test parameter values corresponding to the test type based on the flashing instruction and the flashing instruction library corresponding to the protocol type, thereby obtaining the historical test information. In this embodiment, by searching for a flashing instruction corresponding to the protocol type in the historical CAN message records to determine that the test type of the historical CAN message records is flashing, and then parsing to obtain the flashing parameter information, the automatic reading of flashing information in the historical CAN message records is further realized, facilitating subsequent testing of the ECU under test and thus further improving the testing efficiency of the ECU.
[0060] Furthermore, by parsing multiple messages before and after the message corresponding to the flashing instruction in the historical CAN message record, if they match the flashing instruction library corresponding to the protocol type, a complete flashing message can be obtained. Then, the flashing message is parsed to obtain flashing parameter information, and the addresses and data of each segment of the flashing message are grouped and saved, along with other information such as verification information.
[0061] In some other embodiments of this application, testing the ECU under test based on the historical test information includes: determining the test type corresponding to the current test parameter of the ECU under test as the target test type based on the protocol type and the historical test information, and determining the test parameter value corresponding to the current test parameter of the ECU under test as the target parameter value; testing the current test parameter according to the target test type and the target parameter value to obtain the test result, and displaying the test result on a display device. In this embodiment, by using the historical test information parsed from historical CAN message records to perform corresponding test type and test parameter value tests on the current test parameter of the ECU under test, the CAN message is directly used as a tool for transmitting test results, further improving the efficiency of testing.
[0062] Specifically, for variables whose current test parameters are read using the polling method, they will still be read using the polling method in this test, and the values of the variables in that group in the ECU will be monitored and displayed. For variables whose current test parameters are read using the DAQ method, they will be grouped according to different configurations such as DAQ_LIST_NUMBER and Event channel number, and the values of the variables in that group in the ECU will be monitored and displayed. For calibration variables that need to be read, they will be read from the ECU and displayed according to the variable information obtained from A2L. For calibration variables that need to be written, the corresponding internal values of the variables will be calibrated in the ECU and displayed. For flashing parameters, the address information and corresponding data information obtained from A2L will be flashed into the ECU according to the flashing process, and the data will be verified according to the saved verification information.
[0063] In some optional embodiments, the message protocol includes the XCP protocol, CCP protocol, and UDS protocol. Obtaining the protocol type of a historical CAN message record includes: obtaining the first and second bytes of the historical CAN message record to obtain an instruction byte, wherein for the XCP and CCP protocols, the first byte is the instruction byte, and for the UDS protocol, the second byte is the instruction byte; based on the instruction byte, searching in the message instruction library for the message protocol corresponding to the same byte as the first or second byte to obtain the protocol type, wherein the message instruction library includes multiple bytes and the message protocol corresponding to each byte. In this embodiment, by obtaining the first or second byte representing the instruction in the historical CAN message record and searching in the message instruction library for the corresponding message protocol, the protocol type of the historical CAN message record can be determined relatively simply, quickly, and accurately.
[0064] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the ECU testing method of this application will be described in detail below with reference to specific embodiments.
[0065] This embodiment relates to a specific ECU testing process, specifically including the parsing process of the CAN message from the previous ECU test and the current ECU testing process, such as... Figure 4 As shown, the parsing process includes the following steps:
[0066] Step S1: Create a monitoring, calibration, and flashing instruction library for the XCP / CCP / UDS protocol, parse the first or second byte of the sent message in the historical CAN message record, match it with the protocol instruction library, and obtain the protocol type of the historical CAN message record;
[0067] Step S2: Taking the XCP protocol as an example, parse the addresses corresponding to instructions involving addresses such as 0XF6 (Set Memory Transfer Address) and 0XE1 (WRITE_DAQ) in the historical CAN message records. Query the type of the variable corresponding to the address in the A2L file. If it is CHARACTERISTIC, it is a scalar quantity; if it is MEASUREMENT, it is a measured quantity. Obtain the variable name, variable type (value, curve, map, ascii, axis, measurement, etc.), data type (byte, word, long, etc.), unit, and format information of the scalar quantity in the A2L file.
[0068] Step S3: If it is a measurement, analyze the five packets before and after the packet corresponding to the address. If it matches the monitoring instruction library and contains 0xF5 or 0xf4 instructions, the variable is read using the polling method. If it contains instructions such as 0xE1, 0xE0, or 0xDE, the variable is read using the DAQ method, and obtain information such as DAQ_LIST_NUMBER, Event channel number, and Transmission rate prescaler for the DAQ, and obtain the DAQ frequency (DAQ-500ms, DAQ-100ms, DAQ-10ms, etc.). Then, group and save the variables according to the type and method of variable reading.
[0069] Step S4: If it is a calibration variable, analyze the other instructions in the four messages before and after the message corresponding to the address. If it matches the calibration instruction library and contains the 0xF5 instruction, it is a read operation. Obtain the positive response value of the instruction to get the value of the variable. If it contains the 0xF0 or 0xEF instructions, it is a calibration variable. Parse the internal value of the variable's calibration. If the variable is calibrated repeatedly, the last calibrated value is used. Group and save the variables to be read, the variables to be calibrated, and the corresponding internal values.
[0070] Step S5: Taking the XCP protocol as an example, parse the 20 lines of messages before and after the 0XD2 (PROGRAM_START) and 0XD0 (PROGRAM) instructions. If they match the instruction library to be flashed, then the messages from the 0XD2 instruction to 0XFE (DISCONNECT) are all flash messages. Save the addresses and data of each segment in groups, and save other information such as verification information.
[0071] Step S6: Monitoring of measured quantities: For variables read using the polling method, the polling method will still be used in this experiment. The values of the variables in the corresponding group in the ECU will be monitored and displayed. For variables read using the DAQ method, the group configuration will be adjusted according to different configurations such as DAQ_LIST_NUMBER and Event channel number. The values of the variables in the corresponding group in the ECU will be monitored and displayed.
[0072] Step S7: Reading and calibrating calibration values: For variables that need to be read, read them from the ECU and display them according to the variable information obtained from A2L; for variables that need to be calibrated, calibrate the corresponding internal values of the variables into the ECU and display them.
[0073] Step S8: Data flashing: The address information and corresponding data information obtained from A2L are flashed into the ECU according to the flashing process, and the data is verified according to the saved verification information.
[0074] This embodiment also relates to a specific ECU testing procedure, such as... Figure 5 As shown, the process is as follows: First, establish a connection with the ECU under test; second, perform secure access; third, start the test, which is a cyclical process: first determine the test parameters, then clear the corresponding program, then configure the test information of the test parameters, and then perform the test; fourth, perform test verification; fifth, reset the test program and disconnect.
[0075] This application applies to XCP / CCP / UDS messages and is suitable for scenarios such as monitoring of measured quantities, reading and calibration of calibrated quantities, and data writing; CAN messages can be directly used as a tool for transmitting test results, improving the efficiency of testing and experimentation.
[0076] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0077] This application also provides a testing device for an ECU. It should be noted that the ECU testing device of this application can be used to execute the testing method for ECUs provided in this application. This device is used to implement the embodiments and preferred embodiments described herein; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0078] The following describes the testing apparatus for the ECU provided in the embodiments of this application.
[0079] Figure 6 This is a schematic diagram of a testing apparatus for an ECU according to an embodiment of this application. Figure 6 As shown, the device includes:
[0080] The acquisition unit 10 is used to acquire the protocol type of historical CAN message records, wherein the historical CAN message records are CAN message records obtained from historical tests of the ECU under test;
[0081] Specifically, the historical CAN message record can be the CAN message of the ECU under test obtained by the previous test ECU during the current ECU test. The protocol types include, but are not limited to, XCP protocol, CCP protocol, and UDS protocol.
[0082] The parsing unit 20 is used to parse the historical CAN message records according to the protocol type to determine the historical test information of the ECU under test. The historical test information includes test parameters, corresponding test types, and test parameter values.
[0083] Specifically, different protocol types of CAN messages correspond to different parsing methods. The test parameters are the items of the ECU to be tested, the test type is the method of testing the items, such as flashing, calibration, reading, etc., and the test parameter values are the test values corresponding to the items.
[0084] The test unit 30 is used to test the ECU under test based on the historical test information.
[0085] In the aforementioned embodiment, the acquisition unit obtains the protocol type of historical CAN message records obtained from historical tests of the ECU under test; the parsing unit parses the historical CAN message records according to the obtained protocol type to determine historical test information including test parameters, corresponding test types, and test parameter values; and the testing unit tests the ECU under test based on this historical test information. Compared to the problem of CAN messages not being able to be directly transmitted as test results between tests, leading to low testing efficiency, this application automatically parses historical CAN message records to obtain historical test information, which is then used for the current testing of the ECU. This allows CAN messages to be directly transmitted as test results between tests, eliminating the need for manual parsing of CAN messages to obtain test information and then manually inputting this test information into the testing equipment to test the ECU, thus freeing up manpower and improving ECU testing efficiency.
[0086] In one alternative approach, the parsing unit may specifically include:
[0087] The first reading module is used to read the address instruction from the historical CAN message record if an address instruction corresponding to the protocol type exists in the historical CAN message record;
[0088] Specifically, the protocol type is one of the following: XCP protocol, CCP protocol, and UDS protocol. Based on the address instructions corresponding to the protocol type, the historical CAN message records are searched for the existence of these address instructions, which are used to indicate address information. Taking the XCP protocol as an example, these address instructions include 0xF6 (Set Memory Transfer Address) and 0xE1 (WRITE_DAQ), etc.
[0089] The query module is used to query the variable type corresponding to the address instruction in the A2L file to obtain the test type of the historical CAN message record. The test type includes calibration and measurement.
[0090] Specifically, the variable type indicates whether the variable is a calibration quantity or a measurement quantity. A calibration quantity corresponds to a calibration test type, while a measurement quantity corresponds to a measurement test type. Taking the XCP protocol as an example, if the variable type is CHARACTERISTIC, it is a calibration quantity; if it is MEASUREMENT, it is a measurement quantity.
[0091] The first determining module is used to determine, based on the protocol type and the test type, at least the test parameter and the test parameter value corresponding to the test type from the historical CAN message records, and obtain the historical test information.
[0092] In the embodiment described above, the variable type is queried from the A2L file according to the address instruction corresponding to the protocol type, thereby obtaining the test type for the historical test of the ECU under test. Then, based on the protocol type and test type, at least the test parameters and test parameter values are obtained from the historical CAN message records. This further realizes the automatic parsing and reading of test information in CAN messages, and further achieves the effect of directly transmitting CAN messages as test results between tests.
[0093] To further address the technical problem of low testing efficiency caused by the inability of CAN messages to be directly transmitted as test results between tests, and to further improve the testing efficiency of ECUs, according to another embodiment of this application, the protocol type is one of the following: XCP protocol, CCP protocol, and UDS protocol. The first determining module includes:
[0094] The first extraction submodule is used to extract the test parameters and the test parameter values from the historical CAN message records when the protocol type is the UDS protocol and the test type is the measurement.
[0095] The second extraction submodule is used to determine the test parameters, the test parameter values, and the auxiliary measurement information corresponding to the test parameters based on the measurement instructions extracted from the historical CAN message records and the measurement instruction library corresponding to the protocol type when the protocol type is the XCP protocol or the CCP protocol and the test type is the measurement. The auxiliary measurement information includes at least one of the following: measurement mode, measurement frequency, and measurement configuration parameters. The measurement mode includes Polling mode and DAQ mode.
[0096] Specifically, by analyzing multiple messages before and after the message corresponding to the address instruction in the historical CAN message record, if it matches the Polling measurement instruction library corresponding to the XCP or CCP protocol, the measurement method is determined to be Polling mode; if it matches the DAQ measurement instruction library corresponding to the XCP or CCP protocol, the measurement method is determined to be DAQ mode. When the measurement method is Polling mode, the historical test information includes the test parameters, the test parameter values, and the measurement method. When the measurement method is DAQ mode, the measurement frequency, such as DAQ-500ms, DAQ-100ms, DAQ-10ms, etc., is also acquired, along with measurement configuration parameters including the acquisition list number, the event channel number, and the transmission rate prescaler, etc. The historical test information includes the test parameters, the test parameter values, the measurement method, the measurement frequency, and the measurement configuration parameters.
[0097] The third extraction submodule is used to determine the test parameters, the final test parameter value, and the calibration method based on the calibration instructions extracted from the historical CAN message records and the calibration instruction library corresponding to the protocol type when the test type is calibration. The calibration method includes a reading method and a writing (also known as calibration) method. The final test parameter value is the value of the last calibration of the test parameters.
[0098] Specifically, by analyzing multiple messages before and after the message corresponding to the address instruction in the historical CAN message record, if it corresponds to the read instruction library, the read mode is used for calibration; if it corresponds to the write instruction library, the write mode is used for calibration. Since there may be multiple calibration operations extracted from the calibration instructions, the last calibration operation is used as the reference, and the measurement parameter value corresponding to that operation is read.
[0099] In the embodiments described, when the protocol type is the UDS protocol and the test type is measurement, since the measurement quantity of the UDS protocol does not involve auxiliary measurement information such as measurement method and measurement frequency, the test parameters and the test parameter values can be directly extracted from the historical CAN message records. When the protocol type is the XCP protocol or the CCP protocol and the test type is measurement, historical test information including the test parameters, the test parameter values, and the auxiliary measurement information corresponding to the test parameters is obtained from the historical CAN message records, making the extracted historical test information more complete. When the test type is calibration, historical test information including the test parameters, the final test parameter values, and the calibration method is obtained from the historical CAN message records, ensuring the accuracy of the test information.
[0100] Specifically, after obtaining the historical test information, the information can be saved in groups according to variables.
[0101] To further ensure the completeness and accuracy of the obtained historical test information, in some embodiments of this application, the device further includes a query unit, used to query the description information corresponding to the address instruction from the A2L file after reading the address instruction from the historical CAN message record. The historical test information also includes the description information. Since the historical CAN message record does not record all variable information, this application uses the A2L file to find the incomplete variable information, further ensuring the completeness of the historical test information. This facilitates the use of the LOG file during the current ECU test to calibrate, read, monitor, and rewrite the variables involved in the LOG file.
[0102] Specifically, the descriptive information includes, but is not limited to, the variable name, variable type (value, curve, map, ascii, axis, measurement, etc.), data type (byte, word, long, etc.), unit, format information, etc.
[0103] Optionally, the parsing unit includes: a second determining module, configured to determine that the test type of the historical CAN message record is flashing if a flashing instruction corresponding to the protocol type exists in the historical CAN message record; a second reading module, configured to read the flashing instruction from the historical CAN message record; and a third determining module, configured to determine the test parameters and test parameter values corresponding to the test type based on the flashing instruction and a flashing instruction library corresponding to the protocol type, thereby obtaining the historical test information. In this embodiment, by searching for a flashing instruction corresponding to the protocol type in the historical CAN message record to determine that the test type of the historical CAN message record is flashing, and then parsing to obtain the flashing parameter information, the automatic reading of flashing information in the historical CAN message record is further realized, which facilitates subsequent testing of the ECU under test, thereby further improving the testing efficiency of the ECU.
[0104] Furthermore, by parsing multiple messages before and after the message corresponding to the flashing instruction in the historical CAN message record, if they match the flashing instruction library corresponding to the protocol type, a complete flashing message can be obtained. Then, the flashing message is parsed to obtain flashing parameter information, and the addresses and data of each segment of the flashing message are grouped and saved, along with other information such as verification information.
[0105] In some other embodiments of this application, the testing unit includes: a fourth determining module, configured to determine, based on the protocol type and the historical test information, the test type corresponding to the current test parameter of the ECU under test as the target test type, and determine the test parameter value corresponding to the current test parameter of the ECU under test as the target parameter value; and a testing module, configured to test the current test parameter according to the target test type and the target parameter value, obtain the test result, and display the test result on a display device. In this embodiment, based on the historical test information parsed from historical CAN message records, the current test parameter of the ECU under test is tested according to the corresponding test type and test parameter value, further realizing that CAN messages can be directly used as a tool for transmitting test results, and further improving the efficiency of testing.
[0106] Specifically, for variables whose current test parameters are read using the polling method, they will still be read using the polling method in this test, and the values of the variables in that group in the ECU will be monitored and displayed. For variables whose current test parameters are read using the DAQ method, they will be grouped according to different configurations such as DAQ_LIST_NUMBER and Event channel number, and the values of the variables in that group in the ECU will be monitored and displayed. For calibration variables that need to be read, they will be read from the ECU and displayed according to the variable information obtained from A2L. For calibration variables that need to be written, the corresponding internal values of the variables will be calibrated in the ECU and displayed. For flashing parameters, the address information and corresponding data information obtained from A2L will be flashed into the ECU according to the flashing process, and the data will be verified according to the saved verification information.
[0107] In some optional embodiments, the message protocol includes the XCP protocol, CCP protocol, and UDS protocol. The acquisition unit includes: an acquisition module, used to acquire the first byte and the second byte in the historical CAN message record to obtain an instruction byte, wherein for the XCP and CCP protocols, the first byte is the instruction byte, and for the UDS protocol, the second byte is the instruction byte; and a search module, used to search in the message instruction library for the message protocol corresponding to the same byte as the first or second byte, based on the instruction byte, to obtain the protocol type. The message instruction library includes multiple bytes and the message protocol corresponding to each byte. In this embodiment, by acquiring the first or second byte representing the instruction in the historical CAN message record and searching for the corresponding message protocol in the message instruction library, the protocol type of the historical CAN message record can be determined relatively simply, quickly, and accurately.
[0108] The ECU testing device includes a processor and a memory. The acquisition unit, the parsing unit, and the testing unit are all stored as program units in the memory, and the processor executes the program units stored in the memory to achieve the corresponding functions. All modules are located in the same processor; alternatively, the modules may be located in different processors in any combination.
[0109] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can at least address the problem of low ECU testing efficiency in existing technologies.
[0110] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0111] This invention provides a computer-readable storage medium including a stored program, wherein the program, when running, controls the device where the computer-readable storage medium is located to execute a test method for the ECU.
[0112] This invention provides a processor for running a program, wherein the program executes a test method for the ECU.
[0113] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0114] Step S201: Obtain the protocol type of the historical CAN message record, wherein the historical CAN message record is the CAN message record obtained by the ECU under test in the past.
[0115] Specifically, the historical CAN message record can be the CAN message of the ECU under test obtained by the previous test ECU during the current ECU test. The protocol types include, but are not limited to, XCP protocol, CCP protocol, and UDS protocol.
[0116] Step S202: According to the protocol type, parse the historical CAN message records to determine the historical test information of the ECU under test. The historical test information includes test parameters, corresponding test types, and test parameter values.
[0117] Specifically, different protocol types of CAN messages correspond to different parsing methods. The test parameters are the items of the ECU to be tested, the test type is the method of testing the items, such as flashing, calibration, reading, etc., and the test parameter values are the test values corresponding to the items.
[0118] Step S203: Test the ECU under test according to the historical test information.
[0119] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0120] Optionally, according to the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test, including: if an address instruction corresponding to the protocol type exists in the historical CAN message records, the address instruction is read from the historical CAN message records; the variable type corresponding to the address instruction is queried in the A2L file to obtain the test type of the historical CAN message records, the test type including calibration and measurement; according to the protocol type and the test type, at least the test parameter and the test parameter value corresponding to the test type are determined from the historical CAN message records to obtain the historical test information.
[0121] Optionally, the protocol type is one of the following: XCP protocol, CCP protocol, and UDS protocol. Based on the protocol type and the test type, at least the test parameters and test parameter values corresponding to the test type are determined from the historical CAN message records to obtain the historical test information, including: when the protocol type is the UDS protocol and the test type is the measurement, extracting the test parameters and test parameter values from the historical CAN message records; when the protocol type is the XCP protocol or the CCP protocol and the test type is the measurement, based on the measurement command extracted from the historical CAN message records and... The measurement instruction library corresponding to the protocol type determines the test parameters, the test parameter values, and the auxiliary measurement information corresponding to the test parameters. The auxiliary measurement information includes at least one of the following: measurement mode, measurement frequency, and measurement configuration parameters. The measurement mode includes Polling mode and DAQ mode. When the test type is calibration, the test parameters, the final test parameter values, and the calibration mode are determined based on the calibration instructions extracted from the historical CAN message records and the calibration instruction library corresponding to the protocol type. The calibration mode includes reading mode and writing mode. The final test parameter value is the value of the last calibration of the test parameters.
[0122] Optionally, after reading the address instruction from the historical CAN message record, the method further includes: querying the description information corresponding to the address instruction from the A2L file, wherein the historical test information also includes the description information.
[0123] Optionally, according to the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test, including: if there is a flashing instruction corresponding to the protocol type in the historical CAN message records, the test type of the historical CAN message records is determined to be flashing; the flashing instruction is read from the historical CAN message records; and the test parameters and test parameter values corresponding to the test type are determined according to the flashing instruction and the flashing instruction library corresponding to the protocol type to obtain the historical test information.
[0124] Optionally, testing the ECU under test based on the historical test information includes: determining the test type corresponding to the current test parameter of the ECU under test as the target test type based on the protocol type and the historical test information, and determining the test parameter value corresponding to the current test parameter of the ECU under test as the target parameter value; testing the current test parameter according to the target test type and the target parameter value to obtain the test result, and displaying the test result on a display device.
[0125] Optionally, obtaining the protocol type of historical CAN message records includes: obtaining the first byte and the second byte in the historical CAN message record to obtain the instruction byte; based on the instruction byte, searching in the message instruction library for the message protocol corresponding to the same byte as the first byte or the second byte to obtain the protocol type, wherein the message instruction library includes multiple bytes and the message protocol corresponding to each byte, and the message protocol includes XCP protocol, CCP protocol and UDS protocol.
[0126] This application also provides a computer program product, including computer instructions, which, when executed by a processor, implement at least the following method steps:
[0127] Step S201: Obtain the protocol type of the historical CAN message record, wherein the historical CAN message record is the CAN message record obtained by the ECU under test in the past.
[0128] Specifically, the historical CAN message record can be the CAN message of the ECU under test obtained by the previous test ECU during the current ECU test. The protocol types include, but are not limited to, XCP protocol, CCP protocol, and UDS protocol.
[0129] Step S202: According to the protocol type, parse the historical CAN message records to determine the historical test information of the ECU under test. The historical test information includes test parameters, corresponding test types, and test parameter values.
[0130] Specifically, different protocol types of CAN messages correspond to different parsing methods. The test parameters are the items of the ECU to be tested, the test type is the method of testing the items, such as flashing, calibration, reading, etc., and the test parameter values are the test values corresponding to the items.
[0131] Step S203: Test the ECU under test according to the historical test information.
[0132] Optionally, according to the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test, including: if an address instruction corresponding to the protocol type exists in the historical CAN message records, the address instruction is read from the historical CAN message records; the variable type corresponding to the address instruction is queried in the A2L file to obtain the test type of the historical CAN message records, the test type including calibration and measurement; according to the protocol type and the test type, at least the test parameter and the test parameter value corresponding to the test type are determined from the historical CAN message records to obtain the historical test information.
[0133] Optionally, the protocol type is one of the following: XCP protocol, CCP protocol, and UDS protocol. Based on the protocol type and the test type, at least the test parameters and test parameter values corresponding to the test type are determined from the historical CAN message records to obtain the historical test information, including: when the protocol type is the UDS protocol and the test type is the measurement, extracting the test parameters and test parameter values from the historical CAN message records; when the protocol type is the XCP protocol or the CCP protocol and the test type is the measurement, based on the measurement command extracted from the historical CAN message records and... The measurement instruction library corresponding to the protocol type determines the test parameters, the test parameter values, and the auxiliary measurement information corresponding to the test parameters. The auxiliary measurement information includes at least one of the following: measurement mode, measurement frequency, and measurement configuration parameters. The measurement mode includes Polling mode and DAQ mode. When the test type is calibration, the test parameters, the final test parameter values, and the calibration mode are determined based on the calibration instructions extracted from the historical CAN message records and the calibration instruction library corresponding to the protocol type. The calibration mode includes reading mode and writing mode. The final test parameter value is the value of the last calibration of the test parameters.
[0134] Optionally, after reading the address instruction from the historical CAN message record, the method further includes: querying the description information corresponding to the address instruction from the A2L file, wherein the historical test information also includes the description information.
[0135] Optionally, according to the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test, including: if there is a flashing instruction corresponding to the protocol type in the historical CAN message records, the test type of the historical CAN message records is determined to be flashing; the flashing instruction is read from the historical CAN message records; and the test parameters and test parameter values corresponding to the test type are determined according to the flashing instruction and the flashing instruction library corresponding to the protocol type to obtain the historical test information.
[0136] Optionally, testing the ECU under test based on the historical test information includes: determining the test type corresponding to the current test parameter of the ECU under test as the target test type based on the protocol type and the historical test information, and determining the test parameter value corresponding to the current test parameter of the ECU under test as the target parameter value; testing the current test parameter according to the target test type and the target parameter value to obtain the test result, and displaying the test result on a display device.
[0137] Optionally, obtaining the protocol type of historical CAN message records includes: obtaining the first byte and the second byte in the historical CAN message record to obtain the instruction byte; based on the instruction byte, searching in the message instruction library for the message protocol corresponding to the same byte as the first byte or the second byte to obtain the protocol type, wherein the message instruction library includes multiple bytes and the message protocol corresponding to each byte, and the message protocol includes XCP protocol, CCP protocol and UDS protocol.
[0138] Embodiments of this application also provide an ECU system, including: an ECU; a test device for the ECU, the test device including: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any one of the methods described.
[0139] In the ECU system, the ECU testing equipment automatically parses historical CAN message records to obtain historical test information, which is then used for the current ECU test. This allows CAN messages to be directly transmitted between tests as test results, eliminating the need for manual parsing of CAN messages to obtain test information and then manually inputting this test information into the testing equipment to test the ECU. This frees up manpower and improves the testing efficiency of the ECU.
[0140] It will be apparent to those skilled in the art that the modules or steps of the present invention can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using device-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular hardware and software combination.
[0141] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0142] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0143] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0144] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0145] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0146] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0147] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0148] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0149] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A testing method for an ECU, characterized in that, include: Obtain the protocol type of historical CAN message records, where the historical CAN message records are the CAN message records obtained from the ECU under test in the past; Based on the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test. The historical test information includes test parameters, corresponding test types, and test parameter values. Based on the historical test information, the ECU under test is tested. Based on the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test, including: If an address instruction corresponding to the protocol type exists in the historical CAN message record, the address instruction is read from the historical CAN message record; The variable type corresponding to the address instruction is queried in the A2L file to obtain the test type of the historical CAN message record. The test type includes calibration and measurement. Based on the protocol type and the test type, at least the test parameter and the test parameter value corresponding to the test type are determined from the historical CAN message records to obtain the historical test information.
2. The method according to claim 1, characterized in that, The protocol type is one of the following: XCP protocol, CCP protocol, and UDS protocol. Based on the protocol type and the test type, at least the test parameters and test parameter values corresponding to the test type are determined from the historical CAN message records to obtain the historical test information, including: When the protocol type is the UDS protocol and the test type is the measurement, the test parameters and the test parameter values are extracted from the historical CAN message records. When the protocol type is the XCP protocol or the CCP protocol, and the test type is the measurement, the test parameters, the test parameter values, and the auxiliary measurement information corresponding to the test parameters are determined based on the measurement instructions extracted from the historical CAN message records and the measurement instruction library corresponding to the protocol type. The auxiliary measurement information includes at least one of the following: measurement mode, measurement frequency, and measurement configuration parameters. The measurement mode includes Polling mode and DAQ mode. When the test type is calibration, the test parameters, the final test parameter value, and the calibration method are determined based on the calibration instructions extracted from the historical CAN message records and the calibration instruction library corresponding to the protocol type. The calibration method includes a read method and a write method. The final test parameter value is the value of the last time the test parameters were calibrated.
3. The method according to claim 1, characterized in that, After reading the address instruction from the historical CAN message record, the method further includes: The description information corresponding to the address instruction is obtained by querying the A2L file, and the historical test information also includes the description information.
4. The method according to claim 1, characterized in that, Based on the protocol type, the historical CAN message records are parsed to determine the historical test information of the ECU under test, including: If a flashing instruction corresponding to the protocol type exists in the historical CAN message record, the test type of the historical CAN message record is determined to be flashing. Read the write command from the historical CAN message record; Based on the flashing command and the flashing command library corresponding to the protocol type, the test parameters and test parameter values corresponding to the test type are determined, and the historical test information is obtained.
5. The method according to any one of claims 1 to 4, characterized in that, Based on the historical test information, the ECU under test is tested, including: Based on the protocol type and the historical test information, the test type corresponding to the current test parameter of the ECU under test is determined as the target test type, and the test parameter value corresponding to the current test parameter of the ECU under test is determined as the target parameter value. The current parameter to be tested is tested according to the target test type and the target parameter value, the test result is obtained, and the test result is displayed on the display device.
6. The method according to any one of claims 1 to 4, characterized in that, The protocol types for retrieving historical CAN message records include: Obtain the first and second bytes from the historical CAN message record to get the instruction byte; Based on the instruction byte, the message protocol corresponding to the same byte as the first byte or the second byte is searched in the message instruction library to obtain the protocol type. The message instruction library includes multiple bytes and the message protocol corresponding to each byte. The message protocol includes XCP protocol, CCP protocol and UDS protocol.
7. A testing device for an ECU, characterized in that, include: The acquisition unit is used to acquire the protocol type of historical CAN message records, wherein the historical CAN message records are CAN message records obtained from historical tests of the ECU under test; The parsing unit is used to parse the historical CAN message records according to the protocol type to determine the historical test information of the ECU under test. The historical test information includes test parameters, corresponding test types, and test parameter values. The testing unit is used to test the ECU under test based on the historical test information. The parsing unit includes: The first reading module is used to read the address instruction from the historical CAN message record if an address instruction corresponding to the protocol type exists in the historical CAN message record; The query module is used to query the variable type corresponding to the address instruction in the A2L file to obtain the test type of the historical CAN message record. The test type includes calibration and measurement. The first determining module is used to determine, based on the protocol type and the test type, at least the test parameter and the test parameter value corresponding to the test type from the historical CAN message records, and obtain the historical test information.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 6.
9. An ECU system, characterized in that, include: ECU; The test equipment for the ECU includes: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any one of claims 1 to 6.
Citation Information
Patent Citations
Automatic performance testing method and device
CN116244202A
Measurement calibration method and device of ECU, electronic equipment and storage medium
CN118018450A