CAN communication signal transmitting and receiving function test method, device and equipment of ECU (Electronic Control Unit) and medium
By analyzing the CAN communication protocol and application layer code, establishing the mapping relationship between signals and code variables, and using test system debugging tools and CAN bus analysis tools for automated testing, the problem of time-consuming and labor-consuming CAN communication signal testing in the existing technology is solved, and efficient and accurate signal transmission and reception function testing is achieved.
Patent Information
- Application Number
- CN202510342532.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-10
AI Technical Summary
When testing the transmission and reception functions of CAN communication signals, the prior art requires manual analysis of protocol and code variables and corresponding relationship tables with the signal, which results in huge testing time and energy consumption, and the inability to dynamically change the signal value for testing.
By analyzing the CAN communication protocol and application layer code of the ECU to be tested, the mapping relationship between the signal and the code variable is established, and the test system debugging tool and the CAN bus analysis tool are used to test the signal transmission and reception functions respectively, and verify the correctness of CAN communication when the signal value changes.
It realizes automated testing under the change of signal value, covering all aspects of signal transmission, transmission and reception, improving testing efficiency and reliability, and reducing labor costs and error probability.
Smart Images

Figure CN120128516A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of new energy vehicle control, and specifically to a method, device, equipment and medium for testing the CAN communication signal transceiver function of an electronic control unit (ECU). Background Art
[0002] In new energy vehicles, compared with conventional vehicles, the number of controller components (i.e., electronic control units ECU) is much larger. To ensure the normal operation of the vehicle, it is necessary to first ensure the normal communication between each controller component. Currently, to ensure the communication rate of the vehicle, CAN (Controller Area Network) communication is mostly used.
[0003] Due to vehicle electromagnetic environment failures and the ever-changing vehicle operating environment, there are many cases of CAN communication failures. To avoid situations such as vehicle performance limitation or power interruption caused by communication failures, it is necessary to test the CAN communication function, and the most important thing is to test whether the signals received and sent are correct.
[0004] In current CAN diagnosis, to confirm whether the signal transceiver content is correct, manual verification is mostly adopted. Since the signals and messages involved in sending and receiving are increasing day by day, manually analyze the protocol; use CAN communication software to collect the sent messages, analyze the signal values in combination with the protocol; use CAN communication software to send messages, set the received signal values according to DBC (DataBaseCase); after receiving the messages, use the test system debugging tool to verify whether the received signals are correct; whether the received signals are correctly transmitted to the application layer. The above steps require repeatedly checking the protocol and the correspondence table between code variables and signals, resulting in a large amount of time and effort consumption, and it is impossible to perform dynamic change tests on the signal values. Summary of the Invention
[0005] The present invention provides a method, device, equipment and medium for testing the CAN communication signal transceiver function of an electronic control unit (ECU), which realizes testing the CAN communication signal transceiver function under the condition of signal value change.
[0006] The technical solution of the present invention is as follows: On the one hand, the present application provides a method for testing the CAN communication signal transceiver function of an electronic control unit (ECU), including: Analyze the CAN communication protocol of the ECU to be tested and distinguish signal types; Analyze the application layer code of the ECU to be tested, establish a mapping relationship between signals and application layer code variables, and establish a correspondence relationship between the COM layer receiving function and the received message ID; For the signal sending function, modify the variable value of the application layer code of the ECU under test through the test system debugging tool, and verify whether the ECU under test correctly sends the sending signal; For the signal receiving function, first set breakpoints at the COM layer receiving function of the ECU under test through the test system debugging tool to verify whether the COM layer of the ECU under test correctly receives the receiving signal; then modify the received signal value in the CAN message through the CAN bus analysis tool to further verify whether the application layer of the ECU under test correctly receives the receiving signal, and complete the test.
[0007] Preferably, the steps of parsing the communication protocol of the ECU under test and distinguishing signal types include: Judge the signal type according to the sender field in the communication protocol of the ECU under test; If the sender contains the first predetermined ECU, mark the signal as a sending signal; If the sender does not contain the second predetermined ECU, mark the signal as a receiving signal.
[0008] Preferably, the steps of parsing the application layer code of the ECU under test, establishing the mapping relationship between the signal and the application layer code variable, and establishing the correspondence between the COM layer receiving function and the received message ID include: By parsing the interface cleaning table and code project file of the ECU under test, count the correspondence between the sending signal and the receiving signal and the application layer code variable respectively, and establish the correspondence between the COM layer receiving function and the received message ID.
[0009] Preferably, for the signal sending function, the steps of modifying the code variable value through the test system debugging tool and verifying whether the ECU under test correctly sends the sending signal include: According to the signal bit width of the sending signal, use the test system debugging tool to modify the value of the application layer code variable corresponding to the sending signal, including the minimum value, the maximum value and the intermediate value; Trigger the ECU under test to send a CAN message containing the sending signal to the CAN bus according to the modified application layer code variable; Use the CAN bus analysis tool to receive the CAN message on the CAN bus, and extract the corresponding signal value in the CAN message according to the message ID, start bit and bit width where the sending signal is located; Compare the set application layer code variable value with the received sending signal value; If the set application layer code variable value is consistent with the received sending signal value, it is determined that the ECU under test correctly sends the sending signal.
[0010] Preferably, for the signal receiving function, the steps of verifying whether the COM layer of the ECU under test correctly receives the received signal by setting breakpoints at the COM layer receiving function in the ECU under test through the test system debugging tool include: Use the test system debugging tool to set breakpoints at the COM layer receiving function in the ECU under test; Use the CAN bus analysis tool to send a CAN message containing the received signal to the CAN bus; Observe whether the software program running in the ECU under test terminates normally at the breakpoint; If the software program in the ECU under test terminates normally at the breakpoint, it is determined that the COM layer in the ECU under test correctly receives the received signal.
[0011] Preferably, by modifying the received signal value in the CAN message through the CAN bus analysis tool, and further verifying whether the application layer of the ECU under test correctly receives the received signal, the steps to complete the test include: According to the signal bit width of the received signal, set the received signal value to the minimum value, the maximum value, and any intermediate value, and use the CAN bus analysis tool to send CAN messages containing different received signal values to the CAN bus; The ECU under test receives the CAN message through the CAN bus and transfers the received signal in the CAN message to the application layer; Read the value of the application layer code variable corresponding to the received signal in the application layer code of the ECU under test through the test system debugging tool; Compare the value of the application layer code variable with the set received signal value; If the value of the application layer code variable is consistent with the set received signal value, it is determined that the application layer in the ECU under test correctly receives the received signal.
[0012] Preferably, the first predetermined ECU is a VCU or an in-vehicle T-Box device, and the second predetermined ECU is a vehicle control unit VCU, an in-vehicle T-Box device, or a gateway GW.
[0013] On the other hand, the present application also provides a CAN communication signal transceiver function test device for an electronic control unit ECU, including: A first parsing module for parsing the CAN communication protocol of the ECU under test and distinguishing signal types; A second parsing module for parsing the application layer code of the ECU under test and establishing a mapping relationship between the signal and the application layer code variable in the application layer code; A transmission function verification module for, for the signal transmission function, modifying the value of the application layer code variable of the ECU under test through the test system debugging tool and verifying whether the ECU under test correctly sends the transmitted signal; The receiving function verification module is used for the signal receiving function. First, set breakpoints at the COM layer receiving function of the ECU under test through the test system debugging tool to verify whether the COM layer of the ECU under test correctly receives the received signal. Then, modify the received signal value in the CAN message through the CAN bus analysis tool to further verify whether the application layer of the ECU under test correctly receives the received signal, and complete the test.
[0014] On the other hand, the present application also provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the above-mentioned CAN communication signal transceiver function test method is implemented.
[0015] On the other hand, the present application also provides a computer-readable storage medium, characterized in that it stores a computer program, and when the computer program is executed by a processor, the above-mentioned CAN communication signal transceiver function test method of the electronic control unit ECU is implemented.
[0016] The beneficial effects of the present invention are as follows: By analyzing the communication protocol and the application layer code, a mapping relationship between signals and code variables is established; using the test system debugging tool and the CAN bus analysis tool, the signal sending and receiving functions are respectively tested, and the correctness of CAN communication is verified under the condition of signal value change. The automatic test of CAN communication signals under the condition of signal value change is realized, comprehensively covering all links of signal sending, transmission and receiving, and can efficiently and accurately verify the CAN communication function of the electronic control unit, significantly improving the test efficiency and reliability, while reducing the labor cost and error probability. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic flowchart of the CAN communication signal transceiver function test method of the electronic control unit ECU in the embodiment of the present application; Figure 2 It is a schematic flowchart of step S103 in the embodiment of the present application; Figure 3 It is a schematic flowchart of step S104 in the embodiment of the present application; Figure 4 It is a schematic flowchart of step S104 in the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] For the convenience of those skilled in the art, the present invention patent will be further described below with reference to the drawings. The description is relatively detailed and complete, but it should not be understood as a limitation on the scope of the present invention patent. The obvious deformations and replacement forms of the following examples are all within the protection scope of this patent.
[0019] Refer toFigure 1 , an embodiment of the present application provides a method for testing the CAN communication signal transceiver function of an electronic control unit (ECU), including: S101, analyze the CAN communication protocol of the ECU under test and distinguish signal types.
[0020] By analyzing the CAN communication protocol of the ECU under test, information such as the signal sender, receiver, message ID, start bit, bit width, etc. can be obtained.
[0021] According to the sender field in the CAN communication protocol of the ECU under test, distinguish signal types: If the sender is the first predetermined ECU (such as a vehicle control unit VCU or an in-vehicle T-Box device), then mark the signal as a transmitted signal; if the sender is not the second predetermined ECU (such as a vehicle control unit VCU, an in-vehicle T-Box device, or a gateway GW), then mark the signal as a received signal.
[0022] After distinguishing the signal types, the message ID and CAN path where the signal is located can also be obtained. So as to perform the transceiver function test according to the signal type subsequently.
[0023] The CAN communication protocol of the ECU under test defines the mapping relationship between signals and CAN messages. Specifically, for example, the communication protocol of the ECU under test stipulates that: In the CAN message with message ID 0x100: Bytes 0-1: Vehicle speed signal (16 bits).
[0024] Bytes 2-3: Battery voltage signal (16 bits).
[0025] Bytes 4-5: Motor speed signal (16 bits) Bytes 6-7: Reserved.
[0026] The sending ECU (such as VCU) packs signals such as vehicle speed, battery voltage, and motor speed into a CAN message (ID = 0x100) according to the protocol and sends it through the CAN bus.
[0027] The receiving ECU (such as MCU) receives the message (ID = 0x100) from the CAN bus and parses out signals such as vehicle speed, battery voltage, and motor speed from it.
[0028] Step S102 provides basic data for subsequent tests, clarifies the signal types to be tested and their positions in the CAN message, and ensures the pertinence and comprehensiveness of the tests.
[0029] S102, analyze the application layer code of the ECU under test, establish the mapping relationship between signals and application layer code variables, and establish the corresponding relationship between the COM layer receiving function and the received message ID.
[0030] Among them, the interface cleaning table counts the signals required to be received by the application layer. Whether the message reception function is configured is recorded in the rte_cbk.h file. Whether the signals required by the application layer are defined and called is recorded in the rte_cbk.h file and the rte.c file. Whether the callback function is called is recorded in Com_PBcfg.c.
[0031] In this step S102, by inputting the interface cleaning table of the ECU under test and the rte_cbk.h, rte.c, and Com_PBcfg.c files in the code project file, the one-to-one correspondence between the transmitted signals and received signals and the code variables in the application layer, and the one-to-one correspondence between the COM layer reception function and the received message ID are counted.
[0032] This step S102 realizes the association between the signals and the code variables of the application layer of the ECU under test, provides a basis for variable access and breakpoint setting for subsequent tests, and ensures the accuracy and operability of the tests.
[0033] S103, for the signal transmission function, modify the values of the code variables in the application layer of the ECU under test through the test system debugging tool, and verify whether the ECU under test correctly transmits the transmitted signal.
[0034] In the embodiments of the present application, the test system debugging tool is, for example, Lauterbach tool, Renesas E2 emulator and other tools.
[0035] Taking the Lauterbach tool as an example of the test system debugging tool, refer to Figure 2 , this step S103 specifically includes: S1031, according to the signal bit width of the transmitted signal, use the Lauterbach tool to modify the values of the code variables in the application layer corresponding to the transmitted signal, including the minimum value, maximum value and intermediate value; S1032, trigger the ECU under test to send a CAN message containing the transmitted signal to the CAN bus according to the modified code variables in the application layer; S1033, use the CAN bus analysis tool to receive the CAN message on the CAN bus, and extract the corresponding signal value in the CAN message according to the message ID, start bit and bit width where the transmitted signal is located; S1034, compare the set value of the code variable in the application layer with the received transmitted signal value; if they are inconsistent, record the abnormality and analyze the reason.
[0036] S1035, if the set value of the code variable in the application layer is consistent with the received transmitted signal value, it is determined that the ECU under test correctly transmits the transmitted signal.
[0037] In step S1034, if "The variable does not exist inside the program code!" appears, such as the counter signal and the CRC check signal, since they are not sent from the application layer but are calculated, there is no need for verification; or if "The sent value and the received value do not match correctly!" appears, such as the longitude and latitude signal, since the code variable is sent in the message after value processing in the application layer, the values are not equal, and such signals need to be verified separately.
[0038] This step S103 verifies whether the ECU under test can correctly generate and send the send signal, ensuring the correctness and stability of the signal sending function.
[0039] Next, the signal reception function test is carried out. Since problems may occur in both the COM layer and the application layer of the ECU under test, resulting in abnormal reception of the received signal, the transmission processes of the received signal to the COM layer and the application layer of the ECU under test are tested separately to facilitate locating the cause of the problem.
[0040] S104, for the signal reception function, first set a breakpoint at the receive function of the COM layer of the ECU under test through the test system debugging tool to verify whether the COM layer of the ECU under test correctly receives the received signal; then modify the received signal value in the CAN message through the CAN bus analysis tool to further verify whether the application layer of the ECU under test correctly receives the received signal, and complete the test.
[0041] In the embodiment of the present application, the CAN bus analysis tool is, for example, the ZCANPRO tool, the CANOE tool, etc.
[0042] Taking the Lauterbach tool as the test system debugging tool and the ZCANPRO tool as the CAN bus analysis tool as an example, referring to Figure 3 , this step S104 includes: S1041, use the Lauterbach tool to set a breakpoint at the receive function of the COM layer in the ECU under test; S1042, use the ZCANPRO tool to send a CAN message containing the received signal to the CAN bus; S1043, observe whether the software program running in the ECU under test terminates normally at the breakpoint; S1044, if the software program in the ECU under test terminates normally at the breakpoint, it is determined that the COM layer in the ECU under test correctly receives the received signal.
[0043] Referring to Figure 4 , this step S104 further includes: S1045. Set the received signal value to the minimum value, maximum value, and any intermediate value according to the signal bit width of the received signal, and use the ZCANPRO tool to send CAN messages containing different received signal values to the CAN bus; S1046. The ECU under test receives the CAN message through the CAN bus and transfers the received signal in the CAN message to the application layer; S1047. Read the value of the application layer code variable corresponding to the received signal in the application layer code of the ECU under test through the Lauterbach tool; S1048. Compare the value of the application layer code variable with the set received signal value; S1049. If the value of the application layer code variable is consistent with the set received signal value, it is determined that the application layer in the ECU under test correctly receives the received signal.
[0044] This step S104 verifies whether the application layer of the ECU under test can correctly process the received signal, ensuring the normal transmission function of the received signal from the COM layer to the application layer.
[0045] The above method can automatically complete the following seven functions according to the messages and signals required to be tested by the current protocol: parse the protocol, sort out the messages and signals required for transceiver testing; preset the source signal values of the application layer, and set them to the maximum value, minimum value, and any intermediate value of the signal respectively; collect the sent messages, parse their signal values, and compare them with the source signal values of the application layer; preset the signal reception values, and send messages with the maximum value, minimum value, and any intermediate value of the signal respectively; sort out the COM layer functions corresponding to the received messages according to the input interface cleaning table; use the script and the test system debugging tool to set breakpoints for the COM layer reception function, send the corresponding messages, and check whether the program can stop at the breakpoints; after receiving the signal, verify whether the result signal value of the application layer changes synchronously. When manually parsing, due to problems such as a large number of transceiver signals involved in the protocol, similar signal names in part, and a large number of signals in the same message, it is easy to have difficulties in the process of corresponding code variables to signal values one by one, which is time-consuming and laborious. And during the manual testing process, the signal values are mostly set to fixed values, and it is difficult to simulate the dynamic change of the signal values. However, the above method of the present application only needs to input the protocol and the code project, and can automatically set dynamic signal values and compare them, thereby reducing the labor cost and the probability of errors.
[0046] For the above method of this embodiment, after setting up the test environment, only the expected CAN communication protocol and the address of the program binary file of the ECU under test need to be input, and the results of signal sending and receiving can be obtained. The function implementation mainly relies on the python script to automate the operation of the test system debugging tool and the ZCANPRO tool, so as to realize functions such as controlling message transceiver, changing signal values, and setting breakpoints.
[0047] On the other hand, the present application also provides a CAN communication signal transceiver function testing device for an electronic control unit (ECU), including: A first parsing module, configured to parse the CAN communication protocol of the ECU under test and distinguish signal types; A second parsing module, configured to parse the application layer code of the ECU under test and establish a mapping relationship between the signal and the application layer code variables in the application layer code; A transmission function verification module, for the signal transmission function, to modify the values of the application layer code variables of the ECU under test through a test system debugging tool, and verify whether the ECU under test correctly sends out the transmission signal; A reception function verification module, for the signal reception function, first set breakpoints at the COM layer reception function of the ECU under test through a test system debugging tool to verify whether the COM layer of the ECU under test correctly receives the reception signal; then modify the reception signal value in the CAN message through a CAN bus analysis tool to further verify whether the application layer of the ECU under test correctly receives the reception signal, and complete the test.
[0048] On the other hand, the present application also provides an electronic device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the above-mentioned CAN communication signal transceiver function testing method is implemented.
[0049] On the other hand, the present application also provides a computer-readable storage medium, characterized in that it stores a computer program, and when the computer program is executed by a processor, the above-mentioned CAN communication signal transceiver function testing method for the electronic control unit (ECU) is implemented.
[0050] It should be noted that the various embodiments in this specification are described in a progressive manner, and the key point of each embodiment is to describe the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0051] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concept. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.
[0052] It should also be noted that in this text, terms such as "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings. This is for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation on the present invention. In addition, relative terms such as "first" and "second" are used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations, nor can they be construed as indicating or implying relative importance. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements does not include those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or terminal device comprising the element.
[0053] The technical solutions provided by the present invention have been introduced in detail above. Specific examples are used in this text to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the present invention, and the content of this specification should not be construed as a limitation on the present invention. At the same time, for those of ordinary skill in the art, based on the present invention, there will be various forms of changes in the specific implementation manners and application scopes. It is not necessary and impossible to enumerate all the implementation manners here, and the obvious changes or variations derived therefrom are still within the protection scope of the present invention.
Claims
1. A method for testing the CAN communication signal receiving and sending function of an electronic control unit ECU, characterized in that: include: Analyze the CAN communication protocol of the ECU under test and distinguish the signal type; Parse the application layer code of the ECU under test, establish the mapping relationship between the signal and the application layer code variable, and establish the corresponding relationship between the COM layer receiving function and the receiving message ID; For the signal sending function, the application layer code variable value of the ECU under test is modified through the test system debugging tool to verify whether the ECU under test sends the sending signal correctly; For the signal receiving function, first set a breakpoint at the COM layer receiving function of the ECU under test through the test system debugging tool to verify whether the COM layer of the ECU under test correctly receives the receiving signal; then modify the receiving signal value in the CAN message through the CAN bus analysis tool to further verify whether the application layer of the ECU under test correctly receives the receiving signal to complete the test.
2. The method for testing the CAN communication signal receiving and sending function of the electronic control unit ECU according to claim 1, characterized in that: The steps to parse the communication protocol of the ECU under test and distinguish the signal type include: Determine the signal type based on the sender field in the communication protocol of the ECU under test; If the sender includes the first predetermined ECU, marking the signal as a sending signal; If the sender does not include the second predetermined ECU, the signal is marked as a received signal.
3. The method for testing the CAN communication signal receiving and sending function of the electronic control unit ECU according to claim 1, characterized in that: The steps of parsing the application layer code of the ECU under test, establishing a mapping relationship between the signal and the application layer code variable, and establishing a corresponding relationship between the COM layer receiving function and the receiving message ID include: By parsing the interface cleanup table and code engineering files of the ECU under test, the correspondence between the sending signal and the receiving signal and the application layer code variables is statistically analyzed, and the correspondence between the COM layer receiving function and the receiving message ID is established.
4. The method for testing the CAN communication signal receiving and sending function of the electronic control unit ECU according to claim 1, characterized in that: For the signal sending function, the steps of modifying the code variable value through the test system debugging tool to verify whether the ECU under test correctly sends the sending signal include: According to the signal bit width of the transmitted signal, use the test system debugging tool to change the application layer code variables corresponding to the transmitted signal, including the minimum value, maximum value and intermediate value; Trigger the ECU under test to send a CAN message containing a sending signal to the CAN bus according to the modified application layer code variable; Use the CAN bus analysis tool to receive CAN messages on the CAN bus, and extract the corresponding signal value in the CAN message based on the message ID, start bit and bit width of the sent signal; Compare the set application layer code variable value with the received send signal value; If the set application layer code variable value is consistent with the received transmission signal value, it is determined that the ECU under test correctly sends the transmission signal.
5. The method for testing the CAN communication signal receiving and sending function of the electronic control unit ECU according to claim 1, characterized in that: For the signal receiving function, the steps of setting a breakpoint at the COM layer receiving function in the ECU under test by using the test system debugging tool to verify whether the COM layer of the ECU under test correctly receives the receiving signal include: Use the test system debugging tool to set a breakpoint at the COM layer receiving function in the ECU under test; Use the CAN bus analysis tool to send a CAN message containing the received signal to the CAN bus; Observe whether the software program running in the ECU under test terminates normally at the breakpoint; If the software program in the ECU under test terminates normally at the breakpoint, it is determined that the COM layer in the ECU under test correctly receives the receive signal.
6. The method for testing the CAN communication signal receiving and sending function of the electronic control unit ECU according to claim 1, characterized in that: Use the CAN bus analysis tool to modify the received signal value in the CAN message to further verify whether the application layer of the ECU under test correctly receives the received signal. The steps to complete the test include: According to the signal bit width of the received signal, set the received signal value to the minimum value, the maximum value and any value in the middle, and use the CAN bus analysis tool to send CAN messages containing different received signal values to the CAN bus; The ECU under test receives CAN messages through the CAN bus and passes the received signals in the CAN messages to the application layer; Read the application layer code variable value corresponding to the received signal in the application layer code of the ECU under test through the test system debugging tool; Compare the application layer code variable value with the set received signal value; If the application layer code variable value is consistent with the set receive signal value, it is determined that the application layer in the ECU under test correctly receives the receive signal.
7. The method for testing the CAN communication signal receiving and sending function of the electronic control unit ECU according to claim 2, characterized in that: The first predetermined ECU is a vehicle controller VCU or a vehicle-mounted T-Box device, and the second predetermined ECU is a vehicle controller VCU, a vehicle-mounted T-Box device or a gateway GW.
8. A device for testing the CAN communication signal receiving and sending function of an electronic control unit ECU, characterized in that: include: The first parsing module is used to parse the CAN communication protocol of the ECU under test and distinguish the signal type; The second parsing module is used to parse the application layer code of the ECU under test and establish a mapping relationship between the signal and the application layer code variables in the application layer code; The sending function verification module is used to modify the application layer code variable value of the ECU under test through the test system debugging tool for the signal sending function to verify whether the ECU under test sends the sending signal correctly; The receiving function verification module is used for the signal receiving function. First, a breakpoint is set at the receiving function of the COM layer of the ECU under test through the test system debugging tool to verify whether the COM layer of the ECU under test correctly receives the receiving signal; then the receiving signal value in the CAN message is modified through the CAN bus analysis tool to further verify whether the application layer of the ECU under test correctly receives the receiving signal to complete the test.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the CAN communication signal receiving and sending function test method of the electronic control unit ECU according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the CAN communication signal receiving and sending function test method of the electronic control unit ECU according to any one of claims 1 to 7 is implemented.