Multi-terminal diagnosis method, device, terminal equipment and storage medium

By sending lock request commands to the car gateway and generating diagnostic commands based on the lock ID, the diagnostic conflicts and synchronization problems in multi-client diagnosis are solved, and the diagnostic efficiency is improved.

CN115808916BActive Publication Date: 2025-02-14LAUNCH TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211586248.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2025-02-14
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

The prior art is prone to diagnostic conflicts and synchronization problems during multi-client diagnosis, resulting in inefficient diagnosis.

Method used

By sending a lock request command to the gateway of the target vehicle, the target ECU is locked, and a diagnostic command is generated based on the lock ID of the gateway reply, and sent to the gateway to forward to the target ECU, receiving the diagnostic reply data returned by the gateway.

Benefits of technology

It effectively prevents diagnostic conflicts between diagnostic devices of different clients, avoids synchronization problems between multiple clients, and improves the efficiency of multi-client diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115808916B_ABST
    Figure CN115808916B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-terminal diagnosis method, device, terminal device and storage medium. The method includes sending a lock request command to the gateway of the target vehicle, the lock request command is used to request the target ECU to be locked; receiving the lock ID replied by the gateway, and generating a diagnostic command for the target ECU based on the lock ID, sending the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU; receiving the diagnostic reply data returned by the gateway, and the diagnostic reply data is generated by the target ECU after executing the diagnostic command. The target ECU is locked by sending a lock request command to the gateway through the target diagnostic device, so that the diagnostic device can diagnose the target ECU only through the lock ID replied by the gateway. In this process, devices other than the target diagnostic device cannot diagnose the target ECU at the same time, so as to prevent diagnostic conflicts between diagnostic devices of different clients, and at the same time avoid synchronization problems between multiple clients, thereby improving the efficiency of multi-client diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile diagnosis technology, and in particular to a multi-terminal diagnosis method, device, terminal equipment and storage medium. Background Art

[0002] With the continuous development of vehicle diagnostic technology, it is now possible to support multiple clients to diagnose the vehicle at the same time. Different clients can diagnose different functions of the vehicle, but there may be diagnostic conflicts. For example, if one client wants to write to an ECU (Electronic Control Unit) and another client also wants to write or read, it will cause a conflict and lead to diagnostic uncertainty.

[0003] There are currently two solutions to prevent diagnostic conflicts: 1. Use only one client for diagnosis, and only diagnose one function before executing other functions; 2. Multiple clients must agree with each other not to read and write to the same ECU, which may cause conflicts. However, if only one client is used, the diagnostic efficiency will be much lower than that of multiple clients. If multiple clients are used for diagnosis, it is also troublesome to make agreements with multiple clients, and they must be synchronized in time. If the synchronization is not timely, diagnostic conflicts will still occur.

[0004] Therefore, it is necessary to propose a solution to improve the efficiency of multi-client diagnosis and circumvent the synchronization problem between multiple clients.

[0005] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of the present invention is to provide a multi-terminal diagnosis method, apparatus, terminal device and storage medium, aiming to improve the efficiency of multi-client diagnosis and avoid synchronization problems between multiple clients.

[0007] To achieve the above object, the present invention provides a multi-terminal diagnosis method, which is applied to a target diagnosis device and includes:

[0008] Sending a lock request command to the gateway of the target vehicle, wherein the lock request command is used to request to lock the target ECU;

[0009] receiving the lock ID replied by the gateway, generating a diagnostic command for the target ECU based on the lock ID, and sending the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU;

[0010] The diagnostic response data returned by the gateway is received, where the diagnostic response data is generated by the target ECU after executing the diagnostic command.

[0011] Optionally, after the step of receiving the diagnostic reply data returned by the gateway, the step further includes:

[0012] An unlock request command is sent to the gateway, so that the gateway unlocks the target ECU according to the unlock request command.

[0013] In addition, to achieve the above object, the present invention also provides a multi-terminal diagnostic method, which is applied to the gateway of the target vehicle, and the multi-terminal diagnostic method includes the following steps:

[0014] Receiving a lock request command sent by a target diagnostic device, wherein the lock request command is used to request to lock the target ECU;

[0015] generating a lock ID based on the target ECU and sending the lock ID to the target diagnostic device, so that the target diagnostic device generates a diagnostic command for the target ECU based on the lock ID;

[0016] receiving a diagnostic command sent by the target diagnostic device, and forwarding the diagnostic command to the target ECU;

[0017] The diagnostic reply data generated by the target ECU through executing the diagnostic command is received, and the diagnostic reply data is sent to the target diagnostic device.

[0018] Optionally, after the step of receiving the lock request command sent by the target diagnostic device, the step further includes:

[0019] Parsing the lock request command to obtain the system ID of the target ECU;

[0020] Determining whether the target ECU is in a locked state according to the system ID of the target ECU;

[0021] If the target ECU is not in a locked state, setting the state of the target ECU to a locked state, and executing the steps of generating a lock ID based on the target ECU and sending it to the target diagnostic device and thereafter;

[0022] If the target ECU is in a locked state, a corresponding abnormality code is generated and sent to the target diagnostic device.

[0023] Optionally, the lock request command also includes an unaccessed automatic unlocking time, and after the step of setting the state of the target ECU to the locked state, the step further includes:

