Diagnostic system and method for electronic control unit of whole vehicle and electronic equipment

By using a vehicle electronic control unit diagnostic system without hardware design, the system connects the target electronic device to the on-board diagnostic system, achieving efficient diagnostics of the vehicle electronic control unit. This solves the problems of large equipment size, heavy weight, and untimely software adaptation, and improves diagnostic efficiency and flexibility.

CN121325835APending Publication Date: 2026-01-13CHERY AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511766422.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing diagnostic equipment for vehicle electronic control units is large in size and heavy in weight, and its software is not adapted in a timely manner, making it unable to meet the needs of the latest vehicle models.

Method used

A diagnostic system for a vehicle electronic control unit is provided. It adopts a hardware-free design and connects to the vehicle diagnostic system through the interface module of the target electronic device. It performs diagnosis based on a preset communication protocol using a communication module and a communication diagnostic module. The system includes a front-end display module, a communication module, and a communication diagnostic module. DoIP diagnosis is implemented using Python language to construct diagnostic messages and parse response messages.

Benefits of technology

The device's size and weight have been improved, reducing costs. At the same time, it enables rapid adaptation to read and diagnose configuration information of the vehicle's electronic control unit, improving the timeliness of software adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121325835A_ABST
    Figure CN121325835A_ABST
Patent Text Reader

Abstract

The invention provides a diagnosis system and method of a whole vehicle electronic control unit and electronic equipment, the system is installed on target electronic equipment, the IP address of the target electronic equipment is the IP address of a diagnostic instrument defined in a vehicle-mounted network specification, the target electronic equipment comprises an interface module, and the interface module is used for connecting a vehicle-mounted diagnosis system of a tested vehicle; the system comprises a front-end display module, a communication module and a communication diagnosis module, the communication diagnosis module diagnoses the whole vehicle electronic control unit based on a preset communication protocol. According to the invention, the problems of large equipment size, heavy weight and untimely software adaptation in the prior art can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of whole vehicle integrated testing, and in particular to a whole vehicle electronic control unit diagnosis system, method and electronic device. BACKGROUND

[0002] With the rapid development of the automobile industry, especially the entry of new forces and Internet companies, the research and development and iteration cycle of automobiles are becoming shorter and shorter, and higher requirements are put forward for the efficiency of development and testing. In the whole vehicle integrated testing stage, the DoIP diagnosis (Diagnostic Communication over Internet Protocol) of the whole vehicle ECU (Electronic Control Unit) is carried out through the main driver OBD (On Board Diagnostics) in the LabCAR bench test environment or real vehicle test environment. However, the whole vehicle integrated testing is at the downstream of the research and development, and the testing time is more tense. In the integrated testing stage, the test software needs to be frequently written, and the ECU software and hardware version and part number need to be read and compared. Therefore, the above work needs to be frequently carried out using a diagnostic instrument.

[0003] At present, the diagnostic tools of various automobile enterprises basically adopt the outsourcing development mode, and the supplier is responsible for the hardware design and software adaptation. The current diagnostic instrument generally adopts the Android or Windows system, and the design of the host and the diagnostic head is separated, and the size and weight are large. The software update of the diagnostic instrument needs the output of the diagnosis professional as the development basis, and cannot adapt to the latest research vehicle in time and effectively. SUMMARY

[0004] Therefore, the purpose of the present application is to provide a whole vehicle electronic control unit diagnosis system, method and electronic device, which can improve the problems of large equipment size, heavy weight and untimely software adaptation in the prior art.

[0005] In order to achieve the above purpose, the technical scheme adopted by the present application is as follows: In a first aspect, the present application provides a vehicle electronic control unit diagnosis system, which is installed on a target electronic device, the IP address of the target electronic device is the IP address of a diagnostic instrument defined in a vehicle network specification, the target electronic device comprises an interface module for connecting a vehicle diagnosis system of a vehicle under test; the system comprises a front-end display module, a communication module and a communication diagnosis module; wherein the communication diagnosis module diagnoses the vehicle electronic control unit based on a preset communication protocol; the front-end display module is configured to receive a diagnosis request input by a user and send the diagnosis request to the communication diagnosis module through the communication module; the communication diagnosis module is configured to read configuration information of each vehicle electronic control unit and determine a target vehicle electronic control unit based on the configuration information of each vehicle electronic control unit; the communication diagnosis module is further configured to send a diagnosis message to the target vehicle electronic control unit, receive a response message fed back by the target vehicle electronic control unit, analyze the response message to obtain diagnosis information, and return the diagnosis information to the front-end display module through the communication module for display.

