Diagnostic method and system for ECU (Electronic Control Unit) of vehicle machine
By introducing the DoIP protocol stack module into the vehicle's ECU, the vehicle's ECU can support DoIP diagnostics, which solves the problem of the single diagnostic method in the existing technology and improves diagnostic efficiency.
Patent Information
- Application Number
- CN202410916414.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-05
AI Technical Summary
Existing vehicle ECUs only support CAN diagnostics, which limits the diagnostic methods and makes it difficult to adapt to more diagnostic scenarios, resulting in low diagnostic efficiency.
By introducing a DoIP protocol stack module into the vehicle's ECU, it responds to requests from the DoIP diagnostic tool, sends and receives UDS messages, and processes them on the vehicle's MCU, enabling the vehicle's ECU to support DoIP diagnostics. It also supports CAN diagnostics, enhancing diagnostic capabilities.
It enables the vehicle ECU to support both CAN and DoIP diagnostics, adapting to more diagnostic scenarios and improving diagnostic efficiency.
Smart Images

Figure CN118897530A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle computer diagnosis, and in particular to a method and system for diagnosing a vehicle computer ECU. Background Art
[0002] The vehicle ECU (Electronic Control Unit) is one of the core electronic components of modern automobiles. The function of the ECU is to monitor various input data and various operating conditions of the vehicle at any time, and calculate the information sent by various sensors according to a pre-designed program. After processing, the various parameters are sent to the relevant actuators to perform various predetermined control functions. The vehicle ECU is an indispensable key component for the normal operation of the vehicle, and the diagnostic function of the vehicle ECU is needed to ensure the safe operation of the vehicle.
[0003] At present, the vehicle ECU mainly supports the CAN (Controller Area Network) diagnostic function, that is, locating and solving faults through the CAN bus to ensure the normal operation of the vehicle CAN network.
[0004] However, the vehicle ECU only supports CAN diagnostic functions, and the diagnostic method is relatively simple, which makes it difficult to adapt to more diagnostic scenario requirements, resulting in low diagnostic efficiency. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a diagnostic method and system for a vehicle ECU, which sends a UDS message to the vehicle ECU in response to a DoIP network diagnostic request sent by a DoIP diagnostic instrument through a DoIP protocol stack module, and sends the DoIP diagnostic message responded by the vehicle ECU to the DoIP diagnostic instrument after receiving it, thereby realizing the support of the vehicle ECU for DoIP diagnosis, so that the vehicle ECU supports both CAN diagnosis and DoIP diagnosis, and can adapt to more diagnostic scenarios, thereby improving the diagnostic efficiency. In the first aspect, an embodiment of the present application provides a diagnostic method for a vehicle ECU, which is applied to the vehicle ECU, the vehicle ECU includes a processor module and a vehicle MCU, a DoIP application module runs on the processor module, and the DoIP application module includes a DoIP protocol stack module and a vehicle-mounted device hardware abstraction layer client module; the diagnostic method includes:
[0006] The DoIP protocol stack module responds to receiving a DoIP network diagnostic request sent by an external DoIP diagnostic instrument by sending a UDS message corresponding to the DoIP network diagnostic request to the vehicle-mounted device hardware abstraction layer client module;
[0007] The DoIP protocol stack module calls the interface provided by the vehicle-mounted device hardware abstraction layer client module to perform secondary packaging on the UDS message to obtain a processed UDS message, and sends the processed UDS message to the vehicle-mounted device hardware abstraction layer client module through the vehicle-mounted device hardware abstraction layer client module;
[0008] After the vehicle MCU performs corresponding operations according to the received UDS message, it determines a DoIP diagnostic message in response to the UDS message, and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message.
[0009] In a possible implementation manner, the vehicle ECU diagnosis method further includes:
[0010] In response to receiving a CAN diagnostic request sent by an external CAN diagnostic instrument, the vehicle computer MCU sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
[0011] In a possible implementation manner, the DoIP application module further includes a fault collection module, and the vehicle ECU diagnosis method further includes:
[0012] The fault collection module acquires target fault data of a target device; wherein the target device includes at least a central control and an instrument;
[0013] The target fault data is sent to the vehicle MCU based on a preset private protocol, so that the vehicle MCU obtains a UDS diagnostic fault table based on the target fault data.
[0014] In a possible implementation manner, the vehicle ECU diagnosis method further includes:
[0015] When the DoIP diagnostic instrument and / or the CAN diagnostic instrument are used to perform a diagnostic query on the target device, all fault states of the target device are acquired based on the UDS diagnostic fault table.
[0016] In a possible implementation manner, the sending the target fault data to the vehicle MCU based on a preset private protocol includes:
[0017] Acquire a corresponding fault status message based on the target fault data;
[0018] The fault status message is sent to the vehicle MCU.
[0019] In a possible implementation manner, the vehicle ECU further includes a vehicle-mounted device hardware abstraction layer service module, and the sending of the processed UDS message to the vehicle MCU includes:
[0020] Sending the UDS message to the vehicle-mounted device hardware abstraction layer service module;
[0021] The vehicle-mounted device hardware abstraction layer service module sends the UDS message to the vehicle computer MCU based on a preset logical channel.
[0022] In a possible implementation manner, sending the DoIP diagnostic message to the DoIP diagnostic instrument includes:
[0023] The vehicle MCU sends the DoIP diagnostic message to the vehicle-mounted device hardware abstraction layer service module;
[0024] In response to receiving the DoIP diagnostic message, the vehicle-mounted device hardware abstraction layer service module sends the DoIP diagnostic message to the vehicle-mounted device hardware abstraction layer client module, so that the vehicle-mounted device hardware abstraction layer client module sends the DoIP diagnostic message to the DoIP diagnostic instrument.
[0025] In a second aspect, an embodiment of the present application further provides a vehicle ECU diagnostic system, the vehicle ECU diagnostic system comprising the vehicle ECU, an external DoIP diagnostic instrument and a CAN diagnostic instrument; the diagnostic system is used to:
[0026] The vehicle ECU, in response to receiving the DoIP network diagnostic request sent by the DoIP diagnostic instrument, determines a corresponding DoIP diagnostic message based on the DoIP network diagnostic request and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message;
[0027] In response to receiving a CAN diagnostic request sent by the CAN diagnostic instrument, the vehicle ECU sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
[0028] In a third aspect, an embodiment of the present application further provides a vehicle MCU, wherein the vehicle MCU includes a preset UDS protocol stack module; the vehicle MCU is used to:
[0029] Receiving a UDS message corresponding to a DoIP network diagnostic request from an external DoIP diagnostic instrument and determining a DoIP diagnostic message in response to the UDS message, and sending the DoIP diagnostic message to the DoIP diagnostic instrument so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message;
[0030] A CAN diagnostic request sent by an external CAN diagnostic instrument is received, and a CAN diagnostic message for the CAN diagnostic request is sent to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
[0031] In a fourth aspect, an embodiment of the present application further provides a vehicle, the vehicle comprising a vehicle ECU diagnostic system, the vehicle ECU diagnostic system comprising the vehicle ECU, an external DoIP diagnostic instrument and a CAN diagnostic instrument; the vehicle is used for:
[0032] The vehicle ECU, in response to receiving the DoIP network diagnostic request sent by the DoIP diagnostic instrument, determines a corresponding DoIP diagnostic message based on the DoIP network diagnostic request and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message;
[0033] In response to receiving a CAN diagnostic request sent by the CAN diagnostic instrument, the vehicle ECU sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
[0034] A diagnostic method and system for a vehicle ECU provided in an embodiment of the present application are applied to the vehicle ECU. The vehicle ECU includes a processor module and a vehicle MCU. A DoIP application module runs on the processor module. The DoIP application module includes a DoIP protocol stack module and a vehicle-mounted device hardware abstraction layer client module. The DoIP protocol stack module responds to a DoIP network diagnostic request received from an external DoIP diagnostic instrument, and sends a UDS message corresponding to the DoIP network diagnostic request to the vehicle-mounted device hardware abstraction layer client module. The DoIP protocol stack module calls an interface provided by the vehicle-mounted device hardware abstraction layer client module to perform secondary packaging of the UDS message to obtain a processed UDS message, and sends the processed UDS message to the vehicle-mounted device MCU through the vehicle-mounted device hardware abstraction layer client module. After the vehicle-mounted MCU performs corresponding operations based on the received UDS message, it determines a DoIP diagnostic message in response to the UDS message, and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message. In this application, the DoIP protocol stack module sends the UDS message to the vehicle ECU in response to the DoIP network diagnostic request sent by the DoIP diagnostic instrument, and sends the DoIP diagnostic message responded by the vehicle ECU to the DoIP diagnostic instrument after receiving it, so as to realize the support of the vehicle ECU for DoIP diagnosis, so that the vehicle ECU supports CAN diagnosis and DoIP diagnosis at the same time, and can adapt to more diagnostic scenarios, thereby improving the diagnostic efficiency. In order to make the above-mentioned purposes, features and advantages of this application more obvious and easy to understand, the following is a preferred embodiment, and is described in detail in conjunction with the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 is a flow chart of a diagnostic method for a vehicle ECU according to an embodiment of the present application;
[0037] Figure 2 This is a flow chart of the vehicle ECU's diagnosis process;
[0038] Figure 3 is a flow chart of a diagnostic method for a vehicle ECU according to another embodiment of the present application;
[0039] Figure 4 It is a schematic diagram of the private protocol between the fault collection module and the MCU;
[0040] Figure 5 is a flow chart of a diagnostic method for a vehicle ECU according to another embodiment of the present application;
[0041] Figure 6 is a flow chart of a diagnostic method for a vehicle ECU according to another embodiment of the present application;
[0042] Figure 7 This is a timing diagram of the vehicle ECU performing diagnosis;
[0043] Figure 8 is a structural schematic diagram of a vehicle ECU diagnostic system according to an embodiment of the present application;
[0044] Fig. 9 is a structural diagram of a vehicle machine MCU according to an embodiment of the present application;
[0045] Fig.10 It is a schematic diagram of the structure of a vehicle according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0047] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0048] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0049] Considering that the vehicle ECU is one of the core electronic components of modern automobiles, the function of the ECU is to monitor various input data and various operating states of the vehicle at any time, and calculate the information sent by various sensors according to the pre-designed program. After processing, the various parameters are sent to the relevant actuators to perform various predetermined control functions. The vehicle ECU is an indispensable key component for the normal operation of the vehicle, and the diagnostic function of the vehicle ECU is required to ensure the safe operation of the vehicle. It can be understood by those skilled in the art that the vehicle ECU refers to the entire system that constitutes the vehicle, which usually includes two hardware modules: SoC (System on a Chip) and MCU (Microcontroller Unit), among which SoC is used to run the Android system, and MCU is used to run RTOS (Real Time Operating System) to achieve functions such as power management, CAN communication and diagnosis.
[0050] At present, the vehicle ECU mainly supports the CAN diagnostic function, that is, locating and solving faults through the CAN bus to ensure the normal operation of the vehicle CAN network. However, the vehicle ECU only supports the CAN diagnostic function, and the diagnostic method is relatively simple, which is difficult to adapt to more diagnostic scenario requirements, resulting in low diagnostic efficiency.
[0051] To address this problem, the present application provides a diagnostic method and system for a vehicle ECU, which sends UDS messages to the vehicle ECU in response to the DoIP network diagnostic request sent by the DoIP diagnostic instrument through the DoIP protocol stack module, and sends the DoIP diagnostic message in response to the vehicle ECU to the DoIP diagnostic instrument, thereby realizing the support of the vehicle ECU for DoIP diagnosis, so that the vehicle ECU supports CAN diagnosis and DoIP diagnosis at the same time, can adapt to more diagnostic scenarios, and thus improve diagnostic efficiency.
[0052] Figure 1 It is a flow chart of a diagnostic method for a vehicle ECU according to an embodiment of the present application, the method is applied to the vehicle ECU, the vehicle ECU includes a processor module and a vehicle MCU, the processor module runs a DoIP application module, the DoIP application module includes a DoIP protocol stack module, and a vehicle-mounted device hardware abstraction layer client module; Figure 1 As shown, the diagnostic method of the vehicle ECU of the embodiment of the present application may specifically include:
[0053] S101, in response to receiving a DoIP network diagnosis request sent by an external DoIP diagnostic instrument, the DoIP protocol stack module sends a UDS message corresponding to the DoIP network diagnosis request to the vehicle-mounted device hardware abstraction layer client module.
[0054] It is understood by those skilled in the art that DoIP (Diagnostic on IP) is a diagnostic communication technology based on IP (vehicle communication bus medium), which uses TCP / IP and Ethernet to implement diagnostic services introduced via UDS (Unified Diagnostic Services). UDS is a set of diagnostic and communication protocols defined in the ISO 14229 standard for communication and diagnosis between ECUs.
[0055] It should be noted that if Figure 2 As shown, the vehicle ECU includes a processor module (SOC side) and a vehicle MCU (MCU side). This application places the core implementation of the UDS protocol stack on the MCU side and runs the DoIP application module (DoIP APP program) on the SOC side. The DoIP APP includes the DoIP protocol stack module ( Figure 2 doip server protocol stack module in the vehicle equipment hardware abstraction layer client module ( Figure 2 The DoIP protocol stack module is used to implement the function of the doip server, and the vehicle-mounted MCU is used to implement and maintain all functions of the UDS protocol stack, the UDS state machine, and the function of providing UDS diagnosis to the outside world.
[0056] In the embodiment of the present application, the DoIP diagnostic instrument is an instrument used for DoIP diagnosis outside the vehicle ECU, for example, Figure 2 The tester1 shown in the figure represents the DoIP diagnostic instrument, the DoIP network diagnostic request is the request for DoIP network diagnosis sent by the DoIP diagnostic instrument, the UDS message is the UDS standard message corresponding to the DoIP network diagnostic request, the DoIP protocol stack module receives and responds to the DoIP network diagnostic request sent by the DoIP diagnostic instrument, and sends the UDS message corresponding to the DoIP network diagnostic request to the vehicle-mounted device hardware abstraction layer client module, for example, Figure 2 As shown, tester1 sends a DoIP network diagnostic request to the doipserver protocol stack module, the doip server protocol stack module receives and responds to the DoIP network diagnostic request, and sends the corresponding UDS message to the vhal_client module.
[0057] Optionally, the DoIP network diagnosis request is parsed to obtain a corresponding UDS message.
[0058] S102, the DoIP protocol stack module calls the interface provided by the vehicle-mounted device hardware abstraction layer client module to re-packetize the UDS message to obtain a processed UDS message, and sends the processed UDS message to the vehicle machine MCU through the vehicle-mounted device hardware abstraction layer client module.
[0059] In the embodiment of the present application, the DoIP protocol stack module calls the interface of the vehicle-mounted device hardware abstraction layer client module to re-pack the UDS message obtained in step S1O1, and then sends it to the vehicle MCU through the vehicle-mounted device hardware abstraction layer client module, for example, Figure 2 As shown, the doip server protocol stack module calls the interface provided by the vhal_client module to re-packetize the UDS message corresponding to the DoIP network diagnostic request of the standard UDS, and transmits it to the MCU built into the vehicle through the vhal_client module for subsequent processing.
[0060] S103, after the vehicle MCU performs corresponding operations according to the received UDS message, it determines a DoIP diagnostic message in response to the UDS message, and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message.
[0061] In the embodiment of the present application, the DoIP diagnostic message is the DoIP diagnostic message sent by the vehicle MCU after receiving and responding to the UDS message. After receiving the processed UDS message sent by the DoIP protocol stack module, the vehicle MCU responds to the UDS message to determine the corresponding DoIP diagnostic message, and sends the DoIP diagnostic message to the external DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP network diagnosis after receiving the DoIP diagnostic message. For example, Figure 2 As shown, after receiving and responding to the UDS message, the MCU sends a DoIP message to tester1, so that tester1 performs DoIP diagnosis according to the DoIP message.
[0062] It is understandable that the car ECU implements support for DoIP diagnosis, and the car ECU natively supports CAN diagnosis, because the car ECU can support both DoIP diagnosis and CAN diagnosis.
[0063] The embodiment of the present application provides a diagnostic method for a vehicle ECU, wherein the vehicle ECU includes a processor module and a vehicle MCU, a DoIP application module is run on the processor module, and the DoIP application module includes a DoIP protocol stack module and a vehicle-mounted device hardware abstraction layer client module; the method includes: the DoIP protocol stack module responds to a DoIP network diagnostic request sent by an external DoIP diagnostic instrument, and sends a UDS message corresponding to the DoIP network diagnostic request to the vehicle-mounted device hardware abstraction layer client module, the DoIP protocol stack module calls the interface provided by the vehicle-mounted device hardware abstraction layer client module to perform secondary packaging of the UDS message to obtain a processed UDS message, and sends the processed UDS message to the vehicle-mounted device MCU through the vehicle-mounted device hardware abstraction layer client module, after the vehicle-mounted device MCU performs corresponding operations according to the received UDS message, it determines a DoIP diagnostic message in response to the UDS message, and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message. The diagnostic method of the vehicle ECU of the present application sends a UDS message to the vehicle ECU in response to a DoIP network diagnostic request sent by a DoIP diagnostic instrument through a DoIP protocol stack module, and sends the DoIP diagnostic message responded by the vehicle ECU to the DoIP diagnostic instrument after receiving it, thereby realizing the support of the vehicle ECU for DoIP diagnosis, so that the vehicle ECU supports CAN diagnosis and DoIP diagnosis at the same time, can adapt to more diagnostic scenarios, and thus improves diagnostic efficiency.
[0064] Furthermore, the diagnostic method of the vehicle ECU in the embodiment of the present application may further include the following steps:
[0065] In response to receiving a CAN diagnostic request sent by an external CAN diagnostic instrument, the vehicle computer MCU sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
[0066] In the embodiment of the present application, the CAN diagnostic instrument is an instrument used for CAN diagnosis outside the vehicle ECU, for example, Figure 2 The tester2 shown in the figure represents a CAN diagnostic instrument, a CAN diagnostic request is a request for CAN diagnostics sent by the CAN diagnostic instrument, and a CAN diagnostic message is a diagnostic message sent by the vehicle MCU in response to the CAN diagnostic request. The vehicle MCU receives and responds to the CAN diagnostic request sent by the CAN diagnostic instrument, and sends the corresponding CAN diagnostic message to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis according to the CAN diagnostic message after receiving the CAN diagnostic message. For example, Figure 2As shown, tester2 sends a CAN diagnostic request to the MCU, the MCU receives and responds to the CAN diagnostic request, and sends the corresponding CAN diagnostic message to tester2.
[0067] It should be noted that the DoIP application module also includes a fault collection module. Figure 2 As shown, this is the "fault status collection" module included in the doip app.
[0068] Further, such as Figure 3 As shown, the diagnostic method of the vehicle ECU in the embodiment of the present application may further include the following steps:
[0069] S301, a fault collection module obtains target fault data of a target device.
[0070] In an embodiment of the present application, the target device includes at least a central control and an instrument. The target fault data is the fault data of the target device, such as data on the fault status. The fault collection module is a fault collection module that mainly collects various fault statuses on the central control side and the instrument side (for example, whether the main and auxiliary screens are abnormal, whether the camera is normal, whether Bluetooth and wifi are normal, etc.). The vehicle MCU itself cannot collect these fault statuses, so a fault collection module is required to collect them. Based on the fault collection module, the target fault data of the target device is collected and acquired for subsequent processing.
[0071] S302, sending the target fault data to the vehicle computer MCU based on a preset private protocol, so that the vehicle computer MCU obtains a UDS diagnostic fault table based on the target fault data.
[0072] In the embodiment of the present application, the private protocol is a pre-set communication protocol, for example, part of the private protocol between the fault collection module and the MCU is as follows Figure 4 As shown, the UDS diagnostic fault table is the UDSDTC (Diagnostic Trouble Code) fault table. After the fault collection module collects the fault status, that is, obtains the target fault data, it sends it to the vehicle MCU through a private protocol, so that the vehicle MCU obtains the UDS diagnostic fault table based on the target fault data, that is, summarizes it into the UDSDTC fault table.
[0073] It should be noted that the present application does not impose too many restrictions on the specific method of sending the target fault data to the vehicle MCU, and it can be set according to actual conditions.
[0074] As a possible implementation method, a corresponding fault status message is obtained based on the target fault data; and the fault status message is sent to the vehicle MCU. Optionally, the fault status is obtained based on the target fault data, and the corresponding fault status message is determined based on the fault status. Among them, the target fault data and the fault status message are corresponding, and specifically, the fault status and the fault status message are one-to-one corresponding. After obtaining the fault status message based on the target fault data, the fault collection module sends the fault status message to the vehicle MCU for processing.
[0075] It should be noted that the vehicle ECU also includes a vehicle equipment hardware abstraction layer service module, for example Figure 2 As shown, the vehiclehal service module represents the vehicle device hardware abstraction layer service module of the present application. It can be understood that the vehiclehal service is a data exchange function specially provided for the Android vehicle system. The vhal_client module is used to establish a connection with the vehiclehal service module to realize cross-process data exchange. Specifically, for example, Figure 2 As shown, the fault collection module sends the fault status message to the vhal_client module, and sends the fault status message to the MCU through the vhal_client module and the vehiclehal service module.
[0076] Furthermore, the diagnostic method of the vehicle ECU in the embodiment of the present application may further include the following steps:
[0077] When a diagnostic query is performed on a target device using a DoIP diagnostic instrument and / or a CAN diagnostic instrument, all fault states of the target device are acquired based on the UDS diagnostic fault table.
[0078] In the embodiment of the present application, when a diagnostic query is performed on a target device through a diagnostic instrument, all fault states of the target device are acquired based on the UDS diagnostic fault table.
[0079] Further, such as Figure 5 As shown, the "sending the processed UDS message to the vehicle MCU" in step S102 in the above embodiment may specifically include the following steps:
[0080] S501, sending the UDS message to the vehicle-mounted device hardware abstraction layer service module.
[0081] In the embodiment of the present application, the DoIP protocol stack module sends the processed UDS message to the vehicle-mounted device hardware abstraction layer service module through the vehicle-mounted device hardware abstraction layer client module for subsequent processing. Figure 2As shown, the doipserver protocol stack module sends the UDS message to the vhal_client module, and sends the UDS message to the vehiclehal service module through the vhal_client module.
[0082] S502, the vehicle-mounted device hardware abstraction layer service module sends the UDS message to the vehicle computer MCU based on a preset logical channel.
[0083] In the embodiment of the present application, the logical channel is a pre-set logical channel between the vehicle-mounted device hardware abstraction layer service module and the vehicle-mounted MCU. After receiving the UDS message sent by the DoIP protocol stack through the vehicle-mounted device hardware abstraction layer client module, the vehicle-mounted device hardware abstraction layer service module sends the UDS message to the vehicle-mounted MCU based on the preset logical channel. Figure 2 As shown in FIG. 1 , the vehiclehal service module sends the UDS message to the MCU.
[0084] Further, such as Figure 6 As shown, the "sending the DoIP diagnostic message to the DoIP diagnostic instrument" in step S103 in the above embodiment may specifically include the following steps:
[0085] S601, the vehicle MCU sends the DoIP diagnostic message to the vehicle device hardware abstraction layer service module.
[0086] In the embodiment of the present application, the vehicle MCU sends the DoIP diagnostic message determined in response to the UDS message to the vehicle-mounted device hardware abstraction layer service module for subsequent processing. Figure 2 As shown, the MCU sends the doip message to the vehiclehal service module.
[0087] S602, in response to receiving the DoIP diagnostic message, the vehicle-mounted device hardware abstraction layer service module sends the DoIP diagnostic message to the vehicle-mounted device hardware abstraction layer client module, so that the vehicle-mounted device hardware abstraction layer client module sends the DoIP diagnostic message to the DoIP diagnostic instrument.
[0088] In the embodiment of the present application, after receiving the DoIP diagnostic message sent by the vehicle MCU, the vehicle-mounted device hardware abstraction layer service module responds to the DoIP diagnostic message and sends the DoIP diagnostic message to the vehicle-mounted device hardware abstraction layer client module, so that the vehicle-mounted device hardware abstraction layer client module sends the DoIP diagnostic message to the DoIP diagnostic instrument. Specifically, the vehicle-mounted device hardware abstraction layer client module sends the DoIP diagnostic message to the DoIP diagnostic instrument through the DoIP protocol stack module. For example, Figure 2As shown, the vehiclehal service module sends the doip message to the vhal_client module. After receiving the doip message, the vhal_client module sends the doip message to tester1 through the doip server protocol stack module.
[0089] To better describe the diagnostic method of the vehicle ECU of the present application, the following is combined with Figure 7 Give an example description.
[0090] like Figure 2 and Figure 7 As shown, the doip app program first calls the register function of the doip sdk to register multiple callback functions, and calls the init function of the doip sdk to pull up the doip sdk (create an event loop internally, receive network requests, etc.). When an external network diagnostic tester requests diagnostic information, taking session switching as an example, the doip sdk receives the network request, parses it into a standard uds request, and calls back the registered function (containing input parameters (standard uds request) and output parameters (uds response)). When each callback function is executed, it will call the vhal_client class (vhal_client module 3) to send the input parameter (standard uds request) to the mcu, and synchronously wait for the final uds response of the mcu. After receiving the response from the mcu, the callback function filled with the response is output, and the callback ends. After the callback ends, the doip sdk gets the final uds response from the output parameter, and encapsulates the response into a doip message, i.e., a DoIP diagnostic message, and sends it to the external diagnostic tester.
[0091] Figure 8 800 is a structural diagram of a vehicle ECU diagnostic system according to an embodiment of the present application. The vehicle ECU diagnostic system 800 includes a vehicle ECU 801, an external DoIP diagnostic instrument 802 and a CAN diagnostic instrument 803. Figure 8 As shown, the diagnostic system of the vehicle ECU of the embodiment of the present application is used for the following steps:
[0092] In response to receiving the DoIP network diagnosis request sent by the DoIP diagnosis instrument 802, the vehicle ECU 801 determines the corresponding DoIP diagnosis message based on the DoIP network diagnosis request and sends the DoIP diagnosis message to the DoIP diagnosis instrument 802, so that the DoIP diagnosis instrument 802 performs DoIP diagnosis based on the DoIP diagnosis message;
[0093] In response to receiving the CAN diagnostic request sent by the CAN diagnostic instrument 803 , the vehicle ECU 801 sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument 803 , so that the CAN diagnostic instrument 803 performs CAN diagnosis based on the CAN diagnostic message.
[0094] It should be noted here that the above explanation of the embodiment of the diagnostic method for the vehicle ECU is also applicable to the diagnostic system for the vehicle ECU of the embodiment of the present application, and the specific process will not be repeated here.
[0095] The diagnostic system of the vehicle ECU provided in the embodiment of the present application is that the vehicle ECU responds to receiving a DoIP network diagnostic request sent by a DoIP diagnostic instrument, determines the corresponding DoIP diagnostic message based on the DoIP network diagnostic request and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message; the vehicle ECU responds to receiving a CAN diagnostic request sent by a CAN diagnostic instrument, and sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message. The diagnostic system of the vehicle ECU of the present application sends a UDS message to the vehicle ECU in response to the DoIP network diagnostic request sent by the DoIP diagnostic instrument through the DoIP protocol stack module, and sends the DoIP diagnostic message responded by the vehicle ECU to the DoIP diagnostic instrument after receiving it, thereby realizing the support of the vehicle ECU for DoIP diagnosis, so that the vehicle ECU supports both CAN diagnosis and DoIP diagnosis, can adapt to more diagnostic scenarios, and thus improves diagnostic efficiency.
[0096] Fig. 9 is a structural diagram of a vehicle MCU according to an embodiment of the present application, wherein the vehicle MCU 900 includes a preset UDS protocol stack module 901; Fig. 9 As shown, the vehicle machine MCU 900 of the embodiment of the present application is used for the following steps:
[0097] Receive a UDS message corresponding to a DoIP network diagnostic request from an external DoIP diagnostic instrument 802 and determine a DoIP diagnostic message in response to the UDS message, and send the DoIP diagnostic message to the DoIP diagnostic instrument 802, so that the DoIP diagnostic instrument 802 performs DoIP diagnosis based on the DoIP diagnostic message;
[0098] A CAN diagnostic request sent by an external CAN diagnostic instrument 803 is received, and a CAN diagnostic message for the CAN diagnostic request is sent to the CAN diagnostic instrument 803, so that the CAN diagnostic instrument 803 performs CAN diagnosis based on the CAN diagnostic message.
[0099] It should be noted here that the above explanation of the embodiment of the diagnostic method for the vehicle ECU is also applicable to the vehicle MCU of the embodiment of the present application, and the specific process will not be repeated here.
[0100] The vehicle MCU provided in the embodiment of the present application receives the UDS message corresponding to the DoIP network diagnostic request of the external DoIP diagnostic instrument and determines the DoIP diagnostic message in response to the UDS message, and sends the DoIP diagnostic message to the DoIP diagnostic instrument so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message; receives the CAN diagnostic request sent by the external CAN diagnostic instrument, and sends the CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message. The vehicle MCU of the present application sends the UDS message to the vehicle ECU in response to the DoIP network diagnostic request sent by the DoIP diagnostic instrument through the DoIP protocol stack module, and sends the DoIP diagnostic message in response to the vehicle ECU to the DoIP diagnostic instrument after receiving it, thereby realizing the support of the vehicle ECU for DoIP diagnosis, so that the vehicle ECU supports both CAN diagnosis and DoIP diagnosis, and can adapt to more diagnostic scenarios, thereby improving diagnostic efficiency.
[0101] Fig.10 1 is a schematic diagram of the structure of a vehicle according to an embodiment of the present application, wherein the vehicle 1000 includes a vehicle ECU diagnostic system 800, and the vehicle ECU diagnostic system 800 includes a vehicle ECU 801, an external DoIP diagnostic instrument 802, and a CAN diagnostic instrument 803; Fig.10 As shown, the vehicle 1000 of the embodiment of the present application is used for the following steps:
[0102] In response to receiving the DoIP network diagnosis request sent by the DoIP diagnosis instrument 802, the vehicle ECU 801 determines the corresponding DoIP diagnosis message based on the DoIP network diagnosis request and sends the DoIP diagnosis message to the DoIP diagnosis instrument 802, so that the DoIP diagnosis instrument 802 performs DoIP diagnosis based on the DoIP diagnosis message;
[0103] In response to receiving the CAN diagnostic request sent by the CAN diagnostic instrument 803 , the vehicle ECU 801 sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument 803 , so that the CAN diagnostic instrument 803 performs CAN diagnosis based on the CAN diagnostic message.
[0104] It should be noted here that the above explanation of the embodiment of the diagnostic method for the vehicle ECU is also applicable to the vehicle of the embodiment of the present application, and the specific process will not be repeated here.
[0105] In the vehicle provided by the embodiment of the present application, the vehicle ECU responds to receiving a DoIP network diagnostic request sent by the DoIP diagnostic instrument, determines the corresponding DoIP diagnostic message based on the DoIP network diagnostic request and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message; the vehicle ECU responds to receiving a CAN diagnostic request sent by the CAN diagnostic instrument, and sends the CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message. The vehicle of the present application sends a UDS message to the vehicle ECU in response to the DoIP network diagnostic request sent by the DoIP diagnostic instrument through the DoIP protocol stack module, and sends the DoIP diagnostic message in response to the vehicle ECU to the DoIP diagnostic instrument after receiving it, thereby realizing the vehicle ECU's support for DoIP diagnosis, so that the vehicle ECU supports both CAN diagnosis and DoIP diagnosis, can adapt to more diagnostic scenarios, and thus improves diagnostic efficiency.
[0106] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0107] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0108] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0109] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the deployment method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0110] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A diagnostic method for a vehicle ECU, characterized in that: Applied to a vehicle ECU, the vehicle ECU includes a processor module and a vehicle MCU, the processor module runs a DoIP application module, the DoIP application module includes a DoIP protocol stack module and a vehicle-mounted device hardware abstraction layer client module; the diagnostic method includes: The DoIP protocol stack module responds to receiving a DoIP network diagnostic request sent by an external DoIP diagnostic instrument by sending a UDS message corresponding to the DoIP network diagnostic request to the vehicle-mounted device hardware abstraction layer client module; The DoIP protocol stack module calls the interface provided by the vehicle-mounted device hardware abstraction layer client module to perform secondary packaging on the UDS message to obtain a processed UDS message, and sends the processed UDS message to the vehicle-mounted device hardware abstraction layer client module through the vehicle-mounted device hardware abstraction layer client module; After the vehicle MCU performs corresponding operations according to the received UDS message, it determines a DoIP diagnostic message in response to the UDS message, and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message.
2. The diagnostic method according to claim 1, characterized in that The method further comprises: In response to receiving a CAN diagnostic request sent by an external CAN diagnostic instrument, the vehicle computer MCU sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
3. The diagnostic method according to claim 2, characterized in that The DoIP application module also includes a fault collection module, and the method further includes: The fault collection module acquires target fault data of a target device; wherein the target device includes at least a central control and an instrument; The target fault data is sent to the vehicle MCU based on a preset private protocol, so that the vehicle MCU obtains a UDS diagnostic fault table based on the target fault data.
4. The diagnostic method according to claim 3, characterized in that: The method further comprises: When the DoIP diagnostic instrument and / or the CAN diagnostic instrument are used to perform a diagnostic query on the target device, all fault states of the target device are acquired based on the UDS diagnostic fault table.
5. The diagnostic method according to claim 3, characterized in that: The sending of the target fault data to the vehicle computer MCU based on a preset private protocol includes: Acquire a corresponding fault status message based on the target fault data; The fault status message is sent to the vehicle MCU.
6. The diagnostic method according to claim 1, characterized in that: The vehicle ECU also includes a vehicle equipment hardware abstraction layer service module, and the processing UDS message is sent to the vehicle MCU, including: Sending the UDS message to the vehicle-mounted device hardware abstraction layer service module; The vehicle-mounted device hardware abstraction layer service module sends the UDS message to the vehicle computer MCU based on a preset logical channel.
7. The diagnostic method according to claim 6, characterized in that: The step of sending the DoIP diagnostic message to the DoIP diagnostic instrument includes: The vehicle MCU sends the DoIP diagnostic message to the vehicle-mounted device hardware abstraction layer service module; In response to receiving the DoIP diagnostic message, the vehicle-mounted device hardware abstraction layer service module sends the DoIP diagnostic message to the vehicle-mounted device hardware abstraction layer client module, so that the vehicle-mounted device hardware abstraction layer client module sends the DoIP diagnostic message to the DoIP diagnostic instrument.
8. A diagnostic system for a vehicle ECU, characterized in that: The vehicle ECU diagnostic system includes the vehicle ECU, an external DoIP diagnostic instrument and a CAN diagnostic instrument; the diagnostic system is used for: The vehicle ECU, in response to receiving the DoIP network diagnostic request sent by the DoIP diagnostic instrument, determines a corresponding DoIP diagnostic message based on the DoIP network diagnostic request and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message; In response to receiving a CAN diagnostic request sent by the CAN diagnostic instrument, the vehicle ECU sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
9. A vehicle computer MCU, characterized in that: The vehicle MCU includes a preset UDS protocol stack module; the vehicle MCU is used for: Receiving a UDS message corresponding to a DoIP network diagnostic request from an external DoIP diagnostic instrument and determining a DoIP diagnostic message in response to the UDS message, and sending the DoIP diagnostic message to the DoIP diagnostic instrument so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message; A CAN diagnostic request sent by an external CAN diagnostic instrument is received, and a CAN diagnostic message for the CAN diagnostic request is sent to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
10. A vehicle, characterized in that: The vehicle includes a vehicle ECU diagnostic system, the vehicle ECU diagnostic system includes the vehicle ECU, an external DoIP diagnostic instrument and a CAN diagnostic instrument; the vehicle is used for: The vehicle ECU, in response to receiving the DoIP network diagnostic request sent by the DoIP diagnostic instrument, determines a corresponding DoIP diagnostic message based on the DoIP network diagnostic request and sends the DoIP diagnostic message to the DoIP diagnostic instrument, so that the DoIP diagnostic instrument performs DoIP diagnosis based on the DoIP diagnostic message; In response to receiving a CAN diagnostic request sent by the CAN diagnostic instrument, the vehicle ECU sends a CAN diagnostic message for the CAN diagnostic request to the CAN diagnostic instrument, so that the CAN diagnostic instrument performs CAN diagnosis based on the CAN diagnostic message.