[0024] monitoring the communication between the target diagnostic device and the target ECU, and recording the communication time;

[0025] Counting the non-communication time between the target diagnostic device and the target ECU according to the communication time;

[0026] When the non-communication time reaches the non-access automatic unlocking time, the state of the target ECU is changed to an unlocked state.

[0027] Optionally, the method further comprises:

[0028] receiving a first diagnostic command sent by a first diagnostic device to a target ECU, and determining whether the target ECU is in a locked state;

[0029] If the target ECU corresponding to the first diagnostic command is in a locked state, parsing the first diagnostic command to obtain a first lock ID carried in the first diagnostic command;

[0030] If the first diagnostic command does not have the first lock ID, or the first lock ID does not match the target ECU, the first diagnostic command is rejected from being sent to the target ECU.

[0031] Optionally, after the step of receiving the diagnostic command sent by the target diagnostic device and forwarding the diagnostic command to the target ECU, the step further includes:

[0032] Receiving an unlock request command sent by the target diagnostic device, and parsing the unlock request command to obtain a system ID and a lock ID corresponding to the ECU to be unlocked;

[0033] Determine whether the lock ID corresponding to the ECU to be unlocked matches the target ECU;

[0034] If the lock ID corresponding to the ECU to be unlocked matches the target ECU, the state of the target ECU is changed to an unlocked state.

[0035] In addition, to achieve the above object, the present invention further provides a multi-terminal diagnostic device, the multi-terminal diagnostic device comprising:

[0036] A request module, used to send a lock request command to the gateway of the target vehicle, wherein the lock request command is used to request to lock the target ECU;

[0037] A diagnostic module, configured to receive the lock ID replied by the gateway, generate a diagnostic command for the target ECU based on the lock ID, and send the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU;

[0038] The receiving module is used to receive the diagnostic response data returned by the gateway, wherein the diagnostic response data is generated by the target ECU after executing the diagnostic command.

[0039] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal device, which includes a memory, a processor, and a multi-terminal diagnostic program stored in the memory and executable on the processor, and the multi-terminal diagnostic program, when executed by the processor, implements the steps of the multi-terminal diagnostic method as described above.

[0040] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium, on which a multi-terminal diagnostic program is stored, and when the multi-terminal diagnostic program is executed by a processor, the steps of the multi-terminal diagnostic method as described above are implemented.

[0041] A multi-terminal diagnostic method, device, terminal device and storage medium proposed in an embodiment of the present invention, the multi-terminal diagnostic method is applied to a target diagnostic device, by sending a lock request command to the gateway of the target vehicle, the lock request command is used to request the target ECU to be locked; receiving the lock ID replied by the gateway, and generating a diagnostic command for the target ECU based on the lock ID, sending the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU; receiving the diagnostic reply data returned by the gateway, the diagnostic reply data is generated by the target ECU after executing the diagnostic command. The target diagnostic device sends a lock request command to the gateway to lock the target ECU, so that the diagnostic device can diagnose the target ECU only through the lock ID replied by the gateway, and receives the diagnostic reply data returned by the gateway. In this process, devices other than the target diagnostic device cannot diagnose the target ECU at the same time, preventing diagnostic conflicts between diagnostic devices of different clients, and avoiding synchronization problems between multiple clients, thereby improving the efficiency of multi-client diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a schematic diagram of the functional modules of the terminal equipment to which the multi-terminal diagnostic device of the present invention belongs;

[0043] Figure 2 A schematic diagram of a flow chart of an exemplary embodiment of a multi-terminal diagnosis method of the present invention;

[0044] Figure 3 FIG. 4 is a flow chart of another exemplary embodiment of the multi-terminal diagnosis method of the present invention.

[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] 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.

[0047] The main solution of the embodiment of the present invention is: by sending a lock request command to the gateway of the target vehicle, the lock request command is used to request to lock the target ECU; receiving the lock ID replied by the gateway, and generating a diagnostic command for the target ECU based on the lock ID, sending the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU; receiving the diagnostic reply data returned by the gateway, the diagnostic reply data is generated by the target ECU after executing the diagnostic command. The target diagnostic device sends a lock request command to the gateway to lock the target ECU, so that the diagnostic device can diagnose the target ECU only through the lock ID replied by the gateway, and receive the diagnostic reply data returned by the gateway. In this process, devices other than the target diagnostic device cannot diagnose the target ECU at the same time, preventing diagnostic conflicts between diagnostic devices of different clients, and avoiding synchronization problems between multiple clients, thereby improving the efficiency of multi-client diagnosis.

[0048] Specifically, refer to Figure 1 , Figure 1 This is a functional module diagram of the terminal device to which the multi-terminal diagnostic device of the present invention belongs. The multi-terminal diagnostic device can be a device that is independent of the terminal device and can perform multi-terminal diagnosis, and it can be carried on the terminal device in the form of hardware or software. The terminal device can be a smart mobile terminal with data processing function such as a mobile phone or a tablet computer, and can also be a fixed terminal device or server with data processing function.

[0049] In this embodiment, the terminal device to which the multi-terminal diagnostic apparatus belongs includes at least an output module 110 , a processor 120 , a memory 130 and a communication module 140 .