[0006] Optionally, the system further comprises a Flask module; the front-end display module is further configured to obtain a link address input by a user and generate a communication request based on the link address; and the Flask module is configured to receive the communication request and respond to corresponding page content based on the communication request, so that the front-end display module displays the corresponding page content.

[0007] Optionally, the system further comprises a configuration module configured to store diagnosis data of the vehicle electronic control unit, the diagnosis data at least comprising configuration information of each vehicle electronic control unit, test instructions and diagnosis control procedures; and the configuration information of the vehicle electronic control unit at least comprising a diagnosis IP address of the vehicle electronic control unit, a logical address and a vehicle electronic control unit name.

[0008] Optionally, the communication diagnosis module is specifically configured to read the configuration information of each vehicle electronic control unit from the configuration module and establish a communication connection with each vehicle electronic control unit based on the configuration information, and determine a vehicle electronic control unit for which the communication connection is successful as the target vehicle electronic control unit.

[0009] Optionally, the front-end display module is further configured to obtain configuration information of a vehicle electronic control unit input by a user and send the configuration information of the vehicle electronic control unit to the communication diagnosis module; and the communication diagnosis module is further configured to receive the configuration information of the vehicle electronic control unit and establish a communication connection with the corresponding vehicle electronic control unit based on the configuration information of the vehicle electronic control unit; if the connection is successful, the vehicle electronic control unit is determined as the target vehicle electronic control unit.

[0010] Optionally, the communication diagnosis module is further configured to construct a diagnosis message based on a pre-defined structure model and a diagnosis request.

[0011] Optionally, the communication diagnosis module is further configured to determine a diagnosis service type based on the diagnosis request, and read a corresponding function from the dynamic link library based on the diagnosis service type for calculation.

[0012] In a second aspect, the present application provides a diagnosis method of a vehicle electronic control unit, applied to a target electronic device, an IP address of the target electronic device being an IP address of a diagnostic instrument defined in a vehicle network specification, the target electronic device comprising an interface module, the interface module being configured to connect a vehicle diagnosis system of a vehicle under test, the system comprising a front-end display module, a communication module and a communication diagnosis module, wherein the communication diagnosis module is configured to diagnose the vehicle electronic control unit based on a preset communication protocol, the method comprising: receiving a diagnosis request input by a user through the front-end display module, and sending the diagnosis request to the communication diagnosis module through the communication module; reading configuration information of each vehicle electronic control unit through the communication diagnosis module, and determining a target vehicle electronic control unit based on the configuration information of each vehicle electronic control unit; sending a diagnosis packet to the target vehicle electronic control unit through the communication diagnosis module, receiving a response packet fed back by the target vehicle electronic control unit, and analyzing the response packet to obtain diagnosis information, and returning the diagnosis information to the front-end display module through the communication module for display.

[0013] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, the memory storing computer executable instructions capable of being executed by the processor, the processor executing the computer executable instructions to implement the steps of the method provided in the second aspect.

[0014] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed by the processor to implement the steps of the method provided in the second aspect.

[0015] The present application has the following beneficial effects: The application provides a vehicle electronic control unit diagnosis system, method and electronic device, the system is installed on a target electronic device, the IP address of the target electronic device is the IP address of a diagnostic instrument defined in a vehicle network specification, the target electronic device comprises an interface module, and the interface module is used to connect a vehicle diagnosis system of a vehicle to be tested; the system comprises a front-end display module, a communication module and a communication diagnosis module; the communication diagnosis module is used to diagnose the vehicle electronic control unit based on a preset communication protocol; the front-end display module is used to receive a diagnosis request input by a user, and send the diagnosis request to the communication diagnosis module through the communication module; the communication diagnosis module is used to read configuration information of each vehicle electronic control unit, and determine a target vehicle electronic control unit based on the configuration information of each vehicle electronic control unit; the communication diagnosis module is also used to send a diagnosis message to the target vehicle electronic control unit, receive a response message fed back by the target vehicle electronic control unit, and analyze the response message to obtain diagnosis information, and return the diagnosis information to the front-end display module through the communication module for display.

