Program flashing method and related device

By setting the diagnostic session mode of the vehicle controller to the programming session mode, performing security authentication and application inspection, the problem of abnormal application of new energy light truck ECU is solved, and effective flashing and security improvement of the application is achieved.

CN119512576APending Publication Date: 2025-02-25BEIJING XINSHIYA TECH CO LTD +3
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411620355.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The ECU application abnormality of the new energy light truck makes the vehicle unavailable. How to effectively write the repaired application to the ECU.

Method used

When the application is invalid, set the diagnostic session mode of the vehicle controller to programmatic session mode. After performing security authentication, delete the invalid application, download and check the integrity and dependency of the application to be flashed, and finally reset the vehicle controller to flash the application.

Benefits of technology

The purpose of repairing ECU applications is achieved, ensuring that the application of the vehicle controller can be written normally, and improving the security of the vehicle writing program.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512576A_ABST
    Figure CN119512576A_ABST
Patent Text Reader

Abstract

The invention discloses a program flashing method and a related device, and relates to the field of program flashing, and the program flashing method comprises the following steps: under the condition that an application program is invalid, setting a diagnosis session mode of a vehicle controller as a programming session mode; after the security authentication is passed, deleting the invalid application program, downloading the application program to be swiped in, and checking whether the application program to be swiped in is complete or not; if the application program to be brushed in is complete, program dependency checking is conducted on the application program to be brushed in; and under the condition that the program dependency check is passed, performing reset operation on the vehicle controller, so that the to-be-swiped application program is swiped into the vehicle controller. The purpose of repairing the application program can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of program flashing technology, and in particular to a program flashing method and related devices. Background Art

[0002] In some scenarios, a new energy light truck may experience a fault that causes the ECU (Electronic Control Unit) application to become abnormal, which in turn renders the vehicle unusable. Therefore, how to flash the repaired application into the ECU is an urgent problem to be solved. Summary of the invention

[0003] In view of the above problems, the present application provides a program flashing method and related devices to achieve the purpose of repairing the application program. The specific scheme is as follows:

[0004] The first aspect of the present application provides a program flashing method, comprising:

[0005] In the case where the application is invalid, the diagnostic session mode of the vehicle controller is set to the programming session mode;

[0006] After the security authentication is passed, the invalid application is deleted, the application to be flashed is downloaded, and the application to be flashed is checked to see if it is complete;

[0007] If the application to be flashed is complete, performing a program dependency check on the application to be flashed;

[0008] When the program dependency check passes, the vehicle controller is reset so that the application program to be flashed is flashed into the vehicle controller.

[0009] In a possible implementation, when the application is invalid, setting the diagnostic session mode of the vehicle controller to the programming session mode includes:

[0010] In the case where the application is invalid, switching the diagnostic session mode from a default session mode to an extended session mode, and performing security authentication;

[0011] After the safety authentication is passed, the diagnostic trouble codes and non-diagnostic communications are disabled, and then the extended session mode is switched to the programming session mode.

[0012] In a possible implementation, after resetting the vehicle controller, the method further includes:

[0013] Switching the diagnostic session mode from the programming session mode to the default session mode, and then switching the default session mode to the extended session mode;

[0014] In the extended session mode, the non-diagnostic communication and the diagnostic trouble code are enabled, and then the extended session mode is switched to the default session mode.

[0015] In a possible implementation, the method further includes:

[0016] In case of an application upgrade, setting the diagnostic session mode of the vehicle controller to the programming session mode;

[0017] Downloading the application to be updated, and replacing the backup application stored in the backup area of ​​the vehicle controller with the application to be updated;

[0018] Performing a legality check on the application to be updated;

[0019] If the check fails, the application to be updated is deleted from the backup area, and the backup application is stored in the backup area;

[0020] If the check passes, the application to be updated is backed up in the running area of ​​the vehicle controller.

[0021] In a possible implementation, after the diagnostic session mode of the vehicle controller is set to the programming session mode, the method further includes:

[0022] requesting a seed from the vehicle controller;