[0050] The memory 130 stores an operating system and a multi-terminal diagnostic program. The multi-terminal diagnostic device can store information such as a lock request command, a lock ID, a diagnostic command, and a diagnostic reply data in the memory 130. The output module 110 can be a display screen, etc. The communication module 140 can include a WIFI module, a mobile communication module, and a Bluetooth module, etc., and communicates with an external device or a server through the communication module 140.

[0051] When the multi-terminal diagnostic program in the memory 130 is executed by the processor, the following steps are implemented:

[0052] Sending a lock request command to the gateway of the target vehicle, wherein the lock request command is used to request to lock the target ECU;

[0053] receiving the lock ID replied by the gateway, generating a diagnostic command for the target ECU based on the lock ID, and sending the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU;

[0054] The diagnostic response data returned by the gateway is received, where the diagnostic response data is generated by the target ECU after executing the diagnostic command.

[0055] Furthermore, when the multi-terminal diagnostic program in the memory 130 is executed by the processor, the following steps are also implemented:

[0056] An unlock request command is sent to the gateway, so that the gateway unlocks the target ECU according to the unlock request command.

[0057] Furthermore, when the multi-terminal diagnostic program in the memory 130 is executed by the processor, the following steps are also implemented:

[0058] Receiving a lock request command sent by a target diagnostic device, wherein the lock request command is used to request to lock the target ECU;

[0059] generating a lock ID based on the target ECU and sending the lock ID to the target diagnostic device, so that the target diagnostic device generates a diagnostic command for the target ECU based on the lock ID;

[0060] receiving a diagnostic command sent by the target diagnostic device, and forwarding the diagnostic command to the target ECU;

[0061] The diagnostic reply data generated by the target ECU through executing the diagnostic command is received, and the diagnostic reply data is sent to the target diagnostic device.

[0062] Furthermore, when the multi-terminal diagnostic program in the memory 130 is executed by the processor, the following steps are also implemented:

[0063] Parsing the lock request command to obtain the system ID of the target ECU;

[0064] Determining whether the target ECU is in a locked state according to the system ID of the target ECU;

[0065] If the target ECU is not in a locked state, setting the state of the target ECU to a locked state, and executing the steps of generating a lock ID based on the target ECU and sending it to the target diagnostic device and thereafter;

[0066] If the target ECU is in a locked state, a corresponding abnormality code is generated and sent to the target diagnostic device.

[0067] Furthermore, when the multi-terminal diagnostic program in the memory 130 is executed by the processor, the following steps are also implemented:

[0068] monitoring the communication between the target diagnostic device and the target ECU, and recording the communication time;

[0069] Counting the non-communication time between the target diagnostic device and the target ECU according to the communication time;

[0070] When the non-communication time reaches the non-access automatic unlocking time, the state of the target ECU is changed to an unlocked state.

[0071] Furthermore, when the multi-terminal diagnostic program in the memory 130 is executed by the processor, the following steps are also implemented:

[0072] receiving a first diagnostic command sent by a first diagnostic device to a target ECU, and determining whether the target ECU is in a locked state;

[0073] If the target ECU corresponding to the first diagnostic command is in a locked state, parsing the first diagnostic command to obtain a first lock ID carried in the first diagnostic command;

[0074] If the first diagnostic command does not have the first lock ID, or the first lock ID does not match the target ECU, the first diagnostic command is rejected from being sent to the target ECU.

[0075] Furthermore, when the multi-terminal diagnostic program in the memory 130 is executed by the processor, the following steps are also implemented:

[0076] Receiving an unlock request command sent by the target diagnostic device, and parsing the unlock request command to obtain a system ID and a lock ID corresponding to the ECU to be unlocked;

[0077] Determine whether the lock ID corresponding to the ECU to be unlocked matches the target ECU;

[0078] If the lock ID corresponding to the ECU to be unlocked matches the target ECU, the state of the target ECU is changed to an unlocked state.

[0079] This embodiment uses the above scheme, specifically by sending a lock request command to the gateway of the target vehicle, the lock request command is used to request the target ECU to be locked; receiving the lock ID replied by the gateway, and generating a diagnostic command for the target ECU based on the lock ID, sending the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU; receiving the diagnostic reply data returned by the gateway, the diagnostic reply data is generated by the target ECU after executing the diagnostic command. The target diagnostic device sends a lock request command to the gateway to lock the target ECU, so that the diagnostic device can diagnose the target ECU only through the lock ID replied by the gateway, and receive the diagnostic reply data returned by the gateway. During this process, devices other than the target diagnostic device cannot diagnose the target ECU at the same time, preventing diagnostic conflicts between diagnostic devices of different clients, and avoiding synchronization problems between multiple clients, thereby improving the efficiency of multi-client diagnosis.

[0080] Based on the above terminal device architecture but not limited to the above architecture, an embodiment of the method of the present invention is proposed.

[0081] The execution subject of the method of this embodiment may be a multi-terminal diagnostic device or terminal equipment, etc. This embodiment takes a multi-terminal diagnostic device as an example.