[0016] The diagnosis system is installed on a target electronic device, connected to a vehicle diagnosis system of a vehicle to be tested through an interface module, and the hardware-free design scheme is used, so that the problems of large size and heavy weight of equipment in the prior art are improved, and the cost is reduced; meanwhile, the diagnosis system can read configuration information of each vehicle electronic control unit, determine a target vehicle electronic control unit, send a diagnosis message to the target vehicle electronic control unit, receive a response message fed back by the target vehicle electronic control unit, and finally analyze the response message to obtain diagnosis information, so that the problem of untimely software adaptation is improved.

[0017] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and achieved by the structure particularly pointed out in the description, claims and drawings.

[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0020] Figure 1A structural schematic diagram of a vehicle electronic control unit diagnosis system provided by an embodiment of the present application is shown in the figure. Figure 2 A structural schematic diagram of another vehicle electronic control unit diagnosis system provided by an embodiment of the present application is shown in the figure. Figure 3 A software and hardware architecture diagram of a Python-based DoIP diagnosis system provided by an embodiment of the present application is shown in the figure. Figure 4 A flowchart of a vehicle electronic control unit diagnosis method provided by an embodiment of the present application is shown in the figure. Figure 5 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in the figure.

[0021] Icon: 101 - front-end display module; 102 - communication module; 103 - communication diagnosis module; 104 - Flask module; 105 - configuration module. DETAILED DESCRIPTION

[0022] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described below in connection with the accompanying drawings, obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0023] At present, diagnostic instruments generally use Android or Windows systems, and the host and the diagnostic head are designed in a separated manner, which has a large size and a heavy weight. The software update of the diagnostic instrument needs diagnostic professional output as the development basis, and cannot timely and effectively adapt to the latest vehicle under research.

[0024] Based on this, the vehicle electronic control unit diagnosis system, method and electronic device provided by the embodiments of the present application can improve the problems of large size, heavy weight and untimely software adaptation in the prior art.

[0025] To facilitate the understanding of the embodiments, first, a vehicle electronic control unit diagnosis system disclosed by the embodiments of the present application is described in detail. The system is installed in a target electronic device, which can be a computer with a Windows system, and the IP address of the target electronic device is the IP address of the diagnostic instrument defined in the vehicle network specification. The electronic device includes an interface module, which is used to connect the on-board diagnosis system of a vehicle under test. In the embodiments of the present application, the target electronic device and the on-board diagnosis system of the vehicle under test can be connected through an OBD-to-RJ45 harness.

[0026] Referring toFigure 1 The diagram illustrates the structure of a diagnostic system for a vehicle electronic control unit (ECU). The system mainly includes a front-end display module 101, a communication module 102, and a communication diagnostic module 103. The communication module 102 uses a full-duplex communication protocol (WebSocket) based on TCP. The communication diagnostic module 103 performs diagnostics on the ECU based on a preset communication protocol, including a Python-based diagnostic program. The communication diagnostic module 103 can be used for DoIP diagnostics, i.e., diagnostics of the ECU via Ethernet.

[0027] The front-end display module 101 receives diagnostic requests input by the user and sends these requests to the communication diagnostic module 103 via the communication module 102. In specific implementations, the front-end display module 101 is essentially an HTML (browser page) module. It primarily uses HTML to define various display and operation controls for the front end, encapsulates HTTP requests and a full-duplex communication protocol based on TCP, and establishes communication with the back-end service. Users can input diagnostic requests through the browser page, and the requests are then sent to the communication diagnostic module 103 via the communication module 102.

[0028] The communication diagnostic module 103 is used to read the configuration information of each vehicle electronic control unit and determine the target vehicle electronic control unit based on the configuration information of each vehicle electronic control unit; it is also used to send diagnostic messages to the target vehicle electronic control unit, receive response messages from the target vehicle electronic control unit, parse the response messages to obtain diagnostic information, and return the diagnostic information to the front-end display module 101 for display through the communication module 102.

