ECU diagnosis method and device, computer equipment and storage medium

By introducing an automated diagnostic unit into ECU diagnostics, adjusting system variables and configuring diagnostic messages, the problem of inefficiency of existing ECU diagnostic tools is solved, and efficient ECU diagnostics and automated testing is realized, suitable for diagnostic testing of FlexRay bus.

CN120233752APending Publication Date: 2025-07-01WUHAN LOTUS CARS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311857896.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The existing ECU diagnostic tool based on the FlexRay bus does not have a program interface and cannot be called by third-party automated scripts to execute software, resulting in low ECU diagnostic efficiency and cannot be applied to automated diagnostic testing across software platforms.

Method used

It provides an ECU diagnostic method, which adjusts the value of system variables through the control of the automated diagnostic unit, configures and sends diagnostic request messages, receives and processes the diagnostic response messages of the ECU, and realizes the transmission and reception of diagnostic messages and automated diagnostic tests.

Benefits of technology

It improves the diagnostic efficiency of ECU, reduces the defect rate of ECU software, reduces the cost of software development, and is suitable for diagnostic tests based on FlexRay bus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120233752A_ABST
    Figure CN120233752A_ABST
Patent Text Reader

Abstract

The invention relates to an ECU diagnosis method and device, computer equipment and a storage medium. The method comprises the following steps: under the control of an automatic diagnosis unit, adjusting a value in a first system variable into a preset numerical value, and writing a diagnosis request message configured by the automatic diagnosis unit into a second system variable; when it is detected that the first system variable jumps to the preset numerical value, the second system variable is sent to the ECU through the communication bus; receiving a diagnosis response message sent by the ECU from the communication bus, and writing the diagnosis response message into a third system variable; the third system variable is used for responding to the reading operation of the automatic diagnosis unit and transmitting the diagnosis response message to the automatic diagnosis unit so as to instruct the automatic diagnosis unit to carry out ECU diagnosis according to the diagnosis response message. The method can be matched with a third-party automatic diagnosis unit, diagnosis message receiving and sending and automatic diagnosis testing are achieved, the diagnosis efficiency of the ECU is improved, and the method is suitable for diagnosis testing based on the FlexRay bus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle diagnosis, and in particular, to an ECU diagnosis method, device, computer device, and storage medium. Background Art

[0002] In the Hardware-in-the-Loop (HIL) test of an ECU (Electronic Control Unit), it is often necessary to perform Unified Diagnostic Services (UDS) based on the FlexRay network to verify related functions. There are many verification items and high frequencies, such as confirmation of Diagnostic Trouble Code (DTC) reporting and recovery conditions, confirmation of Diagnostic Identifier (DID) read information, etc. This requires a highly automated test solution to diagnose the ECU and ensure the quality of the ECU software. Currently, diagnostic tools based on the FlexRay bus (for example, DSA diagnostic special tools) do not open program interfaces. During HIL automated testing, they cannot be called by third-party automated script execution software and are not applicable to cross-software platform automated diagnostic testing. They are mainly used for manual troubleshooting and verification of diagnostic problems within the software, resulting in low efficiency of ECU diagnosis. Summary of the Invention

[0003] Based on this, in view of the above technical problems, it is necessary to provide an ECU diagnosis method, device, computer device, and computer-readable storage medium that can cooperate with a third-party automated diagnostic unit to achieve the sending and receiving of diagnostic messages and automated diagnostic testing, thereby improving the diagnostic efficiency of the ECU.

[0004] In a first aspect, the present application provides an ECU diagnosis method, which is applied to a bus control unit. The method includes:

[0005] Under the control of an automated diagnostic unit, adjust the value in a first system variable to a preset value, and write the diagnostic request message configured by the automated diagnostic unit into a second system variable;

[0006] When it is detected that the first system variable jumps to the preset value, send the second system variable to the ECU through a communication bus;

[0007] Receive a diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into a third system variable; the third system variable is used to respond to the read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit to instruct the automated diagnostic unit to perform ECU diagnosis based on the diagnostic response message.

[0008] In one embodiment, writing the diagnostic request message into the second system variable includes:

[0009] When the length of the diagnostic request message is greater than a first set length, splitting the diagnostic request message into N request sub-messages according to the first set length; N ≥ 2;

