Vehicle electronic control unit software flashing method based on unified diagnostic service protocol
By deploying software drivers in the vehicle electronic control unit and integrating the flash-write calibration function, the software flash-write process is simplified by using the unified diagnostic service agreement, and compatibility and security are improved, and problems of cumbersome and inefficient in the existing technology are solved.
Patent Information
- Application Number
- CN202510464416.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art has cumbersome processes, low compatibility and efficiency, and insufficient safety in the process of writing software of vehicle electronic control unit.
Adopting a unified diagnostic service agreement, software drivers are deployed in the electronic control unit in advance, and the application is directly flashed after information security is unlocked, and the flashed calibration function is integrated in the application to simplify the process and improve security.
The brushing process has been greatly simplified, the compatibility and success rate of brushing has been improved, and the efficiency and security of software updates have been significantly improved.
Smart Images

Figure CN120335825A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle control, and particularly to a method for software flashing of a vehicle electronic control unit based on the unified diagnostic service protocol. Background Art
[0002] In recent years, with the accelerating speed of vehicle product replacement, the functions of vehicles have gradually become more complex and intelligent. As the core control component for realizing various functions - the Electronic Control Unit (ECU) has played a crucial role. At present, the application of in-vehicle ECU controllers is becoming more and more extensive, and the quantity is also increasing continuously, which poses new challenges to the rapid update of vehicle ECUs. Therefore, developing and researching a precise and efficient ECU controller software flashing system is undoubtedly a key point in the field of vehicle electronics. Summary of the Invention
[0003] In view of the above, the present invention aims to provide a method for software flashing of a vehicle electronic control unit based on the unified diagnostic service protocol to solve the aforementioned technical problems.
[0004] The technical solution adopted by the present invention is as follows:
[0005] The present invention provides a method for software flashing of a vehicle electronic control unit based on the unified diagnostic service protocol, which includes:
[0006] Pre-deploy a software driver program in the electronic control unit;
[0007] After starting the flashing, enter the pre-flashing preparation stage, and the pre-flashing preparation stage includes unlocking the electronic control unit based on information security;
[0008] After the preparation is completed, directly flash the application program installed in the electronic control unit, and the application program is pre-configured with a flashing calibration function;
[0009] After confirming that the application program flashing is completed, enter the feedback stage of the electronic control unit.
[0010] In at least one possible implementation manner, the pre-flashing preparation stage specifically includes:
[0011] Trigger to enter the extended diagnostic session mode;
[0012] Turn off the fault diagnostic code function;
[0013] Turn off the communication;
[0014] Trigger to enter the programming session mode;
[0015] Call a preset security mechanism to unlock the in-vehicle electronic control unit;
[0016] The preparation stage ends.
[0017] In at least one possible implementation, the security mechanism specifically includes:
[0018] Execute the security access service: Request Seed;
[0019] Read the encryption algorithm and combine it with the ECU serial number;
[0020] Execute the security access service: Send the key.
[0021] In at least one possible implementation, between the closing of the communication and the triggering of entering the programming session mode, a secondary triggering of entering the programming session mode is further included.
[0022] In at least one possible implementation, the calibration function for flashing is automatically triggered at a predetermined time, or manually triggered according to an instruction input by the user.
[0023] In at least one possible implementation, the process of flashing the application program specifically includes:
[0024] Erase the memory area through a preset routine;
[0025] Request to download the data to be flashed;
[0026] Transmit the data to be flashed and after the transmission is completed, request to exit the data transmission;
[0027] Conduct an integrity check on the flashed application program through a preset routine.
[0028] Compared with the prior art, the main design concept of the present invention is to pre-deploy a software driver program in the electronic control unit; after starting the flashing process, first enter the pre-flashing preparation stage, which includes unlocking the electronic control unit based on information security; after the above preparations are completed, directly flash the application program installed in the electronic control unit, and the application program is pre-configured with a calibration function for flashing; after confirming that the application program has been flashed, enter the feedback stage of the electronic control unit. The present invention greatly simplifies the flashing process, has high compatibility, and significantly improves the flashing efficiency and success rate, while also being able to improve the security during software updates. Description of the Drawings
[0029] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described below in conjunction with the drawings, where:
[0030] Figure 1Schematic diagram of the method for flashing the software of a vehicle electronic control unit based on the unified diagnostic service protocol provided by the embodiments of the present invention. Detailed implementation manners
[0031] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as a limitation of the present invention.
[0032] The present invention proposes an embodiment of a method for flashing the software of a vehicle electronic control unit based on the unified diagnostic service (UDS) protocol. Specifically, as Figure 1 shown, which includes:
[0033] Step S1: Deploy a software driver in the electronic control unit (ECU) in advance;
[0034] This step can streamline the process of flashing the driver in the subsequent flashing link.
[0035] Step S2: After starting the flashing, enter the pre-flashing preparation stage, and the pre-flashing preparation stage includes unlocking the electronic control unit based on information security;
[0036] Specifically, the pre-flashing preparation stage proposed by the present invention includes the following execution sub-steps:
[0037] Step S21: Trigger to enter the extended diagnostic session mode;
[0038] Step S22: Turn off the fault diagnostic code function;
[0039] Step S23: Turn off the communication;
[0040] Step S24: Trigger to enter the programming session mode;
[0041] Step S25: Invoke a preset security mechanism to unlock the vehicle-mounted electronic control unit;
[0042] Step S26: The preparation stage ends.
[0043] It can be seen that in the above pre-flashing preparation link, the present invention cancels cumbersome steps such as biometric writing, which can make the flashing process designed by the present invention more concise.
[0044] It can also be supplemented here that the security mechanism specifically may include:
[0045] Step S251: Execute the security access service: Request Seed;
[0046] Step S252: Read the encryption algorithm and combine it with the ECU serial number;
[0047] For example but not limited to, read the KEY Seed2Key (ROUND, SEED, F18CNumber, SAL) security algorithm, which can combine the ECU serial number, such as F18CNumber, to effectively improve the information security level during the flashing process.
[0048] Step S253: Execute the security access service: send the key.
[0049] In addition, it can be further supplemented that between the above-mentioned communication closing link and the triggering to enter the programming session mode, there is also a secondary triggering to enter the extended diagnostic session mode. This is to ensure that the extended diagnostic session mode remains after the above-mentioned DTC and communication are closed, and to avoid abnormalities in subsequent links caused by the foregoing operation links.
[0050] Continuing from the previous text, step S3: After preparation is completed, directly flash the application program (APP) installed in the electronic control unit (ECU), and the application program is pre-configured with a flashing calibration function;
[0051] In detail, the process of flashing the application program proposed by the present invention can specifically include:
[0052] Step S31: Erase the memory area through a preset routine;
[0053] Step S32: Request to download the data to be flashed;
[0054] Step S33: Transmit the data to be flashed and after the transmission is completed, request to exit the data transmission;
[0055] Step S34: Perform an integrity check on the flashed application program through a preset routine.
[0056] It can be pointed out that the flashing calibration function can be triggered and set as needed. For example, it can automatically trigger the flashing calibration at a predetermined time or execute the manual flashing calibration according to the instructions input by the user.
[0057] It can be seen that in the design concept of the present invention, the additional configured flashing calibration process is also cancelled, and the flashing calibration function is integrated into the APP, further realizing the simplification of the software flashing link.
[0058] Finally, execute step S4: After confirming that the application program flashing is completed, enter the feedback stage of the electronic control unit.
[0059] In the feedback stage, it mainly involves the reset of the electronic control unit, then enters the extended diagnostic session mode, and turns on the DTC and communication functions one by one, and the entire ECU software flashing process ends.
[0060] Based on the above embodiments, the present invention only needs to involve the following UDS diagnostic services in actual operation: Diagnostic Session Control (0x10), Control DTC Setting (0x85), Communication Control (0x28), Security Access (0x27), Read Data with Encryption Algorithm (0x22), Routine Control (0x31), Request Download (0x34), Data Transmission (0x36), Request to Exit Data Transmission (0x37), and Electronic Control Unit Reset (0x11), etc.
[0061] In summary, the main design concept of the present invention is to pre-deploy a software driver program in the electronic control unit; after starting the flashing process, first enter the pre-flashing preparation stage, which includes unlocking the electronic control unit based on information security; after the above preparations are completed, directly flash the application program installed in the electronic control unit, and the application program is pre-configured with a flashing calibration function; after confirming that the application program flashing is completed, enter the feedback stage of the electronic control unit. The present invention greatly simplifies the flashing process, has high compatibility, significantly improves the flashing efficiency and the flashing success rate, and can also improve the security during software update.
[0062] In the embodiments of the present invention, if terms expressing directions are mentioned, they are relative concepts based on the embodiments. In addition, "at least one" means one or more, and "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent the situation of A existing alone, A and B existing simultaneously, and B existing alone. Where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and back associated objects. "At least one of the following" and its similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0063] The structure, features, and effects of the present invention have been described in detail based on the embodiments shown in the drawings above. However, the above are only the preferred embodiments of the present invention. It should be noted that for the technical features involved in the above embodiments and their preferred methods, those skilled in the art can reasonably combine and match them into a variety of equivalent solutions without departing from and without changing the design concept and technical effects of the present invention; Therefore, the present invention is not limited by the scope shown in the drawings. Any changes made according to the concept of the present invention or modified into equivalent embodiments with equivalent changes still fall within the spirit covered by the specification and the drawings, and should be within the protection scope of the present invention.
Claims
1. A method for software flashing of a vehicle electronic control unit based on a unified diagnostic service protocol, characterized in that Including: Pre-deploy software drivers in the electronic control unit; After starting the flashing, enter the pre-flashing preparation stage, which includes unlocking the electronic control unit based on information security; After the preparation is completed, directly flash the application installed in the electronic control unit, and the application is pre-configured with a flashing calibration function; After confirming that the application flashing is completed, enter the feedback stage of the electronic control unit.
2. The method for software flashing of a vehicle electronic control unit based on a unified diagnostic service protocol according to claim 1, wherein The pre-flashing preparation stage specifically includes: Trigger to enter the extended diagnostic session mode; Turn off the fault diagnostic code function; Turn off the communication; Trigger to enter the programming session mode; Call the preset security mechanism to unlock the vehicle electronic control unit; The preparation stage ends.
3. The method for flashing the software of a vehicle electronic control unit based on a unified diagnostic service protocol according to claim 2, characterized in that, The security mechanism specifically includes: Execute the security access service: request Seed; Read the encryption algorithm and combine it with the ECU serial number; Execute the security access service: send the key.
4. The method for software flashing of a vehicle electronic control unit based on a unified diagnostic service protocol according to claim 2, wherein Between the turn-off of the communication and the trigger to enter the programming session mode, there is also a secondary trigger to enter the programming session mode.
5. The method for flashing the software of a vehicle electronic control unit based on a unified diagnostic service protocol according to claim 1, wherein The flashing calibration function automatically triggers the flashing calibration at a predetermined timing or performs a manual flashing calibration according to the instruction input by the user.
6. The method for software flashing of a vehicle electronic control unit based on a unified diagnostic service protocol according to any one of claims 1 to 5, characterized in that, The process of flashing the application specifically includes: Erase the memory area through a preset routine; Request to download the data to be flashed; Transmit the data to be flashed and after the transmission is completed, request to exit the data transmission; Perform an integrity check of the application flashing through a preset routine.