[0029] In practical implementation, after receiving a diagnostic request, the communication diagnostic module 103 can automatically read the list of vehicle electronic control units (ECUs) to obtain the configuration information of each ECU. Then, based on the configuration information of each ECU, it determines the target ECU, i.e., the ECU being tested. Subsequently, the communication diagnostic module 103 can send a diagnostic message to the target ECU. Upon receiving the diagnostic message, the target ECU responds and returns a response message to the communication diagnostic module 103. The communication diagnostic module 103 parses the response message to obtain diagnostic information, integrates the diagnostic information, and returns it to the front-end display module 101 through the communication module 102. Upon receiving the diagnostic information, the front-end display module 101 can display it according to a predetermined format, and simultaneously generate a table file and automatically download it to the local Windows host.

[0030] In one implementation, the communication diagnostic module 103 is further configured to construct diagnostic messages based on a predefined structure model and diagnostic requests. Specifically, the communication diagnostic module 103 constructs and parses DoIP messages using a Struct. Specifically, the basic structure of a DoIP message includes: protocol version, reverse protocol version, payload type (identifying the message type, such as vehicle detection, diagnostic message, etc.), payload length (indicating the number of bytes in the subsequent payload), and payload. Different types of DoIP messages (such as vehicle identification requests, diagnostic message transmissions, etc.) have different substructures in their payload portions.

[0031] In this embodiment of the invention, a corresponding structure model is defined for each DoIP message type. Based on the type of DoIP message to be sent, a corresponding structure object is created and the required field values ​​are filled in (e.g., version number is set to 0x02, payload type is set to diagnostic message type, etc.). If the payload is diagnostic data, it is filled into the payload field of the structure as a byte array, and the payload length field is updated synchronously. Then, according to the field order and data type defined in the structure, each field is converted into bytes and concatenated into a complete DoIP message byte stream.

[0032] During message parsing, the complete DoIP message byte sequence is read from the network socket or buffer. The first 8 bytes (version, reverse version, payload type, payload length) are read at a fixed offset to verify if the protocol version is supported, check if the reverse version is the bitwise inversion of the version, and confirm the reasonableness of the payload length. Then, the corresponding structure is selected according to the payload type. Different payload types correspond to different payload structures. For example, if it is a diagnostic message, the source / destination address and diagnostic data are parsed. Next, starting from the 9th byte, bytes of the specified payload length are read and mapped to structured fields according to the selected structure. The total message length is checked to see if it matches, and the validity of key fields (such as address range, VIN format, etc.) is verified. If parsing fails, the message is discarded or an error response is returned.

[0033] The diagnostic system for the vehicle electronic control unit provided in this embodiment of the invention is installed on the target electronic device. It connects the target electronic device to the on-board diagnostic system of the vehicle under test via an interface module. By using a hardware-free design, it improves upon the problems of large device size and heavy weight in the prior art, reducing costs. Simultaneously, the diagnostic system can read the configuration information of each vehicle electronic control unit, identify the target vehicle electronic control unit, send diagnostic messages to the target vehicle electronic control unit, receive response messages from the target vehicle electronic control unit, and finally parse the response messages to obtain diagnostic information, thereby improving the problem of untimely software adaptation.

[0034] In one implementation, see Figure 2As shown, the system also includes a Flask module 104. The Flask module 104 primarily defines HTTP interfaces through Flask, including: tool webpage entry points, template downloads, etc.

[0035] In specific implementation, the front-end display module 101 is also used to obtain the link address input by the user and generate a communication request based on the link address; the Flask module 104 is used to receive the communication request and respond with the corresponding page content based on the communication request, so that the front-end display module can display the corresponding page content.

[0036] Specifically, when a user enters a link address in the front-end display module 101, the front-end display module 101 initiates a communication request (HTTP request), the Flask module 104 receives the HTTP request and responds with the corresponding page content, and the front-end display module 101 receives and opens the corresponding page content.

