Diagnostic method, device, medium and program product for an ecu

CN122902524APending Publication Date: 2026-10-13LAUNCH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611209140.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]但是,随着整车电控架构复杂化,车内ECU数量大幅增加,原有点对点认证诊断模式,需要重复完成多次安全认证流程,导致该点对点认证诊断模式效率低下,已无法适配高效诊断需求

Benefits of technology

[0039]借由上述技术方案,本申请提供的实施例具有以下优点:本申请实施例方法包括:响应于诊断设备下发的针对多个目标ECU的诊断指令,获取预先为所述诊断设备生成的当前全局认证令牌;基于每个所述目标ECU对应的所述诊断指令,在所述多个目标ECU中确定与所述当前全局认证令牌匹配的第一目标ECU;向所述第一目标ECU发送认证请求,以使每个所述第一目标ECU对各自接收到的所述认证请求进行校验得到认证结果;在所述第一目标ECU中确定所述认证结果为通过的第二目标ECU,将所述诊断设备下发的对应于所述第二目标ECU的诊断指令转发至所述第二目标ECU,以使所述第二目标ECU执行所述诊断指令对应的诊断操作。如此,本申请通过搭建网关集中认证的机制,诊断设备仅需要与网关进行一次安全认证授权,授权通过后就可实现诊断操作的执行,省去了重复的安全认证环节,大幅提高ECU诊断指令的执行效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122902524A_ABST
    Figure CN122902524A_ABST
Patent Text Reader

Abstract

The application discloses a kind of ECU diagnostic methods, it is related to ECU diagnosis field, comprising: in response to the diagnosis instruction of multiple target ECUs issued by diagnostic equipment, obtain the current global authentication token generated in advance for diagnostic equipment;Determine the first target ECU matched with the current global authentication token in multiple target ECUs based on the diagnosis instruction corresponding to each target ECU;Send authentication request to the first target ECU, to make each first target ECU check the authentication result obtained by respective received authentication request;Determine the second target ECU in the first target ECU, and the diagnosis instruction corresponding to the second target ECU issued by diagnostic equipment is forwarded to the second target ECU, to make the second target ECU execute the diagnosis operation corresponding to diagnosis instruction.The application is based on the mode that gateway and diagnostic equipment are collectively authenticated, and the ECU diagnosis efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of diagnostic technology, and in particular to an ECU diagnostic method, as well as an ECU diagnostic method, apparatus, medium, and program product. Background Technology

[0002] With the rapid development of the automotive electronics technology industry, modern automobiles are evolving from traditional mechanical products into intelligent, Internet of Things (IoT) connected electronic information products. To achieve complex functions such as vehicle power control, infotainment, and advanced driver assistance, modern automobiles typically integrate dozens or even more Electronic Control Units (ECUs). To perform fault diagnosis, firmware flashing, parameter configuration, and function debugging for each ECU, the global automotive industry has established a standardized on-board diagnostic system. Currently, the on-board diagnostic system follows international standards such as Unified Diagnostic Services (UDS, ISO 14229) and Diagnostic Communication over Internet Protocol (DoIP, ISO 13400).

[0003] In traditional ECU diagnostics, a point-to-point authentication diagnostic mode is typically used. Since each ECU in a vehicle operates independently and without interference, the diagnostic tool needs to communicate point-to-point with each ECU separately and execute a complete security authentication process. Specifically, before performing diagnostic operations such as fault diagnosis, firmware flashing, parameter configuration, and function debugging on a single ECU, the diagnostic tool must establish a separate diagnostic session with the ECU and complete a series of security authentication procedures. After successful authentication, the diagnostic operation for the ECU is executed. Then, the diagnostic tool must disconnect the current session and repeat all the above steps with the next target ECU until the diagnostic operations for all ECUs are completed.

[0004] However, with the increasing complexity of the vehicle's electronic control architecture and the significant increase in the number of ECUs in the vehicle, the original point-to-point authentication and diagnostic mode requires repeated completion of multiple safety authentication processes, resulting in low efficiency and making it unable to meet the needs of efficient diagnosis. Summary of the Invention

[0005] In view of the above problems, this application provides an ECU diagnostic method and related apparatus to achieve efficient ECU diagnostics. The specific solution is as follows:

[0006] The first aspect of this application provides a diagnostic method for an ECU, applied to a central gateway, the diagnostic method comprising:

[0007] In response to diagnostic commands issued by the diagnostic device for multiple target ECUs, obtain the current global authentication token pre-generated for the diagnostic device;

[0008] Based on the diagnostic instructions corresponding to each target ECU, a first target ECU that matches the current global authentication token is determined from the plurality of target ECUs;

