Automobile controller fault diagnosis method, device, equipment and storage medium
By obtaining and parsing the information storage files of the car controller, building data packets and comparing variable values, the limitations of traditional diagnostic methods are solved and fast and simple vehicle controller fault diagnosis is achieved.
Patent Information
- Application Number
- CN202310009407.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-03
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2043-01-03
AI Technical Summary
In the prior art, it is difficult to diagnose low-probability occasional vulnerabilities in automotive controllers through on-site debugging as soon as possible, and the limitations of traditional debuggers and source codes lead to diagnosis difficulties.
By obtaining the information storage files of the car controller, analyzing variable information and building data packets, sending and receiving messages using the instruction set protocol, and troubleshooting based on the variable values is avoided, cumbersome debugging process.
It realizes rapid and simple troubleshooting of automotive controllers without relying on debuggers and source code, and improves diagnostic efficiency.
Smart Images

Figure CN116203922B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of fault diagnosis, and in particular to a method, apparatus, device and storage medium for diagnosing faults of an automobile controller. Background Art
[0002] As body controllers become more complex and integrated, the code complexity increases, making it difficult to detect low-probability, occasional vulnerabilities. Traditional MCU controller debugging requires the use of a specific debugger and source code, but source code cannot usually be provided to others at will, making it difficult to diagnose some on-site problems through on-site debugging in the first place. Summary of the Invention
[0003] In view of the above-mentioned shortcomings of the prior art, the present invention provides a method, device, equipment and storage medium for diagnosing automobile controller faults, which can solve the technical problem in the prior art that it is difficult to diagnose through on-site debugging in the first time.
[0004] The present invention provides a method for diagnosing a fault in an automobile controller, the method comprising:
[0005] Acquire an information storage file of the vehicle controller, wherein the information storage file is pre-stored in the vehicle controller;
[0006] Parsing the information storage file to obtain variable information;
[0007] constructing a data message using the variable information, and sending the data message to the vehicle controller;
[0008] When a return message from the automobile controller is received, the return message is parsed to obtain a variable value, and a fault diagnosis is performed on the automobile controller based on the variable value. The return message is generated based on the data message.
[0009] In one embodiment of the present invention, obtaining an information storage file of a vehicle controller includes:
[0010] Get the network address and port information of the vehicle controller;
[0011] Establishing a communication link between a host computer and the vehicle controller according to the network address information and the port information;
[0012] The information storage files in the automobile controller are collected to a host computer according to the communication link.
[0013] In one embodiment of the present invention, when the variable information includes a sending address and a variable length, constructing a data message using the variable information includes:
[0014] Fill the sending address and the variable length into the preset message template to obtain a data message.
[0015] In one embodiment of the present invention, sending the data message to the vehicle controller includes:
[0016] Acquire an instruction set protocol, and send the data message to the vehicle controller according to the instruction set protocol.
[0017] In one embodiment of the present invention, parsing the returned message includes:
[0018] The return message is parsed according to the instruction set protocol.
[0019] In one embodiment of the present invention, performing fault diagnosis on the vehicle controller based on the variable value includes:
[0020] comparing the variable value with a preset target value;
[0021] When the variable value is consistent with the preset target value, it is determined that there is no fault in the automobile controller; when the variable value is inconsistent with the preset target value, it is determined that there is a fault in the automobile controller.
[0022] In one embodiment of the present invention, after parsing the return message to obtain the variable value, the method further includes:
[0023] The variable information and the variable value are added to a preset observation area, and the variable information and the variable value are displayed through the observation area.
[0024] The present invention also provides a vehicle controller fault diagnosis device, the device comprising:
[0025] An acquisition module, configured to obtain an information storage file of the vehicle controller, wherein the information storage file is pre-stored in the vehicle controller;
[0026] A parsing module, configured to parse the information storage file to obtain variable information;
[0027] a sending module, configured to construct a data message using the variable information and send the data message to the vehicle controller;
[0028] The diagnostic module is used to parse the return message received from the automobile controller to obtain variable values, and perform fault diagnosis on the automobile controller based on the variable values. The return message is generated based on the data message.
[0029] The present invention further provides an electronic device, comprising:
[0030] one or more processors;
[0031] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the electronic device implements the automobile controller fault diagnosis method as described above.
[0032] The present invention also provides a computer-readable storage medium, characterized in that a computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the above-mentioned automobile controller fault diagnosis method.
[0033] Beneficial effects of the present invention: The present invention provides a method, device, equipment, and storage medium for diagnosing faults in an automobile controller. The method obtains an information storage file of the automobile controller, which is pre-stored in the automobile controller; parses the information storage file to obtain variable information; constructs a data message using the variable information, and sends the data message to the automobile controller; upon receiving a return message from the automobile controller, parses the return message to obtain variable values, and performs fault diagnosis on the automobile controller based on the variable values, with the return message generated based on the data message. The present invention pre-writes an information storage file into the automobile controller, stores the variable information of the automobile controller through the information storage file, and then constructs a data message for diagnosing the automobile controller based on the variable information. After receiving the data message, the automobile controller returns the variable values corresponding to the variable information. The variable values are used to diagnose the automobile controller, thereby enabling diagnosis of the automobile controller without tedious debugging.
[0034] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0036] Figure 1 is an application scenario diagram of a method for diagnosing a fault in an automobile controller, shown in an exemplary embodiment of the present application;
[0037] Figure 2 1 is a diagram of the upper computer software architecture shown in an exemplary embodiment of the present application;
[0038] Figure 3is a flow chart of a method for diagnosing a fault in an automobile controller shown in an exemplary embodiment of the present application;
[0039] Figure 4 is a structural block diagram of an automobile controller fault diagnosis device shown in an exemplary embodiment of the present application;
[0040] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0041] The following describes the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art will readily appreciate the other advantages and benefits of the present invention from the disclosure herein. The present invention may also be implemented or applied through various other specific embodiments, and the various details in this specification may be modified or altered based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are intended only to illustrate the present invention and are not intended to limit the scope of protection of the present invention.
[0042] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.
[0043] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the embodiments of the present invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring the embodiments of the present invention.
[0044] Figure 1 FIG. 1 is an application scenario diagram of a method for diagnosing a fault in an automobile controller according to an exemplary embodiment of the present application. Figure 1 As shown, the hardware devices relied on by this embodiment include a host computer, a switch converter, and a body controller (slave computer). The host computer is connected to the switch converter via Ethernet, and then connected to the body controller slave computer. Through UDP (User Datagram Protocol) communication, data interaction is realized according to the instruction set protocol to obtain the real-time operation status of the controller, so as to diagnose and analyze the problems of the controller itself.
[0045] The host computer development environment adopts the Windows platform, and the QT integrated development environment is implemented based on the C++ programming language. QT can be used to quickly develop usable host computer software.
[0046] Figure 2 This is a diagram of the host computer software architecture, illustrating an exemplary embodiment of this application. The software consists of two major components: the user interface (UI) and the implementation of various functional modules. The UI includes three parts: interface layout design, software theme settings, and custom controls based on functional requirements. The functional modules include: ELF file parsing, A2L file parsing, UDP communication, instruction set parsing, and a general function library. ELF and A2L file parsing is used to extract variable addresses and lengths, which are then used to send read instructions to the lower computer, which is then parsed according to the communication protocol.
[0047] like Figure 3 As shown, in an exemplary embodiment, a method for diagnosing a fault in an automobile controller includes at least steps S310 to S340, which are described in detail as follows:
[0048] S310, obtaining an information storage file of the vehicle controller, wherein the information storage file is pre-stored in the vehicle controller;
[0049] S320, parsing the information storage file to obtain variable information;
[0050] S330, constructing a data message using the variable information, and sending the data message to the vehicle controller;
[0051] S340, when receiving a return message from the automobile controller, parsing the return message to obtain variable values, and performing fault diagnosis on the automobile controller based on the variable values, wherein the return message is generated based on the data message.
[0052] In this embodiment, the information storage file can be an ELF format file or an A2L format file. Because the software versions of automobile controllers vary when they leave the factory, the software information of the controller can be pre-written using the ELF format file or the A2L format file. Thus, by loading the ELF format file or the A2L format file corresponding to the current software version, the variable information in the file can be parsed according to the ELF file format or the A2L file format. The variable information includes: variable address and length information.
[0053] The variable address is the network address of the vehicle controller, and the length information specifies the length of the variable value returned by the vehicle controller. If the variable value returned by the vehicle controller meets the variable length and is consistent with the preset value, it indicates that there is no fault in the vehicle controller. Otherwise, it indicates that there is a fault in the vehicle controller.
[0054] Through steps S310 to S340, the traditional debugging mode through a debugger and source code is changed, and the controller can be diagnosed and debugged through Ethernet, which is easy to operate and convenient for non-developers to operate and troubleshoot problems.
[0055] In one embodiment of the present invention, the process of obtaining the information storage file of the automobile controller may include steps S410 to S430, which are described in detail as follows:
[0056] S410, obtaining network address information and port information of the vehicle controller;
[0057] S420, establishing a communication link between the host computer and the vehicle controller according to the network address information and the port information;
[0058] S430: Collect the information storage files in the vehicle controller to the host computer according to the communication link.
[0059] In this embodiment, a socket communication link is established between the vehicle controller and the host computer by inputting the IP address and port number of the vehicle controller (or the slave computer to which the vehicle controller is connected) into the host computer. The socket communication link can be used to access the vehicle controller's information storage files, send data messages, and receive return messages.
[0060] In one embodiment of the present invention, when the variable information includes a sending address and a variable length, the process of constructing a data message using the variable information may include step S510, which is described in detail as follows:
[0061] S510: Fill the sending address and the variable length into a preset message template to obtain a data message.
[0062] In this embodiment, the message template reserves positions for the sending address and variable length. The host computer fills the sending address and variable length information into the message template to obtain a complete data message corresponding to the variable information.
[0063] In one embodiment of the present invention, the process of sending the data message to the vehicle controller may include step S610, which is described in detail as follows:
[0064] S610: Acquire an instruction set protocol, and send the data message to the vehicle controller according to the instruction set protocol.
[0065] In this embodiment, the host computer sends UDP messages according to the instruction set protocol to obtain the values of all variables in the observation area. In addition, the instruction set supported by the host computer system can be obtained through the help command. According to the actual diagnostic and debugging scenario, different instructions are used to obtain controller operation information for problem troubleshooting.
[0066] In one embodiment of the present invention, the process of parsing the returned message may include step S710, which is described in detail as follows:
[0067] S710: Parse the returned message according to the instruction set protocol.
[0068] In this embodiment, the data message is transmitted using the instruction set protocol, and the return message is also returned using the instruction set protocol. The host computer needs to parse the return message using the same instruction set protocol to obtain the corresponding variable value.
[0069] In one embodiment of the present invention, the process of performing fault diagnosis on the automobile controller based on the variable value may include steps S810 to S820, which are described in detail as follows:
[0070] S810, comparing the variable value with a preset target value;
[0071] S820: When the variable value is consistent with the preset target value, determine that there is no fault in the vehicle controller; when the variable value is inconsistent with the preset target value, determine that there is a fault in the vehicle controller.
[0072] In this embodiment, the length of the variable value needs to meet the variable length. When the variable value is consistent with the target value, it indicates that there is no fault in the vehicle controller. Otherwise, it indicates that there is a fault.
[0073] In one embodiment of the present invention, after parsing the return message to obtain the variable value, the process may further include step S910, which is described in detail as follows:
[0074] S910: Add the variable information and the variable value to a preset observation area, and display the variable information and the variable value through the observation area.
[0075] In this embodiment, the variables to be observed are selected by searching in a drop-down list and added to the observation area, so that the staff can observe the values of the variables in real time.
[0076] A method for diagnosing faults in an automobile controller disclosed herein obtains an information storage file of the automobile controller, the information storage file being pre-stored in the automobile controller; parses the information storage file to obtain variable information; constructs a data message using the variable information, and sends the data message to the automobile controller; and upon receiving a return message from the automobile controller, parses the return message to obtain variable values, and performs fault diagnosis on the automobile controller based on the variable values, with the return message generated based on the data message. The present invention pre-writes an information storage file within the automobile controller, stores the variable information of the automobile controller in the information storage file, and then constructs a data message for diagnosing the automobile controller based on the variable information. Upon receiving the data message, the automobile controller returns the variable values corresponding to the variable information, and uses the variable values to diagnose the automobile controller, thereby enabling diagnosis of the automobile controller without tedious debugging.
[0077] The present invention also provides a vehicle controller fault diagnosis device, the device comprising:
[0078] An acquisition module, configured to obtain an information storage file of the vehicle controller, wherein the information storage file is pre-stored in the vehicle controller;
[0079] A parsing module, configured to parse the information storage file to obtain variable information;
[0080] a sending module, configured to construct a data message using the variable information and send the data message to the vehicle controller;
[0081] The diagnostic module is used to parse the return message received from the automobile controller to obtain variable values, and perform fault diagnosis on the automobile controller based on the variable values. The return message is generated based on the data message.
[0082] The present invention provides a vehicle controller fault diagnosis device. The device obtains an information storage file of the vehicle controller, which is pre-stored in the vehicle controller; parses the information storage file to obtain variable information; constructs a data message based on the variable information, and sends the data message to the vehicle controller; and upon receiving a return message from the vehicle controller, parses the return message to obtain variable values. The device then performs fault diagnosis on the vehicle controller based on the variable values, with the return message generated based on the data message. The present invention pre-writes an information storage file into the vehicle controller, stores the variable information of the vehicle controller in the information storage file, and then constructs a data message for diagnosing the vehicle controller based on the variable information. Upon receiving the data message, the vehicle controller returns the variable values corresponding to the variable information. The variable values are then used to diagnose the vehicle controller, thereby enabling diagnosis of the vehicle controller without tedious debugging.
[0083] It should be noted that the application data display system provided in the above-described embodiment and the application data display method provided in the above-described embodiment are based on the same concept. The specific manner in which each module and unit performs operations has been described in detail in the method embodiments and will not be repeated here. In actual applications, the application data display system provided in the above-described embodiment can, as needed, allocate the aforementioned functions to different functional modules, i.e., divide the internal structure of the device into different functional modules to perform all or part of the functions described above. This is not a limitation herein.
[0084] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the application data display method provided in the above-mentioned embodiments.
[0085] Figure 5 The following is a schematic diagram showing the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application. Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0086] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 into the random access memory (RAM) 503, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the RAM 503. The CPU 501, ROM 502 and RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0087] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 510 as needed, so that a computer program read from the removable medium can be installed in the storage section 508 as needed.
[0088] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from a removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the various functions defined in the system of the present application are executed.
[0089] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0091] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0092] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon. When executed by a computer processor, the computer program causes the computer to perform the application data display method described above. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.
[0093] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the application data display method provided in each of the above embodiments.
[0094] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, any equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.
Claims
1. A method for diagnosing a fault in an automobile controller, characterized in that: The method comprises: Acquire an information storage file of the vehicle controller, wherein the information storage file is pre-stored in the vehicle controller; Parsing the information storage file to obtain variable information; constructing a data message using the variable information, and sending the data message to the vehicle controller; Upon receiving a return message from the vehicle controller, parsing the return message to obtain a variable value, and performing fault diagnosis on the vehicle controller based on the variable value, wherein the return message is generated based on the data message; Acquiring an information storage file of the automobile controller, including: acquiring network address information and port information of the automobile controller; establishing a communication link between a host computer and the automobile controller based on the network address information and the port information; and collecting the information storage file in the automobile controller to the host computer based on the communication link; Sending the data message to the vehicle controller includes: acquiring an instruction set protocol, and sending the data message to the vehicle controller according to the instruction set protocol; Parsing the returned message, comprising: parsing the returned message according to the instruction set protocol; Fault diagnosis of the automobile controller is performed based on the variable value, including: comparing the variable value with a preset target value; when the variable value is consistent with the preset target value, determining that there is no fault in the automobile controller; when the variable value is inconsistent with the preset target value, determining that there is a fault in the automobile controller.
2. The method for diagnosing a fault in an automobile controller according to claim 1, wherein: When the variable information includes a sending address and a variable length, constructing a data message using the variable information includes: Fill the sending address and the variable length into the preset message template to obtain a data message.
3. The method for diagnosing a fault in an automobile controller according to claim 1, wherein: After parsing the returned message to obtain the variable value, the method further includes: The variable information and the variable value are added to a preset observation area, and the variable information and the variable value are displayed through the observation area.
4. An automobile controller fault diagnosis device applied to the automobile controller fault diagnosis method according to any one of claims 1 to 3, characterized in that: The device comprises: An acquisition module, configured to obtain an information storage file of the vehicle controller, wherein the information storage file is pre-stored in the vehicle controller; A parsing module, configured to parse the information storage file to obtain variable information; a sending module, configured to construct a data message using the variable information and send the data message to the vehicle controller; The diagnostic module is used to parse the return message received from the automobile controller to obtain variable values, and perform fault diagnosis on the automobile controller based on the variable values. The return message is generated based on the data message.
5. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement a vehicle controller fault diagnosis method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute a method for diagnosing faults of an automobile controller according to any one of claims 1 to 3.
Citation Information
Patent Citations
Automobile decoder and automotive type recognition method thereof
CN104216391A
Vehicle-mounted diagnosis method and device, electronic equipment and readable storage medium
CN114863582A