ECU test method and device, computer readable storage medium and ECU system
By automatically parsing historical CAN message records to obtain test information, the problem of low ECU test efficiency is solved, and the automation and efficiency of ECU testing are realized.
Patent Information
- Application Number
- CN202410755679.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-12
AI Technical Summary
The test efficiency of ECU is low, mainly because CAN messages cannot be directly transmitted between tests as test results, resulting in manual analysis and manual input of test information, which is inefficient.
By obtaining the protocol type recorded in historical CAN messages, the historical test information is automatically parsed and used for the current test of the ECU, so that CAN messages can be directly transferred between tests as test results, freeing up manpower and improving test efficiency.
It realizes the automation of ECU testing, improves testing and testing efficiency, reduces manual analysis and input steps, and improves testing accuracy and efficiency.
Smart Images

Figure CN118689199A
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an ECU testing method, device, computer-readable storage medium and ECU system. Background Art
[0002] In the field of vehicle control, the vehicle electronic control unit (ECU) is a lower computer that can obtain vehicle status information such as motor speed, motor voltage, motor current, fault information, etc. through ECU, and convert the vehicle status information into digital signals and feed them back to the upper computer. At this time, the upper computer can display the obtained digital signals, generate corresponding control instructions, and send the control instructions to ECU, so that ECU can control the vehicle status based on the control instructions.
[0003] In order to achieve control accuracy, it is usually necessary to test and test the ECU through test equipment. In the process of ECU related tests and experiments, CAN messages can be used as an important basis for test results. However, CAN messages cannot be directly transmitted between tests as test results, resulting in low test and experiment efficiency. Summary of the invention
[0004] The main purpose of the present application is to provide an ECU testing method, device, computer-readable storage medium and ECU system, so as to at least solve the problem of low ECU test efficiency in the prior art.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a test method for an ECU is provided, comprising: obtaining a protocol type of a historical CAN (Controller Area Network) message record, wherein the historical CAN message record is a CAN message record obtained by a historical test of an ECU to be tested; according to the protocol type, parsing the historical CAN message record to determine historical test information of the ECU to be tested, wherein the historical test information includes test parameters, corresponding test types and test parameter values; and testing the ECU to be tested according to the historical test information.
[0006] Optionally, according to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: when there is an address instruction corresponding to the protocol type in the historical CAN message record, the address instruction is read from the historical CAN message record; querying 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 including calibration and measurement; according to the protocol type and the test type, at least the test parameters and the test parameter values corresponding to the test type are determined from the historical CAN message record to obtain the historical test information.
[0007] Optionally, the protocol type is one of the following: XCP (Universal Calibration Protocol) protocol, CCP (CAN Calibration Protocol, based on CAN bus calibration protocol) protocol and UDS (Unified Diagnostic Services) protocol. 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 record to obtain the historical test information, including: when the protocol type is the UDS protocol and the test type is the measurement, the test parameter and the test parameter value are extracted from the historical CAN message record; when the protocol type is the XCP protocol or the CCP protocol, and the test type is the measurement, according to the measurement instruction extracted from the historical CAN message record and the measurement instruction library corresponding to the protocol type, the test parameter, the test parameter value, and the auxiliary measurement information corresponding to the test parameter are determined, and the auxiliary measurement information includes at least one of the following: measurement mode, measurement frequency, and measurement configuration parameters. The measurement mode includes Polling (query) mode and DAQ (Data Acquisition) mode. Command, data acquisition instruction) mode; when the test type is the calibration, the test parameters, the final test parameter values and the calibration mode 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 mode includes a reading mode and a writing mode, and the final test parameter value is the value of the last calibration of the test parameter.
[0008] Optionally, after reading the address instruction from the historical CAN message record, the method further includes: querying from an A2L file to obtain description information corresponding to the address instruction, and the historical test information also includes the description information.
[0009] Optionally, according to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: when there is a flash instruction corresponding to the protocol type in the historical CAN message record, determining that the test type of the historical CAN message record is flash; reading the flash instruction from the historical CAN message record; determining the test parameters and the test parameter values corresponding to the test type according to the flash instruction and the flash instruction library corresponding to the protocol type, to obtain the historical test information.
[0010] Optionally, the ECU to be tested is tested according to the historical test information, including: determining, according to the protocol type and the historical test information, that the test type corresponding to the current parameter to be tested of the ECU to be tested is a target test type, and determining that the test parameter value corresponding to the current parameter to be tested of the ECU to be tested is a target parameter value; testing the current parameter to be tested according to the target test type and the target parameter value to obtain a test result, and displaying the test result on a display device.
[0011] Optionally, obtaining the protocol type of a historical CAN message record includes: obtaining the first byte and the second byte in the historical CAN message record to obtain an instruction byte; based on the instruction byte, searching a message instruction library for a message protocol corresponding to a byte that is the same as the first byte or the second byte to obtain the protocol type, wherein the message instruction library includes multiple bytes and the message protocols corresponding to each of the bytes, and the message protocols include an XCP protocol, a CCP protocol, and a UDS protocol.
[0012] According to another aspect of the present application, a test device for an ECU is provided, comprising: an acquisition unit, used to acquire a protocol type of a historical CAN message record, wherein the historical CAN message record is a CAN message record obtained by a historical test of an ECU to be tested; a parsing unit, used to parse the historical CAN message record according to the protocol type, and determine historical test information of the ECU to be tested, wherein the historical test information includes test parameters, corresponding test types and test parameter values; and a testing unit, used to test the ECU to be tested according to the historical test information.
[0013] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0014] According to another aspect of the present application, an ECU system is provided, comprising: an ECU; 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, and the one or more programs include methods for executing any one of the described methods.
[0015] Applying the technical solution of the present application, firstly, the protocol type of the historical CAN message record obtained by the historical test of the ECU to be tested is obtained; then, according to the obtained protocol type, the historical CAN message record is parsed to determine the historical test information including the test parameters, the corresponding test type and the test parameter value; finally, according to the historical test information, the ECU to be tested is tested. Compared with the problem that CAN messages cannot be directly transferred between tests as test results, resulting in low test and test efficiency, the present application automatically parses the historical CAN message records to obtain historical test information, and uses it for the current test of the ECU, so that the CAN message can be directly transferred between tests as the test result, without the need to manually parse the CAN message to obtain the test information, and then manually input the test information into the test equipment to test the ECU, which frees up manpower and improves the test efficiency of the ECU. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 A hardware structure block diagram of a mobile terminal for executing an ECU test method provided in an embodiment of the present application is shown;
[0018] Figure 2 A schematic diagram of a flow chart of a method for testing an ECU provided according to an embodiment of the present application is shown;
[0019] Figure 3 A schematic flow chart of another ECU testing method provided according to an embodiment of the present application is shown;
[0020] Figure 4 A schematic diagram of a test flow of an ECU provided according to an embodiment of the present application is shown;
[0021] Figure 5 A schematic diagram of another ECU test process provided according to an embodiment of the present application is shown;
[0022] Figure 6A structural block diagram of an ECU testing device provided according to an embodiment of the present application is shown.
[0023] The drawings include the following reference numerals:
[0024] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0029] CAN message: refers to the frame that transmits data from the sending unit to the receiving unit, 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 introduced in the background technology, the test efficiency of ECU in the prior art is low. To solve the above technical problems, the embodiments of the present application provide an ECU test method, device, computer-readable storage medium and ECU system.
[0031] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0032] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of an ECU testing method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the test method of the ECU in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the method described is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as 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] In this embodiment, a test method for an ECU running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of 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 can be executed in an order different from that shown here.
[0035] Figure 2 : is a flow chart of a method for testing an ECU according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0036] Step S201, obtaining the protocol type of a historical CAN message record, wherein the historical CAN message record is a CAN message record obtained by a historical test ECU;
[0037] Specifically, the historical CAN message record may be a CAN message of the ECU to be tested obtained in the last test of the current ECU. The protocol types include but are not limited to XCP protocol, CCP protocol and UDS protocol.
[0038] Step S202, parsing the historical CAN message records according to the protocol type to determine the historical test information of the ECU to be tested, wherein 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 parameter is the ECU item to be tested, the test type is the method of testing the item, such as flashing, calibration, reading, etc., and the test parameter value is the test value corresponding to the item.
[0040] Step S203: testing the ECU to be tested according to the historical test information.
[0041] Through the embodiment, the protocol type of the historical CAN message record obtained by the historical test of the ECU to be tested is first obtained; then, according to the obtained protocol type, the historical CAN message record is parsed to determine the historical test information including the test parameters, the corresponding test type and the test parameter value; finally, according to the historical test information, the ECU to be tested is tested. Compared with the problem that CAN messages cannot be directly transferred between tests as test results, resulting in low test and test efficiency, the present application automatically parses the historical CAN message records to obtain historical test information, and uses it for the current test of the ECU, so that the CAN message can be directly transferred between tests as the test result, without the need to manually parse the CAN message to obtain the test information, and then manually input the test information into the test equipment to test the ECU, which frees up manpower and improves the test efficiency of the ECU.
[0042] In one alternative, Figure 3 As shown, step S202: according to the protocol type, the historical CAN message record is parsed, and the specific implementation method of determining the historical test information of the ECU to be tested may include:
[0043] Step S2021: when there is an address instruction corresponding to the protocol type 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. According to the address instructions corresponding to the protocol type, whether these address instructions exist in the historical CAN message record is searched, and these address instructions are used to indicate address information. Taking the protocol type as XCP protocol as an example, these address instructions include 0XF6 (Set Memory Transfer Address) and 0XE1 (WRITE_DAQ) and the like.
[0045] Step S2022: querying the variable type corresponding to the address instruction in the A2L file to obtain the test type of the historical CAN message record, where the test type includes calibration and measurement;
[0046] Specifically, the variable type is used to indicate whether the variable is a calibrated variable or a measured variable. A calibrated variable means that the corresponding test type is calibration, and a measured variable means that the corresponding test type is measurement. Still taking the XCP protocol as an example, if the variable type is CHARACTERISTIC, it is a calibrated variable, and if it is MEASUREMENT, it is a measured variable.
[0047] Step S2023: 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.
[0048] In the described embodiment, according to the address instruction corresponding to the protocol type, the variable type is queried from the A2L file to obtain the test type of the historical test of the ECU to be tested, and then according to the protocol type and the test type, at least the test parameters and the test parameter values are obtained from the historical CAN message records, further realizing the automatic parsing and reading of the test information in the CAN message, and further achieving the effect of directly transmitting the CAN message as the test result between tests.
[0049] In order to further solve the technical problem that CAN messages cannot be directly transmitted between tests as test results, resulting in low test and test efficiency, and further improve the test efficiency of the ECU, according to another embodiment of the present application, the protocol type is one of the following: XCP protocol, CCP protocol and UDS protocol. Step S2023: 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 record 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, extracting the test parameter and the test parameter value from the historical CAN message record;
[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 parameter, the test parameter value, and auxiliary measurement information corresponding to the test parameter according to the measurement instruction extracted from the historical CAN message record and the measurement instruction library corresponding to the protocol type, wherein the auxiliary measurement information includes at least one of the following: a measurement mode, a measurement frequency, and a measurement configuration parameter, and the measurement mode includes a Polling mode and a DAQ mode;
[0052] Specifically, by analyzing the 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 protocol or the CCP protocol, it is determined that the measurement method is the Polling method; if it matches the DAQ measurement instruction library corresponding to the XCP protocol or the CCP protocol, it is determined that the measurement method is the DAQ method. In the case where the measurement method is the Polling method, the historical test information includes the test parameters, the test parameter values, and the measurement method. In the case where the measurement method is the DAQ method, it is also necessary to obtain the measurement frequency, such as DAQ-500ms, DAQ-100ms, DAQ-10ms, etc., as well as the measurement configuration parameters including the number of the acquisition list, the number of the event channel, and the transmission rate pre-divider, etc., and 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 the calibration, the test parameters, the final test parameter values 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 reading method and a writing (also called calibration) method. The final test parameter value is the value of the last calibration of the test parameter.
[0054] Specifically, by analyzing the 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 method is used for calibration, and if it corresponds to the write instruction library, the write method is used for calibration. Since there may be multiple calibration operations extracted from the calibration instruction, the last calibration operation is used as the reference at this time to read the measurement parameter value corresponding to the operation.
[0055] In the embodiment, when the protocol type is the UDS protocol and the test type is the measurement, since the measurement quantity of the UDS protocol does not involve auxiliary measurement information such as the measurement method and the 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 the measurement, the 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, so that the extracted historical test information is relatively complete. When the test type is the calibration, the 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 may be grouped and saved according to variables.
[0057] In order to further ensure that the historical test information is relatively complete and accurate, in some other embodiments of the present application, after reading the address instruction from the historical CAN message record, the method further includes: querying and obtaining the description information corresponding to the address instruction from the A2L file, and the historical test information also includes the description information. Since the historical CAN message record does not record all variable information, the present application finds the part of variable information that is not fully recorded through the A2L file, further ensuring the integrity of the historical test information, and facilitating the calibration, reading, monitoring, and flashing of the variables involved in the LOG file again based on the LOG file during this ECU test.
[0058] Specifically, the description 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, according to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: when there is a flashing instruction corresponding to the protocol type in the historical CAN message record, determining that the test type of the historical CAN message record is flashing; reading the flashing instruction from the historical CAN message record; according to the flashing instruction and the flashing instruction library corresponding to the protocol type, determining the test parameters and the test parameter values corresponding to the test type, and obtaining the historical test information. In this embodiment, by searching for the flashing instruction corresponding to the protocol type in the historical CAN message record, determining 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 the flashing information in the historical CAN message record is further realized, which facilitates the subsequent application to the test of the ECU to be tested, thereby further improving the test efficiency of the ECU.
[0060] Furthermore, by parsing multiple messages before and after the message corresponding to the flash instruction in the historical CAN message record, if it matches the flash instruction library corresponding to the protocol type, a complete flash message can be obtained, and then the flash message is parsed to obtain the flash parameter information, and the addresses and data groups of each segment of the flash message are saved, and other information such as verification information is saved.
[0061] In some other embodiments of the present application, the ECU to be tested is tested according to the historical test information, including: determining that the test type corresponding to the current parameter to be tested of the ECU to be tested is the target test type according to the protocol type and the historical test information, and determining that the test parameter value corresponding to the current parameter to be tested of the ECU to be tested is the target parameter value; testing the current parameter to be tested 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, according to the historical test information parsed from the historical CAN message records, the current parameter to be tested of the ECU to be tested is tested for the corresponding test type and test parameter value, further realizing that the CAN message is directly used as a transmission tool for the test result, and further improving the efficiency of the experiment and test.
[0062] Specifically, for variables whose current measured parameters are read by Polling, they are still read by polling in this test, and the values of variables in this group in the ECU are monitored and displayed; for variables whose current measured parameters are read by DAQ, they are grouped and configured according to different configurations such as DAQ_LIST_NUMBER and Event channel number in this test, and the values of variables in this group in the ECU are monitored and displayed; for variables whose current measured parameters are calibration variables that need to be read, they are read from the ECU and displayed according to the variable information obtained from A2L; for variables whose current measured parameters are calibration variables that need to be written, the corresponding internal values of the variables are calibrated to the ECU and displayed; and for variables whose current measured parameters are write parameters, the address information and corresponding data information of each segment obtained from A2L are written to the ECU according to the write process, and the data verification is completed according to the saved verification information.
[0063] In some other optional embodiments, the message protocol includes the XCP protocol, the CCP protocol and the UDS protocol, and obtaining the protocol type of the historical CAN message record includes: obtaining the first byte and the second byte in the historical CAN message record to obtain the instruction byte, wherein for the XCP protocol and the CCP protocol, the first byte is the instruction byte, and for the UDS protocol, the second byte is the instruction byte; according to the instruction byte, searching the message instruction library for the message protocol corresponding to the byte identical to the first byte or the second byte to obtain the protocol type, and the message instruction library includes multiple bytes and the message protocols corresponding to each of the bytes. In this embodiment, by obtaining the first byte or the second byte representing the instruction directly in the historical CAN message record, and searching the message instruction library to obtain the message protocol corresponding to the byte, the protocol type of the historical CAN message record can be determined relatively simply, quickly and accurately.
[0064] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the ECU testing method of the present application will be described in detail below in conjunction with specific embodiments.
[0065] This embodiment relates to a specific ECU test process, which specifically includes the parsing process of the CAN message of the last ECU test and the current ECU test 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 byte or the second byte of the message sent 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 the instructions involving addresses such as 0XF6 (Set Memory TransferAddress) 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 calibrated quantity, if it is MEASUREMENT, it is a measured quantity, and obtain the variable name, variable type (value, curve, map, ascii, axis, measurement, etc.), data type (byte, word, long, etc.), unit, format information, etc. of the scalar in A2L;
[0068] Step S3: If it is a measurement, analyze the 5 messages before and after the message corresponding to the address. If it matches the monitored instruction library and contains 0xF5 or 0xf4 instructions, the variable is read through Polling; if it contains 0XE1, OXE0, 0XDE and other instructions, the variable is read through DAQ, and obtain the DAQ_LIST_NUMBER, Event channel number, Transmission rate prescaler and other information of the DAQ, and obtain the frequency of the DAQ (DAQ-500ms, DAQ-100ms, DAQ-10ms, etc.). And save the variables in groups according to the type and method of variable reading;
[0069] Step S4: If it is a calibration, analyze the other instructions in the 4 messages before and after the message corresponding to the address. If it matches the calibrated instruction library and contains the 0xF5 instruction, it is a read, and the value of the positive response of the instruction is obtained to obtain the value read by the variable; if it contains 0xF0 and 0XEF instructions, it is a calibration, and the internal value of the variable calibration is parsed. If the variable is repeatedly calibrated, the last calibrated value shall prevail. Group 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 flash instruction library, the messages from the 0XD2 instruction to 0XFE (DISCONNECT) are all flash messages. The addresses and data of each segment are grouped and saved, and other information such as verification information is saved.
[0071] Step S6: Monitoring of measured quantities: For variables read by Polling, they are still read by polling in this experiment, and the values of variables in this group in the ECU are monitored and displayed; for variables read by DAQ, they are grouped according to different configurations such as DAQ_LIST_NUMBER and Event channel number in the experiment, and the values of variables in this group in the ECU are monitored and displayed;
[0072] Step S7: Reading and calibrating the calibration quantity: For variables that need to be read, read from the ECU and display according to the variable information obtained from the A2L; for variables that need to be calibrated, calibrate the corresponding internal value of the variable into the ECU and display it;
[0073] Step S8: Flashing of data: Flashing of each segment of address information and corresponding data information obtained from A2L to ECU according to the flashing process, and completing data verification according to the saved verification information.
[0074] This embodiment also relates to a specific ECU test process, such as Figure 5 As shown, first, establish a connection with the ECU to be tested; second, perform secure access; third, start the test. This process is a cyclic process: first determine the test parameters, then clear the corresponding program, then configure the test information of the test parameters, and perform the test; fourth, perform test verification; fifth, reset the test program and disconnect.
[0075] This application is applicable to XCP / CCP / UDS messages, and is suitable for scenarios such as monitoring of measured quantities, reading and calibration of calibrated quantities, and data flushing; CAN messages can be directly used as a tool for transmitting test results to improve the efficiency of experiments and tests.
[0076] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0077] The embodiment of the present application also provides a test device for an ECU. It should be noted that the test device for the ECU of the embodiment of the present application can be used to execute the test method for the ECU provided in the embodiment of the present application. The device is used to implement the embodiments and preferred implementations, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0078] The following is an introduction to the ECU testing device provided in the embodiment of the present application.
[0079] Figure 6 Schematic diagram of a test device for an ECU according to an embodiment of the present application. Figure 6 As shown, the device comprises:
[0080] An acquisition unit 10 is used to acquire a protocol type of a historical CAN message record, wherein the historical CAN message record is a CAN message record obtained by a historical test of the ECU to be tested;
[0081] Specifically, the historical CAN message record may be a CAN message of the ECU to be tested obtained in the last test of the current ECU. The protocol types include but are not limited to XCP protocol, CCP protocol and UDS protocol.
[0082] A parsing unit 20, configured to parse the historical CAN message record according to the protocol type to determine the historical test information of the ECU to be tested, wherein the historical test information includes a test parameter, a corresponding test type, and a test parameter value;
[0083] Specifically, different protocol types of CAN messages correspond to different parsing methods. The test parameter is the ECU item to be tested, the test type is the method of testing the item, such as flashing, calibration, reading, etc., and the test parameter value is the test value corresponding to the item.
[0084] The testing unit 30 is used to test the ECU to be tested according to the historical test information.
[0085] Through the embodiment, the protocol type of the historical CAN message record obtained by the historical test of the ECU to be tested is obtained by the acquisition unit; the historical CAN message record is parsed by the parsing unit according to the obtained protocol type to determine the historical test information including the test parameters, the corresponding test type and the test parameter value; the ECU to be tested is tested by the test unit according to the historical test information. Compared with the problem that CAN messages cannot be directly transferred between tests as test results, resulting in low test and test efficiency, the present application automatically parses the historical CAN message records to obtain historical test information, and uses it for the current test of the ECU, so that the CAN message can be directly transferred between tests as the test result, without the need to manually parse the CAN message to obtain the test information, and then manually input the test information into the test equipment to test the ECU, which frees up manpower and improves the test efficiency of the ECU.
[0086] In an optional solution, the parsing unit may specifically include:
[0087] A first reading module, configured to read the address instruction from the historical CAN message record if there is an address instruction corresponding to the protocol type in the historical CAN message record;
[0088] Specifically, the protocol type is one of the following: XCP protocol, CCP protocol and UDS protocol. According to the address instructions corresponding to the protocol type, whether these address instructions exist in the historical CAN message record is searched, and these address instructions are used to indicate address information. Taking the protocol type as XCP protocol as an example, these address instructions include 0XF6 (Set Memory Transfer Address) and 0XE1 (WRITE_DAQ) and the like.
[0089] A query module, used to query the variable type corresponding to the address instruction in the A2L file, and obtain the test type of the historical CAN message record, wherein the test type includes calibration and measurement;
[0090] Specifically, the variable type is used to indicate whether the variable is a calibrated variable or a measured variable. A calibrated variable means that the corresponding test type is calibration, and a measured variable means that the corresponding test type is measurement. Still taking the XCP protocol as an example, if the variable type is CHARACTERISTIC, it is a calibrated variable, and if it is MEASUREMENT, it is a measured variable.
[0091] The first determination module is used to determine at least the test parameter and the test parameter value corresponding to the test type from the historical CAN message record according to the protocol type and the test type, so as to obtain the historical test information.
[0092] In the described embodiment, according to the address instruction corresponding to the protocol type, the variable type is queried from the A2L file to obtain the test type of the historical test of the ECU to be tested, and then according to the protocol type and the test type, at least the test parameters and the test parameter values are obtained from the historical CAN message records, further realizing the automatic parsing and reading of the test information in the CAN message, and further achieving the effect of directly transmitting the CAN message as the test result between tests.
[0093] In order to further solve the technical problem that CAN messages cannot be directly transmitted between tests as test results, resulting in low test and test efficiency, and further improve the test efficiency of ECU, according to another embodiment of the present application, the protocol type is one of the following: XCP protocol, CCP protocol and UDS protocol. The first determination module includes:
[0094] A first extraction submodule, configured to extract the test parameter and the test parameter value from the historical CAN message record when the protocol type is the UDS protocol and the test type is the measurement;
[0095] A second extraction submodule is used for determining, when the protocol type is the XCP protocol or the CCP protocol and the test type is the measurement, the test parameter, the test parameter value, and the auxiliary measurement information corresponding to the test parameter according to the measurement instruction extracted from the historical CAN message record and the measurement instruction library corresponding to the protocol type, wherein the auxiliary measurement information includes at least one of the following: a measurement mode, a measurement frequency, and a measurement configuration parameter, and the measurement mode includes a Polling mode and a DAQ mode;
[0096] Specifically, by analyzing the 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 protocol or the CCP protocol, it is determined that the measurement method is the Polling method; if it matches the DAQ measurement instruction library corresponding to the XCP protocol or the CCP protocol, it is determined that the measurement method is the DAQ method. In the case where the measurement method is the Polling method, the historical test information includes the test parameters, the test parameter values, and the measurement method. In the case where the measurement method is the DAQ method, it is also necessary to obtain the measurement frequency, such as DAQ-500ms, DAQ-100ms, DAQ-10ms, etc., as well as the measurement configuration parameters including the number of the acquisition list, the number of the event channel, and the transmission rate pre-divider, etc., and 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 values and the calibration method according to 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 the calibration. The calibration method includes a reading method and a writing (also called calibration) method. The final test parameter value is the value of the last calibration of the test parameter.
[0098] Specifically, by analyzing the 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 method is used for calibration, and if it corresponds to the write instruction library, the write method is used for calibration. Since there may be multiple calibration operations extracted from the calibration instruction, the last calibration operation is used as the reference at this time to read the measurement parameter value corresponding to the operation.
[0099] In the embodiment, when the protocol type is the UDS protocol and the test type is the measurement, since the measurement quantity of the UDS protocol does not involve auxiliary measurement information such as the measurement method and the 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 the measurement, the 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, so that the extracted historical test information is relatively complete. When the test type is the calibration, the 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 may be grouped and saved according to variables.
[0101] In order to further ensure that the historical test information obtained is relatively complete and accurate, in some other embodiments of the present application, the device further includes: a query unit, which is used to query and obtain the description information corresponding to the address instruction from the A2L file after reading the address instruction from the historical CAN message record, and the historical test information also includes the description information. Since the historical CAN message record does not record all variable information, the present application finds the part of variable information that is not fully recorded through the A2L file, further ensuring the integrity of the historical test information, and facilitating the calibration, reading, monitoring, and flashing of the variables involved in the LOG file again based on the LOG file during this ECU test.
[0102] Specifically, the description 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 determination module, which is used to determine that the test type of the historical CAN message record is flashing when there is a flashing instruction corresponding to the protocol type in the historical CAN message record; a second reading module, which is used to read the flashing instruction from the historical CAN message record; and a third determination module, which is used to determine the test parameters and the test parameter values corresponding to the test type according to the flashing instruction and the flashing instruction library corresponding to the protocol type, and obtain the historical test information. In this embodiment, by searching for the flashing instruction corresponding to the protocol type in the historical CAN message record, it is determined that the test type of the historical CAN message record is flashing, and then the flashing parameter information is parsed to further realize the automatic reading of the flashing information in the historical CAN message record, which is convenient for subsequent application to the test of the ECU to be tested, thereby further improving the test efficiency of the ECU.
[0104] Furthermore, by parsing multiple messages before and after the message corresponding to the flash instruction in the historical CAN message record, if it matches the flash instruction library corresponding to the protocol type, a complete flash message can be obtained, and then the flash message is parsed to obtain the flash parameter information, and the addresses and data groups of each segment of the flash message are saved, and other information such as verification information is saved.
[0105] In some other embodiments of the present application, the test unit includes: a fourth determination module, which is used to determine that the test type corresponding to the current test parameter of the ECU under test is the target test type according to the protocol type and the historical test information, and to determine that the test parameter value corresponding to the current test parameter of the ECU under test is the target parameter value; a test module, which is used 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 the display device. In this embodiment, according to the historical test information parsed from the historical CAN message record, the current test parameter of the ECU under test is tested for the corresponding test type and test parameter value, further realizing that the CAN message is directly used as a transmission tool for the test result, and further improving the efficiency of the experiment and test.
[0106] Specifically, for variables whose current measured parameters are read by Polling, they are still read by polling in this test, and the values of variables in this group in the ECU are monitored and displayed; for variables whose current measured parameters are read by DAQ, they are grouped and configured according to different configurations such as DAQ_LIST_NUMBER and Event channel number in this test, and the values of variables in this group in the ECU are monitored and displayed; for variables whose current measured parameters are calibration variables that need to be read, they are read from the ECU and displayed according to the variable information obtained from A2L; for variables whose current measured parameters are calibration variables that need to be written, the corresponding internal values of the variables are calibrated to the ECU and displayed; and for variables whose current measured parameters are write parameters, the address information and corresponding data information of each segment obtained from A2L are written to the ECU according to the write process, and the data verification is completed according to the saved verification information.
[0107] In some other optional embodiments, the message protocol includes the XCP protocol, the CCP protocol and the UDS protocol, and the acquisition unit includes: an acquisition module, which is used to acquire the first byte and the second byte in the historical CAN message record to obtain the instruction byte, wherein for the XCP protocol and the CCP protocol, the first byte is the instruction byte, and for the UDS protocol, the second byte is the instruction byte; a search module, which is used to search the message protocol corresponding to the byte identical to the first byte or the second byte in the message instruction library according to the instruction byte to obtain the protocol type, and the message instruction library includes multiple bytes and the message protocols corresponding to each byte. In this embodiment, by acquiring the first byte or the second byte representing the instruction in the historical CAN message record, and finding the message protocol corresponding to the byte from the message instruction library, the protocol type of the historical CAN message record can be determined relatively simply, quickly and accurately.
[0108] The ECU test device includes a processor and a memory, wherein the acquisition unit, the parsing unit, and the test unit are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0109] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be provided, and the problem of low ECU test efficiency in the prior art can be at least solved by adjusting kernel parameters.
[0110] The memory may include non-permanent memory in a computer-readable medium, 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] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, a device where the computer-readable storage medium is located is controlled to execute a test method for the ECU.
[0112] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the test method of the ECU when it is running.
[0113] An embodiment of the present invention provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0114] Step S201, obtaining the protocol type of a historical CAN message record, wherein the historical CAN message record is a CAN message record obtained by a historical test ECU;
[0115] Specifically, the historical CAN message record may be a CAN message of the ECU to be tested obtained in the last test of the current ECU. The protocol types include but are not limited to XCP protocol, CCP protocol and UDS protocol.
[0116] Step S202, parsing the historical CAN message records according to the protocol type to determine the historical test information of the ECU to be tested, wherein 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 parameter is the ECU item to be tested, the test type is the method of testing the item, such as flashing, calibration, reading, etc., and the test parameter value is the test value corresponding to the item.
[0118] Step S203: testing the ECU to be tested according to the historical test information.
[0119] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0120] Optionally, according to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: when there is an address instruction corresponding to the protocol type in the historical CAN message record, the address instruction is read from the historical CAN message record; querying 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 including calibration and measurement; according to the protocol type and the test type, at least the test parameters and the test parameter values corresponding to the test type are determined from the historical CAN message record to obtain the historical test information.
[0121] Optionally, the protocol type is one of the following: XCP protocol, CCP protocol and UDS protocol, and 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 record 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 parameter and the test parameter value from the historical CAN message record; when the protocol type is the XCP protocol or the CCP protocol and the test type is the measurement, according to the measurement instructions 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, wherein the auxiliary measurement information includes at least one of the following: measurement mode, measurement frequency, and measurement configuration parameters, and the measurement mode includes a Polling mode and a DAQ mode; when the test type is the calibration, the test parameters, the final test parameter values, and the calibration mode are determined according to the calibration instructions extracted from the historical CAN message records and the calibration instruction library corresponding to the protocol type, wherein the calibration mode includes a reading mode and a writing mode, and the final test parameter value is the value of the last calibration of the test parameter.
[0122] Optionally, after reading the address instruction from the historical CAN message record, the method further includes: querying from an A2L file to obtain description information corresponding to the address instruction, and the historical test information also includes the description information.
[0123] Optionally, according to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: when there is a flash instruction corresponding to the protocol type in the historical CAN message record, determining that the test type of the historical CAN message record is flash; reading the flash instruction from the historical CAN message record; determining the test parameters and the test parameter values corresponding to the test type according to the flash instruction and the flash instruction library corresponding to the protocol type, to obtain the historical test information.
[0124] Optionally, the ECU to be tested is tested according to the historical test information, including: determining, according to the protocol type and the historical test information, that the test type corresponding to the current parameter to be tested of the ECU to be tested is a target test type, and determining that the test parameter value corresponding to the current parameter to be tested of the ECU to be tested is a target parameter value; testing the current parameter to be tested according to the target test type and the target parameter value to obtain a test result, and displaying the test result on a display device.
[0125] Optionally, obtaining the protocol type of a historical CAN message record includes: obtaining the first byte and the second byte in the historical CAN message record to obtain an instruction byte; based on the instruction byte, searching a message instruction library for a message protocol corresponding to a byte that is the same as the first byte or the second byte to obtain the protocol type, wherein the message instruction library includes multiple bytes and the message protocols corresponding to each of the bytes, and the message protocols include an XCP protocol, a CCP protocol, and a UDS protocol.
[0126] The present 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, obtaining the protocol type of a historical CAN message record, wherein the historical CAN message record is a CAN message record obtained by a historical test ECU;
[0128] Specifically, the historical CAN message record may be a CAN message of the ECU to be tested obtained in the last test of the current ECU. The protocol types include but are not limited to XCP protocol, CCP protocol and UDS protocol.
[0129] Step S202, parsing the historical CAN message records according to the protocol type to determine the historical test information of the ECU to be tested, wherein 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 parameter is the ECU item to be tested, the test type is the method of testing the item, such as flashing, calibration, reading, etc., and the test parameter value is the test value corresponding to the item.
[0131] Step S203: testing the ECU to be tested according to the historical test information.
[0132] Optionally, according to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: when there is an address instruction corresponding to the protocol type in the historical CAN message record, the address instruction is read from the historical CAN message record; querying 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 including calibration and measurement; according to the protocol type and the test type, at least the test parameters and the test parameter values corresponding to the test type are determined from the historical CAN message record to obtain the historical test information.
[0133] Optionally, the protocol type is one of the following: XCP protocol, CCP protocol and UDS protocol, and 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 record 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 parameter and the test parameter value from the historical CAN message record; when the protocol type is the XCP protocol or the CCP protocol and the test type is the measurement, according to the measurement instructions 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, wherein the auxiliary measurement information includes at least one of the following: measurement mode, measurement frequency, and measurement configuration parameters, and the measurement mode includes a Polling mode and a DAQ mode; when the test type is the calibration, the test parameters, the final test parameter values, and the calibration mode are determined according to the calibration instructions extracted from the historical CAN message records and the calibration instruction library corresponding to the protocol type, wherein the calibration mode includes a reading mode and a writing mode, and the final test parameter value is the value of the last calibration of the test parameter.
[0134] Optionally, after reading the address instruction from the historical CAN message record, the method further includes: querying from an A2L file to obtain description information corresponding to the address instruction, and the historical test information also includes the description information.
[0135] Optionally, according to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: when there is a flash instruction corresponding to the protocol type in the historical CAN message record, determining that the test type of the historical CAN message record is flash; reading the flash instruction from the historical CAN message record; determining the test parameters and the test parameter values corresponding to the test type according to the flash instruction and the flash instruction library corresponding to the protocol type, to obtain the historical test information.
[0136] Optionally, the ECU to be tested is tested according to the historical test information, including: determining, according to the protocol type and the historical test information, that the test type corresponding to the current parameter to be tested of the ECU to be tested is a target test type, and determining that the test parameter value corresponding to the current parameter to be tested of the ECU to be tested is a target parameter value; testing the current parameter to be tested according to the target test type and the target parameter value to obtain a test result, and displaying the test result on a display device.
[0137] Optionally, obtaining the protocol type of a historical CAN message record includes: obtaining the first byte and the second byte in the historical CAN message record to obtain an instruction byte; based on the instruction byte, searching a message instruction library for a message protocol corresponding to a byte that is the same as the first byte or the second byte to obtain the protocol type, wherein the message instruction library includes multiple bytes and the message protocols corresponding to each of the bytes, and the message protocols include an XCP protocol, a CCP protocol, and a UDS protocol.
[0138] An embodiment of the present application also provides an ECU system, comprising: an ECU; 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 are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the methods described.
[0139] In the ECU system, the ECU test equipment automatically parses historical CAN message records to obtain historical test information, and uses it for the current test of the ECU, so that the CAN message can be directly transmitted between tests as a test result. There is no need to manually parse the CAN message to obtain the test information, and then manually input the test information into the test equipment to test the ECU, which frees up manpower and improves the test efficiency of the ECU.
[0140] Obviously, those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions 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] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0147] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0148] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0149] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A test method for ECU, It is characterized in that include: Obtaining the protocol type of a historical CAN message record, wherein the historical CAN message record is a CAN message record obtained by the ECU under test in a historical test; According to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, wherein the historical test information includes test parameters, corresponding test types and test parameter values; The ECU to be tested is tested according to the historical test information.
2. The method according to claim 1, It is characterized in that According to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: In a case where an address instruction corresponding to the protocol type exists in the historical CAN message record, reading the address instruction from the historical CAN message record; Query the variable type corresponding to the address instruction in the A2L file to obtain the test type of the historical CAN message record, where the test type includes 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.
3. The method according to claim 2, It is characterized in that The protocol type is one of the following: XCP protocol, CCP protocol and UDS protocol. 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 record 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 parameter and the test parameter value from the historical CAN message record; When the protocol type is the XCP protocol or the CCP protocol, and the test type is the measurement, the test parameter, the test parameter value, and auxiliary measurement information corresponding to the test parameter are determined according to the measurement instruction extracted from the historical CAN message record and the measurement instruction library corresponding to the protocol type, wherein the auxiliary measurement information includes at least one of the following: a measurement mode, a measurement frequency, and a measurement configuration parameter, and the measurement mode includes a Polling mode and a DAQ mode; When the test type is the calibration, the test parameters, the final test parameter values 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 reading method and a writing method. The final test parameter value is the value of the last calibration of the test parameter.
4. The method according to claim 2, It is 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 from the A2L file, and the historical test information also includes the description information.
5. The method according to claim 1, It is characterized in that According to the protocol type, the historical CAN message record is parsed to determine the historical test information of the ECU to be tested, including: In the case where a flashing instruction corresponding to the protocol type exists in the historical CAN message record, determining that the test type of the historical CAN message record is flashing; Reading the flashing instruction from the historical CAN message record; The test parameters and the test parameter values corresponding to the test type are determined according to the flash instruction and the flash instruction library corresponding to the protocol type, and the historical test information is obtained.
6. The method according to any one of claims 1 to 5, It is characterized in that Testing the ECU to be tested according to the historical test information includes: According to the protocol type and the historical test information, determining that the test type corresponding to the current test parameter of the ECU to be tested is a target test type, and determining that the test parameter value corresponding to the current test parameter of the ECU to be tested is a target parameter value; According to the target test type and the target parameter value, the current parameter to be tested is tested to obtain a test result, and the test result is displayed on a display device.
7. The method according to any one of claims 1 to 5, It is characterized in that Get the protocol type of historical CAN message records, including: Obtain the first byte and the second byte in the historical CAN message record to obtain the instruction byte; According to the instruction byte, the message protocol corresponding to the byte that is the same 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 protocols corresponding to each of the bytes, and the message protocols include XCP protocol, CCP protocol and UDS protocol.
8. A test device for ECU, It is characterized in that include: An acquisition unit, used for acquiring a protocol type of a historical CAN message record, wherein the historical CAN message record is a CAN message record obtained by a historical test ECU; A parsing unit, used to parse the historical CAN message record according to the protocol type to determine the historical test information of the ECU to be tested, wherein the historical test information includes a test parameter, a corresponding test type, and a test parameter value; The testing unit is used to test the ECU to be tested according to the historical test information.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
10. An ECU system, It is characterized in that include: ECU; The ECU test device comprises: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of claims 1 to 7.
Citation Information
Patent Citations
Data reading system for software debugging of electronic control unit loaded vehicle
CN108965052A
Automatic sequence testing system and method for whole vehicle CAN communication
CN111510355A
Network communication test method, device and equipment and readable storage medium
CN115914028A
Automatic performance testing method and device
CN116244202A
Vehicle-mounted communication DTC automatic test method and test system
CN117176561A