[0009] An authentication request is sent to the first target ECU so that each of the first target ECUs verifies the authentication request it receives and obtains an authentication result.

[0010] In the first target ECU, if the second target ECU is determined to have passed the authentication, the diagnostic command issued by the diagnostic device corresponding to the second target ECU is forwarded to the second target ECU so that the second target ECU executes the diagnostic operation corresponding to the diagnostic command.

[0011] In one possible implementation, determining the first target ECU that matches the current global authentication token among the plurality of target ECUs based on the diagnostic instructions corresponding to each target ECU includes:

[0012] Obtain a diagnostic permission whitelist, which includes: at least one ECU, at least one diagnostic operation type corresponding to each ECU, and a global authentication token corresponding to each ECU under each diagnostic operation;

[0013] Based on the diagnostic instructions corresponding to each target ECU, determine the diagnostic operation type corresponding to each target ECU;

[0014] In the diagnostic permission whitelist, find the global authentication token corresponding to each target ECU under its respective diagnostic operation type;

[0015] The target ECU whose current global authentication token matches the searched global authentication token among the plurality of target ECUs is selected as the first target ECU.

[0016] In one possible implementation, determining the diagnostic operation type corresponding to each target ECU based on the diagnostic instruction corresponding to each target ECU includes:

[0017] The diagnostic operation type for each target ECU is determined based on the service identifier in the diagnostic instruction corresponding to each target ECU.

[0018] In one possible implementation, sending the authentication request to the first target ECU includes:

[0019] Based on the diagnostic instructions corresponding to each first target ECU, determine the diagnostic operation type corresponding to each first target ECU;

[0020] Based on the diagnostic operation type corresponding to each first target ECU, an authentication request corresponding to each diagnostic operation type is determined as the authentication request corresponding to each first target ECU.

[0021] Send each of the first target ECUs its own authentication request.

[0022] In one possible implementation, before obtaining the current global authentication token pre-generated for the diagnostic device in response to a diagnostic command issued by the diagnostic device for multiple target ECUs, the method further includes:

[0023] In response to a security authentication request sent by the diagnostic device, a random seed is generated and sent back to the diagnostic device so that the diagnostic device can calculate a security key based on the random seed;

[0024] If the security key returned by the diagnostic device is valid, the current global authentication token corresponding to the diagnostic device is generated.

[0025] In one possible implementation, determining the first target ECU that matches the current global authentication token among the plurality of target ECUs includes:

[0026] Verify whether the global authentication token is within its validity period;

[0027] If the global authentication token is valid, then a first target ECU matching the global authentication token is determined from among the plurality of target ECUs.

[0028] In one possible implementation, before determining the first target ECU matching the current global authentication token among the plurality of target ECUs based on the diagnostic instructions corresponding to each target ECU, the method further includes:

[0029] In response to diagnostic commands issued by the diagnostic device for multiple target ECUs, a cache table is obtained; wherein the cache table includes: at least one second target ECU, a diagnostic operation type corresponding to each second target ECU, and a global authentication token corresponding to each second target ECU under each diagnostic operation type;

[0030] If, based on the cache table, it is determined that among the plurality of target ECUs, there is a second target ECU that meets the conditions, the diagnostic command issued by the diagnostic device corresponding to the second target ECU is forwarded to the second target ECU; wherein the second target ECU that meets the conditions is that the ECU is the same as the second target ECU in the cache table, and the diagnostic operation type of the diagnostic command is the same as the diagnostic operation type of the same second target ECU in the cache table, and the current global authentication token matches the global authentication token of the same second target ECU in the cache table under the same diagnostic operation type;

[0031] If it is determined based on the cache table that a second target ECU that meets the conditions is not included among the plurality of target ECUs, the process returns to the step of determining the first target ECU that matches the current global authentication token among the plurality of target ECUs based on the diagnostic instructions corresponding to each target ECU.

[0032] A second aspect of this application provides a diagnostic device for an ECU, comprising:

[0033] The acquisition unit is used to acquire a current global authentication token pre-generated for the diagnostic device in response to a diagnostic command issued by the diagnostic device for multiple target ECUs.

[0034] A determining unit is configured to determine, based on the diagnostic instruction corresponding to each target ECU, a first target ECU that matches the current global authentication token among the plurality of target ECUs;

[0035] The sending unit is used to send an authentication request to the first target ECU, so that each of the first target ECUs verifies the authentication request it receives and obtains an authentication result;

[0036] An execution unit is configured to determine, in the first target ECU, a second target ECU whose authentication result is passed, and forward the diagnostic command issued by the diagnostic device corresponding to the second target ECU to the second target ECU, so that the second target ECU executes the diagnostic operation corresponding to the diagnostic command.