[0037] See Figure 2 As shown, the system also includes a configuration module 105 for storing diagnostic data of the vehicle electronic control unit. The diagnostic data includes at least the configuration information, test instructions, and diagnostic control flow of each vehicle electronic control unit. The configuration information of the vehicle electronic control unit includes at least the diagnostic IP address, logical address, and name of the vehicle electronic control unit.

[0038] In practical implementation, the configuration module 105 primarily stores the DoIP and UDS (Unified Diagnostic Services) related diagnostic data of the vehicle's electronic control unit in a specific format, including at least: the diagnostic IP address, logical address, ECU name, supported action test commands, and diagnostic control flow for each ECU. In this embodiment of the invention, Python code is used to read relevant business tables and generate dictionaries or lists, or other data formats that Python supports well.

[0039] Furthermore, the communication diagnostic module 103 is specifically used to read the configuration information of each vehicle electronic control unit from the configuration module 105, and establish a communication connection with each vehicle electronic control unit based on the configuration information, and identify the vehicle electronic control unit with which the communication connection is successful as the target vehicle electronic control unit.

[0040] In practice, the configuration information of each vehicle electronic control unit is stored in the database of the configuration module 105 in advance. When performing a diagnosis, the communication diagnosis module 103 can read the configuration information of each vehicle electronic control unit from the database, and then establish a communication connection with each vehicle electronic control unit according to the configuration information of each vehicle electronic control unit. If the connection is successful, the vehicle electronic control unit is identified as the target vehicle electronic control unit.

[0041] Furthermore, in this embodiment of the invention, the target vehicle electronic control unit can also be determined through user input. Specifically, the front-end display module 101 is also used to obtain the configuration information of the vehicle electronic control unit input by the user, and send the configuration information of the vehicle electronic control unit to the communication diagnostic module 103; the communication diagnostic module 103 is also used to receive the configuration information of the vehicle electronic control unit, and establish a communication connection with the corresponding vehicle electronic control unit based on the configuration information of the vehicle electronic control unit; if the connection is successful, the vehicle electronic control unit is determined as the target vehicle electronic control unit.

[0042] In practice, users can input configuration information such as the name, diagnostic IP address, and logical address of the vehicle electronic control unit being tested into the front-end display module 101 and send it to the communication diagnostic module 103. After receiving the configuration information, the communication diagnostic module 103 establishes a communication connection with the corresponding vehicle electronic control unit based on the configuration information. If the connection is successful, it is identified as the target vehicle electronic control unit.

[0043] In one implementation, the communication diagnostic module 103 is further configured to determine the diagnostic service type based on the diagnostic request, and to read the corresponding function from the dynamic link library for calculation based on the diagnostic service type. In a specific implementation, the communication diagnostic module 103 can use Ctypes to read the relevant functions in the DLL (Dynamic Link Library) file to calculate the KEY value in the UDS27 service.

[0044] Specifically, the UDS27 service is used for secure access control. First, it obtains the DLL file provided by the vehicle manufacturer or ECU supplier. Then, it loads the target DLL file into the current Python process space using Ctypes' CDLL or WinDLL (depending on the calling convention).

[0045] In this embodiment of the invention, the communication diagnostic module 103 sends a request for a seed function to the ECU and receives the Seed returned by the ECU via DoIP; then, it extracts the corresponding callable function object from the DLL instance by function name to calculate the Key; the Key is encapsulated into a UDS27 service request message and sent to the ECU to complete the secure access unlocking.

[0046] In one implementation, the communication diagnostic module 103 can also use a Socket to receive and send Ethernet frames, and to convert between string-type diagnostic messages and binary diagnostic messages. Specifically, receiving and sending Ethernet frames via a Socket includes: first, using a raw socket that supports link layer operations and determining the protocol type; then, constructing an Ethernet frame, including: destination MAC address, source MAC address, Ethernet type, and payload; next, calling the Socket's send interface to send the constructed complete frame to a specified network interface (e.g., an ECU); and finally, calling the receive interface to read the raw frame data from the network interface.