[0010] After writing the i-th request sub-message into the second system variable, if it is detected that the second system variable has been successfully received by the ECU, clearing the second system variable and writing the (i + 1)-th request sub-message into the second system variable; 1 ≤ i < N.

[0011] In one embodiment, writing the diagnostic response message into the third system variable includes:

[0012] When the length of the diagnostic response message is greater than a second set length, splitting the diagnostic response message into M response sub-messages according to the second set length; M ≥ 2;

[0013] After writing the k-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clearing the third system variable and writing the (k + 1)-th response sub-message into the third system variable; 1 ≤ k < M.

[0014] In one embodiment, after writing the diagnostic response message into the third system variable, the method further includes:

[0015] After writing the M-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clearing the third system variable and adjusting the value in the first system variable to the default value.

[0016] In one embodiment, the method further includes:

[0017] Receiving a configuration instruction, setting at least one network node according to the configuration instruction, and configuring the functional attributes of the at least one network node; the network node corresponds to a physical communication bus;

[0018] Under the control of the automated diagnostic unit, determining the target network node targeted by the automated diagnostic unit;

[0019] When the functional attribute of the target network node is the target attribute, performing the steps of adjusting the value in the first system variable to a preset value and writing the diagnostic request message configured by the automated diagnostic unit into the second system variable.

[0020] In one embodiment, the communication bus includes any one of a FlexRay bus, a CAN bus, a LIN bus, and an Ethernet bus.

[0021] In a second aspect, the present application provides an ECU diagnosis method. The method is applied to an automated diagnosis unit, and the method includes:

[0022] Sending a control instruction to a bus control unit to instruct the bus control unit to trigger a jump of a first system variable, writing a diagnostic request message configured by the automated diagnosis unit into a second system variable, sending the second system variable to an ECU via a communication bus, receiving a diagnostic response message sent by the ECU from the communication bus, and writing the diagnostic response message into a third system variable;

[0023] Reading the third system variable to obtain the diagnostic response message;

[0024] Performing ECU diagnosis according to the diagnostic response message.

[0025] In a third aspect, the present application further provides an ECU diagnosis device. The device includes:

[0026] A request receiving module, configured to, under the control of an automated diagnosis unit, adjust the value in a first system variable to a preset value, and write a diagnostic request message configured by the automated diagnosis unit into a second system variable;

[0027] A transmission module, configured to, when detecting that the first system variable jumps to the preset value, send the second system variable to an ECU via a communication bus;

[0028] A response receiving module, configured to receive a diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into a third system variable; the third system variable is used to respond to a read operation of the automated diagnosis unit, and transfer the diagnostic response message to the automated diagnosis unit to instruct the automated diagnosis unit to perform ECU diagnosis according to the diagnostic response message.

[0029] In a fourth aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0030] Under the control of an automated diagnosis unit, adjust the value in a first system variable to a preset value, and write a diagnostic request message configured by the automated diagnosis unit into a second system variable;

[0031] When it is detected that the first system variable jumps to the preset value, send the second system variable to the ECU via the communication bus;

[0032] Receive the diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into the third system variable; the third system variable is used to respond to the read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message.

[0033] In a fifth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0034] Under the control of the automated diagnostic unit, adjust the value in the first system variable to the preset value, and write the diagnostic request message configured by the automated diagnostic unit into the second system variable;

[0035] When it is detected that the first system variable jumps to the preset value, send the second system variable to the ECU via the communication bus;

[0036] Receive the diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into the third system variable; the third system variable is used to respond to the read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message.

[0037] The above ECU diagnostic method, device, computer device and storage medium, under the control of the automated diagnostic unit, adjust the value in the first system variable to the preset value, and write the diagnostic request message configured by the automated diagnostic unit into the second system variable; when it is detected that the first system variable jumps to the preset value, send the second system variable to the ECU via the communication bus; receive the diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into the third system variable; the third system variable is used to respond to the read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message. Through the above method, cooperate with a third-party automated diagnostic unit to realize the transceiver of diagnostic messages and automated diagnostic tests, and can efficiently complete comprehensive automatic tests based on diagnostic message interaction. Compared with manual troubleshooting and verification, this method improves the diagnostic efficiency of the ECU, thereby reducing the ECU software defect rate, reducing software development costs, and is applicable to diagnostic tests based on the FlexRay bus. Brief Description of the Drawings