[0082] The method embodiment of the present invention relates to diagnostic equipment, gateways, and ECUs. The diagnostic equipment can be an automobile fault diagnostic instrument used for automobile diagnosis. The diagnostic equipment supports a series of data read and write operations on the ECU, such as reading fault codes, clearing fault codes, and flashing ECU firmware, etc. These operations correspond to different diagnostic functions of the diagnostic equipment. The ECU is an electronic control unit that comes with the car, also known as a driving computer. The ECU can monitor various data and states during the operation of the car, and can output parameters to control some execution components. The gateway refers to the central gateway (CGW) of the car. As the core control device of the automobile network system, the gateway is responsible for coordinating the protocol conversion, data exchange, fault diagnosis and other tasks between CAN bus networks and other data networks with different structures and characteristics. When the gateway collects networks with different architectures or protocols for intercommunication, it provides network compatibility functions such as protocol conversion and data exchange. This gateway can also be commonly understood as a connector between automobile networks, a protocol converter, and a data translator.

[0083] The diagnostic device reads and writes data to the ECU through the gateway, that is, to realize the diagnostic function of the diagnostic device. In this process, four types of communication messages are generated, namely, the receiving and sending of communication messages between the diagnostic device and the gateway, and the receiving and sending of communication messages between the gateway and the ECU. However, the action of the diagnostic device reading and writing data to the ECU through the gateway is not necessarily successful, that is, the diagnostic function fails. For example, the diagnostic device fails to read the fault code of the engine ECU. At this time, it is necessary to analyze the communication messages during the execution of the diagnostic function to find out the cause of the failure of the diagnostic function and further solve the problem.

[0084] Reference Figure 2 , Figure 2 1 is a flow chart of an exemplary embodiment of a multi-terminal diagnosis method of the present invention. The multi-terminal diagnosis method comprises:

[0085] Step S10, sending a lock request command to the gateway of the target vehicle, wherein the lock request command is used to request to lock the target ECU;

[0086] Specifically, ECU (Electronic Control Unit) is also called the "driving computer" of the car. Their purpose is to control the driving state of the car and realize its various functions. It mainly uses data collection and exchange of various sensors and buses to judge the vehicle status and the driver's intention and control the car through actuators. Currently, multiple ECUs are installed on vehicles, such as engine ECU, gearbox ECU, etc. If multiple clients are connected to the vehicle bus at the same time to diagnose the vehicle, client 1 may conflict with other clients when executing a diagnostic function. For example, if the engine ECU needs to be flashed with firmware, other clients are not allowed to operate the engine ECU during the flashing period. In this case, the lock mechanism in the embodiment of the present invention can be used to send a lock request command to the gateway of the target vehicle. Since the communication between each client and the ECU is usually transferred through the vehicle's gateway, the diagnostic communication between the client and the ECU can be controlled by setting a lock on the gateway.

[0087] In the embodiment of the present application, the diagnostic device corresponding to client 1 among multiple clients is used as the target diagnostic device, and the engine firmware flashing is used as an example for explanation. When the target diagnostic device sends a lock request command to the gateway, the gateway can determine whether to set the target ECU to a locked state according to the lock request command. If the target ECU is already in a locked state, the gateway replies with an abnormal code. If the target ECU is not in a locked state, the gateway replies with the corresponding lock ID to the target diagnostic device.

[0088] Optionally, the lock request command may include the system ID of the target ECU to be encrypted, such as the engine system ID is 0x07E0, and the gateway can quickly determine the corresponding target ECU based on the system ID.

[0089] Optionally, the lock request command may also include an automatic unlocking time if there is no access. For example, when the automatic unlocking time if there is no access is 10 seconds, it means that if client 1 does not communicate with the engine ECU for more than 10 seconds, the gateway will automatically unlock the engine ECU. This is mainly to prevent the situation where other clients cannot access the engine normally due to the client not unlocking normally.

[0090] Optionally, when the target diagnostic device receives the abnormal code replied by the gateway, it indicates that there are other client diagnostic devices diagnosing the target ECU. Then the target diagnostic device can send a lock request command to the target ECU again after a preset time interval, and try to diagnose the target ECU again. The preset time interval can be set by the user according to actual needs. In addition, if there are other diagnostic tasks, the target diagnostic device can also choose to send a lock request command to other ECUs besides the target ECU to reduce waiting time and further improve the efficiency of multi-terminal diagnosis.

[0091] Step S20, receiving the lock ID replied by the gateway, generating a diagnostic command for the target ECU based on the lock ID, and sending the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU;

[0092] Furthermore, when the target diagnostic device receives the lock ID replied by the gateway, it can start to execute diagnostic functions such as firmware flashing. The lock ID is included in each frame of the diagnostic command. After the gateway receives the diagnostic command sent by the target diagnostic device, if it is determined that the target ECU is in an unlocked state, the diagnostic command will be forwarded to the ECU to execute the corresponding diagnostic function; if the target ECU is in a locked state, it will determine whether the lock ID contained in the diagnostic command matches the target ECU. If the lock ID contained in the diagnostic command does not match the target ECU, it means that the target diagnostic device currently has no diagnostic authority, and the gateway replies with a diagnostic error code that locking is not supported; if it matches, it means that the target diagnostic device can perform normal diagnosis on the target ECU, and will forward the diagnostic data to the corresponding ECU for diagnosis. When the target ECU completes the diagnostic function, it will generate diagnostic reply data, and the gateway will forward the diagnostic reply data to the target diagnostic device.