[0047] Diagnostic messages typically refer to instructions or responses conforming to standards such as UDS (Unified Diagnostic Services), and are essentially byte sequences. The conversion between string-type diagnostic messages and binary diagnostic messages includes: (1) Converting string type diagnostic messages to binary diagnostic messages: First, the user-provided string is preprocessed to remove irrelevant characters, and then each group of hexadecimal characters is converted into the corresponding 8-bit unsigned integer.

[0048] (2) Converting binary diagnostic messages to string-type diagnostic messages: The diagnostic message byte sequence received from the network is converted into a two-digit uppercase (or lowercase) hexadecimal string for each byte. If the byte value is less than 0x10, leading zeros are added (e.g., 0x03 → "03"). When outputting, you can choose whether to insert spaces, newlines or other separators between bytes.

[0049] The communication diagnostic module 103 can also integrate related functions by reading the config file. Specifically, during the program initialization phase, the config file at the specified path is read and parsed into a data structure in memory; then, the validity of key fields is checked, such as whether the IP address format is correct, whether the DLL path exists, and whether the security level is within the valid range; if a certain item is not defined in the configuration, the built-in default value is used to ensure that the program can still run.

[0050] Furthermore, the loaded configuration information is injected into each functional unit to achieve configuration-driven behavior: the communication unit establishes a DoIP connection based on the IP and port in the config; the diagnostic engine constructs a UDS request based on the configured message template; the secure access unit dynamically loads the DLL specified in the config and calls the functions within it to calculate the Key; the logging unit determines the level of detail in the output according to the configured log level; and the process control unit determines the behavior after failure based on whether automatic retry is enabled.

[0051] Using the above method, only the configuration needs to be modified when switching ECUs or test environments, without changing the code, thus improving the system's flexibility.

[0052] For ease of understanding, taking DoIP diagnostics and an office computer as the target electronic device as an example, this embodiment of the invention also provides a software and hardware architecture diagram of a Python-based DoIP diagnostic system. (See attached diagram.) Figure 3 As shown, it includes: The DoIPClient module (i.e., the communication diagnostic module) constructs and parses DoIP messages using structs, receives and sends Ethernet frames using sockets, converts between string and binary diagnostic messages, calculates the KEY value in the UDS27 service by reading relevant functions in the DLL file using Ctypes, and integrates related functions by reading the config file.

[0053] The Config module primarily stores DoIP and UDS related data in a specific format, such as the diagnostic IP address, logical address, ECU name, supported action test commands, and diagnostic control flow of each ECU. The current design uses Python code to read relevant business tables and generate dictionaries or lists, which are data formats well supported by Python.

[0054] The Flask module primarily defines HTTP interfaces through Flask, including tool web page entry points, template downloads, etc.

[0055] The WebSocket module (i.e., the communication module) primarily uses WebSockets to enable data interaction between the HTML frontend and the service backend. This includes: transmitting frontend function commands, transmitting messages to be sent, transmitting backend traces, transmitting work status, and transmitting response messages. By defining different business types, it achieves efficient data transmission and effective utilization.

[0056] The HTML module primarily uses the HTML language to define various display and operation controls on the front end, and encapsulates HTTP requests and WebSocket methods to establish communication with the backend service.

[0057] DoIP diagnostics based on the above system include: automatically identifying the test vehicle ECU list; selecting the DoIP diagnostic target ECU; inputting, sending, and displaying the input and response of DoIP diagnostic commands; reading and comparing the software and hardware versions and part numbers of the whole vehicle ECUs; flashing the software version of each ECU; implementing the functions of the 31 services supported by each ECU; and automatically recording and uploading diagnostic commands and function usage.

[0058] Furthermore, this system is written in Python and packaged as an EXE executable program, which can be used on Windows systems. The main steps for testers using this system are as follows: ① Connect the driver's side OBD device to the test computer (Windows system) using an OBD-to-RJ45 adapter; ② Manually change the network adapter IP address of the test computer to the IP address of the diagnostic tool as defined in the vehicle network specification; ③ Open the EXE executable program; the program will automatically hide and minimize; ④ Open a browser, enter the link address defined in the backend service, and open the corresponding program page; ⑤ Click the menu and function buttons on the webpage to use it.