[0038] Figure 1 It is an application environment diagram of the ECU diagnosis method in an embodiment;

[0039] Figure 2 It is a schematic flowchart of the ECU diagnosis method in an embodiment;

[0040] Figure 3 It is a schematic flowchart of the ECU diagnosis method in another embodiment;

[0041] Figure 4 It is a structural block diagram of the ECU diagnosis device in an embodiment;

[0042] Figure 5 It is a structural block diagram of the ECU diagnosis device in another embodiment;

[0043] Figure 6 It is an internal structure diagram of a computer device in an embodiment. Detailed Description of the Embodiment

[0044] In order to make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0045] The ECU diagnosis method provided by the embodiments of the present application can be applied to an application environment as shown in Figure 1 . Among them, the automated diagnosis unit 102 communicates with the bus control unit 104. The bus control unit 104 realizes the function of sending and receiving diagnostic messages on the communication bus. The automated diagnosis unit 102 and the bus control unit 104 cooperate with each other. The automated diagnosis unit 102 is used for diagnostic control, and the bus control unit 104 is used for sending and receiving diagnostic messages, and can efficiently complete a comprehensive automatic test based on diagnostic message interaction. In one implementation, the automated diagnosis unit 102 and the bus control unit 104 can be set on different devices sharing system variables, and the automated diagnosis unit 102 and the bus control unit 104 can also be set on the same device sharing system variables. This embodiment does not limit this.

[0046] In an embodiment, as shown in Figure 2 , a kind of ECU diagnosis method is provided. Taking the method applied to the bus control unit 104 in Figure 1 as an example for description, the method includes the following steps:

[0047] Step 202, under the control of the automated diagnostic unit, adjust the value in the first system variable to a preset value, and write the diagnostic request message configured by the automated diagnostic unit into the second system variable.

[0048] Among them, the automated diagnostic unit can be ECU-TEST software or NI TestStand automation software, and this embodiment does not limit this. The bus control unit can be a CANoe bus development tool. By writing a CAPL script on the CANoe platform, this CAPL script is used to implement the diagnostic message sending and receiving function.

[0049] The automated diagnostic unit has an automatic diagnostic process control function and shares the system variables of the bus control unit. Under the control of the automated diagnostic unit, adjust the value in the first system variable. Among them, the preset value can be 1. Under different instruction controls, the value of the first system variable can be 0 or 1. When the first system variable is 0, it indicates that the diagnostic message sending and receiving function is closed. When the first system variable is 1, it indicates that the diagnostic message sending and receiving function is enabled. Under the configuration of the automated diagnostic unit, write the diagnostic request message into the second system variable.

[0050] Step 204, when it is detected that the first system variable jumps to the preset value, send the second system variable to the ECU through the communication bus.

[0051] Among them, when it is detected that the first system variable jumps from 0 to 1, send the second system variable to the ECU through the communication bus. In one implementation, when sending the second system variable, encapsulate the data in the second system variable according to the set communication bus protocol and send it through the communication bus.

[0052] Step 206, receive the diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into the third system variable; the third system variable is used to respond to the read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message.

[0053] Among them, write the diagnostic response message sent by the ECU into the third system variable, and the automated diagnostic unit shares this third system variable, reads the diagnostic response message from the third system variable, and diagnoses whether the function of the ECU software is normal based on the diagnostic response message.

[0054] In one implementation, three system variables are created in the CANoe project: CommonDiagReqstr, CommonDiagReqSts, and CommonDIDDataStr. When the system variable CommonDiagReqSts is detected to jump from 0 to 1, the diagnostic request message CommonDiagReqstr is sent to the ECU according to the ISO 14229-4 protocol, and the ECU diagnostic response message is written into the system variable CommonDIDDataStr. Among them, the data type of CommonDiagReqSts is an integer variable, and the data types of CommonDiagReqstr and CommonDIDDataStr are string types.

[0055] In one implementation, a Package script is written in the ECU-TEST software to transmit UDS diagnostic data, and the status is monitored through system variables. A CAPL script is written to encapsulate the UDS service data transmitted by ECU-TEST based on the UDSonFR (UDS diagnosis based on Flexray communication) rules, and the CANoe tool is used to send data, parse the received messages, and synchronize the results to ECU-TEST to form a closed loop.