[0023] Receive a seed sent by the vehicle controller, generate a secret key based on the seed, and send the secret key to the vehicle controller for security authentication.

[0024] In a possible implementation, switching the diagnostic session mode from a default session mode to an extended session mode includes:

[0025] In the default session mode, the hardware version number and the software version number of the vehicle controller are obtained, and then the default session mode is switched to the extended session mode.

[0026] A second aspect of the present application provides a program flashing system, comprising:

[0027] A mode conversion module, used for setting the diagnostic session mode of the vehicle controller to the programming session mode when the application is invalid;

[0028] The download module is used to delete the invalid application after the security authentication is passed, download the application to be flashed, and check whether the application to be flashed is complete;

[0029] A checking module, used for performing a program dependency check on the application to be flashed when the application to be flashed is complete;

[0030] The flashing module is used to reset the vehicle controller if the program dependency check passes, so that the application program to be flashed is flashed into the vehicle controller.

[0031] A third aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the program flashing method of the first aspect or any implementation of the first aspect.

[0032] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0033] The memory is used to store computer programs;

[0034] The processor is used to execute the computer program so that the electronic device can implement the program flashing method of the above-mentioned first aspect or any implementation manner of the first aspect.

[0035] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can be enabled to flash the program of the first aspect or any implementation method of the first aspect.

[0036] By means of the above-mentioned technical scheme, the program flashing method and related devices provided by the present application, when the application is invalid, set the diagnostic session mode of the vehicle controller to the programming session mode, download the application to be flashed in this mode, check the program integrity and dependencies, and reset the vehicle controller if the check passes, so that the application to be flashed can be flashed into the vehicle controller, thereby achieving the purpose of repairing the application; in addition, after the diagnostic session mode of the vehicle controller is set to the programming session mode, security authentication is performed, which can improve the security of the vehicle when flashing the program. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent 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.

[0038] Figure 1 A flowchart of a program flashing method provided by this application;

[0039] Figure 2 A schematic diagram of switching diagnostic session modes provided by this application;

[0040] Figure 3 A flashing schematic diagram provided for this application;

[0041] Figure 4 Another flashing schematic diagram provided for this application;

[0042] Figure 5 A structural diagram of a program flashing system provided for this application;

[0043] Figure 6 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0044] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0045] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0046] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0047] The embodiment of the present application provides a program flashing method. The program flashing method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0048] Reference Figure 1 , Figure 1 A schematic diagram of a program flashing method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, a program flashing method provided in an embodiment of the present application is applied to a diagnostic instrument. The method may include steps 101 to 104, and these steps are described in detail below.

[0049] Step 101: When the application is invalid, the diagnostic session mode of the vehicle controller is set to the programming session mode.

[0050] The vehicle controller can be an ECU. When the vehicle is offline, the Bootloader is solidified in the ECU's specified memory area, so that the ECU can support reprogramming of applications and application data (including network configuration data and calibration data). During normal operation, applications and application data are executed. In a certain scenario, the new energy light truck has an abnormal application program of the ECU due to a certain fault. When the application program or application data is invalid, the Bootloader will be activated, and one or more application software or application data needs to be downloaded to the ECU memory for reprogramming.

[0051] In a possible implementation, when the application is invalid, the diagnostic session mode of the vehicle controller is set to the programming session mode, including:

[0052] In the case where the application is invalid, the diagnostic session mode is switched from the default session mode to the extended session mode, and security authentication is performed;

[0053] After the safety certification is passed, the diagnostic trouble codes and non-diagnostic communications are disabled, and then the extended session mode is switched to the programming session mode.

[0054] In Bootloader mode, the vehicle controller's diagnostic session mode includes three session modes: default session mode, extended session mode, and programming session mode. After power-on, enter the default session mode first. If you enter the programming session mode, you need to switch from the default session mode to the extended session mode first, and then switch from the extended session mode to the programming session mode.