[0037] A third aspect of this application provides a computer storage medium carrying one or more computer programs that, when executed by an electronic device, enable the diagnostic method of the ECU of the electronic device as described in the first aspect or any implementation thereof.

[0038] The fourth aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the diagnostic method of the ECU described in the first aspect or any implementation thereof.

[0039] By employing the above technical solutions, the embodiments provided in this application have the following advantages: The method of this application includes: in response to diagnostic instructions issued by a diagnostic device for multiple target ECUs, obtaining a current global authentication token pre-generated for the diagnostic device; based on the diagnostic instructions corresponding to each target ECU, determining a first target ECU among the multiple target ECUs that matches the current global authentication token; sending an authentication request to the first target ECU, so that each first target ECU verifies the authentication request it receives to obtain an authentication result; determining a second target ECU among the first target ECUs whose authentication result is passed, and forwarding the diagnostic instructions issued by the diagnostic device corresponding to the second target ECU to the second target ECU, so that the second target ECU executes the diagnostic operation corresponding to the diagnostic instructions. Thus, by establishing a gateway centralized authentication mechanism, this application requires the diagnostic device to perform only one security authentication and authorization with the gateway. After successful authorization, the diagnostic operation can be executed, eliminating repeated security authentication steps and significantly improving the execution efficiency of ECU diagnostic instructions. Attached Figure Description

[0040] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0041] Figure 1 This is a schematic diagram of a diagnostic system architecture for an ECU provided in an embodiment of this application;

[0042] Figure 2 A flowchart illustrating a diagnostic method for an ECU provided in an embodiment of this application;

[0043] Figure 3 A flowchart illustrating another diagnostic method for an ECU provided in an embodiment of this application;

[0044] Figure 4 A flowchart illustrating another diagnostic method for an ECU provided in an embodiment of this application;

[0045] Figure 5 A schematic diagram of the structure of an ECU diagnostic device provided in an embodiment of this application; Detailed Implementation

[0046] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0047] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0048] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0049] This application can be applied to the field of ECU diagnostics, as follows: Figure 1 For example, we will introduce several application scenarios that have been implemented in products.

[0050] First, we will introduce the application scenarios of this application. This application can be applied, but is not limited to, to applications with diagnostic functions or cloud services provided by cloud-side servers, which will be described in detail below:

[0051] See Figure 1 , Figure 1 A schematic diagram of a system architecture for ECU diagnostics is shown. The system may include a diagnostic device 101, a gateway 102, and an ECU 103. The diagnostic device 101 can provide the methods provided in the embodiments of this application to multiple ECUs.

[0052] The diagnostic device 101 is connected to the gateway 102, and the gateway 102 is connected to the ECU 103. This connection can be wired or wireless, and is not limited here. The ECU 103 can be located within the gateway 102, meaning the gateway 102 and the ECU 103 can be integrated into the same physical device, or the ECU 103 can be located outside the gateway 102, and is not limited here. Furthermore, the diagnostic device 101 may include diagnostic instruments, diagnostic adapters, testing equipment, etc.; the number of diagnostic functions of the ECU 103 is not limited to... Figure 1 There are 5, but the specific ones are not limited here.

[0053] In the traditional ECU diagnostic process, before performing diagnostic operations on ECU 103, the diagnostic device 101 needs to perform a security authentication process with each ECU 103. Only after passing the security authentication can it obtain the relevant diagnostic permissions for that ECU. After completing the diagnostic operation, the same security authentication is required before performing operations on the next ECU 103, and this process is repeated. This traditional ECU diagnostic process greatly reduces the efficiency of the diagnostic device in performing diagnostic operations on ECUs. Therefore, this application embodiment provides an ECU diagnostic method that can improve the efficiency of the diagnostic device in performing diagnostic operations on ECUs, such as... Figure 2 As shown, the diagnostic method includes the following specific steps:

[0054] 201. In response to diagnostic commands issued by the diagnostic device for multiple target ECUs, obtain the current global authentication token pre-generated for the diagnostic device.

[0055] In this embodiment, the gateway receives diagnostic commands from the diagnostic device targeting multiple ECUs. This means that the diagnostic commands are not sent directly to their respective ECUs, but are instead sent uniformly to the gateway, which then verifies the permissions of the commands. For ease of distinction, the ECUs corresponding to the diagnostic commands issued by the diagnostic device are referred to as the target ECUs; that is, the ECUs to which the diagnostic commands are directed are called the target ECUs.