[0093] Optionally, when the gateway successfully locks the target ECU, it can monitor the communication between the target diagnostic device and the target ECU and record the communication time between the two. If the target diagnostic device and the target ECU do not communicate within the preset non-access automatic unlocking time, the gateway changes the state of the target ECU to an unlocked state to prevent deadlock, so that other clients can perform diagnostic functions on the target ECU in a timely manner.

[0094] Step S30, receiving the diagnostic response data returned by the gateway, wherein the diagnostic response data is generated by the target ECU after executing the diagnostic command.

[0095] Furthermore, when the gateway sends the diagnostic command to the target ECU, the target ECU can execute the diagnostic command and generate diagnostic response data, and the gateway forwards the diagnostic response data to the target diagnostic device.

[0096] Optionally, after the step of receiving the diagnostic reply data returned by the gateway, the step further includes:

[0097] An unlock request command is sent to the gateway, so that the gateway unlocks the target ECU according to the unlock request command.

[0098] As one of the implementation modes, when the target diagnostic device receives the diagnostic response data, it can be determined whether the target ECU has completed the diagnostic function based on the diagnostic response data. If the target ECU has completed the diagnosis, the target diagnostic device can send an unlock request command to the gateway. The unlock request command includes the system ID and lock ID of the ECU to be unlocked. When the gateway receives the unlock request command, it determines whether the lock ID contained therein matches the target ECU. If so, the state of the target ECU is changed to an unlocked state.

[0099] As another implementation method, during the diagnosis process, the target diagnostic device can send an unlock request command to the target ECU at any time according to the actual situation, without waiting for the diagnosis process to be fully completed.

[0100] In this embodiment, a lock request command is sent to the gateway of the target vehicle, and the lock request command is used to request the target ECU to be locked; the lock ID replied by the gateway is received, and a diagnostic command for the target ECU is generated based on the lock ID, and the diagnostic command is sent to the gateway so that the gateway sends the diagnostic command to the target ECU; the diagnostic reply data returned by the gateway is received, and the diagnostic reply data is generated by the target ECU after executing the diagnostic command. The target diagnostic device sends a lock request command to the gateway to lock the target ECU, so that the diagnostic device can diagnose the target ECU only through the lock ID replied by the gateway, and receive the diagnostic reply data returned by the gateway. During this process, devices other than the target diagnostic device cannot diagnose the target ECU at the same time, preventing diagnostic conflicts between diagnostic devices of different clients, and avoiding synchronization problems between multiple clients, thereby improving the efficiency of multi-client diagnosis.

[0101] Reference Figure 3 , Figure 3 This is a flow chart of another exemplary embodiment of the multi-terminal diagnosis method of the present invention. Figure 2 In the embodiment shown, in this embodiment, the multi-terminal diagnostic method is applied to the gateway of the target vehicle, and the multi-terminal diagnostic method includes:

[0102] Step A10, receiving a lock request command sent by a target diagnostic device, wherein the lock request command is used to request to lock the target ECU;

[0103] Optionally, after the step of receiving the lock request command sent by the target diagnostic device, the step further includes:

[0104] Parsing the lock request command to obtain the system ID of the target ECU;

[0105] Determining whether the target ECU is in a locked state according to the system ID of the target ECU;

[0106] If the target ECU is not in a locked state, setting the state of the target ECU to a locked state, and executing the steps of generating a lock ID based on the target ECU and sending it to the target diagnostic device and thereafter;

[0107] If the target ECU is in a locked state, a corresponding abnormality code is generated and sent to the target diagnostic device.

[0108] Specifically, the gateway parses the system ID in the lock request command, determines the target ECU through the system ID, and then determines whether to lock the target ECU. The gateway queries the status of the target ECU. If it is already in a locked state, it replies to client 1 with an exception code, indicating that the target ECU has been locked and the application is not supported. If the target ECU is in an unlocked state, the gateway changes the state of the target ECU to a locked state, and then generates a lock ID and replies to client 1.

[0109] Optionally, the lock request command also includes an unaccessed automatic unlocking time, and after the step of setting the state of the target ECU to the locked state, the step further includes:

[0110] monitoring the communication between the target diagnostic device and the target ECU, and recording the communication time;

[0111] Counting the non-communication time between the target diagnostic device and the target ECU according to the communication time;

[0112] When the non-communication time reaches the non-access automatic unlocking time, the state of the target ECU is changed to an unlocked state.

[0113] Specifically, the lock request command may also include the non-access automatic unlocking time. After the gateway generates the lock ID and sends it to the client 1, the non-access automatic unlocking time will be stored in the gateway. For example, when the non-access automatic unlocking time is 10 seconds, it means that if the client 1 does not communicate with the engine ECU for more than 10 seconds, the gateway will automatically unlock the engine ECU, mainly to prevent the situation where other clients cannot access normally due to the client not unlocking normally.

[0114] Step A20, generating a lock ID based on the target ECU and sending the lock ID to the target diagnostic device, so that the target diagnostic device generates a diagnostic command for the target ECU based on the lock ID;