[0056] In the above ECU diagnostic method, under the control of the automated diagnostic unit, the value in the first system variable is adjusted to a preset value, and the diagnostic request message configured by the automated diagnostic unit is written into the second system variable; when it is detected that the first system variable jumps to the preset value, the second system variable is sent to the ECU via the communication bus; the diagnostic response message sent by the ECU is received from the communication bus, and the diagnostic response message is written into the third system variable; the third system variable is used to respond to the read operation of the automated diagnostic unit, and the diagnostic response message is transmitted to the automated diagnostic unit to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message. Through the above method, in cooperation with a third-party automated diagnostic unit, the diagnostic message sending and receiving and automated diagnostic testing are realized, and comprehensive automatic testing based on diagnostic message interaction can be efficiently completed. Compared with manual troubleshooting and verification, this method improves the diagnostic efficiency of the ECU, thereby reducing the ECU software defect rate and software development costs, and is suitable for diagnostic testing based on the FlexRay bus.

[0057] In one embodiment, writing the diagnostic request message into the second system variable includes: when the length of the diagnostic request message is greater than a first set length, splitting the diagnostic request message into N request sub-messages according to the first set length; N≥2; after writing the i-th request sub-message into the second system variable, if it is detected that the second system variable has been successfully received by the ECU, clearing the second system variable and writing the (i + 1)-th request sub-message into the second system variable; 1≤i < N.

[0058] Wherein, the first set length is the maximum data length that can be accommodated by a single segment in the pre-set segmented transmission of the diagnostic request. The diagnostic request message with a length greater than the first set length is segmented. The lengths of the N request sub-messages after segmentation are less than or equal to the first set length. The N segmented request sub-messages are sequentially written into the second system variable, and the diagnostic request message is sent to the ECU through the second system variable. In this way, the data transmission efficiency and accuracy can be improved, and data loss or transmission errors caused by too long messages can be avoided. In one implementation, by detecting the read operation for the second system variable, it is judged whether the second system variable has been successfully received by the ECU. The bus control unit reads the second system variable, encapsulates the read data according to the set communication bus protocol, and sends it through the communication bus.

[0059] The i-th request sub-message is any one of the N request sub-messages obtained by splitting except the N-th request sub-message. After the i-th request sub-message is successfully received by the ECU, the next request sub-message (i.e., the (i + 1)-th request sub-message is written into the second system variable). In one implementation, after writing the N-th request sub-message into the second system variable, if it is detected that the second system variable has been successfully received by the ECU, the second system variable is cleared and waiting for the subsequent diagnostic message sending and receiving function to be enabled again.

[0060] In one implementation, when splitting the diagnostic request message, a sequence tag is set for each request sub-message according to the position of the request sub-message in the diagnostic request message, so that after the ECU receives the N request sub-messages, the sequence tags in the request sub-messages are read, and the N request sub-messages are spliced according to the sequence tags to obtain the complete diagnostic request message.

[0061] In one embodiment, writing the diagnostic response message into the third system variable includes: when the length of the diagnostic response message is greater than a second set length, splitting the diagnostic response message into M response sub-messages according to the second set length; M≥2; after writing the kth response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clearing the third system variable and writing the (k + 1)th response sub-message into the third system variable; 1≤k<M.

[0062] Wherein, the second set length is the maximum data length that can be accommodated by a single segment in the pre-set segmented transmission of the diagnostic response. Segmenting the diagnostic response message with a length greater than the second set length, the lengths of the M response sub-messages after segmentation are less than or equal to the second set length, writing the M response sub-messages after segmentation into the third system variable in sequence, and passing the diagnostic response message to the automated diagnostic unit through the third system variable. In this way, the data transmission efficiency and accuracy can be improved, and data loss or transmission errors caused by too long messages can be avoided. In one implementation, by detecting the read operation on the third system variable, it is determined whether the third system variable has been successfully received by the automated diagnostic unit.

[0063] In one implementation, when splitting the diagnostic response message, set a sequence tag for each response sub-message according to the position of the response sub-message in the diagnostic response message, so that after the automated diagnostic unit receives the M response sub-messages, read the sequence tags in the response sub-messages and splice the M response sub-messages according to the sequence tags to obtain a complete diagnostic response message.

[0064] In one embodiment, after writing the diagnostic response message into the third system variable, the method further includes: after writing the Mth response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clearing the third system variable and adjusting the value in the first system variable to the default value.