[0056] For example, the specific process may include the diagnostic device establishing a communication connection with the gateway via a bus, entering a default session mode. This bus can be a CAN bus, LIN bus, DoIP bus, etc. After establishing the communication connection, the diagnostic device sends a session service switch request to the gateway, that is, switching from the current default session mode to an extended session or programming session. It should be noted that the ECU automatically enters the default session mode after power-on and reset, and remains in this mode during normal vehicle operation. In this mode, simple, unrestricted operations can be performed, such as reading fault codes and reading basic vehicle information; specific details are not specified here. If more complex, restricted operations are required, such as parameter configuration, testing, or firmware flashing, a mode switch is necessary, switching to the corresponding session mode according to the session service switch command. It should also be noted that diagnostic commands issued by the diagnostic device for multiple target ECUs include batch diagnostics, firmware flashing, parameter configuration, fault diagnosis, etc.; specific details are not specified here.

[0057] The gateway obtains a pre-generated global authentication token for the diagnostic device. To distinguish it from other global authentication tokens, this token is referred to as the current global authentication token. Furthermore, the obtained current global authentication token has an access level, such as level A, level B, or level C, without being specifically limited here. The level of this generated current global authentication token is unique and remains unchanged during this diagnostic operation, depending solely on the diagnostic device; that is, if the diagnostic device remains the same, the level of the generated current global authentication token remains unchanged.

[0058] 202. Based on the diagnostic instructions corresponding to each target ECU, determine the first target ECU that matches the current global authentication token among multiple target ECUs.

[0059] The gateway, based on the diagnostic commands corresponding to each target ECU, determines the ECU that matches the current global authentication token among multiple target ECUs. For ease of distinction, the target ECU matching the current global token is referred to as the first target ECU. Specifically, the gateway receives diagnostic commands from the diagnostic device targeting multiple target ECUs. Based on these commands, it determines which ECU requires which diagnostic operation; for example, command 1 requires a flashing operation on ECU2. It further determines the execution permissions required to perform this operation on that ECU. For instance, ECU permission levels include levels 1, 2, 3, 4, and 5. Assume flashing ECU2 requires level 4 permission. The higher the permission required to perform a diagnostic operation on a particular ECU, the higher the required permission level of the current global authentication token. Specifically, assuming the current global authentication token's permission level is B, corresponding to level 4 permission required for the ECU to perform the relevant operation, the current global authentication token's permission level must be at least level B to match. Tokens with permission levels lower than the required permission level are not authorized to perform the corresponding operation on that ECU. For example, performing a flashing operation on ECU2 requires Level 4 privileges, meaning that the current global authentication token must have a privilege level of at least Level B. Level A tokens do not have the privileges to perform flashing operations on ECU2.

[0060] Based on the current global authentication token's permission level and the execution permissions required by the ECUs corresponding to multiple diagnostic commands to perform this operation, the first target ECU is determined. Specifically, assuming the current global authentication token's permission level is B, corresponding to the ECU's level 4 permission required to perform the relevant operation, then any diagnostic operation performed on an ECU at a level lower than 4 (including level 4) can be executed. For example, ECU1 requires level 3 permission to perform parameter configuration, and ECU2 requires level 4 permission to perform flashing. If the current global authentication token's permission level is B, both operations can be executed, and this ECU is determined as the first target ECU matching the current global authentication token. If a diagnostic operation on an ECU requires a permission level higher than 4, and the current global authentication token's permission level is insufficient, then the instruction is directly intercepted.

[0061] 203. Send an authentication request to the first target ECU so that each first target ECU can verify the authentication request it receives and obtain the authentication result.

[0062] The gateway sends an authentication request to the first target ECU, enabling each first target ECU to verify its received authentication request and obtain an authentication result. Specifically, the gateway pre-stores authentication request instructions for each ECU at various levels; that is, the permission level corresponding to each diagnostic operation performed by each ECU is uniquely assigned to each instruction in the gateway. After identifying the first target ECU that matches the current global authentication token, the gateway sends its corresponding authentication request instruction to each first target ECU. Each first target ECU receives the authentication request instruction, verifies it, and if the verification is successful, the corresponding permission level is granted, obtaining the authentication result and preparing for the next step of gateway instruction forwarding.

[0063] 204. In the first target ECU, if the second target ECU is determined to have passed the certification, the diagnostic command issued by the diagnostic device corresponding to the second target ECU is forwarded to the second target ECU so that the second target ECU can execute the diagnostic operation corresponding to the diagnostic command.

[0064] To facilitate differentiation, the first target ECU that passed the above verification is designated as the second target ECU. Subsequently, diagnostic commands from the diagnostic device corresponding to the second target ECU are forwarded to the second target ECU. The second target ECU receives the diagnostic commands forwarded by the gateway and begins to execute the diagnostic operations corresponding to the commands. After completing the diagnostic operations, the second target ECU feeds back the execution results to the gateway. The gateway then summarizes the execution results and sends them back to the diagnostic device.