[0055] Figure 2 A schematic diagram of switching the diagnostic session mode provided in an embodiment of the present application is provided. Figure 2The bootloader mode and application mode are shown. The bootloader mode is the Bootloader mode, which uses three different diagnostic session modes, namely the default session mode, the extended session mode and the programming session mode, while the application mode uses two diagnostic session modes, namely the default session mode and the extended session mode. When the application is valid, it is in the application mode, and the default session mode is performed first. After receiving the 1003 message information, it switches to the extended session mode. After receiving 1001 in the extended session mode, it switches to the default session mode. After receiving 1002, the ECU resets. When the application is invalid, it is in the bootloader mode, and the default session mode is performed first. After receiving the 1003 message information, it switches to the extended session mode. After receiving 1002 in the extended session mode, it enters the programming session mode. If 1001 is received in the extended session mode, it switches to the default session mode. In the bootloader mode, if there is an external programming request, the diagnostic session mode of the vehicle controller is the default session mode. If there is no external programming request, it determines whether the application is valid. In the default session mode, the ECU is reset after receiving the 1101 reset message; in the extended session mode, the ECU is reset after receiving the 1101 reset message or the S3 timer timeout message; in the programming session mode, the ECU is reset after receiving the 1101 reset message or the 1001 message or the S3 timer timeout message. The ECU enters the default session mode after power-on.

[0056] In a possible implementation, switching the diagnostic session mode from the default session mode to the extended session mode includes:

[0057] In the default session mode, obtain the hardware version number and software version number of the vehicle controller, and then switch the default session mode to the extended session mode.

[0058] When the diagnostic instrument obtains the hardware version number of the ECU, the diagnostic service identifier SID is 22, the diagnostic address DID is 0xF193, and the ECU responds positively or negatively to the information obtained, and the message of the positive response is 62h. Then the diagnostic instrument obtains the software version number of the ECU, the diagnostic service identifier SID is 0x22, and the diagnostic address DID is 0xF195. The ECU responds positively or negatively to the information obtained, and the message of the positive response is 62h, and then switches the default session mode to the extended session mode.

[0059] Optionally, switch the diagnostic session mode from the default session mode to the extended session mode and perform security authentication, including:

[0060] After switching to the extended session mode, the ECU responds positively and sends the timing parameters P2CAN and P2*CAN. The message of the positive response is 50h, and then security authentication is performed.

[0061] During security authentication, the diagnostic instrument requests a seed from the ECU, with the SID of 0x27h01h. The ECU responds positively, and the message of the positive response is 67h. The diagnostic instrument receives the seed sent by the ECU, generates a secret key based on the seed, and sends the secret key to the ECU, with the SID of 0x27h02h. The ECU responds positively, and the message of the positive response is 67h. The security authentication is passed.

[0062] After the security authentication is passed, the diagnostic instrument checks the pre-programming conditions, SID is 31h, DID is 0xF002, ECU responds positively, and the message of the positive response is 71h. Then the diagnostic instrument disables the diagnostic trouble code (DTC), SID is 0x85,02h, ECU responds positively, and the message of the positive response is C5h. The diagnostic instrument then disables non-diagnostic communication, SID is 0x85,03h, ECU responds positively, and the message of the positive response is 68h. This message request uses physical addressing or functional addressing, and CAN (FD) network preparation is performed before programming, and preparations are also made to improve download capabilities.

[0063] After disabling the diagnostic trouble codes and non-diagnostic communications, switch the extended session mode to the programming session mode, the SID is 10, the ECU responds positively, the message of the positive response is 50h, and the timing parameters P2CAN and P2*CAN are sent.

[0064] In a possible implementation, after the diagnostic session mode of the vehicle controller is set to the programming session mode, the method further includes:

[0065] Request a seed from the vehicle controller;

[0066] Receive the seed sent by the vehicle controller, generate a secret key based on the seed, and send the secret key to the vehicle controller for security authentication.