[0065] Wherein, after passing the M response sub-messages to the automated diagnostic unit through the third system variable in sequence, adjust the first system variable and the third system variable to the initial state: that is, clear the third system variable and adjust the value in the first system variable to the default value. Optionally, the default value of the first system variable is 0, and adjust the value of the first system variable to 0, so as to perform the message sending and receiving steps again under the control of the automated diagnostic unit subsequently. Wherein, after writing the Mth response sub-message into the third system variable, if a read operation of the automated diagnostic unit is detected, it is determined that the third system variable has been successfully received by the automated diagnostic unit, and at this time, perform the steps of clearing the third system variable and adjusting the value in the first system variable to the default value.

[0066] In one embodiment, the method further includes: receiving a configuration instruction, setting at least one network node according to the configuration instruction, and configuring functional attributes of the at least one network node; the network node corresponding to a physical communication bus; under the control of an automated diagnostic unit, determining a target network node targeted by the automated diagnostic unit; in a case where the functional attribute of the target network node is a target attribute, performing the step of adjusting a value in a first system variable to a preset value and writing a diagnostic request message configured by the automated diagnostic unit into a second system variable.

[0067] Wherein, the bus control unit is configured with multiple bus communication methods. In this embodiment, the communication method for implementing the diagnostic message sending and receiving function based on system variables for the communication bus (hereinafter referred to as the target communication method) is one of the bus communication methods. For example, the bus control unit is also configured with a method of calling CAN bus related functions for communication. The bus control unit responds to a user's configuration instruction and sets one or more network nodes, and each network node corresponds to a physical communication bus. The functional attribute is used to characterize the communication method configured by the network node. Specifically, each network node is linked with a script for realizing communication through the physical communication bus, and different scripts for realizing different communication functions can be distinguished through the functional attribute. The target attribute is used to characterize that the target network node is configured with the target communication method. When it is detected that the target network node targeted by the automated diagnostic unit needs to use the target communication method of this embodiment, the above steps 202 to 206 of this embodiment are performed.

[0068] In one implementation, within the Simulation page of the CANoe project, insert a new network node in the FlexRay Clusters and link the diagnostic CAPL script written for this network node. The diagnostic CAPL script is used to: create three system variables in the CANoe project: CommonDiagReqstr, CommonDiagReqSts, and CommonDIDDataStr. When it is detected that the system variable CommonDiagReqSts jumps from 0 to 1, send the diagnostic request message CommonDiagReqstr to the ECU according to the ISO 14229-4 protocol, and write the ECU diagnostic response message into the system variable CommonDIDDataStr. When the automated diagnostic unit uses this network node, execute the above CAPL script to realize the diagnostic message sending and receiving function.

[0069] In one embodiment, the communication bus includes any one of a FlexRay bus, a CAN bus, a LIN bus, and an Ethernet bus.

[0070] Among them, the cross-software-platform automated diagnosis method in this embodiment is applicable not only to the controller based on the FlexRay bus, but also to the controllers based on communication methods such as the CAN bus, LIN bus, and Ethernet bus. Specifically, the CANoe CAPL script is reconstructed with reference to the specific execution standards of ISO 14229 on different buses. Based on the diagnostic rules of each bus by the CAPL script, the UDS service data transmitted by ECU-TEST is encapsulated. Using the CANoe tool, the data is sent, and the received message is parsed, and the result is synchronized to ECU-TEST to form a closed loop.

[0071] In one embodiment, as Figure 3 shown, an ECU diagnosis method is provided. Taking the application of this method to the automated diagnosis unit 102 in Figure 1 as an example for illustration, the method includes the following steps:

[0072] Step 302: Send a control instruction to the bus control unit; to instruct the bus control unit to trigger a jump of the first system variable, write the diagnostic request message configured by the automated diagnosis unit into the second system variable, send the second system variable to the ECU through the communication bus, receive the diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into the third system variable.

[0073] Step 304: Read the third system variable to obtain the diagnostic response message.

[0074] Step 306: Perform ECU diagnosis according to the diagnostic response message.