[0065] After all diagnostic operations are completed, the diagnostic device sends a request to close the session. The gateway destroys the current global authentication token and sends a permission revocation command to all second target ECUs. After receiving the permission revocation command, all second target ECUs lock their execution permissions and revert to the original traditional ECU diagnostic mode. The gateway clears cache resources, releases bus memory, and completes the entire ECU diagnostic process.

[0066] In summary, in this embodiment, based on the diagnostic instructions issued by the diagnostic device, a first target ECU matching the current global authentication token is determined from multiple target ECUs. During the matching process of the current global authentication token, a centralized authentication is performed. After authentication is completed, an authentication request is sent to the first target ECU to determine the second target ECU, and then the diagnostic instructions are forwarded to the second target ECU for execution. In this embodiment, the diagnostic device only needs to perform centralized authentication with the gateway once. By establishing this gateway centralized authentication mechanism, the repeated authentication process in traditional ECU diagnosis is eliminated, significantly improving the execution efficiency of diagnostic instructions.

[0067] In one possible implementation, the diagnostic method will be described in more detail, such as Figure 3 As shown, the diagnostic method includes the following specific steps:

[0068] 301. In response to the security authentication request sent by the diagnostic device, generate a random seed and send it back to the diagnostic device so that the diagnostic device can calculate the security key based on the random seed; if the security key returned by the diagnostic device is valid, generate the current global authentication token corresponding to the diagnostic device.

[0069] In this embodiment, before executing step 302, the gateway needs to pre-generate a current global authentication token for the diagnostic device. Specifically, after establishing a communication connection, the diagnostic device sends a session service switch request to the gateway, i.e., switching from the current default session mode to an extended session mode or a programmable session mode, as detailed in step 201. After switching session modes, the diagnostic device sends a seed service instruction to the gateway. The gateway generates a random seed based on this instruction and sends it back to the diagnostic device. The diagnostic device uses its locally stored key, combined with the seed data, to calculate a security key using an encryption algorithm and sends it to the gateway. Further, the gateway verifies the validity of this security key. Using the same algorithm and key, it calculates a local verification key based on the same seed data and compares it with the key sent by the diagnostic device. If the comparison result matches, the security key is determined to be valid, and a unique and unchanging current global authentication token is generated for the current diagnostic device during this diagnostic operation.

[0070] 302. In response to diagnostic commands issued by the diagnostic device for multiple target ECUs, obtain the current global authentication token pre-generated for the diagnostic device.

[0071] The gateway receives diagnostic commands from the diagnostic device targeting multiple target ECUs and obtains the current global authentication token generated in step 301. It should be clear that these diagnostic commands target multiple target ECUs requiring diagnosis, and the diagnostic device can issue diagnostic commands multiple times and in batches; specific limitations are not specified here. Step 302 is essentially the same as step 201 above and will not be elaborated further.

[0072] 303. Based on the diagnostic instructions corresponding to each target ECU, determine the first target ECU that matches the current global authentication token among multiple target ECUs.

[0073] In this embodiment, step 303 determines the corresponding diagnostic command among multiple target ECUs based on the diagnostic command for each target ECU.

[0074] The first target ECU for the current global authentication token matching includes the following steps 3031-3034:

[0075] 3031. Obtain the diagnostic permission whitelist. The diagnostic permission whitelist includes: at least one ECU, at least one diagnostic operation type corresponding to each ECU, and a global authentication token corresponding to each ECU under each diagnostic operation.

[0076] Before the diagnostic device establishes a communication connection with the gateway, the gateway stores a diagnostic permission whitelist. This whitelist includes each target ECU corresponding to the diagnostic command, each type of operation performed by each target ECU, the permission level required for each type of operation performed by each target ECU, and the permission level of the global authentication token corresponding to each ECU for each diagnostic operation. For example, performing a flashing operation on ECU2 requires level 4 permission, which corresponds to level B permission on the global authentication token. This means that performing a flashing operation on ECU2 requires at least level B permission on the global authentication token.

[0077] 3032. Based on the diagnostic instructions corresponding to each target ECU, determine the diagnostic operation type corresponding to each target ECU.

[0078] In this embodiment, the diagnostic operation type corresponding to each target ECU is determined based on the diagnostic instruction corresponding to each target ECU. This includes determining the diagnostic operation type corresponding to each target ECU based on the service identifier (SID) in the diagnostic instruction corresponding to each target ECU. Specifically, for example, when the SID value is 0x2E, the corresponding diagnostic operation type is a parameter configuration operation; when the SID value is 0x34, the corresponding diagnostic operation type is a firmware flashing operation. No specific restrictions are imposed here.