[0115] Furthermore, after the gateway receives the lock request command and locks the target ECU, it can return the lock success reply and the generated lock ID to client 1. After client 1 receives the lock success reply, it obtains the lock ID and can start executing the firmware flashing function, in which each frame of the diagnostic command contains the lock ID data.

[0116] Step A30, receiving a diagnostic command sent by the target diagnostic device, and forwarding the diagnostic command to the target ECU;

[0117] Specifically, after receiving the diagnostic command from the client, the gateway determines whether to forward the diagnostic command to the target ECU. If the target ECU is currently unlocked, the diagnostic command will be forwarded to the ECU to perform the corresponding diagnostic function; if the gateway determines that the target ECU is currently locked, it will determine whether the lock ID in the diagnostic command matches the target ECU. If it does not match, it means that the client currently has no authority to diagnose, and it will reply with a lock-unsupported diagnostic error code; if it matches, it means that the client can diagnose normally, and the diagnostic data will be forwarded to the corresponding ECU for diagnosis. When the ECU completes the diagnostic function, it can generate the corresponding diagnostic reply data.

[0118] Optionally, the multi-terminal diagnosis method further includes:

[0119] receiving a first diagnostic command sent by a first diagnostic device to a target ECU, and determining whether the target ECU is in a locked state;

[0120] If the target ECU corresponding to the first diagnostic command is in a locked state, parsing the first diagnostic command to obtain a first lock ID carried in the first diagnostic command;

[0121] If the first diagnostic command does not have the first lock ID, or the first lock ID does not match the target ECU, the first diagnostic command is rejected from being sent to the target ECU.

[0122] Specifically, for a first diagnostic device other than the target diagnostic device, when the first diagnostic device sends a first diagnostic command for the target ECU to the gateway, the gateway determines whether the target ECU is in a locked state. If the target ECU corresponding to the first diagnostic command is in a locked state, the first diagnostic command is parsed to obtain the first lock ID carried in the first diagnostic command. If the first lock ID does not exist or the first lock ID does not match the target ECU, it means that a diagnostic device is currently diagnosing the target ECU. In this case, the first diagnostic command is refused to be sent to the target ECU to avoid diagnostic conflicts between diagnostic devices.

[0123] Step A40, receiving the diagnostic response data generated by the target ECU by executing the diagnostic command, and sending the diagnostic response data to the target diagnostic device.

[0124] Specifically, when the ECU completes the diagnostic function, it generates corresponding diagnostic response data, and forwards the diagnostic response data to client 1 through the gateway. When client 1 receives the diagnostic response data, it can send an unlock request command to the gateway. The unlock request command includes the system ID and lock ID of the ECU to be unlocked.

[0125] Optionally, after the step of receiving the diagnostic command sent by the target diagnostic device and forwarding the diagnostic command to the target ECU, the step further includes:

[0126] Receiving an unlock request command sent by the target diagnostic device, and parsing the unlock request command to obtain a system ID and a lock ID corresponding to the ECU to be unlocked;

[0127] Determine whether the lock ID corresponding to the ECU to be unlocked matches the target ECU;

[0128] If the lock ID corresponding to the ECU to be unlocked matches the target ECU, the state of the target ECU is changed to an unlocked state.

[0129] Specifically, the gateway parses the system ID and lock ID corresponding to the ECU to be unlocked contained in the unlock request command, and after further determining that the lock ID matches the target ECU, the ECU state is changed to an unlocked state.

[0130] Optionally, when the gateway successfully locks an ECU, it will monitor the communication between client 1 and the ECU and record the communication time. If client 1 and the ECU do not communicate within the specified non-access automatic unlocking time, the gateway will also change the ECU state to unlocked to prevent deadlock.

[0131] This embodiment adopts the above scheme, specifically by receiving a lock request command sent by a target diagnostic device, the lock request command is used to request to lock the target ECU; generating a lock ID based on the target ECU and sending it to the target diagnostic device, so that the target diagnostic device can generate a diagnostic command for the target ECU based on the lock ID; receiving the diagnostic command sent by the target diagnostic device, and forwarding the diagnostic command to the target ECU; receiving the diagnostic reply data generated by the target ECU by executing the diagnostic command, and sending the diagnostic reply data to the target diagnostic device. By setting a lock on the gateway to control the diagnostic communication between the client and the ECU, the ECU can be locked and unlocked to prevent diagnostic conflicts. If a client needs to perform a diagnostic function on a certain ECU, there may be a risk of diagnostic conflicts. The client can apply for the gateway to lock the ECU. After locking, only the client can diagnose the ECU through the lock ID, and other clients cannot access the locked ECU. Until the locked client completes the diagnosis and then unlocks the ECU, other clients can perform the diagnosis. In this way, the diagnostic conflict between different clients can be effectively prevented, and there is no need to make an agreement between multiple clients, which improves the efficiency of multi-client diagnosis and reduces the cost of synchronization.

[0132] In addition, an embodiment of the present invention further provides a multi-terminal diagnostic device, the multi-terminal diagnostic device comprising:

[0133] A request module, used to send a lock request command to the gateway of the target vehicle, wherein the lock request command is used to request to lock the target ECU;

[0134] A diagnostic module, configured to receive the lock ID replied by the gateway, generate a diagnostic command for the target ECU based on the lock ID, and send the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU;