[0075] Among them, the automated diagnosis unit can be the ECU-TEST software or the NI TestStand automation software, and this embodiment does not limit this. The bus control unit can be the CANoe bus development tool. By writing a CAPL script on the CANoe platform, the CAPL script is used to implement the function of receiving and sending diagnostic messages. When the bus control unit detects that the first system variable jumps from 0 to 1, the second system variable is sent to the ECU through the communication bus. The diagnostic response message sent by the ECU is written into the third system variable, and the third system variable is shared by the automated diagnosis unit. The diagnostic response message is read from the third system variable, and based on the diagnostic response message, it is diagnosed whether the function of the ECU software is normal.

[0076] In the above ECU diagnosis method, a control instruction is sent to the bus control unit, instructing the bus control unit to trigger a jump of the first system variable, writing the diagnostic request message configured by the automated diagnosis unit into the second system variable, sending the second system variable to the ECU via the communication bus, receiving the diagnostic response message sent by the ECU from the communication bus, and writing the diagnostic response message into the third system variable. The third system variable is read to obtain the diagnostic response message, and ECU diagnosis is performed based on the diagnostic response message. In this way, the bus control unit cooperates with the third-party automated diagnosis unit to achieve the sending and receiving of diagnostic messages and automated diagnostic tests, enabling the efficient completion of comprehensive automatic tests based on diagnostic message interaction. Compared with manual troubleshooting and verification, this method improves the diagnostic efficiency of the ECU, thereby reducing the software defect rate of the ECU, reducing software development costs, and is applicable to diagnostic tests based on the FlexRay bus.

[0077] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the indications of the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily have to be completed at the same moment, but can be executed at different moments. The execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of the steps or stages in other steps or other steps.

[0078] Based on the same inventive concept, an embodiment of the present application further provides an ECU diagnosis device for implementing the above-mentioned ECU diagnosis method. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the ECU diagnosis device provided below can refer to the limitations on the ECU diagnosis method in the above text, and will not be repeated here.

[0079] In one embodiment, as Figure 4 shown, an ECU diagnosis device is provided. The device is applied to the bus control unit, and the device includes:

[0080] A request receiving module 402, configured to, under the control of the automated diagnosis unit, adjust the value in the first system variable to a preset value, and write the diagnostic request message configured by the automated diagnosis unit into the second system variable.

[0081] A transfer module 404, configured to send the second system variable to the ECU via a communication bus when it is detected that the first system variable jumps to the preset value.

[0082] A response receiving module 406, configured to receive a diagnostic response message sent by the ECU from the communication bus and write the diagnostic response message into a third system variable; the third system variable is used to respond to a read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit, so as to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message.

[0083] In the above ECU diagnosis method, under the control of the automated diagnostic unit, the value in the first system variable is adjusted to a preset value, and a diagnostic request message configured by the automated diagnostic unit is written into the second system variable; when it is detected that the first system variable jumps to the preset value, the second system variable is sent to the ECU via the communication bus; a diagnostic response message sent by the ECU is received from the communication bus and written into the third system variable; the third system variable is used to respond to a read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit, so as to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message. In this way, by cooperating with a third-party automated diagnostic unit, the diagnosis message sending and receiving and automated diagnostic tests are realized, and the comprehensive automatic test based on the diagnostic message interaction can be efficiently completed. Compared with manual troubleshooting and verification, the device improves the diagnostic efficiency of the ECU, thereby reducing the ECU software defect rate and the software development cost, and is applicable to the diagnostic test based on the FlexRay bus.

[0084] In one embodiment, the request receiving module 402 is further configured to, when the length of the diagnostic request message is greater than a first set length, split the diagnostic request message into N request sub-messages according to the first set length; N≥2; after writing the i-th request sub-message into the second system variable, if it is detected that the second system variable has been successfully received by the ECU, clear the second system variable and write the (i + 1)-th request sub-message into the second system variable; 1≤i < N.

[0085] In one embodiment, the response receiving module 406 is further configured to, when the length of the diagnostic response message is greater than a second set length, split the diagnostic response message into M response sub-messages according to the second set length; M≥2; after writing the k-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clear the third system variable and write the (k + 1)-th response sub-message into the third system variable; 1≤k < M.

[0086] In one embodiment, the response receiving module 406 is further configured to, after writing the Mth response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnosis unit, clear the third system variable and adjust the value in the first system variable to the default value.

[0087] In one embodiment, the device further includes a configuration module;

[0088] The configuration module is configured to receive a configuration instruction, set at least one network node according to the configuration instruction, and configure the functional attributes of the at least one network node; the network node corresponds to a physical communication bus;