[0067] The diagnostic instrument requests a seed from the ECU, with the SID of 0x27,03h. The ECU responds positively, and the message of the positive response is 67h. The diagnostic instrument receives the seed sent by the ECU, generates a secret key based on the seed, and sends the secret key to the ECU, with the SID of 0x27,04h. The ECU responds positively, and the message of the positive response is 67h. The diagnostic instrument writes fingerprint information, with the SID of 0x2E and the DID of 0xF184. The ECU responds positively, and the message of the positive response is 6Eh. The security authentication is passed.

[0068] Step 102: After the security authentication is passed, delete the invalid application, download the application to be flashed, and check whether the application to be flashed is complete.

[0069] Before deleting the invalid application, the diagnostic instrument downloads the driver and checks the integrity of the driver. The SID is 31h, the DID is 0xF1A0, and the ECU responds positively. The message of the positive response is 71h. Then delete the invalid application. The SID is 31h, the DID is 0xFF00, and the ECU responds positively or negatively. The message of the positive response is 71h, the message of the negative response is 7FH, and the response key is 78h. The diagnostic instrument downloads the application to be flashed and checks whether the application to be flashed is complete. The SID is 31h, the DID is 0xF1A0, and the ECU responds positively. The message of the positive response is 71h.

[0070] Optionally, the diagnostic instrument determines whether more data needs to be downloaded. If so, the downloaded application is deleted. If not, step 103 is executed.

[0071] Step 103: If the application to be flashed is complete, a program dependency check is performed on the application to be flashed.

[0072] If the application to be flashed is complete, a program dependency check is performed on the application to be flashed. The SID is 31h, the DID is 0xFF01, and the ECU responds positively. The message of the positive response is 71h.

[0073] Step 104: When the program dependency check passes, the vehicle controller is reset to allow the application program to be flashed into the vehicle controller.

[0074] Reset the vehicle controller, SID is 11h, DID is 0x01, ECU responds positively, and the message of the positive response is 51h.

[0075] In a possible implementation, after resetting the vehicle controller, the method further includes:

[0076] Switch the diagnostic session mode from programming session mode to default session mode, and then switch the default session mode to extended session mode;

[0077] In extended session mode, enable non-diagnostic communications and diagnostic trouble codes, and then switch extended session mode to the default session mode.

[0078] After the vehicle controller is reset and the application to be flashed is written into the vehicle controller, the diagnostic session mode is first switched from the programming session mode to the default session mode, and then the default session mode is switched to the extended session mode, with the SID being 0x10. The ECU responds positively, the message of the positive response is 50h, the SID is 0x50, and the timing parameters are P2CAN and P2*CAN. The diagnostic instrument enables non-diagnostic communication, the SID is 0x28,00h, the ECU responds positively, and the message of the positive response is 68h. The diagnostic instrument enables the diagnostic fault code DTC, the SID is 0x85,01h, the ECU responds positively, and the message of the positive response is C5h. Then the extended session mode is switched to the default session mode, the SID is 0x10, the ECU responds positively, the message of the positive response is 50h, the SID is 0x50, and the timing parameters are P2CAN and P2*CAN. The diagnostic instrument clears the diagnostic information, SID is 0x14, DID is 0Xffff, ECU responds positively, and the message of positive response is 54h. Resynchronize the CAN (FD) network after programming.

[0079] In one possible implementation, the ECU downloads a data block, the diagnostic instrument requests downloading, the message is 34h, the ECU responds affirmatively, the message of the affirmative response is 74h, the diagnostic instrument transmits application data, the message is 36h, the ECU responds negatively, the message is 7Fh, the response code is 78h, the ECU responds positively, the message is 76h, the diagnostic instrument determines whether there is still application data to be transmitted, if so, it continues to transmit the application data, if not, it requests to exit, the message is 37h, the ECU responds negatively, the message is 7Fh, the response code is 78h, the ECU responds positively, the message is 77h.

[0080] In a possible implementation, the program flashing method provided by the present application further includes:

[0081] In case of application upgrade, the diagnostic session mode of the vehicle controller is set to programming session mode;

[0082] Downloading the application to be updated, and replacing the backup application stored in the backup area of ​​the vehicle controller with the application to be updated;