[0135] The receiving module is used to receive the diagnostic response data returned by the gateway, wherein the diagnostic response data is generated by the target ECU after executing the diagnostic command.

[0136] The multi-terminal diagnostic device also includes an unlocking module, which is used to send an unlocking request command to the gateway, so that the gateway can unlock the target ECU according to the unlocking request command.

[0137] In addition, an embodiment of the present invention further provides another multi-terminal diagnostic device, the multi-terminal diagnostic device comprising:

[0138] A locking module, used for receiving a locking request command sent by a target diagnostic device, wherein the locking request command is used for requesting to lock the target ECU;

[0139] A sending module, used for generating a lock ID based on the target ECU and sending the lock ID to the target diagnostic device, so that the target diagnostic device generates a diagnostic command for the target ECU based on the lock ID;

[0140] A forwarding module, used for receiving a diagnostic command sent by the target diagnostic device and forwarding the diagnostic command to the target ECU;

[0141] The reply module is used to receive the diagnostic reply data generated by the target ECU through executing the diagnostic command, and send the diagnostic reply data to the target diagnostic device.

[0142] The multi-terminal diagnostic device further comprises:

[0143] The parsing module includes a first parsing unit, a judgment unit, a locking unit and an exception response unit, wherein the first parsing unit is used to parse the locking request command to obtain the system ID of the target ECU; the judgment unit is used to judge whether the target ECU is in a locked state according to the system ID of the target ECU; if the target ECU is not in a locked state, the locking unit is used to set the state of the target ECU to a locked state, and execute the steps of generating a lock ID based on the target ECU and sending it to the target diagnostic device and thereafter; if the target ECU is in a locked state, the exception response unit is used to generate a corresponding exception code and send the exception code to the target diagnostic device.

[0144] The monitoring module includes a recording unit, a statistical unit and a first change unit, wherein the recording unit is used to monitor the communication between the target diagnostic device and the target ECU and record the communication time; the statistical unit is used to count the non-communication time between the target diagnostic device and the target ECU according to the communication time; when the non-communication time reaches the non-access automatic unlocking time, the first change unit is used to change the state of the target ECU to an unlocked state.

[0145] The identification module includes a determination unit, an acquisition unit and a rejection unit, wherein the determination unit is used to receive a first diagnostic command sent by a first diagnostic device to a target ECU, and determine whether the target ECU is in a locked state; if the target ECU corresponding to the first diagnostic command is in a locked state, the first diagnostic command is parsed, and the acquisition unit is used to acquire a first lock ID carried in the first diagnostic command; if the first diagnostic command does not contain the first lock ID, or the first lock ID does not match the target ECU, the rejection unit is used to refuse to send the first diagnostic command to the target ECU.

[0146] The unlocking module includes a second parsing unit, a matching unit and a second changing unit, wherein the second parsing unit is used to receive an unlocking request command sent by the target diagnostic device, and parse the unlocking request command to obtain a system ID and a lock ID corresponding to the ECU to be unlocked; the matching unit is used to determine whether the lock ID corresponding to the ECU to be unlocked matches the target ECU; if the lock ID corresponding to the ECU to be unlocked matches the target ECU, the second changing unit is used to change the state of the target ECU to an unlocked state.

[0147] For the principle and implementation process of implementing multi-terminal diagnosis in this embodiment, please refer to the above embodiments and will not be repeated here.

[0148] In addition, an embodiment of the present invention also proposes a terminal device, which includes a memory, a processor, and a multi-terminal diagnostic program stored in the memory and executable on the processor, wherein the multi-terminal diagnostic program implements the steps of the multi-terminal diagnostic method described above when executed by the processor.

[0149] Since all the technical solutions of all the aforementioned embodiments are adopted when the multi-terminal diagnostic program is executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.

[0150] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a multi-terminal diagnostic program is stored. When the multi-terminal diagnostic program is executed by a processor, the steps of the multi-terminal diagnostic method described above are implemented.

[0151] Since all the technical solutions of all the aforementioned embodiments are adopted when the multi-terminal diagnostic program is executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.

[0152] Compared with the prior art, the multi-terminal diagnostic method, device, terminal device and storage medium proposed in the embodiment of the present invention send a lock request command to the gateway of the target vehicle, the lock request command is used to request the target ECU to be locked; receive the lock ID replied by the gateway, and generate a diagnostic command for the target ECU based on the lock ID, send the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU; receive the diagnostic reply data returned by the gateway, the diagnostic reply data is generated by the target ECU after executing the diagnostic command. The target diagnostic device sends a lock request command to the gateway to lock the target ECU, so that the diagnostic device can diagnose the target ECU only through the lock ID replied by the gateway, and devices other than the target diagnostic device cannot diagnose the target ECU at the same time until the target diagnostic device receives the diagnostic reply data and unlocks the target ECU. Only then can other diagnostic devices diagnose the target ECU, preventing diagnostic conflicts between diagnostic devices of different clients, while avoiding synchronization problems between multiple clients, and improving the efficiency of multi-client diagnosis.

[0153] 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.

[0154] 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.

[0155] 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 ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.