[0079] 3033. In the diagnostic permission whitelist, find the global authentication token corresponding to each target ECU under its respective diagnostic operation type.

[0080] Step 3032 above determines the diagnostic operation type for each target ECU. Further, using the whitelist, the permission level corresponding to each target ECU for the diagnostic command under its respective diagnostic operation type is found. For example, performing a flashing operation on ECU2 requires level 4 permission. Further, this permission level determines the global authentication token level required to perform the operation. That is, it is determined that at least level B global authentication token is required to perform a flashing operation on ECU2.

[0081] 3034. Among multiple target ECUs, the target ECU whose current global authentication token matches the searched global authentication token is selected as the first target ECU.

[0082] After determining the global authentication token permission level corresponding to each target ECU under its respective diagnostic operation type, the execution permission is judged. Specifically, the current global authentication token is compared with the searched global authentication token. For example, performing a flashing operation on ECU2 requires at least a global authentication token with a level B permission. If the current global authentication token has a level C permission, it means that the current global authentication token has the permission to perform a flashing operation on ECU2, and ECU2 is determined as the first target ECU. If the current global authentication token has a level A permission, it means that the current global authentication token does not have the permission to perform a flashing operation on ECU2.

[0083] In this embodiment of the application, when determining whether the current global authentication token has the authority to perform the relevant operation, step 303 also needs to determine whether the validity period of the current global authentication token is within the validity period. If the validity period of the global authentication token is within the validity period, then the first target ECU matching the global authentication token is determined among multiple target ECUs. The validity period of the current global authentication token can be 20 minutes or 30 minutes, and there is no specific limitation here.

[0084] 304. Based on the diagnostic instructions corresponding to each first target ECU, determine the diagnostic operation type corresponding to each first target ECU; based on the diagnostic operation type corresponding to each first target ECU, determine the authentication request corresponding to each diagnostic operation type as the authentication request corresponding to each first target ECU; send the authentication request corresponding to each first target ECU to each first target ECU so that each first target ECU can verify the authentication request it receives and obtain the authentication result.

[0085] After determining the first target ECU in step 303, the diagnostic operation type for each first target ECU is determined based on the diagnostic instructions corresponding to each first target ECU. This has already been described in detail in step 3032 and will not be repeated here. The gateway pre-stores the authentication request instructions corresponding to each diagnostic operation performed by each first target ECU. Based on the diagnostic operation type corresponding to each first target ECU, the authentication request instructions corresponding to that diagnostic operation type for each first target ECU can be determined.

[0086] The system sends the corresponding authentication request command to each first target ECU. Each first target ECU receives the authentication request command and verifies it. If the verification is successful, the corresponding permission level is enabled, and the authentication result is obtained.

[0087] 305. In the first target ECU, if the second target ECU is determined to have passed the certification, the diagnostic command issued by the diagnostic device corresponding to the second target ECU is forwarded to the second target ECU so that the second target ECU can execute the diagnostic operation corresponding to the diagnostic command.

[0088] After the second target ECU is identified in the first target ECU, the gateway forwards the instructions issued by the diagnostic device to the corresponding second target ECU, so that the second target ECU can execute the diagnostic operation corresponding to the diagnostic instructions.

[0089] It is important to note that if, during the execution of the corresponding diagnostic operation by the second target ECU, an abnormal disconnection occurs, the current global authentication token expires, or other unforeseen circumstances arise, the gateway will automatically revoke the execution privileges of the diagnostic device, the second target ECU will lock its execution privileges, revert to the original traditional ECU diagnostic mode, and exit the ECU diagnostic mode. Further details will not be elaborated upon here.

[0090] The above describes a detailed ECU diagnostic method provided by this application embodiment. In response to diagnostic commands issued by the diagnostic device for multiple target ECUs, the gateway obtains a pre-generated global authentication token for the diagnostic device. By using a preset whitelist, the gateway identifies the first target ECU matching the current global authentication token among the multiple target ECUs based on the diagnostic commands issued by the diagnostic device, improving the accuracy of the ECU executing its corresponding commands. Then, it sends its corresponding authentication request to the first target ECU to further verify the permission level of the current global authentication token, improving the fault tolerance of this embodiment. Finally, it issues diagnostic commands from the diagnostic device. This embodiment, based on a centralized authentication method between the gateway and the diagnostic device, significantly improves the efficiency of ECU diagnostics.

[0091] In another possible implementation, the diagnostic methods for the ECU will be further described, such as... Figure 4As shown, this embodiment also includes a more convenient ECU diagnostic method. The specific steps are as follows:

[0092] 401. In response to diagnostic commands issued by the diagnostic device for multiple target ECUs, obtain a cache table; wherein the cache table includes: at least one second target ECU, a diagnostic operation type corresponding to each second target ECU, and a global authentication token corresponding to each second target ECU under each diagnostic operation type.

[0093] In this embodiment, it is important to understand that before the previous diagnostic operation ends, the gateway stores the multiple second target ECUs that executed the previous diagnostic command, the diagnostic operation types corresponding to these multiple second target ECUs, and the global authentication token permission levels corresponding to these multiple second target ECUs under their respective diagnostic operation types in a cache. It is also important to understand that while the current global authentication token is valid, the contents of the cache table are appended; that is, the information in the cache table may include information related to the second target ECU corresponding to the previous diagnostic command, or it may include information related to the second target ECU corresponding to the diagnostic command two years prior, without any specific limitation here.

[0094] 402. If, based on the cache table, it is determined that among multiple target ECUs, there is a second target ECU that meets the conditions, the diagnostic command issued by the diagnostic device corresponding to the second target ECU is forwarded to the second target ECU.

[0095] After obtaining the relevant information from the cache table, based on the diagnostic commands issued by the current diagnostic device for multiple target ECUs, the target ECU corresponding to this diagnostic operation and the diagnostic operation type corresponding to each target ECU are determined. The specific determination process is not detailed here. After the target ECU corresponding to this diagnostic operation and the diagnostic operation type corresponding to each target ECU are determined, each target ECU corresponding to this diagnostic operation is compared one by one with the relevant information of the second target ECU in the cache table. The comparisons are as follows: whether each target ECU corresponding to this diagnostic operation is the same as the second target ECU in the cache table; whether the diagnostic operation type corresponding to each target ECU is the same as the diagnostic operation type of the same second target ECU in the cache table; and whether the level and permission of the current global authentication token generated by the diagnostic device matches the global authentication token of the same second target ECU in the cache table under the same diagnostic operation type. Only when all three conditions are met is this target ECU identified as the second target ECU, and the gateway forwards the diagnostic command from the diagnostic device to the second target ECU.

[0096] 403. If the cache table determines that the multiple target ECUs do not include a second target ECU that meets the conditions, return to the step of determining the first target ECU that matches the current global authentication token among the multiple target ECUs based on the diagnostic instructions corresponding to each target ECU.

[0097] If none of the multiple target ECUs corresponding to the diagnostic command issued by the diagnostic device in this instance simultaneously meet the above three conditions, then return to step 202 to determine the first target ECU that matches the current global authentication token among the multiple target ECUs based on the diagnostic command corresponding to each target ECU.

[0098] In this embodiment, before performing the authorization authentication in step 202, the ECU information corresponding to the diagnostic command is compared with the second target ECU in the cache table. If a second target ECU matching the target ECU exists in the cache table, the diagnostic command issued by the diagnostic device is sent to that target ECU for execution. This cache table comparison method further improves the efficiency of ECU diagnosis.

[0099] The following will describe the device used to perform the diagnostic method for the ECU described above.

[0100] This application provides an ECU diagnostic device, such as... Figure 5 As shown, it includes:

[0101] The acquisition unit 501 is used to acquire the current global authentication token pre-generated for the diagnostic device in response to the diagnostic command issued by the diagnostic device for multiple target ECUs.

[0102] The determining unit 502 is configured to determine, based on the diagnostic instruction corresponding to each target ECU, a first target ECU that matches the current global authentication token among the plurality of target ECUs;

[0103] The sending unit 503 is used to send an authentication request to the first target ECU, so that each of the first target ECUs verifies the authentication request it receives and obtains an authentication result.

[0104] The execution unit 504 is used to determine, in the first target ECU, a second target ECU whose authentication result is passed, and forward the diagnostic command issued by the diagnostic device corresponding to the second target ECU to the second target ECU, so that the second target ECU executes the diagnostic operation corresponding to the diagnostic command.

[0105] This application also provides a computer-readable storage medium carrying one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the ECU diagnostic methods provided in this application.

[0106] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the ECU diagnostic methods provided in this application.

[0107] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0108] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0110] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

Claims

1. A diagnostic method for an ECU, characterized in that, Applied to a central gateway, the diagnostic method includes: In response to diagnostic commands issued by the diagnostic device for multiple target ECUs, obtain the current global authentication token pre-generated for the diagnostic device; Based on the diagnostic instructions corresponding to each target ECU, a first target ECU that matches the current global authentication token is determined from the plurality of target ECUs; An authentication request is sent to the first target ECU so that each of the first target ECUs verifies the authentication request it receives and obtains an authentication result. In the first target ECU, if the second target ECU is determined to have passed the authentication, the diagnostic command issued by the diagnostic device corresponding to the second target ECU is forwarded to the second target ECU so that the second target ECU executes the diagnostic operation corresponding to the diagnostic command.