[0083] Perform a validity check on the application to be updated;

[0084] If the check fails, the application to be updated is deleted from the backup area, and the backup application is stored in the backup area;

[0085] If the check passes, the application to be updated is backed up in the running area of ​​the vehicle controller.

[0086] If the program is upgraded, the diagnostic session mode of the vehicle controller is set to the programming session mode. In order to prevent the software refresh from causing the ECU to fail to work, for ECUs that support AB surface flashing, it is necessary to support A and B area flashing, one area is the running area, and the other area is the backup area. Download the application to be updated, replace the backup application stored in the backup area of ​​the vehicle controller with the application to be updated, perform a legality check on the application to be updated, and check whether the application to be updated is damaged. If it fails to pass the check, the application to be updated can be deleted, and the backup application originally stored in the backup area can be rolled back to the backup area, that is, after the software update fails, it can still run normally according to the program before the update. If the check passes, the application to be updated is backed up in the running area of ​​the vehicle controller.

[0087] like Figure 3 As shown in the figure, the ECU includes an MCU (Microcontroller Unit), and the MCU's FLASH is divided into two areas, A and B. Area A is the normal operating area of ​​the application, storing the first application APP1, and area B is the backup area of ​​the application, storing the backup of APP1. When starting to download the application to be updated, first erase APP1 in the backup area, and then flash the application APP2 to be updated into the backup area B. If the refresh is successful, the backup of APP2 can be stored in area A. Figure 4 As shown, if APP2 is illegal or damaged when flashing APP2 into area B, APP2 will be erased from area B, and APP1 will be backed up and rolled back to area B. At this time, area B is the running area, ensuring that the original version of the program can continue to run after the flashing fails. Optionally, after the upgrade fails, area A or B is not fixed as the running area. If the upgrade of area A fails, the Bootloader can change the backup area of ​​area B to the running area, and then back up area B to area A. If the upgrade of area B fails next time, area A will be switched back to the running area.

[0088] The program flashing method provided in this application can improve the safety of new energy vehicles such as new energy light trucks when flashing software. The Bootloader is passed before flashing the ECU, which can more effectively protect the information of the OEM and the owner and prevent information leakage. Applying this Bootloader process to the software flashing process can improve the standardization of the OEM's software flashing, make the OEM management more convenient, and save the time and energy of the vehicle users.

[0089] A program flashing method provided by an embodiment of the present application is introduced above, and a system for executing the above program flashing method will be introduced below.

[0090] See also Figure 5 , Figure 5This is a schematic diagram of the structure of a program flashing system provided in an embodiment of the present application. Figure 5 As shown, the program flashes the system, including:

[0091] The mode conversion module 501 is used to set the diagnostic session mode of the vehicle controller to the programming session mode when the application is invalid.

[0092] The download module 502 is used to delete invalid applications, download applications to be flashed, and check whether the applications to be flashed are complete after the security authentication is passed.

[0093] The checking module 503 is used to perform a program dependency check on the application to be flashed when the application to be flashed is complete.

[0094] The flashing module 504 is used to reset the vehicle controller when the program dependency check passes, so that the application program to be flashed is flashed into the vehicle controller.

[0095] The mode conversion module 501 is specifically used for:

[0096] In the case where the application is invalid, the diagnostic session mode is switched from the default session mode to the extended session mode, and security authentication is performed;

[0097] After the safety certification is passed, the diagnostic trouble codes and non-diagnostic communications are disabled, and then the extended session mode is switched to the programming session mode.

[0098] The program flashes the system and also includes:

[0099] A switching module, used to switch the diagnostic session mode from the programming session mode to the default session mode, and then switch the default session mode to the extended session mode;

[0100] The enabling module is used to enable non-diagnostic communication and diagnostic trouble codes in the extended session mode, and then switch the extended session mode to the default session mode.

[0101] The program flashes the system and also includes:

[0102] The upgrade module is used to set the diagnostic session mode of the vehicle controller to the programming session mode when the application is upgraded; download the application to be updated, and replace the backup application stored in the backup area of ​​the vehicle controller with the application to be updated; perform a legitimacy check on the application to be updated; if the check fails, delete the application to be updated from the backup area and store the backup application in the backup area; if the check passes, back up the application to be updated in the running area of ​​the vehicle controller.

[0103] The program flashes the system and also includes:

[0104] The security authentication module is used to request a seed from the vehicle controller after the diagnostic session mode of the vehicle controller is set to the programming session mode; receive the seed sent by the vehicle controller, generate a secret key based on the seed, and send the secret key to the vehicle controller for security authentication.

[0105] The mode conversion module 501 is further used for:

[0106] In the default session mode, obtain the hardware version number and software version number of the vehicle controller, and then switch the default session mode to the extended session mode.

[0107] The present application also provides an electronic device in an embodiment. Figure 6 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0108] like Figure 6 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0109] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0110] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the program flashing methods provided in the embodiments of the present application.

[0111] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any program flashing method provided in the embodiment of the present application.

[0112] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0113] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0114] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0115] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. 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, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A program flashing method, characterized in that: include: In the case where the application is invalid, the diagnostic session mode of the vehicle controller is set to the programming session mode; After the security authentication is passed, the invalid application is deleted, the application to be flashed is downloaded, and the application to be flashed is checked to see if it is complete; If the application to be flashed is complete, performing a program dependency check on the application to be flashed; When the program dependency check passes, the vehicle controller is reset so that the application program to be flashed is flashed into the vehicle controller.

2. The program flashing method according to claim 1, characterized in that: The step of setting the diagnostic session mode of the vehicle controller to the programming session mode when the application is invalid comprises: In the case where the application is invalid, switching the diagnostic session mode from a default session mode to an extended session mode, and performing security authentication; After the safety authentication is passed, the diagnostic trouble codes and non-diagnostic communications are disabled, and then the extended session mode is switched to the programming session mode.

3. The program flashing method according to claim 2, characterized in that: After resetting the vehicle controller, the method further includes: Switching the diagnostic session mode from the programming session mode to the default session mode, and then switching the default session mode to the extended session mode; In the extended session mode, the non-diagnostic communication and the diagnostic trouble code are enabled, and then the extended session mode is switched to the default session mode.

4. The program flashing method according to any one of claims 1 to 3, characterized in that: Also includes: In case of an application upgrade, setting the diagnostic session mode of the vehicle controller to the programming session mode; Downloading the application to be updated, and replacing the backup application stored in the backup area of ​​the vehicle controller with the application to be updated; Performing a legality check on the application to be updated; If the check fails, the application to be updated is deleted from the backup area, and the backup application is stored in the backup area; If the check passes, the application to be updated is backed up in the running area of ​​the vehicle controller.

5. The program flashing method according to any one of claims 1 to 3, characterized in that: After the diagnostic session mode of the vehicle controller is set to the programming session mode, the method further includes: requesting a seed from the vehicle controller; Receive a seed sent by the vehicle controller, generate a secret key based on the seed, and send the secret key to the vehicle controller for security authentication.

6. The program flashing method according to claim 2, characterized in that: The step of switching the diagnostic session mode from a default session mode to an extended session mode includes: In the default session mode, the hardware version number and the software version number of the vehicle controller are obtained, and then the default session mode is switched to the extended session mode.

7. A program flashing system, characterized in that: include: A mode conversion module, used for setting the diagnostic session mode of the vehicle controller to the programming session mode when the application is invalid; The download module is used to delete the invalid application after the security authentication is passed, download the application to be flashed, and check whether the application to be flashed is complete; A checking module, used for performing a program dependency check on the application to be flashed when the application to be flashed is complete; The flashing module is used to reset the vehicle controller if the program dependency check passes, so that the application program to be flashed is flashed into the vehicle controller.

8. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the program flashing method as claimed in any one of claims 1 to 6.

9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the program flashing method as described in any one of claims 1 to 6.

10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the program flashing method as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Program flashing method and related apparatus

    WO2026103768A1