[0156] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A multi-terminal diagnosis method, characterized in that: The multi-terminal diagnosis method is applied to a target diagnosis device, and the multi-terminal diagnosis method comprises the following steps: Sending a lock request command to the gateway of the target vehicle, wherein the lock request command is used to request to lock the target ECU; receiving the lock ID replied by the gateway, generating a diagnostic command for the target ECU based on the lock ID, and sending the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU; Receiving diagnostic response data returned by the gateway, wherein the diagnostic response data is generated by the target ECU after executing the diagnostic command; After the gateway receives the diagnostic command sent by the target diagnostic device, if the target ECU is in a locked state, determining whether the lock ID included in the diagnostic command matches the target ECU; If the lock ID included in the diagnostic command does not match the target ECU, it means that the target diagnostic device currently has no diagnostic authority; If the lock ID included in the diagnosis command matches the target ECU, it means that the target diagnosis device can perform normal diagnosis on the target ECU.

2. The multi-terminal diagnosis method according to claim 1, characterized in that: After the step of receiving the diagnostic reply data returned by the gateway, the method further includes: An unlock request command is sent to the gateway, so that the gateway unlocks the target ECU according to the unlock request command.

3. A multi-terminal diagnosis method, characterized in that: The multi-terminal diagnosis method is applied to the gateway of the target vehicle, and the multi-terminal diagnosis method comprises the following steps: Receiving a lock request command sent by a target diagnostic device, wherein the lock request command is used to request to lock the target ECU; generating a lock ID based on the target ECU and sending the lock ID to the target diagnostic device, so that the target diagnostic device generates a diagnostic command for the target ECU based on the lock ID; receiving a diagnostic command sent by the target diagnostic device, and forwarding the diagnostic command to the target ECU; receiving diagnostic response data generated by the target ECU through executing the diagnostic command, and sending the diagnostic response data to the target diagnostic device; The multi-terminal diagnosis method further includes: receiving a first diagnostic command sent by a first diagnostic device to a target ECU, and determining whether the target ECU is in a locked state; If the target ECU corresponding to the first diagnostic command is in a locked state, parsing the first diagnostic command to obtain a first lock ID carried in the first diagnostic command; If the first diagnostic command does not have the first lock ID, or the first lock ID does not match the target ECU, the first diagnostic command is rejected from being sent to the target ECU.

4. The multi-terminal diagnosis method according to claim 3, characterized in that: After the step of receiving the lock request command sent by the target diagnostic device, the method further includes: Parsing the lock request command to obtain the system ID of the target ECU; Determining whether the target ECU is in a locked state according to the system ID of the target ECU; If the target ECU is not in a locked state, setting the state of the target ECU to a locked state, and executing the steps of generating a lock ID based on the target ECU and sending it to the target diagnostic device and thereafter; If the target ECU is in a locked state, a corresponding abnormality code is generated and sent to the target diagnostic device.

5. The multi-terminal diagnosis method according to claim 4, characterized in that: The lock request command also includes an unaccessed automatic unlocking time, and after the step of setting the state of the target ECU to the locked state, the step further includes: monitoring the communication between the target diagnostic device and the target ECU, and recording the communication time; Counting the non-communication time between the target diagnostic device and the target ECU according to the communication time; When the non-communication time reaches the non-access automatic unlocking time, the state of the target ECU is changed to an unlocked state.

6. The multi-terminal diagnosis method according to claim 3, characterized in that: After the step of receiving the diagnostic command sent by the target diagnostic device and forwarding the diagnostic command to the target ECU, the method further includes: Receiving the unlock request command sent by the target diagnostic device, and parsing the unlock request command to obtain the system ID and lock ID corresponding to the ECU to be unlocked; Determine whether the lock ID corresponding to the ECU to be unlocked matches the target ECU; If the lock ID corresponding to the ECU to be unlocked matches the target ECU, the state of the target ECU is changed to an unlocked state.

7. A multi-terminal diagnostic device, characterized in that: The multi-terminal diagnostic device is applied to a target diagnostic device, and the multi-terminal diagnostic device includes: A request module, used to send a lock request command to the gateway of the target vehicle, wherein the lock request command is used to request to lock the target ECU; A diagnostic module, configured to receive the lock ID replied by the gateway, generate a diagnostic command for the target ECU based on the lock ID, and send the diagnostic command to the gateway, so that the gateway sends the diagnostic command to the target ECU; A receiving module, used for receiving the diagnostic response data returned by the gateway, wherein the diagnostic response data is generated by the target ECU after executing the diagnostic command; Among them, after the gateway receives the diagnostic command sent by the target diagnostic device, if the target ECU is in a locked state, it determines whether the lock ID contained in the diagnostic command matches the target ECU; if the lock ID contained in the diagnostic command does not match the target ECU, it means that the target diagnostic device currently has no diagnostic authority; if the lock ID contained in the diagnostic command matches the target ECU, it means that the target diagnostic device can perform normal diagnosis on the target ECU.

8. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a multi-terminal diagnostic program stored in the memory and executable on the processor. When the multi-terminal diagnostic program is executed by the processor, the steps of the multi-terminal diagnostic method as described in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a multi-terminal diagnostic program, which, when executed by a processor, implements the steps of the multi-terminal diagnostic method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Multi-request remote diagnosis method, device and system

    CN113433929A

  • Exclusive control device and its method

    JP2004094850A