ECU test method and device, first frame message test system and storage medium
Through automated ECU testing methods and systems, the problem of ECU power-on first-frame message outgoing time testing in the prior art is solved, and high accuracy and reliability testing is achieved.
Patent Information
- Application Number
- CN202411513719.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-28
AI Technical Summary
The existing ECU power-on first-frame message outgoing time test method relies on professional equipment, and there are problems such as high resolution error, many test instruments required, and complex operation.
It provides an ECU testing method and system, which simplifies the operation process by automatically performing tests, and uses the power-on timing function to obtain the outgoing time of the first-frame message of the ECU, thereby improving the accuracy and reliability of the test.
It realizes accurate measurement of the outgoing time of the first-frame packet on ECU power-on, improves the accuracy and reliability of the test, and simplifies the operation process.
Smart Images

Figure CN119536208A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automobile electronics, and in particular relates to an ECU testing method, device and first frame message testing system. Background Art
[0002] After the car is powered on, the electronic control unit (ECU) of the car sends the first frame message to each controller connected to it. If the controllers have not completed initialization, they will not be able to receive the first frame message, which will result in serious consequences such as errors. Therefore, measuring the time when the ECU sends the first frame message after power-on can provide a data basis for the operation and debugging of the entire vehicle.
[0003] In the prior art, automotive electronics laboratories generally test the time it takes to send the first frame message when the ECU is powered on by collecting data using an oscilloscope or a Rofin instrument and measuring the time it takes to send the first frame message when the ECU is powered on by moving the cursor.
[0004] The existing ECU power-on first frame message outgoing time test method relies on professional equipment and has problems such as high analysis error, large number of test instruments required, and complex operation. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides an ECU testing method, device and first frame message testing system, which can automatically perform tests, simplify the operation process, and have high test accuracy and reliability.
[0006] The present invention provides a test method for an ECU, and the method comprises the following steps: controlling the ECU to power on, synchronously starting a power-on timing function, and confirming whether a first frame message sent by the ECU is received; when confirming that the first frame message is received, obtaining the current timing time; judging whether the number of tests reaches a preset number of tests; if the preset number of tests is not reached, entering the following steps: controlling the ECU to power off, and after turning off the power-on timing function, returning to controlling the ECU to power on, synchronously starting the power-on timing function, and confirming whether a first frame message sent by the ECU is received; when confirming that the first frame message is received, obtaining the current timing time; judging whether the number of tests reaches a preset number of tests; if the preset number of tests is not reached, entering the step of controlling the ECU to power off, and after turning off the power-on timing function, returning to controlling the ECU to power on, synchronously starting the power-on timing function, and detecting whether a first frame message sent by the ECU is received; if the preset number of tests is reached, entering the step of outputting the outgoing time of the first frame message of the ECU based on the timing time obtained for each test.
[0007] In one embodiment, the test method comprises: in the above-mentioned ECU power-on step, outputting a high-level signal to the ECU to control the ECU to power on.
[0008] In one embodiment, the power-on timing function is synchronously enabled, and it is confirmed whether the first frame message sent by the ECU is received, including: synchronously starting a first timer and a counter to start the power-on timing function; timing the first timer at a preset time; judging whether the first timer is determined to have passed the preset time; when the first timer is determined not to have passed the preset time, confirming whether the first frame message sent by the ECU is received; if it is confirmed that the first frame message sent by the ECU is not received, returning to judging whether the first timer is determined to have passed the preset time; when the first timer is determined to have passed the preset time, controlling the counter to accumulate, and returning to the step of timing the first timer at the preset time.
[0009] In one embodiment, when the ECU performs a power-off operation, the power-on timing function is turned off, and when the control ECU is powered on, the power-on timing function is synchronously started, and the step of detecting whether the first frame message sent by the ECU is received includes: controlling the ECU to power off and synchronously starting the power-off timing function, and turning off the power-on timing function; when it is confirmed that the power-off time of the ECU reaches the power-off reset time, the power-off timing function is turned off, and when the control ECU is powered on, the power-on timing function is synchronously started, and the step of detecting whether the first frame message sent by the ECU is received.
[0010] In one embodiment, the steps of controlling the ECU to power off and synchronously starting the power-off timing function, and turning off the power-on timing function include: outputting a low-level signal to the ECU to control the ECU to power off, and synchronously starting the second timer to turn on the power-off timing function; turning off the first timer and the counter to turn off the power-on timing function.
[0011] The present invention provides a testing device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement any one of the above methods.
[0012] The present invention provides a test system, comprising a voltage-stabilized power supply, a test device, and a pull-up resistor; wherein the test device is connected to an ECU ignition signal pin end and an ECU ground pin, the pull-up resistor is located between the positive electrode of the voltage-stabilized power supply and the ECU ignition signal pin end of the ECU, and the negative electrode of the voltage-stabilized power supply is connected to the ECU ground pin.
[0013] In one embodiment, the test device includes a test computer host and a CANOE; the DOUT+ end of the CANOE is connected to the ECU ignition signal pin end, and the DOUT- end of the CANOE is connected to the ground pin of the ECU; the test computer host is connected to the CANOE, and is used to control the DOUT+ end of the CANOE to output a high-level signal to the ECU to control the ECU to power on, and is also used to control the DOUT+ end of the CANOE to output a low-level signal to the ECU to control the ECU to power off.
[0014] In one implementation, the CANOE is further used to display the time when the first frame message is sent out based on the output of the ECU, wherein the time when the first frame message is sent out is the average value of the timing time obtained in each test.
[0015] The present invention provides a computer-readable storage medium, in which a test host computer executable script is stored, which can be used to support the test host computer to execute any one of the above-mentioned ECU test methods.
[0016] The ECU testing method, device and first frame message testing system provided in the present application can realize automated testing according to the power-on timing function, simplify the operation process, and can output the ECU's power-on first frame message outgoing time based on the timing time obtained in each test, thereby improving the accuracy and reliability of the test.
[0017] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation method is described below, and the detailed explanation is as follows in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The figure is a flow chart of a method for testing an ECU according to an example of the present invention.
[0019] Figure 2 The figure is a schematic diagram of the structure of a first frame message test system according to an example of the present invention.
[0020] Figure 3 The figure is a schematic diagram of a specific implementation test flow of a first frame message test system according to an example of the present invention.
[0021] Among them, 10-tested ECU, 20-voltage-stabilized power supply, 21-pull-up resistor, N-tested ECU and CANOE parallel node, 22-testing computer host, 23-CANOE. DETAILED DESCRIPTION
[0022] To facilitate understanding of the present application, the present application will be described more comprehensively with reference to the relevant drawings. The drawings provide specific implementation methods of the present application. In combination with the following drawings and examples, the present application is described in detail as follows.
[0023] Figure 1 The flowchart of the ECU testing method of an example of the present invention includes the following steps: S10: Control ECU to power on, start the power-on timing function synchronously, and confirm whether the first frame message sent by ECU is received; S11: When confirming receipt of the first frame message, record the current timing time; S12: Determine whether the number of tests reaches the preset number of tests; If the preset number of tests is not reached, the process proceeds to step S13: controlling the ECU to power off and turning off the power-on timing function, and then returns to step S10: when the ECU is powered on, the power-on timing function is synchronously started, and a step of detecting whether the first frame message sent by the ECU is received; If the preset number of tests is reached, the process proceeds to step S14: outputting the time when the ECU's first frame message is sent out after power-on according to the timing time obtained during each test.
[0024] In one embodiment, step S10 may include: controlling the ECU to power on, synchronously starting the first timer and the counter to synchronously start the power-on timing function; timing the first timer at a preset time; judging whether the first timer is determined to have passed the preset time; when the first timer is determined not to have passed the preset time, confirming whether the first frame message sent by the ECU is received; if it is confirmed that the first frame message sent by the ECU is not received, returning to judging whether the first timer is determined to have passed the preset time; when the first timer is determined to have passed the preset time, controlling the counter to accumulate, and returning to the step of timing the first timer at the preset time.
[0025] The preset time may be a time preset by a user or a system. Specifically, the first timer is timed in 1ms, and the counter records the number of times the first timer is timed. After each 1ms of the first timer is timed, the counter counts one, and the first timer resets the time when the first frame message from the ECU is not received. If the first frame message is received, the preset time of the first timer 1ms can be multiplied by the current count of the counter to obtain the current timing time of the current measurement.
[0026] Specifically, in one embodiment, the preset number of tests may be a value preset by a user or a system. For example, the preset number of tests may be 5 times.
[0027] In order to further improve the accuracy of the test, before starting a new round of tests, it is necessary to control the ECU to power off, and confirm that the ECU power-off time reaches the power-off reset time before starting a new round of tests. In one embodiment, step S13: control the ECU to power off, and after turning off the power-on timing function, return to control the ECU to power on, synchronously start the power-on timing function, and detect whether the first frame message sent by the ECU is received, including: control the ECU to power off and synchronously start the power-off timing function, and turn off the power-on timing function; when confirming that the ECU power-off time reaches the power-off reset time, turn off the power-off timing function, return to control the ECU to power on, synchronously start the power-on timing function, and detect whether the first frame message sent by the ECU is received. Among them, the power-off reset time can be preset by the system or the user.
[0028] Specifically, the power-off timing function can be enabled by the second timer, so that the power-on timing function and the power-off timing function use different timers, thereby avoiding timing errors and further ensuring the accuracy of the test. In one embodiment, the steps of controlling the ECU to power off and synchronously enabling the power-off timing function, and disabling the power-on timing function include: outputting a low-level signal to the ECU to control the ECU to power off, and synchronously enabling the second timer to enable the power-off timing function; and disabling the first timer and the counter to disable the power-on timing function.
[0029] Specifically, when performing multiple rounds of tests, the test room can use the test computer host to power off and reset the ECU to control the ECU to power off, and simultaneously start the second timer to start the power-off timing function, and turn off the first timer and counter to turn off the power-on timing function. The test computer host starts the second timer to time the preset power-off reset time to ensure the ECU power-off reset time; the test computer turns off the first timer and counter to reset the power-on timing function.
[0030] The ECU test method provided in the embodiment of the present application can realize automated testing according to the power-on timing function, simplify the operation process, and can output the time when the ECU's first frame message is sent out based on the timing time obtained in each test, which can improve the accuracy and reliability of the test. In addition, in one embodiment, before starting a new round of testing, it is confirmed that the ECU power-off time reaches the power-off reset time, and then a new round of testing is started, which can further improve the accuracy of the test.
[0031] The present application also provides a testing device, wherein the testing device includes a memory and a processor, the memory stores a computer program, and the processor is used to execute the computer program to implement a specific test case.
[0032] Figure 2 FIG. 1 is a schematic diagram of the structure of a test system according to an embodiment of the present invention. Figure 2 As shown, the test system includes a voltage stabilizer 20, a pull-up resistor 21, and a test device. The test device is connected to the ignition signal pin end of the ECU 10 and the ground pin of the ECU 10, the pull-up resistor 21 is located between the positive electrode of the voltage stabilizer 20 and the ECU ignition signal pin end of the ECU 10, and the negative electrode of the voltage stabilizer 21 is connected to the ground pin of the ECU 10.
[0033] In one embodiment, the testing device includes a testing computer host 22 and a CANOE 23 .
[0034] Among them, the voltage-stabilized power supply 20, the pull-up resistor 21 and the ECU 10 under test are connected in series, the test computer host 22 is connected to CANOE 23, and CANOE 23 is connected in parallel with the ECU 10 under test, wherein the DOUT+ end of CANOE 23 is connected to the ignition signal pin end (also known as the KL15 pin) of the ECU 10 under test, and the connection point is the node N, and the DOUT- of CANOE 23 is connected to the ground wire.
[0035] In one embodiment, the DOUT+ terminal of CANOE 23 is connected to the ignition signal pin terminal of the ECU 10 under test, and the DOUT- terminal of CANOE 23 is connected to the ground pin of the ECU 10 under test; CANOE 23 outputs a level signal according to the command of the test computer host, for example, the DOUT+ terminal of CANOE 23 outputs a high level signal to the ECU 10 under test to control the ECU 10 under test to power on, and the DOUT+ terminal of CANOE 23 outputs a low level signal to the ECU 10 under test to control the ECU 10 under test to power off.
[0036] In one embodiment, the CANOE 23 is also used to display the time when the first frame message is sent out based on the output of the ECU 10 under test. Specifically, in one embodiment, the time when the first frame message is sent out is the average value of the timing time obtained in each test. In other embodiments, the time when the first frame message is sent out is the median value of the timing time obtained in each test.
[0037] In one embodiment, a computer-readable storage medium stores a test host computer executable script, and the test host computer can execute the test method according to the executable script in the storage medium.
[0038] In one embodiment, the test computer host 22 outputs a control signal for controlling the power-on of the ECU 10 under test to CANOE, and CANOE outputs a high-level signal to ECU10 to control the power-on of the ECU 10 under test. Specifically, the test computer host 22 writes a CAPL automation script through software to control CANOE 23. When the system starts, the voltage-stabilized power supply 20 provides a 12V voltage, the pull-up resistor 21 is 10K ohms, and the DOUT+ end of CANOE 23 is initially low. The pull-up resistor 21 divides the current loop to cause the node N to be at a low potential. At this time, the ignition signal pin end of the ECU 10 under test detects that the ignition signal is at a low potential, thereby simulating the power-off condition of the ECU 10 under test; the test computer host controls the DOUT+ end of CANOE23 to output a high level through a script to increase the voltage of the node N. At this time, the KL15 ignition signal pin end of the ECU 10 under test detects that the ignition signal is in a startup state, thereby simulating the ECU under test. through the pull-up resistor 21 and CANOE 23 linkage, to achieve the test computer host 22 using CAPL automation script on the ECU 10 under test power control.
[0039] Figure 3 FIG. 1 is a schematic diagram of a specific test flow of a test system according to an embodiment of the present invention. Figure 3 As shown, in one implementation, the specific implementation process of the test system is as follows: Step S301: system initialization; In one embodiment, the system initialization includes setting a power-off reset time and clearing the count of the counter. Step S302: the test computer host starts the test program in response to the start operation received through the computer key; Step S303: Control ECU to power on; In one embodiment, the test host computer controls the high level of the KL15 pin of the ECU through CANOE to power on the ECU; Step S304: start the first timer and set the timer to 1ms; Step S305: Determine whether the timing time of the first timer is greater than 1ms; If the timing time of the first timer is greater than 1 ms, the process proceeds to step S306 : after the counter counts by one, the process returns to step S304 .
[0040] If the timing time of the first timer is not greater than 1ms, proceed to step S307: determine whether the first frame message is received; if the first frame message is not received, return to step S305: determine whether the timing time of the first timer is greater than 1ms; If the first frame message is received, then go to step S308: determine whether the test count is greater than 4; If the test number count is not greater than 4, proceed to step S309: close the first timer, the timing array counts the timing of the corresponding test round in the corresponding timing item, the test number + 1, the counter count is cleared, the ECU under test is powered off, the second timer is started, and proceed to step S310; wherein, step S309 is used to reset the counter and the first timer, and count the data of the current test round, and at the same time, the ECU under test is powered off and reset to prepare for the next round of testing; in addition, since the power-off reset of the ECU under test takes time, the second timer can be started to determine whether the power-off reset time has been reached; Step S310: Determine whether the second timer has exceeded the power-off reset time; If the second timer is longer than the set power-off reset time, the process goes to step S311: turning off the second timer; if the second timer is not longer than the preset time, the process returns to step S310 to perform a loop judgment; If the time is greater than the power-off reset time, it means that the ECU under test has been powered off and reset, and a subsequent power-on test can be performed, and the process returns to step S303; If the test count is greater than 4, go to step S312: reset the timer count, and output the power-on first frame message outgoing time to the Write screen according to the members of the timing array, that is, the average value of the timing time obtained in each test.
[0041] Through the above embodiments, the present invention realizes the automatic test of the first frame message outgoing time of the ECU through the CAPL script.
[0042] The ECU testing method, device and first frame message testing system provided in the present application can realize automated testing according to the power-on timing function, simplify the operation process, and can output the ECU's power-on first frame message outgoing time based on the timing time obtained in each test, thereby improving the accuracy and reliability of the test.
[0043] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A method for testing an ECU, characterized in that: The method comprises the following steps: Controlling the ECU to power on, synchronously starting the power-on timing function, and confirming whether the first frame message sent by the ECU is received; When confirming receipt of the first frame message, obtaining the current timing time; Determine whether the number of tests reaches the preset number of tests; If the preset number of tests is not reached, the ECU is controlled to be powered off, and after the power-on timing function is turned off, the control ECU is returned to be powered on, the power-on timing function is synchronously started, and the step of detecting whether the first frame message sent by the ECU is received; If the preset number of tests is reached, the time when the first frame message is sent out when the ECU is powered on is output based on the timing time obtained during each test.
2. The method according to claim 1, characterized in that: Controlling the ECU to power on includes: outputting a high level signal to the ECU to control the ECU to power on.
3. The method according to claim 1, characterized in that: Synchronously start the power-on timing function and confirm whether the first frame message sent by the ECU is received, including: When the ECU is powered on, the first timer and the counter are started synchronously to start the power-on timing function; Setting the first timer to a preset time; Determining whether the first timer has determined that the preset time has passed; When the first timer determines that the preset time has not passed, confirming whether the first frame message sent by the ECU is received; If it is confirmed that the first frame message sent by the ECU has not been received, returning to determine whether the first timer has determined that the preset time has passed; When the first timer determines that the preset time has passed, the counter is controlled to accumulate, and the timing step of setting the first timer to the preset time is returned.
4. The method according to claim 1 or 3, characterized in that: After controlling the ECU to power off and turning off the power-on timing function, returning to control the ECU to power on, synchronously starting the power-on timing function, and detecting whether the first frame message sent by the ECU is received, the steps include: Controlling the ECU to power off and simultaneously turning on the power-off timing function, and turning off the power-on timing function; When it is confirmed that the power-off time of the ECU reaches the power-off reset time, after turning off the power-off timing function, the control returns to the step of powering on the ECU, synchronously starting the power-on timing function, and detecting whether the first frame message sent by the ECU is received.
5. The method according to claim 4, characterized in that: The steps of controlling the ECU to power off and simultaneously turning on the power-off timing function, and turning off the power-on timing function include: Outputting a low level signal to the ECU to control the ECU to power off, and synchronously starting a second timer to start a power-off timing function; The first timer and the counter are turned off to turn off the power-on timing function.
6. A testing device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the method according to any one of claims 1 to 5.
7. A first frame message test system, characterized in that: It includes a voltage-stabilized power supply, a testing device as claimed in claim 7, and a pull-up resistor; Among them, the test device is connected to the ECU ignition signal pin end and the ECU ground pin, the pull-up resistor is located between the positive pole of the regulated power supply and the ECU ignition signal pin end of the ECU, and the negative pole of the regulated voltage is connected to the ground pin of the ECU.
8. The system as claimed in claim 7, wherein the test device comprises a test computer host and CANOE; The DOUT+ end of the CANOE is connected to the ignition signal pin end of the ECU, and the DOUT- end of the CANOE is connected to the ground pin of the ECU; The test computer host is connected to the CANOE, and is used to control the DOUT+ end of the CANOE to output a high-level signal to the ECU to control the ECU to power on, and is also used to control the DOUT+ end of the CANOE to output a low-level signal to the ECU to control the ECU to power off.
9. The system according to claim 8, characterized in that The CANOE is also used to display the time when the first frame message is sent out based on the output of the ECU, wherein the time when the first frame message is sent out is the average value of the timing time obtained in each test.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an executable script for a test computer host, and the test computer host can execute the test method according to any one of claims 1 to 5 according to the executable script in the storage medium.
Citation Information
Cited By
Frame rate test method and device in three-dimensional rendering scene, medium and product
CN121070752A