[0059] The system's internal operating mechanism during use is as follows: ① When the program is opened, the Flask service and WebSocket service are automatically started; ② When the user enters a link address in the browser, the browser initiates an HTTP request. The Flask service receives the request and responds with the corresponding page content. The browser receives and opens the corresponding page content; ③ When the user uses the system's functions, taking the whole vehicle software and hardware version reading and comparison function as an example: the user enters relevant content, such as the user's name, selects the table file to be compared, and clicks "Start Comparison." The webpage sends the relevant data and comparison request to the backend via the WebSocket service. The backend calls the DoIPClient module and reads the configuration information of each ECU from the config file, establishes diagnostic communication links with each ECU one by one, and sends diagnostic commands to read the software version, read the hardware version, and read the part number. After receiving the response, the backend parses the message and obtains the target information. After all target ECUs are diagnosed, all the read information is assembled and returned to the frontend via WebSocket. After receiving the information, the frontend webpage displays it according to the predetermined format, and at the same time generates a table file and automatically downloads it to the local Windows host.

[0060] When using this system, users only need an OBD to RJ45 cable, a Windows office computer, and this software tool. No other hardware is required. It is a portable, easy-to-use, and efficient testing tool that improves upon the problems of large size and heavy weight in existing technologies and reduces costs.

[0061] In addition to the diagnostic system for the vehicle electronic control unit provided in the foregoing embodiments, this invention also provides a diagnostic method for the vehicle electronic control unit. This method is applied to a target electronic device, the IP address of which is the IP address of the diagnostic tool as defined in the vehicle network specification. The target electronic device includes an interface module for connecting to the on-board diagnostic system of the vehicle under test. The system includes a front-end display module, a communication module, and a communication diagnostic module. The communication diagnostic module diagnoses the vehicle electronic control unit based on a preset communication protocol.

[0062] See Figure 4 The flowchart shown illustrates a diagnostic method for a vehicle electronic control unit, indicating that the method mainly includes the following steps S401 to 403: Step S401: Receive the diagnostic request input by the user through the front-end display module, and send the diagnostic request to the communication diagnostic module through the communication module.

[0063] Step S402: Read the configuration information of each vehicle electronic control unit through the communication diagnostic module, and determine the target vehicle electronic control unit based on the configuration information of each vehicle electronic control unit.

[0064] Step S403: Send a diagnostic message to the target vehicle electronic control unit through the communication diagnostic module, receive the response message from the target vehicle electronic control unit, parse the response message to obtain diagnostic information, and return the diagnostic information to the front-end display module for display through the communication module.

[0065] The diagnostic method for vehicle electronic control units provided in this invention is applied to a target electronic device connected to the on-board diagnostic system of the vehicle under test. By using a hardware-free design, it improves upon the problems of large device size and heavy weight in the prior art, thus reducing costs. Furthermore, the method can read the configuration information of each vehicle electronic control unit, identify the target vehicle electronic control unit, send a diagnostic message to the target vehicle electronic control unit, receive the response message from the target vehicle electronic control unit, and finally parse the response message to obtain diagnostic information, thereby improving the problem of untimely software adaptation.

[0066] It should be noted that the method provided in the embodiments of the present invention has the same implementation principle and technical effect as the aforementioned system embodiments. For the sake of brevity, any parts not mentioned in the method embodiments can be referred to the corresponding content in the aforementioned system embodiments.

[0067] This invention also provides an electronic device, specifically, the electronic device includes a processor and a storage device; the storage device stores a computer program, and the computer program, when run by the processor, executes the method described in any of the above embodiments.

[0068] Figure 5 The present invention provides a schematic diagram of the structure of an electronic device 100, which includes a processor 50, a memory 51, a bus 52 and a communication interface 53. The processor 50, the communication interface 53 and the memory 51 are connected through the bus 52. The processor 50 is used to execute executable modules, such as computer programs, stored in the memory 51.

[0069] The memory 51 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 53 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0070] Bus 52 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0071] The memory 51 is used to store programs. After receiving an execution instruction, the processor 50 executes the programs. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 50 or implemented by the processor 50.

[0072] Processor 50 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 50 or by instructions in software form. Processor 50 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 51. The processor 50 reads the information in memory 51 and, in conjunction with its hardware, completes the steps of the above method.