2. The ECU diagnostic method according to claim 1, characterized in that, The step of determining the first target ECU that matches the current global authentication token among the plurality of target ECUs based on the diagnostic instructions corresponding to each target ECU includes: Obtain a diagnostic permission whitelist, which includes: at least one ECU, at least one diagnostic operation type corresponding to each ECU, and a global authentication token corresponding to each ECU under each diagnostic operation; Based on the diagnostic instructions corresponding to each target ECU, determine the diagnostic operation type corresponding to each target ECU; In the diagnostic permission whitelist, find the global authentication token corresponding to each target ECU under its respective diagnostic operation type; The target ECU whose current global authentication token matches the searched global authentication token among the plurality of target ECUs is selected as the first target ECU.

3. The ECU diagnostic method according to claim 2, characterized in that, The step of determining the diagnostic operation type corresponding to each target ECU based on the diagnostic command corresponding to each target ECU includes: The diagnostic operation type for each target ECU is determined based on the service identifier in the diagnostic instruction corresponding to each target ECU.

4. The ECU diagnostic method according to claim 1, characterized in that, Sending the authentication request to the first target ECU includes: Based on the diagnostic instructions corresponding to each first target ECU, determine the diagnostic operation type corresponding to each first target ECU; Based on the diagnostic operation type corresponding to each first target ECU, an authentication request corresponding to each diagnostic operation type is determined as the authentication request corresponding to each first target ECU. Send each of the first target ECUs its own authentication request.

5. The ECU diagnostic method according to claim 1, characterized in that, Before obtaining the current global authentication token pre-generated for the diagnostic device in response to diagnostic commands issued by the diagnostic device for multiple target ECUs, the method further includes: In response to a security authentication request sent by the diagnostic device, a random seed is generated and sent back to the diagnostic device so that the diagnostic device can calculate a security key based on the random seed; If the security key returned by the diagnostic device is valid, the current global authentication token corresponding to the diagnostic device is generated.

6. The ECU diagnostic method according to claim 1, characterized in that, The step of determining the first target ECU that matches the current global authentication token among the plurality of target ECUs includes: Verify whether the global authentication token is within its validity period; If the global authentication token is valid, then a first target ECU matching the global authentication token is determined from among the plurality of target ECUs.

7. The ECU diagnostic method according to claim 1, characterized in that, Before determining the first target ECU matching the current global authentication token among the plurality of target ECUs based on the diagnostic instructions corresponding to each target ECU, the method further includes: In response to diagnostic commands issued by the diagnostic device for multiple target ECUs, a cache table is obtained; wherein the cache table includes: at least one second target ECU, a diagnostic operation type corresponding to each second target ECU, and a global authentication token corresponding to each second target ECU under each diagnostic operation type; If, based on the cache table, it is determined that among the plurality of target ECUs, there is a second target ECU that meets the conditions, the diagnostic command issued by the diagnostic device corresponding to the second target ECU is forwarded to the second target ECU; wherein the second target ECU that meets the conditions is that the ECU is the same as the second target ECU in the cache table, and the diagnostic operation type of the diagnostic command is the same as the diagnostic operation type of the same second target ECU in the cache table, and the current global authentication token matches the global authentication token of the same second target ECU in the cache table under the same diagnostic operation type; If it is determined based on the cache table that a second target ECU that meets the conditions is not included among the plurality of target ECUs, the process returns to the step of determining a first target ECU that matches the current global authentication token among the plurality of target ECUs based on the diagnostic instructions corresponding to each target ECU.

8. A diagnostic device for an ECU, characterized in that, include: The acquisition unit is used to acquire a current global authentication token pre-generated for the diagnostic device in response to a diagnostic command issued by the diagnostic device for multiple target ECUs. A determining unit is configured to determine, based on the diagnostic instruction corresponding to each target ECU, a first target ECU that matches the current global authentication token among the plurality of target ECUs; The sending unit is used to send an authentication request to the first target ECU, so that each of the first target ECUs verifies the authentication request it receives and obtains an authentication result; An execution unit is configured to determine, in the first target ECU, a second target ECU whose authentication result is passed, and forward the diagnostic command issued by the diagnostic device corresponding to the second target ECU to the second target ECU, so that the second target ECU executes the diagnostic operation corresponding to the diagnostic command.

9. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the diagnostic method for the ECU as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the diagnostic method for an ECU as described in any one of claims 1 to 7.