[0089] The request receiving module 402 is further configured to, under the control of the automated diagnosis unit, determine the target network node targeted by the automated diagnosis unit; in the case where the functional attribute of the target network node is the target attribute, perform the step of adjusting the value in the first system variable to a preset value and writing the diagnostic request message configured by the automated diagnosis unit into the second system variable.

[0090] In one embodiment, the communication bus includes any one of a FlexRay bus, a CAN bus, a LIN bus, and an Ethernet bus.

[0091] In one embodiment, as Figure 5 shown, there is provided an ECU diagnosis device, which is applied to an automated diagnosis unit, and the device includes:

[0092] A request sending module 502, configured to send a control instruction to a bus control unit; to instruct the bus control unit to trigger a jump of a first system variable, write the diagnostic request message configured by the automated diagnosis unit into a second system variable, send the second system variable to an ECU through a communication bus, receive a diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into a third system variable.

[0093] A reading module 504, configured to read the third system variable to obtain the diagnostic response message.

[0094] A diagnosis module 506, configured to perform ECU diagnosis according to the diagnostic response message.

[0095] Each module in the above ECU diagnosis device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in or independent of a processor in a computer device in a hardware form, or stored in a memory in a computer device in a software form, so as to be called by the processor to execute the operations corresponding to the above respective modules.

[0096] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as Figure 6 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an ECU diagnosis method.

[0097] Those skilled in the art can understand that Figure 6 the structure shown in

[0098] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0099] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the length of the diagnostic request message is greater than the first set length, split the diagnostic request message into N request sub-messages according to the first set length; N≥2; after writing the i-th request sub-message into the second system variable, if it is detected that the second system variable has been successfully received by the ECU, clear the second system variable and write the (i + 1)-th request sub-message into the second system variable; 1≤i<N.

[0100] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the length of the diagnostic response message is greater than the second set length, split the diagnostic response message into M response sub-messages according to the second set length; M≥2; after writing the k-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clear the third system variable and write the (k + 1)-th response sub-message into the third system variable; 1≤k<M.

[0101] In one embodiment, when the processor executes the computer program, the following steps are further implemented: after writing the M-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clear the third system variable and adjust the value in the first system variable to the default value.

[0102] In one embodiment, when the processor executes the computer program, the following steps are further implemented: receive a configuration instruction, set at least one network node according to the configuration instruction, and configure the functional attributes of the at least one network node; the network node corresponds to the physical communication bus; under the control of the automated diagnostic unit, determine the target network node targeted by the automated diagnostic unit; when the functional attribute of the target network node is the target attribute, execute the steps of adjusting the value in the first system variable to a preset value and writing the diagnostic request message configured by the automated diagnostic unit into the second system variable.

[0103] In one embodiment, when the processor executes the computer program, the following steps are further implemented: send a control instruction to the bus control unit; to instruct the bus control unit to trigger a jump of the first system variable, write the diagnostic request message configured by the automated diagnostic unit into the second system variable, send the second system variable to the ECU through the communication bus, receive the diagnostic response message sent by the ECU from the communication bus, write the diagnostic response message into the third system variable; read the third system variable to obtain the diagnostic response message; perform ECU diagnosis according to the diagnostic response message.

[0104] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: under the control of an automated diagnostic unit, adjust the value in the first system variable to a preset value, and write the diagnostic request message configured by the automated diagnostic unit into the second system variable; when it is detected that the first system variable jumps to the preset value, send the second system variable to the ECU via a communication bus; receive a diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into a third system variable; the third system variable is used to respond to the read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message.

[0105] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the length of the diagnostic request message is greater than a first set length, split the diagnostic request message into N request sub-messages according to the first set length; N≥2; after writing the i-th request sub-message into the second system variable, if it is detected that the second system variable has been successfully received by the ECU, clear the second system variable and write the (i + 1)-th request sub-message into the second system variable; 1≤i less than N.

[0106] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the length of the diagnostic response message is greater than a second set length, split the diagnostic response message into M response sub-messages according to the second set length; M≥2; after writing the k-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clear the third system variable and write the (k + 1)-th response sub-message into the third system variable; 1≤k less than M.

[0107] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: after writing the M-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clear the third system variable and adjust the value in the first system variable to the default value.

