Vehicle diagnosis method, device and equipment and storage medium
By creating a virtual ECU in a vehicle and determining the physical ECU using an association table, the problem of repeated connection between diagnostic devices and multiple ECUs in the prior art is solved, and efficient vehicle diagnosis is achieved.
Patent Information
- Application Number
- CN202510416924.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-04
AI Technical Summary
Existing vehicle diagnostic equipment needs to repeatedly establish communication connections with different ECUs, resulting in low diagnostic efficiency and high development difficulty.
Create a virtual electronic control unit in the target vehicle, and determine the entity ECU through a preset association table, generate target diagnostic requests and reply commands to avoid repeatedly establishing communication connections.
It improves vehicle diagnostic efficiency and reduces the workload and difficulty of developing diagnostic equipment.
Smart Images

Figure CN120255481A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data diagnosis, and particularly to a vehicle diagnosis method, device, equipment and storage medium. Background Art
[0002] A vehicle ECU (Electronic Control Unit), also known as an on-board computer, is the central nervous system of a vehicle. The data in the vehicle ECU mainly comes from various sensors, which are responsible for collecting various parameters during vehicle operation, such as throttle opening, crankshaft speed, oxygen content, water temperature, etc. The sensors transmit the collected information to the ECU in the form of electrical signals, and the analog-to-digital converter inside the ECU then converts these electrical signals into digital signals for subsequent processing and operations. Currently, when a diagnostic device needs to execute the diagnostic function of a certain ECU, it is necessary to set the communication parameters to those of this ECU, then establish a communication connection with this ECU, and then send diagnostic commands for interaction. However, the communication parameters of different ECUs may all be different, and the system IDs are also different. Each time interacting with different ECUs requires the diagnostic device to determine the information of each ECU and repeatedly establish communication connections with multiple ECUs, resulting in low efficiency of vehicle diagnosis and increasing the development difficulty and workload of the diagnostic device.
[0003] In summary, how to improve the efficiency of vehicle diagnosis is a technical problem that needs to be solved urgently at present. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a vehicle diagnosis method, device, equipment and storage medium, which can improve the efficiency of vehicle diagnosis. The specific solutions are as follows:
[0005] In the first aspect, this application provides a vehicle diagnosis method, including:
[0006] Obtain a first target diagnostic request command for a first electronic control unit, and parse the first target diagnostic request command to obtain a corresponding first parsing result; the first electronic control unit is a virtual electronic control unit created in advance for the target vehicle;
[0007] Based on the first parsing result and a preset association table corresponding to the first electronic control unit, determine a second electronic control unit from each physical electronic control unit of the target vehicle, and generate a second target diagnostic request command corresponding to the second electronic control unit;
[0008] The second electronic control unit is utilized to generate an initial diagnostic response command based on the second target diagnostic request command, and determine a target diagnostic response command based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command.
[0009] Optionally, obtaining a first target diagnostic request command for a first electronic control unit and parsing the first target diagnostic request command to obtain a corresponding first parsing result includes:
[0010] Determining first communication parameters corresponding to the first electronic control unit, and obtaining the first target diagnostic request command sent by a target diagnostic device based on the first communication parameters;
[0011] Parsing the first target diagnostic request command to obtain a first system request identifier, a first target service identifier, and a first target parameter identifier.
[0012] Optionally, determining a second electronic control unit from each entity electronic control unit of the target vehicle based on the first parsing result and a preset association table corresponding to the first electronic control unit includes:
[0013] Judging whether the first system request identifier is consistent with the system request identifier corresponding to the first electronic control unit;
[0014] If they are consistent, based on the first target service identifier, the first target parameter identifier, and the preset association table, determining the second electronic control unit from the entity electronic control units of the target vehicle, and determining second communication parameters, a second system request identifier, a second target service identifier, and a second target parameter identifier of the second electronic control unit;
[0015] Correspondingly, generating a second target diagnostic request command corresponding to the second electronic control unit includes:
[0016] Generating the second target diagnostic request command corresponding to the second electronic control unit based on the second system request identifier, the second target service identifier, and the second target parameter identifier, and sending the second target diagnostic request command to the second electronic control unit based on the second communication parameters.
[0017] Optionally, utilizing the second electronic control unit to generate an initial diagnostic response command based on the second target diagnostic request command includes:
[0018] The second electronic control unit is used to analyze the second target diagnostic request command to obtain a second analysis result, and based on the second analysis result, determine target diagnostic data and a second system response identifier corresponding to the second electronic control unit, so as to generate the initial diagnostic response command based on the target diagnostic data, the second system response identifier, and the second analysis result.
[0019] Optionally, the determining the target diagnostic response command based on the initial diagnostic response command and the preset association table includes:
[0020] Analyze the initial diagnostic response command to obtain a third analysis result, and based on the third analysis result and the preset association table, determine a first system response identifier, a first target service identifier, and a first target parameter identifier of the first electronic control unit;
[0021] Based on the third analysis result, the first system response identifier, the first target service identifier, and the first target parameter identifier, determine the target diagnostic response command, and send the target diagnostic response command to the target diagnostic device.
[0022] Optionally, the determining the vehicle diagnostic result according to the target diagnostic response command includes:
[0023] The target diagnostic device is used to determine the first system response identifier based on the target diagnostic response command, and determine whether the first system response identifier is consistent with the system response identifier corresponding to the first electronic control unit;
[0024] If they are consistent, the target diagnostic device is used to analyze the target diagnostic response command to obtain a fourth analysis result, and determine the vehicle diagnostic result according to the fourth analysis result.
[0025] Optionally, the vehicle diagnostic method further includes:
[0026] Use a preset configuration tool to configure first parameter information of the first electronic control unit, and configure first diagnostic function request information corresponding to the first electronic control unit;
[0027] Based on the first parameter information, the first diagnostic function request information, second parameter information corresponding to the physical electronic control unit of the target vehicle, and second diagnostic function request information corresponding to the physical electronic control unit of the target vehicle, construct the preset association table corresponding to the first electronic control unit, so as to determine the vehicle diagnostic result based on the preset association table.
[0028] In a second aspect, the present application provides a vehicle diagnostic device, including:
[0029] The first parsing result determination module is configured to obtain a first target diagnostic request command for a first electronic control unit, and parse the first target diagnostic request command to obtain a corresponding first parsing result; the first electronic control unit is a virtual electronic control unit created in advance for a target vehicle;
[0030] The second target diagnostic request command generation module is configured to determine a second electronic control unit from each entity electronic control unit of the target vehicle based on the first parsing result and a preset association table corresponding to the first electronic control unit, and generate a second target diagnostic request command corresponding to the second electronic control unit;
[0031] The vehicle diagnostic result determination module is configured to use the second electronic control unit to generate an initial diagnostic response command based on the second target diagnostic request command, and determine a target diagnostic response command based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command.
[0032] In a third aspect, the present application provides an electronic device, including:
[0033] A memory for storing a computer program;
[0034] A processor for executing the computer program to implement the foregoing vehicle diagnostic method.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the foregoing vehicle diagnostic method is implemented.
[0036] In this application, first, a first target diagnostic request command for a first electronic control unit is obtained, and the first target diagnostic request command is parsed to obtain a corresponding first parsing result; the first electronic control unit is a virtual electronic control unit created in advance for a target vehicle; then, based on the first parsing result and a preset association table corresponding to the first electronic control unit, a second electronic control unit is determined from each entity electronic control unit of the target vehicle, and a second target diagnostic request command corresponding to the second electronic control unit is generated; finally, the second electronic control unit is used to generate an initial diagnostic reply command based on the second target diagnostic request command, and a target diagnostic reply command is determined based on the initial diagnostic reply command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic reply command. As can be seen from the above, in this application, a virtual first electronic control unit is created in advance in the target vehicle, and then a second entity electronic control unit of the target vehicle is determined according to the first parsing result corresponding to the first target diagnostic request command and the preset association table of the first electronic control unit, and a second target diagnostic request command is generated. Then, the second electronic control unit is used to determine a corresponding initial diagnostic reply command according to the second target diagnostic request command, and finally, a target diagnostic reply command corresponding to the virtual first electronic control unit is determined based on the initial diagnostic reply command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic reply command. In this way, in this application, when performing vehicle diagnosis, the diagnostic device only interacts with a virtual first electronic control unit, and then the vehicle will convert the functions in the virtual first electronic control unit into the diagnostic functions of the entity second electronic control unit and return the corresponding execution results. In this way, this application avoids repeatedly establishing communication connections with multiple ECUs during vehicle diagnosis by creating a virtual electronic control unit in the target vehicle, thereby improving the efficiency of vehicle diagnosis and reducing the development workload and difficulty of the diagnostic device. Description of the Drawings
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0038] Figure 1 It is a flowchart of a vehicle diagnosis method provided by the present application;
[0039] Figure 2 It is a specific flowchart of a vehicle diagnosis method provided by the present application;
[0040] Figure 3 It is a schematic structural diagram of a vehicle diagnosis device provided by the present application;
[0041] Figure 4 A structural diagram of an electronic device provided for this application. Specific implementation manner
[0042] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0043] The vehicle ECU (Electronic Control Unit), also known as the vehicle computer or in-vehicle computer, is the brain nerve center system of the vehicle. The data in the vehicle ECU mainly comes from various sensors, which are responsible for collecting various parameters during the vehicle operation, such as throttle opening, crankshaft speed, oxygen content, water temperature, etc. The sensors transmit the collected information to the ECU in the form of electrical signals, and the analog-to-digital converter inside the ECU then converts these electrical signals into digital signals for subsequent processing and operations. Currently, when a diagnostic device needs to execute the diagnostic function of a certain ECU, it is necessary to set the communication parameters to those of this ECU, then establish a communication connection with this ECU, and then send diagnostic commands for interaction. However, the communication parameters of different ECUs may all be different, and the system IDs are also different. Each time interacting with different ECUs requires the diagnostic device to determine the information of each ECU and repeatedly establish communication connections with multiple ECUs, resulting in low efficiency of vehicle diagnosis and increasing the development difficulty and workload of the diagnostic device. For this reason, this application provides a vehicle diagnosis solution that can improve the efficiency of vehicle diagnosis.
[0044] See Figure 1 As shown, an embodiment of the present application discloses a vehicle diagnosis method, which may include:
[0045] Step S11, obtain a first target diagnostic request command for a first electronic control unit, and parse the first target diagnostic request command to obtain a corresponding first parsing result; the first electronic control unit is a virtual electronic control unit created in advance for the target vehicle.
[0046] In this embodiment, the obtaining of the first target diagnostic request command for the first electronic control unit and parsing the first target diagnostic request command to obtain the corresponding first parsing result may include: determining the first communication parameter corresponding to the first electronic control unit, and obtaining the first target diagnostic request command sent by the target diagnostic device based on the first communication parameter; parsing the first target diagnostic request command to obtain a first system request identifier, a first target service identifier, and a first target parameter identifier. Specifically, first, a logical ECU, that is, a virtual first electronic control unit, may be created in the vehicle gateway or domain controller, and the corresponding logical diagnostic function of the logical ECU may be configured so that the target diagnostic device can communicate with the first electronic control unit. Since the logical ECU runs on the vehicle gateway or domain controller, the first communication parameter of the first electronic control unit may be determined as the communication parameter of the corresponding vehicle gateway or domain controller. When the target diagnostic device needs to obtain the diagnostic data of the target vehicle through the logical ECU, the target diagnostic device may send the first target diagnostic request command to the vehicle gateway or domain controller through the first communication parameter of the first electronic control unit. Then, the vehicle gateway or domain controller parses the first target diagnostic request command to obtain the first system request identifier, that is, the first system request ID, the first target service identifier (SID, that is, Service Identifier) of the diagnostic function, and the first target parameter identifier (PID, that is, Parameter Identifier) of the diagnostic function.
[0047] Step S12: Based on the first parsing result and the preset association table corresponding to the first electronic control unit, determine a second electronic control unit from each entity electronic control unit of the target vehicle, and generate a second target diagnostic request command corresponding to the second electronic control unit.
[0048] In this embodiment, determining the second electronic control unit from each entity electronic control unit of the target vehicle based on the first parsing result and the preset association table corresponding to the first electronic control unit may include: determining whether the first system request identifier is consistent with the system request identifier corresponding to the first electronic control unit; if they are consistent, then based on the first target service identifier, the first target parameter identifier, and the preset association table, determining the second electronic control unit from the entity electronic control units of the target vehicle, and determining the second communication parameter, the second system request identifier, the second target service identifier, and the second target parameter identifier of the second electronic control unit. Specifically, after the gateway or domain controller of the vehicle parses the first target diagnostic request command to obtain the first system request ID, the first target SID, and the first target PID, it is necessary to determine whether the first system request ID is the system request ID of the logical ECU. If it is determined that the first system request ID is the system request ID of the logical ECU, then the preset association table corresponding to the logical ECU is searched according to the first target SID and the first target PID. The associated ECU of the target vehicle, that is, the second electronic control unit, is found, and the second communication parameter of the associated ECU, the system request ID of the associated ECU, the second target SID of the diagnostic function, and the second target PID of the diagnostic function are determined based on the preset association table.
[0049] It can be understood that generating the second target diagnostic request command corresponding to the second electronic control unit may include: generating the second target diagnostic request command corresponding to the second electronic control unit based on the second system request identifier, the second target service identifier, and the second target parameter identifier, and sending the second target diagnostic request command to the second electronic control unit based on the second communication parameter. Specifically, the gateway or domain controller of the vehicle generates the second target diagnostic request command according to the system request ID, the second target SID, and the second target PID of the associated ECU, and sends the second target diagnostic request command to the associated ECU through the vehicle communication bus according to the second communication parameter of the associated ECU.
[0050] Step S13: Using the second electronic control unit to generate an initial diagnostic response command based on the second target diagnostic request command, and determining a target diagnostic response command based on the initial diagnostic response command and the preset association table, so as to determine the vehicle diagnostic result according to the target diagnostic response command.
[0051] In this embodiment, the step of generating an initial diagnostic response command by using the second electronic control unit based on the second target diagnostic request command may include: parsing the second target diagnostic request command by using the second electronic control unit to obtain a second parsing result, and determining target diagnostic data and a second system response identifier corresponding to the second electronic control unit based on the second parsing result, so as to generate the initial diagnostic response command based on the target diagnostic data, the second system response identifier, and the second parsing result. Specifically, when the associated ECU receives a message sent by the vehicle gateway or domain controller from the vehicle communication bus, it first checks the type of the message to determine whether the message is a diagnostic request command. If it is determined that the second target diagnostic request command is received, the associated ECU parses the second target diagnostic request command to obtain a second target SID and a second target PID. Then, the associated ECU can verify the legitimacy of the current second target diagnostic request command, check whether the second target SID and the second target PID are within the supported range, and check whether the second target diagnostic request command conforms to the current security policy. Then, the associated ECU reads the corresponding target diagnostic data according to the second target SID and the second target PID in the second target diagnostic request command. In a specific implementation manner, if the second target SID indicates reading the engine speed, the associated ECU can obtain the current engine speed value from its internal sensor or data memory. Finally, the associated ECU can fill the read target diagnostic data in the response command to generate an initial diagnostic response command including the target diagnostic data, the system response ID of the associated ECU, the second target SID of the diagnostic function, and the second target PID.
[0052] It should be noted that determining the target diagnostic response command based on the initial diagnostic response command and the preset association table may include: parsing the initial diagnostic response command to obtain a third parsing result, and determining the first system response identifier, the first target service identifier, and the first target parameter identifier of the first electronic control unit based on the third parsing result and the preset association table; determining the target diagnostic response command based on the third parsing result, the first system response identifier, the first target service identifier, and the first target parameter identifier, and sending the target diagnostic response command to the target diagnostic device. Specifically, the gateway or domain controller of the vehicle continuously monitors the vehicle communication bus to receive the response command from the associated ECU. After the gateway or domain controller of the vehicle receives the initial diagnostic response command sent by the associated ECU, it parses the initial diagnostic response command to obtain the target diagnostic data, the second target SID, and the second target PID. Then, it searches the preset association table of the logic ECU to obtain the system response ID, the first target SID, and the first target PID of the logic ECU. Finally, it modifies the system response ID of the associated ECU in the initial diagnostic response command to the system response ID of the logic ECU, the second target SID to the first target SID, and the second target PID to the first target PID to obtain the target diagnostic response command, and sends the target diagnostic response command to the target diagnostic device.
[0053] In this embodiment, determining the vehicle diagnostic result according to the target diagnostic response command may include: determining the first system response identifier by the target diagnostic device based on the target diagnostic response command, and determining whether the first system response identifier is consistent with the system response identifier corresponding to the first electronic control unit; if they are consistent, the target diagnostic device parses the target diagnostic response command to obtain a fourth parsing result, and determines the vehicle diagnostic result according to the fourth parsing result. Specifically, after the target diagnostic device receives the target diagnostic response command sent by the gateway or domain controller of the vehicle, it parses the system response ID field in the target diagnostic response command, and verifies whether the system response ID in the target diagnostic response command is the system response ID of the logic ECU. If it is determined to be the system response ID of the logic ECU, the target diagnostic device parses the target diagnostic response command to obtain the target diagnostic data, the first target SID, and the first target PID. The target diagnostic device can perform data processing on the target diagnostic data, for example: verifying the integrity and correctness of the parsed target diagnostic data to ensure that no errors or losses occur during data transmission; converting the target diagnostic data into a format that is easier to understand or analyze. Finally, the target diagnostic device performs vehicle diagnosis according to the target diagnostic data to obtain the corresponding vehicle diagnostic result, and the vehicle diagnostic result can be displayed to the user in an easy-to-understand manner, such as being displayed to the user through a graphical user interface.
[0054] As can be seen from the above, in this embodiment, first, a first target diagnostic request command for a first electronic control unit is obtained, and the first target diagnostic request command is parsed to obtain a corresponding first parsing result; the first electronic control unit is a virtual electronic control unit created in advance for the target vehicle; then, based on the first parsing result and a preset association table corresponding to the first electronic control unit, a second electronic control unit is determined from each entity electronic control unit of the target vehicle, and a second target diagnostic request command corresponding to the second electronic control unit is generated; finally, the second electronic control unit is used to generate an initial diagnostic response command based on the second target diagnostic request command, and a target diagnostic response command is determined based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command. As can be seen from the above, in this embodiment, a virtual first electronic control unit is created in advance in the target vehicle, and then a second entity electronic control unit of the target vehicle is determined according to the first parsing result corresponding to the first target diagnostic request command and the preset association table of the first electronic control unit, and a second target diagnostic request command is generated. Then, the second electronic control unit is used to determine a corresponding initial diagnostic response command according to the second target diagnostic request command, and finally, a target diagnostic response command corresponding to the virtual first electronic control unit is determined based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command. In this way, in this embodiment, when performing vehicle diagnosis, the diagnostic device only interacts with a virtual first electronic control unit, and then the vehicle converts the functions in the virtual first electronic control unit into the diagnostic functions of the entity second electronic control unit and returns the corresponding execution results. In this way, in this embodiment, by creating a virtual electronic control unit in the target vehicle, repeatedly establishing communication connections with multiple ECUs during vehicle diagnosis is avoided, thereby improving the efficiency of vehicle diagnosis and reducing the development workload and difficulty of the diagnostic device.
[0055] Based on the previous embodiment, it can be known that the present application can obtain vehicle diagnostic data by creating a virtual electronic control unit and a corresponding association table in the target vehicle to obtain corresponding vehicle diagnostic data. Next, in this embodiment, how to create an association table will be elaborated in detail. Refer to Figure 2 As shown, an embodiment of the present application further discloses a vehicle diagnostic method, which may include:
[0056] Step S21: Configure first parameter information of a first electronic control unit by using a preset configuration tool, and configure first diagnostic function request information corresponding to the first electronic control unit; the first electronic control unit is a virtual electronic control unit created in advance for the target vehicle.
[0057] In this embodiment, a configuration tool can be used to configure the first parameter information of the virtual first electronic control unit, i.e., the logical ECU, in the target vehicle. Specifically, configure the name and version number of the logical ECU for identification during subsequent diagnosis and debugging, and configure the system request ID and system response ID of the logical ECU. It is necessary to ensure that the system request ID and system response ID do not conflict with the physical ECUs in the vehicle. At the same time, configure the communication parameters of the logical ECU as the communication parameters of the vehicle gateway or domain controller. The communication parameters include, but are not limited to, network protocol, baud rate, address, etc. In addition, it is necessary to use the configuration tool to configure the first diagnostic function request information according to the logical diagnostic function corresponding to the logical ECU. Specifically, the first diagnostic function request information includes SID and PID. SID represents the type of diagnostic function. For example, 0x22 represents reading data, 0x2e represents writing data, 0x19 represents reading trouble codes, and 0x31 represents executing a routine function; PID is the specific function sub-item parameter, which can be customized according to diagnostic requirements. For example, 0x0101 represents the engine speed, and 0x0102 represents the vehicle VIN code. At this time, 0x220102 can be configured to read the vehicle VIN code.
[0058] Step S22: Construct a preset association table corresponding to the first electronic control unit based on the first parameter information, the first diagnostic function request information, the second parameter information corresponding to the physical electronic control unit of the target vehicle, and the second diagnostic function request information corresponding to the physical electronic control unit of the target vehicle.
[0059] In this embodiment, the logical diagnostic function of the logical ECU can be associated with the diagnostic function of the physical ECU in the vehicle to determine the associated ECU corresponding to the logical diagnostic function. Specifically, the SID and PID of the logical diagnostic function can be mapped to the SID and PID of the associated ECU in the vehicle. In a specific implementation manner, by associating the logical diagnostic function 0x220101 with 0x220801 of the engine ECU, the logical diagnostic function of reading the engine speed can be associated with the engine ECU of the target vehicle. In addition, it is necessary to obtain the second parameter information of the associated ECU, including but not limited to the system request ID and system response ID of the associated ECU, and the communication parameters. Then, as shown in Table 1, generate a preset association table of the logical ECU according to the logical ECU information, logical diagnostic function, association relationship, associated ECU information, and diagnostic function information of the associated ECU, and upload the preset association table of the logical ECU to the vehicle gateway or domain controller through a write operation. After the write is completed, a diagnostic tool or software can be used to verify the write result to ensure that the logical ECU can operate correctly and the logical diagnostic function can be correctly associated with the diagnostic function of the physical ECU in the vehicle.
[0060] Table 1
[0061]
[0062] Step S23: Obtain a first target diagnostic request command for the first electronic control unit, and parse the first target diagnostic request command to obtain a corresponding first parsing result.
[0063] Step S24: Based on the first parsing result and a preset association table corresponding to the first electronic control unit, determine a second electronic control unit from each of the entity electronic control units of the target vehicle, and generate a second target diagnostic request command corresponding to the second electronic control unit.
[0064] Step S25: Use the second electronic control unit to generate an initial diagnostic response command based on the second target diagnostic request command, and determine a target diagnostic response command based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command.
[0065] Wherein, for more specific processing procedures of the above steps S23, S24, and S25, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.
[0066] As can be seen from the above, in this embodiment, first, the first parameter information and the first diagnostic function request information of the virtual first electronic control unit in the target vehicle are configured. Then, the second parameter information and the second diagnostic function request information of the entity electronic control unit corresponding to the first electronic control unit are determined, and the first electronic control unit is associated with the entity electronic control unit by constructing an association table. In this way, this embodiment can map the diagnostic function of the virtual first electronic control unit to the specific diagnostic function of the entity electronic control unit, thereby improving the efficiency of vehicle diagnosis and reducing the development workload and difficulty of diagnostic equipment.
[0067] Correspondingly, as shown in Figure 3 This embodiment of the present application further provides a vehicle diagnostic device, which may include:
[0068] A first parsing result determination module 11, configured to obtain a first target diagnostic request command for a first electronic control unit, and parse the first target diagnostic request command to obtain a corresponding first parsing result; the first electronic control unit is a virtual electronic control unit created in advance for the target vehicle;
[0069] The second target diagnostic request command generation module 12 is configured to determine a second electronic control unit from each entity electronic control unit of the target vehicle based on the first parsing result and a preset association table corresponding to the first electronic control unit, and generate a second target diagnostic request command corresponding to the second electronic control unit;
[0070] The vehicle diagnostic result determination module 13 is configured to use the second electronic control unit to generate an initial diagnostic response command based on the second target diagnostic request command, and determine a target diagnostic response command based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command.
[0071] As can be seen from the above, in this application, first, a first target diagnostic request command for a first electronic control unit is obtained, and the first target diagnostic request command is parsed to obtain a corresponding first parsing result; the first electronic control unit is a virtual electronic control unit created in advance for the target vehicle; then, based on the first parsing result and a preset association table corresponding to the first electronic control unit, a second electronic control unit is determined from each entity electronic control unit of the target vehicle, and a second target diagnostic request command corresponding to the second electronic control unit is generated; finally, the second electronic control unit is used to generate an initial diagnostic response command based on the second target diagnostic request command, and a target diagnostic response command is determined based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command. As can be seen from the above, in this application, a virtual first electronic control unit is created in advance in the target vehicle, and then a second entity electronic control unit of the target vehicle is determined according to the first parsing result corresponding to the first target diagnostic request command and the preset association table of the first electronic control unit, and a second target diagnostic request command is generated. Then, the second electronic control unit is used to determine a corresponding initial diagnostic response command according to the second target diagnostic request command, and finally, a target diagnostic response command corresponding to the virtual first electronic control unit is determined based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command. In this way, in this application, when performing vehicle diagnosis, the diagnostic device only interacts with a virtual first electronic control unit, and then the vehicle will convert the functions in the virtual first electronic control unit into the diagnostic functions of the entity second electronic control unit and return the corresponding execution results. In this way, this application avoids repeatedly establishing communication connections with multiple ECUs during vehicle diagnosis by creating a virtual electronic control unit in the target vehicle, thereby improving the efficiency of vehicle diagnosis and reducing the development workload and difficulty of the diagnostic device.
[0072] In some specific embodiments, the first parsing result determination module 11 may include:
[0073] A first target diagnostic request command acquisition unit, configured to determine first communication parameters corresponding to the first electronic control unit, and acquire the first target diagnostic request command sent by a target diagnostic device based on the first communication parameters;
[0074] A first parsing result determination unit, configured to parse the first target diagnostic request command to obtain a first system request identifier, a first target service identifier, and a first target parameter identifier.
[0075] In some specific embodiments, the second target diagnostic request command generation module 12 may include:
[0076] A first condition judgment unit, configured to judge whether the first system request identifier is consistent with the system request identifier corresponding to the first electronic control unit;
[0077] A second electronic control unit determination unit, configured to, when the first system request identifier is consistent with the system request identifier corresponding to the first electronic control unit, determine the second electronic control unit from the respective entity electronic control units of the target vehicle based on the first target service identifier, the first target parameter identifier, and the preset association table, and determine second communication parameters, a second system request identifier, a second target service identifier, and a second target parameter identifier of the second electronic control unit;
[0078] Correspondingly, the second target diagnostic request command generation module 12 may include:
[0079] A second target diagnostic request command generation unit, configured to generate the second target diagnostic request command corresponding to the second electronic control unit based on the second system request identifier, the second target service identifier, and the second target parameter identifier, and send the second target diagnostic request command to the second electronic control unit based on the second communication parameters.
[0080] In some specific embodiments, the vehicle diagnostic result determination module 13 may include:
[0081] An initial diagnostic response command generation unit, configured to use the second electronic control unit to parse the second target diagnostic request command to obtain a second parsing result, and determine target diagnostic data and a second system response identifier corresponding to the second electronic control unit based on the second parsing result, so as to generate the initial diagnostic response command based on the target diagnostic data, the second system response identifier, and the second parsing result.
[0082] In some specific embodiments, the vehicle diagnostic result determination module 13 may include:
[0083] An initial diagnosis reply command parsing unit, configured to parse the initial diagnosis reply command to obtain a third parsing result, and determine a first system reply identifier, a first target service identifier, and a first target parameter identifier of the first electronic control unit based on the third parsing result and the preset association table;
[0084] A target diagnosis reply command determining unit, configured to determine the target diagnosis reply command based on the third parsing result, the first system reply identifier, the first target service identifier, and the first target parameter identifier, and send the target diagnosis reply command to a target diagnosis device.
[0085] In some specific embodiments, the vehicle diagnosis result determination module 13 may include:
[0086] A second condition judgment unit, configured to determine the first system reply identifier by the target diagnosis device based on the target diagnosis reply command, and judge whether the first system reply identifier is consistent with the system reply identifier corresponding to the first electronic control unit;
[0087] A vehicle diagnosis result determination unit, configured to, when the first system reply identifier is consistent with the system reply identifier corresponding to the first electronic control unit, parse the target diagnosis reply command by the target diagnosis device to obtain a fourth parsing result, and determine the vehicle diagnosis result according to the fourth parsing result.
[0088] In some specific embodiments, the vehicle diagnosis device may further include:
[0089] A first parameter information configuration module, configured to configure the first parameter information of the first electronic control unit by using a preset configuration tool, and configure the first diagnosis function request information corresponding to the first electronic control unit;
[0090] An association table construction module, configured to construct the preset association table corresponding to the first electronic control unit based on the first parameter information, the first diagnosis function request information, the second parameter information corresponding to the physical electronic control unit of the target vehicle, and the second diagnosis function request information corresponding to the physical electronic control unit of the target vehicle, so as to determine the vehicle diagnosis result based on the preset association table.
[0091] Furthermore, an electronic device is also disclosed in an embodiment of the present application, Figure 4It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment. The content in the figure should not be considered as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the vehicle diagnosis method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0092] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.
[0093] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0094] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, and it may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the vehicle diagnosis method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks.
[0095] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the vehicle diagnosis method disclosed above is implemented. For the specific steps of this method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0096] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0097] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0098] The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0099] Finally, it should also be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
[0100] The technical solutions provided in this application have been introduced in detail above. Specific examples have been used herein to illustrate the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A vehicle diagnosis method, characterized in that, Including: Obtain a first target diagnostic request command for a first electronic control unit, and parse the first target diagnostic request command to obtain a corresponding first parsing result; The first electronic control unit is a virtual electronic control unit created in advance for the target vehicle; Based on the first parsing result and a preset association table corresponding to the first electronic control unit, determine a second electronic control unit from each entity electronic control unit of the target vehicle, and generate a second target diagnostic request command corresponding to the second electronic control unit; Use the second electronic control unit to generate an initial diagnostic response command based on the second target diagnostic request command, and determine a target diagnostic response command based on the initial diagnostic response command and the preset association table, so as to determine a vehicle diagnostic result according to the target diagnostic response command.
2. The vehicle diagnosis method according to claim 1, characterized in that, The obtaining the first target diagnostic request command for the first electronic control unit and parsing the first target diagnostic request command to obtain a corresponding first parsing result includes: Determine first communication parameters corresponding to the first electronic control unit, and obtain the first target diagnostic request command sent by a target diagnostic device based on the first communication parameters; Parse the first target diagnostic request command to obtain a first system request identifier, a first target service identifier, and a first target parameter identifier.
3. The vehicle diagnosis method according to claim 2, characterized in that, The determining the second electronic control unit from each entity electronic control unit of the target vehicle based on the first parsing result and the preset association table corresponding to the first electronic control unit includes: Judge whether the first system request identifier is consistent with the system request identifier corresponding to the first electronic control unit; If they are consistent, based on the first target service identifier, the first target parameter identifier, and the preset association table, determine the second electronic control unit from the entity electronic control units of the target vehicle, and determine second communication parameters, a second system request identifier, a second target service identifier, and a second target parameter identifier of the second electronic control unit; Correspondingly, the generating the second target diagnostic request command corresponding to the second electronic control unit includes: Generate the second target diagnostic request command corresponding to the second electronic control unit based on the second system request identifier, the second target service identifier, and the second target parameter identifier, and send the second target diagnostic request command to the second electronic control unit based on the second communication parameters.
4. The vehicle diagnosis method according to claim 1, characterized in that, The using the second electronic control unit to generate an initial diagnostic response command based on the second target diagnostic request command includes: Use the second electronic control unit to parse the second target diagnostic request command to obtain a second parsing result, and determine target diagnostic data and a second system response identifier corresponding to the second electronic control unit based on the second parsing result, so as to generate the initial diagnostic response command based on the target diagnostic data, the second system response identifier, and the second parsing result.
5. The vehicle diagnosis method according to claim 1, characterized in that, The determining the target diagnostic response command based on the initial diagnostic response command and the preset association table includes: Analyze the initial diagnostic reply command to obtain a third analysis result, and determine the first system reply identifier, the first target service identifier, and the first target parameter identifier of the first electronic control unit based on the third analysis result and the preset association table; Determine the target diagnostic reply command based on the third analysis result, the first system reply identifier, the first target service identifier, and the first target parameter identifier, and send the target diagnostic reply command to the target diagnostic device.
6. The vehicle diagnosis method according to claim 5, wherein, The determining the vehicle diagnostic result according to the target diagnostic reply command includes: The target diagnostic device determines the first system reply identifier based on the target diagnostic reply command, and determines whether the first system reply identifier is consistent with the system reply identifier corresponding to the first electronic control unit; If they are consistent, the target diagnostic device is used to analyze the target diagnostic reply command to obtain a fourth analysis result, and the vehicle diagnostic result is determined according to the fourth analysis result.
7. The vehicle diagnosis method according to any one of claims 1 to 6, characterized in that, It further includes: Configure the first parameter information of the first electronic control unit by using a preset configuration tool, and configure the first diagnostic function request information corresponding to the first electronic control unit; Construct the preset association table corresponding to the first electronic control unit based on the first parameter information, the first diagnostic function request information, the second parameter information corresponding to the physical electronic control unit of the target vehicle, and the second diagnostic function request information corresponding to the physical electronic control unit of the target vehicle, so as to determine the vehicle diagnostic result based on the preset association table.
8. A vehicle diagnostic device, characterized in that, It includes: A first analysis result determination module, configured to obtain a first target diagnostic request command for a first electronic control unit, and analyze the first target diagnostic request command to obtain a corresponding first analysis result; the first electronic control unit is a virtual electronic control unit created in advance for the target vehicle; A second target diagnostic request command generation module, configured to determine a second electronic control unit from the respective physical electronic control units of the target vehicle based on the first analysis result and the preset association table corresponding to the first electronic control unit, and generate a second target diagnostic request command corresponding to the second electronic control unit; A vehicle diagnostic result determination module, configured to use the second electronic control unit to generate an initial diagnostic reply command based on the second target diagnostic request command, and determine a target diagnostic reply command based on the initial diagnostic reply command and the preset association table, so as to determine the vehicle diagnostic result according to the target diagnostic reply command.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein, the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the vehicle diagnostic method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, For storing a computer program, the computer program, when executed by a processor, implements the vehicle diagnostic method according to any one of claims 1 to 7.