[0073] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, please refer to the foregoing method embodiments, which will not be repeated here.

[0074] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0075] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A diagnosis system of an electronic control unit of a vehicle, characterized by, The system is installed on a target electronic device, the IP address of the target electronic device is the IP address of a diagnostic instrument defined in a vehicle network specification, the target electronic device comprises an interface module for connecting a vehicle diagnostic system of a vehicle under test; the system comprises a front-end display module, a communication module and a communication diagnosis module; wherein the communication diagnosis module diagnoses the vehicle electronic control units based on a preset communication protocol; The front-end display module is configured to receive a diagnosis request input by a user and send the diagnosis request to the communication diagnosis module through the communication module. The communication diagnosis module is configured to read configuration information of each vehicle electronic control unit and determine a target vehicle electronic control unit based on the configuration information of each vehicle electronic control unit. The communication diagnosis module is further configured to send a diagnosis message to the target vehicle electronic control unit, receive a response message fed back by the target vehicle electronic control unit, and analyze the response message to obtain diagnosis information, and return the diagnosis information to the front-end display module through the communication module for display.

2. The system of claim 1, wherein, Further comprising: A Flask module; The front-end display module is further configured to obtain a link address input by the user and generate a communication request based on the link address; The Flask module is configured to receive the communication request and respond to corresponding page content based on the communication request, so that the front-end display module displays the corresponding page content.

3. The system of claim 1, wherein, Further comprising: A configuration module configured to store diagnosis data of the vehicle electronic control units, the diagnosis data at least comprising configuration information, test instructions and diagnosis control processes of each vehicle electronic control unit, and the configuration information of each vehicle electronic control unit at least comprising a diagnosis IP address, a logical address and a vehicle electronic control unit name of the vehicle electronic control unit.

4. The system of claim 3, wherein, The communication diagnosis module is specifically configured to read the configuration information of each vehicle electronic control unit from the configuration module and establish a communication connection with each vehicle electronic control unit based on the configuration information, and determine a vehicle electronic control unit with a successful communication connection as a target vehicle electronic control unit.

5. The system of claim 1, wherein, The front-end display module is further configured to obtain configuration information of a vehicle electronic control unit input by the user and send the configuration information of the vehicle electronic control unit to the communication diagnosis module. The communication diagnosis module is further configured to receive the configuration information of the vehicle electronic control unit and establish a communication connection with the corresponding vehicle electronic control unit based on the configuration information of the vehicle electronic control unit; if the connection is successful, the vehicle electronic control unit is determined as a target vehicle electronic control unit.

6. The system of claim 1, wherein, The communication diagnosis module is further configured to construct a diagnosis message based on a pre-defined structure model and the diagnosis request.

7. The system of claim 1, wherein, The communication diagnosis module is further configured to determine a diagnosis service type based on the diagnosis request and read a corresponding function from a dynamic link library for calculation based on the diagnosis service type.

8. A diagnosis method of an electronic control unit of a vehicle, characterized by, The application is applied to a target electronic device, the IP address of the target electronic device is the IP address of a diagnostic instrument defined in a vehicle network specification, the target electronic device comprises an interface module for connecting a vehicle onboard diagnostic system of a vehicle under test, the system comprises a front-end display module, a communication module and a communication diagnostic module; wherein the communication diagnostic module diagnoses the vehicle electronic control units based on a preset network protocol; the method comprises: receiving a diagnostic request input by a user through the front-end display module, and sending the diagnostic request to the communication diagnostic module through the communication module; reading configuration information of each vehicle electronic control unit through the communication diagnostic module, and determining a target vehicle electronic control unit based on the configuration information of each vehicle electronic control unit; sending a diagnostic message to the target vehicle electronic control unit through the communication diagnostic module, receiving a response message fed back by the target vehicle electronic control unit, and analyzing the response message to obtain diagnostic information, and returning the diagnostic information to the front-end display module through the communication module for display.

9. An electronic device, comprising: The computer program is run by the processor to execute the steps of the method of claim 8.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is run by the processor to execute the steps of the method of claim 8.