[0108] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: receiving a configuration instruction, setting at least one network node according to the configuration instruction, and configuring functional attributes of the at least one network node; the network node corresponding to a physical communication bus; under the control of an automated diagnosis unit, determining a target network node targeted by the automated diagnosis unit; in a case where the functional attribute of the target network node is a target attribute, performing the step of adjusting a value in a first system variable to a preset value and writing a diagnostic request message configured by the automated diagnosis unit into a second system variable.

[0109] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: sending a control instruction to a bus control unit; to instruct the bus control unit to trigger a jump of a first system variable, writing a diagnostic request message configured by the automated diagnosis unit into a second system variable, sending the second system variable to an ECU via a communication bus, receiving a diagnostic response message sent by the ECU from the communication bus, and writing the diagnostic response message into a third system variable; reading the third system variable to obtain the diagnostic response message; performing ECU diagnosis according to the diagnostic response message.

[0110] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0111] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.

[0112] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0113] The above-described embodiments merely represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. An ECU diagnosis method, characterized in that, The method is applied to a bus control unit, and the method includes: Under the control of an automated diagnostic unit, adjust the value in a first system variable to a preset value, and write a diagnostic request message configured by the automated diagnostic unit into a second system variable; When it is detected that the first system variable jumps to the preset value, send the second system variable to an ECU via a communication bus; Receive a diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into a third system variable; the third system variable is used to respond to a read operation of the automated diagnostic unit, and transfer the diagnostic response message to the automated diagnostic unit to instruct the automated diagnostic unit to perform ECU diagnosis according to the diagnostic response message.

2. The method according to claim 1, wherein The step of writing the diagnostic request message into the second system variable includes: When the length of the diagnostic request message is greater than a first set length, split the diagnostic request message into N request sub-messages according to the first set length; N≥2; After writing the i-th request sub-message into the second system variable, if it is detected that the second system variable has been successfully received by the ECU, clear the second system variable and write the (i + 1)-th request sub-message into the second system variable; 1≤i < N.

3. The method according to claim 1, wherein The step of writing the diagnostic response message into the third system variable includes: When the length of the diagnostic response message is greater than a second set length, split the diagnostic response message into M response sub-messages according to the second set length; M≥2; After writing the k-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clear the third system variable and write the (k + 1)-th response sub-message into the third system variable; 1≤k < M.

4. The method according to claim 3, wherein After the step of writing the diagnostic response message into the third system variable, the method further includes: After writing the M-th response sub-message into the third system variable, if it is detected that the third system variable has been successfully received by the automated diagnostic unit, clear the third system variable and adjust the value in the first system variable to a default value.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Receive a configuration instruction, set at least one network node according to the configuration instruction, and configure functional attributes of the at least one network node; the network node corresponds to a physical communication bus; Under the control of an automated diagnostic unit, determine a target network node targeted by the automated diagnostic unit; When the functional attribute of the target network node is a target attribute, perform the steps of adjusting the value in the first system variable to a preset value and writing a diagnostic request message configured by the automated diagnostic unit into the second system variable.

6. The method according to any one of claims 1 to 4, characterized in that, The communication bus includes any one of a FlexRay bus, a CAN bus, a LIN bus, and an Ethernet bus.

7. An ECU diagnosis method, characterized in that, The method is applied to an automated diagnostic unit, and the method includes: Send a control instruction to the bus control unit; instruct the bus control unit to trigger a jump of the first system variable, write the diagnostic request message configured by the automation diagnosis unit into the second system variable, send the second system variable to the ECU via the communication bus, receive the diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into the third system variable; Read the third system variable to obtain the diagnostic response message; Perform ECU diagnosis according to the diagnostic response message.

8. An ECU diagnostic device, characterized in that, The device is applied to a bus control unit, and the device includes: A request receiving module, configured to, under the control of the automation diagnosis unit, adjust the value in the first system variable to a preset value, and write the diagnostic request message configured by the automation diagnosis unit into the second system variable; A transmission module, configured to, when detecting that the first system variable jumps to the preset value, send the second system variable to the ECU via the communication bus; A response receiving module, configured to receive the diagnostic response message sent by the ECU from the communication bus, and write the diagnostic response message into the third system variable; the third system variable is used to respond to the read operation of the automation diagnosis unit, and transfer the diagnostic response message to the automation diagnosis unit to instruct the automation diagnosis unit to perform ECU diagnosis according to the diagnostic response message.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.