Electric control unit diagnosis method, device and equipment based on CAN bus and storage medium
Through the CAN bus-based electronic control unit diagnosis method on the CANoe platform, the problem of slow diagnosis response in complex electronic control systems is solved, and the rapid diagnosis of electronic control units is achieved to meet diverse needs.
Patent Information
- Application Number
- CN202411242208.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When traditional vehicle diagnostic systems face complex electronic control systems, it is difficult to quickly realize diagnostic responses to electronic control units.
The CAN bus-based electronic control unit diagnosis method is used to build a diagnostic system, and the rapid diagnosis of the electronic control unit is achieved by obtaining diagnostic protocol information, generating test cases, executing test cases and determining the diagnostic results with a preset diagnostic database.
By generating test cases for electronic control units and automatically performing, the diagnosis can be quickly responded and accurately performed, meeting diverse diagnostic needs and improving diagnostic efficiency.
Smart Images

Figure CN119200558A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of fault detection, and in particular to a method, device, equipment and storage medium for diagnosing an electronic control unit based on a CAN bus. Background Art
[0002] With the development of electronic technology and computer technology, more and more electronic control units (ECUs) are applied to vehicles. While ensuring power, economy, safety and comfort, these ECUs also make the vehicle electronic control system increasingly complex, so the requirements for vehicle diagnostic systems are also getting higher and higher.
[0003] Traditional vehicle diagnostic systems monitor the working conditions of each electronic control unit in the vehicle in real time. If there is an abnormality, the fault is determined according to a specific algorithm and recorded in the form of a fault code, so that maintenance personnel can obtain vehicle information, read and clear fault codes, perform data analysis and component testing through the diagnostic instrument, so as to quickly locate and repair the fault. However, due to the complexity of the vehicle's electronic control system, it is difficult to quickly achieve a diagnostic response to each electronic control unit based on the above method. Summary of the invention
[0004] The main purpose of this application is to provide an electronic control unit diagnostic method, device, equipment and storage medium based on the CAN bus, aiming to solve the technical problem that the diagnostic methods in the traditional vehicle diagnostic system are difficult to quickly achieve diagnostic response to each electronic control unit when applied to increasingly complex vehicle electronic control systems.
[0005] To achieve the above purpose, the present application proposes a CAN bus-based electronic control unit diagnosis method, which is applied to a vehicle diagnosis system built on a CANoe platform, and includes:
[0006] In response to a user selection instruction, determining an electronic control unit to be diagnosed, and acquiring diagnostic protocol information of the electronic control unit to be diagnosed;
[0007] Generate a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, wherein the preset diagnostic database is a database pre-established based on a standard electronic control unit diagnostic specification;
[0008] Executing the current test case to obtain test data of the electronic control unit to be diagnosed;
[0009] A diagnosis result is determined based on the test data in combination with the preset diagnosis database.
[0010] In one embodiment, before the step of generating a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, the step further includes:
[0011] Initializing a plurality of diagnostic instances corresponding to the electronic control unit to be diagnosed based on the user's diagnostic requirements;
[0012] Defining parameter information of each of the diagnostic instances and status information of the electronic control unit to be diagnosed according to a standard electronic control unit diagnostic specification;
[0013] Defining a database support interface according to the interface information of the electronic control unit to be diagnosed;
[0014] A preset diagnostic database is established according to the status information of the electronic control unit to be diagnosed, the parameter information of each diagnostic instance and the database support interface.
[0015] In one embodiment, the standard ECU specification includes: diagnostic service definition information and diagnostic status group definition information;
[0016] The step of defining the parameter information of each diagnosis instance and the status information of the electronic control unit to be diagnosed according to the standard electronic control unit diagnosis specification includes:
[0017] Establishing a data identifier and a fault code corresponding to each of the diagnostic instances according to the diagnostic service definition information;
[0018] The electronic control unit to be diagnosed is divided into a plurality of diagnostic status groups, and the status characteristics corresponding to each of the diagnostic status groups are defined according to the diagnostic status group definition information.
[0019] In one embodiment, the standard ECU specification further includes interface definition information and addressing transmission mode and response transmission mode definition information;
[0020] The step of defining a database support interface according to the interface information of the electronic control unit to be diagnosed comprises:
[0021] Initialize the database support interface according to the interface definition information;
[0022] Determining supported interface parameters according to the interface information of the electronic control unit to be diagnosed, wherein the supported interface parameters include the ECU name and interface parameters of the electronic control unit to be diagnosed;
[0023] According to the addressing sending mode and the response sending mode definition information combined with the supporting interface parameters, configuring the physical addressing mode and communication parameters corresponding to the electronic control unit to be diagnosed;
[0024] The database support interface is defined according to the support interface parameters, the physical addressing mode and the communication parameters.
[0025] In one embodiment, the step of generating a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed includes:
[0026] Generate user-defined test data according to the user configuration instruction and a preset diagnostic database corresponding to the electronic control unit to be diagnosed;
[0027] Based on the diagnostic protocol information, formatted data is generated according to the user-defined test data, and a corresponding CDD file is generated;
[0028] By presetting the CANdiva project, the current test case is generated based on the CDD file.
[0029] In one embodiment, before the step of executing the current test case and obtaining the test data of the electronic control unit to be diagnosed, the following steps are included:
[0030] Query the CAN bus interface configuration information corresponding to the electronic control unit to be diagnosed, and establish a communication connection corresponding to the electronic control unit to be diagnosed based on the CAN bus interface configuration information.
[0031] In one embodiment, the step of determining the diagnosis result according to the test data in combination with the preset diagnosis database includes:
[0032] Determining a reference diagnosis instance among the diagnosis instances in the preset diagnosis database based on the current test case;
[0033] The test data is compared with the parameter information of the reference diagnosis instance, and a diagnosis test report of the electronic control unit to be diagnosed is generated according to the comparison result.
[0034] In addition, to achieve the above purpose, the present application also proposes an electronic control unit diagnostic device based on a CAN bus, the device comprising:
[0035] A test task initialization module, used to determine the electronic control unit to be diagnosed and obtain the diagnostic protocol information of the electronic control unit to be diagnosed in response to a user selection instruction;
[0036] A test case generation module, used to generate a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, wherein the preset diagnostic database is a database pre-established based on a standard electronic control unit diagnostic specification;
[0037] The test execution module is used to execute the current test case to obtain the test data of the electronic control unit to be diagnosed; and determine the diagnosis result according to the test data combined with the preset diagnosis database.
[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a CAN bus-based electronic control unit diagnostic device, and the CAN bus-based electronic control unit diagnostic device includes: a memory, a processor, and a CAN bus-based electronic control unit diagnostic program stored in the memory and executable on the processor, and the CAN bus-based electronic control unit diagnostic program, when executed by the processor, implements the steps of the CAN bus-based electronic control unit diagnostic method as described above.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which a CAN bus-based electronic control unit diagnostic program is stored. When the CAN bus-based electronic control unit diagnostic program is executed by a processor, the steps of the CAN bus-based electronic control unit diagnostic method as described above are implemented.
[0040] The present application discloses a method for diagnosing an electronic control unit based on a CAN bus, which is applied to a vehicle diagnostic system built on a CANoe platform, and includes: in response to a user selection instruction, determining an electronic control unit to be diagnosed, and obtaining diagnostic protocol information of the electronic control unit to be diagnosed; generating a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, wherein the preset diagnostic database is a database pre-established based on a standard electronic control unit diagnostic specification; executing the current test case to obtain test data of the electronic control unit to be diagnosed; and determining a diagnostic result according to the test data in combination with the preset diagnostic database. Since the present application can generate a current test case according to the electronic control unit to be diagnosed and its corresponding preset diagnostic database, and the preset diagnostic database is pre-established based on the standard electronic control unit diagnostic specification, it covers a wide range of diagnostic scenarios and test requirements, and can meet the diverse diagnostic needs of different electronic control units, and then automatically execute the test case to determine the diagnostic result in combination with the preset diagnostic database when obtaining the test data, thereby realizing a rapid diagnostic response to the electronic control unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1A schematic diagram of the structure of an electronic control unit diagnostic device based on a CAN bus in a hardware operating environment involved in an embodiment of the present application;
[0044] Figure 2 This is a flow chart of the first embodiment of the electronic control unit diagnosis method based on the CAN bus of the present application;
[0045] Figure 3 This is a schematic diagram of the test environment in the electronic control unit diagnosis method based on the CAN bus of this application;
[0046] Figure 4 This is a flow chart of a second embodiment of the electronic control unit diagnostic method based on the CAN bus of the present application;
[0047] Figure 5 This is a schematic diagram of the entire process of the electronic control unit diagnosis method based on the CAN bus of this application;
[0048] Figure 6 This is a schematic diagram of the module structure of the first embodiment of the electronic control unit diagnostic device based on the CAN bus of the present application.
[0049] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0051] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of an electronic control unit diagnostic device based on the CAN bus in the hardware operating environment involved in the embodiment of the present application.
[0052] like Figure 1As shown, the CAN bus-based electronic control unit diagnostic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0053] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic control unit diagnostic device based on the CAN bus, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0054] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and an electronic control unit diagnostic program based on the CAN bus.
[0055] exist Figure 1 In the CAN bus-based ECU diagnostic device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the CAN bus-based ECU diagnostic device of the present application can be set in the CAN bus-based ECU diagnostic device, and the CAN bus-based ECU diagnostic device calls the CAN bus-based ECU diagnostic program stored in the memory 1005 through the processor 1001, and executes the CAN bus-based ECU diagnostic method provided in the embodiment of the present application.
[0056] The present application embodiment provides a method for diagnosing an electronic control unit based on a CAN bus, referring to Figure 2 , Figure 2This is a flow chart of the first embodiment of the ECU diagnostic method based on the CAN bus of the present application. In this embodiment, the method is applied to a vehicle diagnostic system built on the CANoe platform. The method includes steps S10 to S40:
[0057] Step S10: In response to a user selection instruction, determining an electronic control unit to be diagnosed, and acquiring diagnostic protocol information of the electronic control unit to be diagnosed.
[0058] It should be understood that the method of this embodiment can be applied to the scene of real-time fault detection of each electronic control unit (Electronic Control Unit, ECU) in the vehicle, or pre-delivery detection of each ECU in the vehicle. The execution subject of the method of this embodiment can be a computing service device with the above-mentioned vehicle diagnostic system built on the CANoe platform, and the computing service device can be located inside the vehicle, such as the above-mentioned electronic control unit diagnostic device based on the CAN bus, which can be a part of the vehicle automatic diagnostic system (OBD, On-Board Diagnostics). The following takes the electronic control unit diagnostic device with the vehicle diagnostic system built on the CANoe platform (hereinafter referred to as "vehicle diagnostic system") as an example to explain the various embodiments of this application.
[0059] It should be noted that the vehicle diagnostic system can provide a user interaction interface (TestSetup user interface), so that the user can obtain relevant information of all ECUs in the current vehicle (ECU identification, ECU function, ECU location, etc.) on the interaction interface, and then select the electronic control unit to be diagnosed among each ECU.
[0060] It should be understood that the diagnostic protocol information can be a standardized communication specification, which is used to ensure that the electronic control unit to be diagnosed can effectively exchange data with the vehicle diagnostic system, and can ensure that the user-defined configuration information subsequently obtained from the interactive interface complies with the diagnostic protocol regulations of the electronic control unit to be diagnosed.
[0061] It is understandable that the diagnostic protocol information may include: application layer keyword protocols: ISO 14229-1 (Uniform Diagnostic Service), ISO 15031-5 (Keyword Protocol 2000), ISO 15765-3 (CAN-based diagnostic communication) protocols. Among them, ISO 14229-1 mainly defines the application layer protocol data unit (A_PDU) and diagnostic services, which allow the vehicle diagnostic system to control the diagnostic function in the ECU; ISO 15031-5 mainly specifies the requirements for fault codes (DTCs), and ISO 15765-3 defines application layer timing parameters.
[0062] Step S20: generating a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, wherein the preset diagnostic database is a database pre-established based on a standard electronic control unit diagnostic specification.
[0063] It should be understood that before performing a diagnostic test on the electronic control unit to be diagnosed, a diagnostic database corresponding to the electronic control unit to be diagnosed can be established in advance based on the standard electronic control unit diagnostic specification. The preset diagnostic database includes various diagnostic measurement processes and standards (diagnostic instances, diagnostic services, expected responses) for the ECU to ensure the comprehensiveness and accuracy of the diagnostic test process.
[0064] It is understandable that the above diagnostic protocol information can receive user-defined data from the user interaction interface, and then convert the user-defined data into formatted data that complies with the ECU protocol regulations to generate the current test case.
[0065] Further, in order to specifically illustrate the generation process of the current test case, step S20 specifically includes steps S201 to S203:
[0066] Step S201: Generate user-defined test data according to the user configuration instruction and a preset diagnosis database corresponding to the electronic control unit to be diagnosed.
[0067] It should be understood that the user configuration instruction may be a configuration instruction selected or input by the user based on an interactive interface, and may include: ECU functions to be tested, specific diagnostic scenarios, desired test parameters, and defined expected results, etc.
[0068] In a specific implementation, when the vehicle diagnostic system obtains the configuration instructions input by the user, it can match and merge the user configuration instructions with the relevant entries in the preset diagnostic database to generate user-defined test data.
[0069] Step S202: Based on the diagnostic protocol information, formatted data is generated according to the user-defined test data, and a corresponding CDD file is generated.
[0070] It should be understood that, based on the CANoe platform, the CANdela software can be used to convert the user-defined test data into formatted data and encapsulate it into a CDD file to ensure that the formatted data used for subsequent tests can be correctly parsed and responded to by the electronic control unit to be diagnosed.
[0071] It can be understood that the CDD file is a standardized file format that describes ECU communication data. Encapsulating the formatted data into the CDD file can provide a data basis for subsequent test case generation.
[0072] Step S203: Generate a current test case based on the CDD file by presetting the CANdiva project.
[0073] It should be understood that the CDD file can be directly imported into the CANoe platform for users to perform manual testing. The CANdiva tool can also be used in combination with the CDD file to automatically generate test cases to achieve automated testing.
[0074] It is understandable that the preset CANdiva project may include information such as network topology, ECU configuration, communication parameters, etc., which is the basis for performing ECU testing.
[0075] In a specific implementation, the CDD file can be imported into a preset CANdiva project, and the CANdiva project reads the test data and configuration in the CDD file to automatically generate a current test case for the electronic control unit to be diagnosed.
[0076] It should also be noted that the current test case may include specific test steps, expected results and diagnostic processes, and may also generate a DIVA file based on the current test case to facilitate importing the DIVA file into the CANoe platform to achieve automated testing of the electronic control unit to be diagnosed.
[0077] Step S30: Execute the current test case to obtain test data of the electronic control unit to be diagnosed.
[0078] It should be understood that in order to ensure stable execution of the test process of the electronic control unit to be diagnosed, it is also necessary to ensure that the vehicle diagnostic system and the electronic control unit to be diagnosed can perform normal data exchange. Therefore, before step S30, it also includes:
[0079] Step S30 ′: querying the CAN bus interface configuration information corresponding to the electronic control unit to be diagnosed, and establishing a communication connection corresponding to the electronic control unit to be diagnosed based on the CAN bus interface configuration information.
[0080] It should be understood that the CAN bus interface configuration information may include: an identifier of the ECU to be diagnosed in the CAN bus network, a communication speed between the ECU to be diagnosed and the CAN bus, and a data transmission mode of the ECU to be diagnosed.
[0081] It is understandable that the vehicle diagnostic system can configure the CAN bus interface according to the above CAN bus interface configuration information, for example, to set various parameters of the CAN card. After the configuration is completed, the vehicle diagnostic system can establish a communication connection with the electronic control unit to be diagnosed through the CAN bus interface to facilitate the execution of subsequent diagnostic tests.
[0082] In a specific implementation, the vehicle diagnostic system can execute the above current test case, communicate with the electronic control unit to be diagnosed through the CAN bus to collect response information and status data of the electronic control unit to be diagnosed, such as sensor readings, actuator status, and fault codes.
[0083] Step S40: determining a diagnosis result according to the test data in combination with the preset diagnosis database.
[0084] It should be understood that the vehicle diagnostic system compares and analyzes the collected test data with the standard data in the preset diagnostic database, so as to identify abnormal conditions existing in the electronic control unit to be diagnosed.
[0085] Specifically, the vehicle diagnostic system can determine a reference diagnostic instance in each diagnostic instance of the preset diagnostic database based on the current test case; compare the test data with the parameter information of the reference diagnostic instance, and generate a diagnostic test report for the electronic control unit to be diagnosed according to the comparison result.
[0086] It should be understood that the test report may include fault codes, possible causes, recommended repair steps, etc., and the test report is then displayed to the user based on an interactive interface so that the user can intuitively understand the test diagnosis results of the electronic control unit to be diagnosed.
[0087] It should also be noted that after obtaining the test report, the user can also repeat the test process of the electronic control unit to be diagnosed by checking the above current test case on the interactive interface to meet the flexible testing needs of different users.
[0088] In addition, this can also be combined with Figure 3 The test implementation process of the electronic control unit diagnosis method based on the CAN bus in this application is specifically described. Figure 3 This is a schematic diagram of the test environment in the electronic control unit diagnosis method based on the CAN bus in this application.
[0089] exist Figure 3 In the process, the electronic control unit to be diagnosed (Real ECU) communicates with the vehicle diagnostic system built on the CANoe platform through the configured CAN card (CAN.card). In the CANoe platform, a specific underlying communication module (ECU.dll) can be loaded to realize the communication function with the diagnostic electronic control unit.
[0090] In the CANoe platform, before performing diagnostic tests, you first need to ensure that the preset diagnostic database has been correctly configured. Then, based on the selection instructions or configuration instructions triggered by the user in the operation interface (TestSetup), a CDD file (ECU.cdd) can be generated in combination with the preset diagnostic database, and imported into the CANdiva project to automatically generate the current test case (ECU.diva). The current test case is then transmitted to the CAN bus based on the network data capture control logic to be transmitted to the electronic control unit to be diagnosed.
[0091] The unit to be diagnosed will respond to the test data of the current test instance and return it to the CANoe platform based on the CAN bus. The CANoe platform will then compare and analyze the collected test data with the standard data in the preset diagnostic database, identify the abnormal conditions existing in the electronic control unit to be diagnosed, and generate a corresponding test report (Report.hmt) to complete the diagnostic test of the electronic control unit to be diagnosed.
[0092] The message display and intermediate data on the CAN bus during the diagnostic test process can be stored by configuring the Trace module.
[0093] The present embodiment discloses a method for diagnosing an electronic control unit based on a CAN bus, which is applied to a vehicle diagnostic system built on a CANoe platform, and includes: in response to a user selection instruction, determining an electronic control unit to be diagnosed, and obtaining diagnostic protocol information of the electronic control unit to be diagnosed; generating a current test case according to the diagnostic protocol information combined with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, wherein the preset diagnostic database is a database pre-established based on a standard electronic control unit diagnostic specification; executing the current test case to obtain test data of the electronic control unit to be diagnosed; and determining a diagnostic result according to the test data combined with the preset diagnostic database. Since the present embodiment can generate a current test case according to the electronic control unit to be diagnosed and its corresponding preset diagnostic database, and the preset diagnostic database is pre-established based on the standard electronic control unit diagnostic specification, it covers a wide range of diagnostic scenarios and test requirements, and can meet the diverse diagnostic needs of different electronic control units, and then automatically execute the test case to determine the diagnostic result in combination with the preset diagnostic database when obtaining the test data, thereby realizing a rapid diagnostic response to the electronic control unit.
[0094] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , Figure 4 This is a flow chart of the second embodiment of the electronic control unit diagnosis method based on the CAN bus of the present application.
[0095] In this embodiment, in order to illustrate how to construct a preset diagnosis database, before step S20, the following steps are also included: Steps S01 to S04:
[0096] Step S01: based on the user's diagnostic requirements, initializing a number of diagnostic instances corresponding to the electronic control unit to be diagnosed.
[0097] It should be understood that the user can create a new diagnosis instance or select an existing instance template based on the diagnosis requirements of the electronic control unit to be diagnosed. Each instance can represent a specific diagnosis task or test scenario for the electronic control unit to be diagnosed.
[0098] Step S02: defining parameter information of each diagnosis instance and status information of the ECU to be diagnosed according to a standard ECU diagnosis specification.
[0099] It should be understood that since the functions of the physical layer and data link layer in the communication protocol hierarchy are implemented in the CAN bus and its controller, they are specifically defined by ISO 11898, while the transport layer and application layer require designers to define and design diagnostic specifications according to the PDU format of each layer, and agree on the functions and methods of diagnostic implementation. Therefore, the standard electronic control unit diagnostic specification can include: diagnostic service definition information, diagnostic status group definition information, interface definition information, and addressing transmission method and response transmission method definition information.
[0100] It is understood that the data identifier (DID) and the fault code (DTC) corresponding to each diagnostic instance can first be established according to the diagnostic service definition information. Each DID corresponds to a specific vehicle parameter or data record, and the DTC assigns standardized or manufacturer-specific fault codes to various possible fault conditions.
[0101] It should be noted that the diagnostic service definition can be: The diagnostic specification design includes: (1) detection and query functions. Including reading vehicle information, reading the working status of the electronic control unit, etc.; (2) the function of reading fault codes. Read the fault code stored in the electronic control unit, analyze it by calling the database, and give the specific location and cause of the fault; (3) the function of modifying control parameters; (4) dynamic test function.
[0102] It should also be noted that diagnostic services are an important part of diagnostic specification design. Based on the ISO 14229 protocol, the commonly used basic services are: 10 services (diagnostic mode control), 22 services (read vehicle information, including DID settings), 19 services (read fault codes, including DTC settings), 14 services (clear diagnostic information), and 3E services (equipment online).
[0103] It can be understood that the electronic control unit to be diagnosed can then be divided into several diagnostic status groups, and the status characteristics corresponding to each diagnostic status group can be defined according to the diagnostic status group definition information.
[0104] Specifically, the diagnostic status group can be divided into, for example, normal, fault, standby, etc. The specific state in each diagnostic status group can be used as its corresponding status feature. It is also possible to define the jump conditions of different status components and the diagnostic service types supported by the ECU in each status group.
[0105] It should be noted that the diagnostic status group definition may include: ECU usually has two diagnostic status groups: diagnostic session mode (Session) and security access (Security Access). Each service needs to define the diagnostic session mode and security state it supports, and specify the jump switching conditions between each mode and state.
[0106] The diagnostic session modes include: defaultSession (DS default mode), programmingSession (PRGS programming mode), extendedDiagnosticSession (EXTDS extended mode) and other modes. The client switches the state of the server diagnostic mode through the 10 diagnostic service.
[0107] The security state is divided into locked state and unlocked state, and the security state is controlled by 27 diagnostic services. After the ECU is powered on, it automatically enters the locked state, and this state prohibits the execution of restricted diagnostic services. The ECU needs to complete the password verification by executing the security access service (SID = 0x27) to enter the unlocked state. After the password verification, the security state of the ECU changes to the unlocked state, and the vehicle diagnostic system can request the restricted diagnostic service to switch the server between the locked and unlocked states. Among them, the password verification algorithm is customized by the user.
[0108] In a specific implementation, the vehicle diagnostic system first establishes the data identifier and fault code corresponding to each diagnostic instance according to the diagnostic service definition information; then divides the electronic control unit to be diagnosed into a number of diagnostic status groups, and defines the status characteristics corresponding to each diagnostic status group according to the diagnostic status group definition information.
[0109] Step S03: defining a database support interface according to the interface information of the electronic control unit to be diagnosed.
[0110] Further, in order to specifically explain how to define the support interface, step S03 includes: steps S031 to S034:
[0111] Step S031: Initialize the database support interface according to the interface definition information.
[0112] It can be understood that the above interface definition information may include setting information for various timers, flow control parameters and addressing modes.
[0113] The timer settings include the session management timers of the server and the client, and the network layer timers with the interface service between the data link layer and the network layer as the start and end time.
[0114] The flow control parameters include BS and STmin, which are used to control the transmission of multi-packet data. The management and organization of multi-packet data are completed at the network layer, and the application layer does not need to care about this process. When BS≠0, it means that the sender is allowed to send a number of consecutive frames continuously. After sending the corresponding number of consecutive frames, the sender must wait for the flow control frame sent by the receiver. When BS=0, it means that the sender is allowed to send consecutive frames continuously without waiting for the flow control frame sent by the receiver. STmin indicates the minimum interval time between two consecutive frames.
[0115] The ISO-15765 specification specifies four addressing modes: normal addressing mode (Normal), normal fixed addressing mode (Normal, Fixed), extended addressing mode (Extented), and mixed addressing mode (Mixed) for remote diagnosis.
[0116] In a specific implementation, the database support interface can be initialized based on the above interface definition information to create an interface object.
[0117] Step S032: Determine supported interface parameters according to the interface information of the electronic control unit to be diagnosed, wherein the supported interface parameters include the ECU name and interface parameters of the electronic control unit to be diagnosed.
[0118] It is understandable that the supported interface parameters can be determined based on the interface information of the electronic control unit to be diagnosed. The supported interface parameters correspond to the interface information and may include: ECU name, specific interface parameters such as baud rate, data bit, stop bit and check bit, etc., to ensure accurate communication between the database and the electronic control unit to be diagnosed.
[0119] Step S033: configuring the physical addressing mode and communication parameters corresponding to the electronic control unit to be diagnosed according to the addressing sending mode and response sending mode definition information combined with the supporting interface parameters.
[0120] It should be understood that the definition of the above-mentioned addressing sending mode and response sending mode can be: when the services supported by the ECU are determined, the addressing mode supported by each service needs to be defined. The commonly used addressing modes are: physical addressing and functional addressing, and the request ID of each addressing mode and the response ID of the electronic control unit are defined. When defining the response sending, it is necessary to fully consider: the content of the positive response supported by the server, the sending conditions, and the format of the effective positive response to the client; also fully consider the occurrence of negative response, the type of negative response and the prompt.
[0121] In a specific implementation, the physical addressing mode of the electronic control unit to be diagnosed can be configured based on the addressing and sending mode and the response sending mode of the electronic control unit to be diagnosed, including: the physical address, functional address and mixed addressing mode of the electronic control unit to be diagnosed; and the communication parameters can be determined according to the above-mentioned supporting interface parameters. The communication parameters may include baud rate, application layer timing object, network layer timing object and flow control parameters, etc., to ensure the stability and efficiency of communication.
[0122] Step S034: defining the database support interface according to the support interface parameters, the physical addressing mode and the communication parameters.
[0123] In the specific implementation, the above-determined supported interface parameters, physical addressing methods and communication parameters are integrated to define the database supported interface, and then the interface configuration is created or updated in the database so that subsequent data communication and ECU diagnostic tests can proceed smoothly.
[0124] Step S04: establishing a preset diagnostic database according to the status information of the electronic control unit to be diagnosed, the parameter information of each diagnostic instance and the database support interface.
[0125] It should also be noted that the process of establishing the above-mentioned preset diagnostic database can be completed in the CANdela tool based on the CANoe platform.
[0126] It should be noted that CANdelaStudio is a diagnostic tool designed by Vector Company, which is used to create ECU diagnostic description files and form diagnostic databases. Its software operation interface consists of three parts: tree structure window, Entry Mask, and output window. Select the entry to be edited in the tree structure window, edit the entry content in Entry Mask, and perform consistency detection after the database editing is completed, and observe the detection results in the output window.
[0127] In the specific implementation, after the design of the standard electronic control unit diagnostic specifications is completed, a diagnostic database can be established according to the diagnostic specifications of each electronic control unit to be diagnosed as the basis for the subsequent diagnostic test process, so as to better form test cases and provide diagnostic result evaluation criteria in the subsequent diagnostic test process.
[0128] In addition, this can also be combined with Figure 5 The whole process of the electronic control unit diagnosis method based on CAN bus on the CANoe platform of this application is described. Figure 5 This is a schematic diagram of the entire process of the electronic control unit diagnosis method based on the CAN bus in this application.
[0129] exist Figure 5 In the present invention, the method can be divided into two processes: database establishment and test implementation.
[0130] For a certain ECU to be diagnosed, during the database establishment process, the diagnostic instance can be created first according to the diagnostic requirements, then the diagnostic status group and the status of each group can be created based on the standard ECU diagnostic specification, and finally the interface parameters can be defined. This will enable the establishment of a preset diagnostic database as the input basis for the next step of test implementation.
[0131] During the test implementation process, the current test case can be generated based on the preset diagnostic database first; then based on the task scheduling algorithm control and the interface configuration of the CAN bus hardware (such as the CAN card), the communication connection with the electronic control unit to be diagnosed is realized; then the current test case is imported, and the user makes a secondary selection on the interactive interface to confirm the test case that needs to be executed at present; finally, the test is executed to generate the corresponding test report. Thus, the electronic control unit diagnostic method based on the CAN bus of this application is implemented on the CANoe platform based on the CANdela and CANDiva tools.
[0132] This embodiment initializes several diagnostic instances corresponding to the electronic control unit to be diagnosed based on the user's diagnostic needs; defines the parameter information of each diagnostic instance and the status information of the electronic control unit to be diagnosed according to the standard electronic control unit diagnostic specification; defines the database support interface according to the interface information of the electronic control unit to be diagnosed; and establishes a preset diagnostic database according to the status information of the electronic control unit to be diagnosed, the parameter information of each diagnostic instance and the database support interface. As a result, the established diagnostic database not only accurately reflects the diagnostic needs of the ECU, but also supports comprehensive diagnostic function testing, providing a reliable reference data basis for the subsequent automatic generation of test cases and verification of test results, which is conducive to further improving the efficiency of diagnostic testing of electronic control units.
[0133] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the electronic control unit diagnostic method based on the CAN bus of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0134] In addition, an embodiment of the present application further proposes a storage medium, on which a CAN bus-based ECU diagnostic program is stored. When the CAN bus-based ECU diagnostic program is executed by a processor, the CAN bus-based ECU diagnostic method as described above is implemented.
[0135] The present application also provides an electronic control unit diagnostic device based on the CAN bus, referring to Figure 6 , Figure 6 This is a schematic diagram of the module structure of the first embodiment of the electronic control unit diagnostic device based on the CAN bus of the present application, and the electronic control unit diagnostic device based on the CAN bus includes:
[0136] The test task initialization module 601 is used to determine the electronic control unit to be diagnosed and obtain the protocol information of the electronic control unit to be diagnosed in response to the user selection instruction;
[0137] A test case generation module 602 is used to generate a current test case according to the protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, wherein the preset diagnostic database is a database pre-established based on a standard electronic control unit diagnostic specification;
[0138] The test execution module 603 is used to execute the current test case to obtain the test data of the electronic control unit to be diagnosed; and determine the diagnosis result according to the test data combined with the preset diagnosis database.
[0139] Furthermore, the test case generation module 602 is also used to generate user-defined test data according to user configuration instructions and a preset diagnostic database corresponding to the electronic control unit to be diagnosed; based on the diagnostic protocol information, generate formatted data according to the user-defined test data, and generate a corresponding CDD file; through the preset CANdiva project, generate the current test case based on the CDD file.
[0140] Furthermore, the test execution module 603 is further used to query the CAN bus interface configuration information corresponding to the electronic control unit to be diagnosed, and establish a communication connection corresponding to the electronic control unit to be diagnosed based on the CAN bus interface configuration information.
[0141] In the present embodiment, the current test case can be generated according to the electronic control unit to be diagnosed and its corresponding preset diagnostic database, and the preset diagnostic database is pre-established based on the standard electronic control unit diagnostic specifications, covering a wide range of diagnostic scenarios and test requirements, and can meet the diverse diagnostic needs of different electronic control units, and then automatically execute the test case to determine the diagnostic result in combination with the preset diagnostic database when the test data is obtained, thereby realizing a rapid diagnostic response to the electronic control unit.
[0142] Based on the above-mentioned first embodiment of the electronic control unit diagnostic device based on the CAN bus of the present application, a second embodiment of the electronic control unit diagnostic device based on the CAN bus of the present application is proposed.
[0143] In this embodiment, the CAN bus-based electronic control unit diagnostic device further includes: a database construction module.
[0144] The database construction module is used to initialize several diagnostic instances corresponding to the electronic control unit to be diagnosed based on user diagnostic requirements; define parameter information of each diagnostic instance and status information of the electronic control unit to be diagnosed according to standard electronic control unit diagnostic specifications; define a database support interface according to the interface information of the electronic control unit to be diagnosed; and establish a preset diagnostic database according to the status information of the electronic control unit to be diagnosed, parameter information of each diagnostic instance and the database support interface.
[0145] Further, the standard ECU specification includes: diagnostic service definition information and diagnostic status group definition information;
[0146] The database construction module is also used to establish data identifiers and fault codes corresponding to each of the diagnostic instances based on the diagnostic service definition information; divide the electronic control units to be diagnosed into a number of diagnostic status groups, and define the status characteristics corresponding to each of the diagnostic status groups according to the diagnostic status group definition information.
[0147] Furthermore, the standard ECU specification also includes interface definition information and addressing transmission mode and response transmission mode definition information.
[0148] The database construction module is also used to initialize the database support interface according to the interface definition information; determine the support interface parameters according to the interface information of the electronic control unit to be diagnosed, and the support interface parameters include the ECU name and interface parameters of the electronic control unit to be diagnosed; configure the physical addressing method and communication parameters corresponding to the electronic control unit to be diagnosed according to the addressing sending method and response sending method definition information combined with the support interface parameters; define the database support interface according to the support interface parameters, the physical addressing method and the communication parameters.
[0149] In this embodiment, the diagnostic database pre-established based on the standard electronic control unit diagnostic specification not only accurately reflects the diagnostic requirements for the ECU, but also supports comprehensive diagnostic function testing, providing a reliable reference data basis for subsequent automatic generation of test cases and verification of test results, which is conducive to further improving the efficiency of diagnostic testing of the electronic control unit.
[0150] Other embodiments or specific implementations of the CAN bus-based electronic control unit diagnostic device described in this application can refer to the above-mentioned method embodiments and will not be repeated here.
[0151] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0152] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0154] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for diagnosing an electronic control unit based on a CAN bus, characterized in that: The method is applied to a vehicle diagnostic system built on a CANoe platform, and the method comprises: In response to a user selection instruction, determining an electronic control unit to be diagnosed, and acquiring diagnostic protocol information of the electronic control unit to be diagnosed; Generate a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, wherein the preset diagnostic database is a database pre-established based on a standard electronic control unit diagnostic specification; Executing the current test case to obtain test data of the electronic control unit to be diagnosed; A diagnosis result is determined based on the test data in combination with the preset diagnosis database.
2. The method according to claim 1, characterized in that Before the step of generating a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, the method further includes: Initializing a plurality of diagnostic instances corresponding to the electronic control unit to be diagnosed based on the user's diagnostic requirements; Defining parameter information of each of the diagnostic instances and status information of the electronic control unit to be diagnosed according to a standard electronic control unit diagnostic specification; Defining a database support interface according to the interface information of the electronic control unit to be diagnosed; A preset diagnostic database is established according to the status information of the electronic control unit to be diagnosed, the parameter information of each diagnostic instance and the database support interface.
3. The method according to claim 2, characterized in that The standard ECU specification includes: diagnostic service definition information and diagnostic status group definition information; The step of defining the parameter information of each diagnosis instance and the status information of the electronic control unit to be diagnosed according to the standard electronic control unit diagnosis specification includes: Establishing a data identifier and a fault code corresponding to each of the diagnostic instances according to the diagnostic service definition information; The electronic control unit to be diagnosed is divided into a plurality of diagnostic status groups, and the status characteristics corresponding to each of the diagnostic status groups are defined according to the diagnostic status group definition information.
4. The method according to claim 3, characterized in that The standard ECU specification also includes interface definition information and addressing transmission mode and response transmission mode definition information; The step of defining a database support interface according to the interface information of the electronic control unit to be diagnosed comprises: Initialize the database support interface according to the interface definition information; Determining supported interface parameters according to the interface information of the electronic control unit to be diagnosed, wherein the supported interface parameters include the ECU name and interface parameters of the electronic control unit to be diagnosed; According to the addressing sending mode and the response sending mode definition information combined with the supporting interface parameters, configuring the physical addressing mode and communication parameters corresponding to the electronic control unit to be diagnosed; The database support interface is defined according to the support interface parameters, the physical addressing mode and the communication parameters.
5. The method according to claim 1, characterized in that The step of generating a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed includes: Generate user-defined test data according to the user configuration instruction and a preset diagnostic database corresponding to the electronic control unit to be diagnosed; Based on the diagnostic protocol information, formatted data is generated according to the user-defined test data, and a corresponding CDD file is generated; By presetting the CANdiva project, the current test case is generated based on the CDD file.
6. The method according to claim 1, characterized in that The step of determining the electronic control unit to be diagnosed and acquiring the diagnostic protocol information of the electronic control unit to be diagnosed in response to the user selection instruction includes: In response to a user selection instruction, determining an electronic control unit to be diagnosed; The CAN bus interface corresponding to the electronic control unit to be diagnosed is queried, and the diagnostic protocol information of the electronic control unit to be diagnosed is obtained based on the CAN bus interface.
7. The method according to claim 1, characterized in that The step of determining the diagnosis result according to the test data in combination with the preset diagnosis database comprises: Determining a reference diagnosis instance among the diagnosis instances in the preset diagnosis database based on the current test case; The test data is compared with the parameter information of the reference diagnosis instance, and a diagnosis test report of the electronic control unit to be diagnosed is generated according to the comparison result.
8. A CAN bus-based electronic control unit diagnostic device, characterized in that: The device comprises: A test task initialization module, used to determine the electronic control unit to be diagnosed and obtain the diagnostic protocol information of the electronic control unit to be diagnosed in response to a user selection instruction; A test case generation module, used to generate a current test case according to the diagnostic protocol information in combination with a preset diagnostic database corresponding to the electronic control unit to be diagnosed, wherein the preset diagnostic database is a database pre-established based on a standard electronic control unit diagnostic specification; The test execution module is used to execute the current test case to obtain the test data of the electronic control unit to be diagnosed; and determine the diagnosis result according to the test data combined with the preset diagnosis database.
9. An electronic control unit diagnostic device based on CAN bus, characterized in that: The CAN bus-based ECU diagnostic device comprises: a memory, a processor, and a CAN bus-based ECU diagnostic program stored in the memory and executable on the processor. When the CAN bus-based ECU diagnostic program is executed by the processor, the steps of the CAN bus-based ECU diagnostic method as described in any one of claims 1 to 7 are implemented.
10. A storage medium, characterized in that: The storage medium stores a CAN bus-based ECU diagnostic program, which, when executed by a processor, implements the steps of the CAN bus-based ECU diagnostic method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Diagnostic test method, diagnostic device and diagnostic system
CN104424064A
Commercial vehicle OBD diagnostic device network automation test system and method thereof
CN107491061A
Method, device and equipment for testing vehicle ECU diagnosis based on CAPL and storage medium
CN116088462A
Vehicle diagnosis protocol test method and device, terminal equipment and storage medium
CN117289908A
Diagnosis information message automatic generating system for genterating diagnosis program for automobile and method thereof
KR1020100041574A
