Program updating method, storage medium, controller, vehicle and program product
By updating the MCU running program to the backup area outside the memory in the operation state of the application, using flag bit control, the problems of low update efficiency and error erasing of MCU program are solved, and stability and security are improved.
Patent Information
- Application Number
- CN202510490105.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, MCU program update efficiency is low and it is easy to accidentally erase running programs in memory, affecting the normal operation of the application.
In the running state of the application, the programs in the running program area of the memory are updated to the program backup area outside the memory, the update process is controlled through the flag bit, and the program backup and recovery is performed without affecting the running of the application.
Improves the stability and security of the memory, reduces the risk of error erasure, and improves the efficiency of program updates.
Smart Images

Figure CN120447939A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular, to a program updating method, a storage medium, a controller, a vehicle, and a program product. Background Art
[0002] MCU (Microcontroller Unit) program updates are primarily used to improve, repair, enhance, or upgrade software or applications. In related art, updating the running program in the MCU is typically done through diagnostic protocols. However, these methods can be inefficient and can easily cause accidental erasure of the running program in memory. Summary of the Invention
[0003] The purpose of the present disclosure is to provide a program update method, a storage medium, a controller, a vehicle, and a program product to solve the technical problems existing in the related art.
[0004] To achieve the above objectives, in a first aspect, the present disclosure provides a program update method, comprising: When the application is in a running state, the running program in the running program area of the memory is updated to the backup program in the program backup area, wherein the program backup area is not in the memory.
[0005] Optionally, updating the running program in the running program area of the memory to the target backup program in the program backup area includes: According to a first flag bit, the running program in the running program area of the memory is updated to the backup program in the program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0006] Optionally, updating the running program in the running program area of the memory to the backup program in the program backup area according to the first flag bit includes: When the first flag bit is at the first state value, updating the running program in the running program area of the memory to the backup program in the first program backup area; or When the first flag bit is at the second state value, the running program in the running program area of the memory is updated to the backup program in the second program backup area.
[0007] Optionally, the method further includes: After the running program in the running program area of the memory is updated to the backup program in the program backup area or after the running program is burned into the running program area, the first flag bit is set to a third state value to indicate that the program in the running program area is running.
[0008] Optionally, the method further includes: Actively reset the controller where the memory is located, and when detecting that the first flag bit is the third state value, control the running program area of the memory through the controller to run the backup program in the program backup area or the running program.
[0009] Optionally, controlling the running program area of the memory by the controller to run the backup program in the program backup area or the running program includes: The controller controls the boot program area in the memory to guide the running program area to run the backup program in the program backup area or the running program.
[0010] Optionally, the method further includes: Burn the backup program into the program backup area, or burn the running program and the backup program into the program backup area.
[0011] Optionally, burning the backup program into the program backup area includes: In response to the programming request, the backup program is programmed into the program backup area according to a second flag bit, wherein the second flag bit is used to indicate a program programming status.
[0012] Optionally, burning the backup program into the program backup area according to the second flag bit includes: When the second flag bit is in a fourth state value, burning the backup program into the first program backup area; The method further comprises: After the backup program is burned into the first program backup area, the second flag bit is set to a fifth state value to indicate that the burning of the backup program is completed.
[0013] Optionally, the method further includes: After setting the second flag bit to the fifth state value, the first flag bit is set to the first state value to indicate that the running program in the running program area of the memory needs to be updated to the backup program in the first program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0014] Optionally, burning the backup program into the program backup area according to the second flag bit includes: When the second flag bit is in the fifth state value, burning the backup program into the second program backup area; The method further comprises: After the backup program is burned into the second program backup area, the second flag bit is set to a fourth state value to indicate that the burning of the backup program is completed.
[0015] Optionally, the method further includes: After setting the second flag bit to the fourth state value, the first flag bit is set to the second state value to indicate that the running program in the running program area of the memory needs to be updated to the backup program in the second program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0016] Optionally, burning the running program into the program backup area includes: The running program is burned into the program backup area according to a second flag bit, wherein the second flag bit is used to indicate a program burning status.
[0017] Optionally, the step of burning the running program into the program backup area according to the second flag bit includes: When the second flag bit is in the sixth state value, the running program is burned into a program backup area, wherein the program backup area is any one of a plurality of program backup areas.
[0018] Optionally, the method further includes: Burning the running program and the backup program into the program backup area; According to the rollback instruction, the backup program in the running program area is updated to the running program in the program backup area.
[0019] In a second aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods provided in the first aspect of the present disclosure.
[0020] In a third aspect, the present disclosure further provides a controller, comprising: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of any one of the methods provided in the first aspect of the present disclosure.
[0021] In a fourth aspect, the present disclosure further provides a vehicle, comprising the controller provided in the third aspect of the present disclosure.
[0022] In a fifth aspect, the present disclosure further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods provided in the first aspect of the present disclosure.
[0023] With the above technical solution, while the application is running, the running program in the running program area of the memory is updated with a backup program in the program backup area, which is not in the memory. Compared with the related art method of updating the running program in the MCU through the diagnostic protocol, the running program can be updated without going through the boot program area. In addition, by locating the program backup area outside the memory, the running program can be updated without affecting the operation of the application, while reducing the risk of accidental erasure of the running program in the memory, thereby improving the stability of the memory and the efficiency of program updates.
[0024] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following detailed description, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings: Figure 1 This is a flowchart of MCU programming through a diagnostic protocol in related technologies.
[0026] Figure 2 is a schematic diagram illustrating a program updating method according to an exemplary embodiment of the present disclosure.
[0027] Figure 3 The figure is a flowchart illustrating a program updating method according to an exemplary embodiment of the present disclosure.
[0028] Figure 4 FIG. 1 is a schematic diagram illustrating a program updating apparatus according to an exemplary embodiment of the present disclosure.
[0029] Figure 5 is a block diagram of a vehicle according to an exemplary embodiment. DETAILED DESCRIPTION
[0030] The following describes the specific embodiments of the present disclosure in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure and are not intended to limit the present disclosure.
[0031] In related technologies, such as Figure 1As shown, MCU programming is primarily performed through the diagnostic protocol. The MCU's flash memory primarily consists of the Bootloader Area (bootloader area), the Application Area (app area), and a software backup area. Each time the MCU is powered on, it checks for a refresh request. If a refresh request is received, the data in the APP area is erased and new data is stored in the APP area. After all data has been received, the software backup flag is set to 0, and execution jumps to the APP area. The APP area is used to store and execute application software. Before executing the application, if the software backup flag is 0, the APP area data is copied to the software backup area, and the software backup flag is set to 1. The software backup area is used to store backups of application software.
[0032] However, the inventors discovered that when performing a software update using the method described in the first related art, the process of receiving the program to be burned requires a jump to the Boot area in the flash memory. If the controller is in a special operating state, the jump to the Boot area cannot be made, and thus the program burning cannot be performed. Furthermore, even when burning conditions permit, the application program is no longer running during the program burning process. Once the program is burned, the product cannot be used again until the program is completed, which reduces the burning efficiency.
[0033] At the same time, the program backup area is set in the memory. The program is updated through the internal flash driver of the memory. The internal flash driver may be mistakenly called due to external attacks or internal operation errors, and there is a risk that the running application or boot will be erased.
[0034] In view of this, the present disclosure provides a program update method, a storage medium, a controller, a vehicle, and a program product to solve the technical problems existing in the above-mentioned related technologies.
[0035] like Figure 2 As shown, Figure 2 is a schematic diagram illustrating a program update method according to an exemplary embodiment of the present disclosure, with reference to Figure 2 ,include: S201: When an application is in a running state, updating a running program in a running program area of a memory to a backup program in a program backup area, wherein the program backup area is not in the memory.
[0036] Through the above technical solution, when the application is in the running state, the running program in the running program area of the memory is updated to the backup program in the program backup area that is not in the memory. Compared with the related art of updating the running program in the MCU through the diagnostic protocol, the running program can be updated without going through the boot program area. In addition, the program backup area is set outside the memory, which can achieve the update of the running program without affecting the operation of the application. At the same time, it can reduce the accidental erasure of the running program in the memory, improve the security and stability of the memory operation, and further improve the security and stability of the memory operation, and further improve the stability of the memory, and also improve the efficiency of program updates.
[0037] In order to enable those skilled in the art to better understand the program updating method provided by the present disclosure, the above steps are described in detail with examples below.
[0038] For example, the memory can be used to store data and programs. This memory can be set in the MCU, which is not specifically limited in the embodiments of the present disclosure. The application can be a software program set up in the MCU to meet specific requirements. The running program area can be used to store and run application programs. The program backup area can be used to store running programs or programs to be updated.
[0039] In the disclosed embodiment, the program backup area is not set in the memory, and the memory can be connected to the program backup area by means of inter-board communication. For example, when the memory is set in the MCU, the program backup area can be a program backup area in the memory of other controllers other than the MCU. Among them, inter-board communication can include SPI communication (Serial Peripheral Interface, full-duplex communication), UART communication (Universal Asynchronous Receiver / Transmitter, asynchronous communication) and CAN communication (Controller Area Network, multi-master communication) and other communication methods.
[0040] Thus, when an application is running, the running program in the running program area of the memory can be directly updated to the backup program in the program backup area without having to be booted from the boot program area of the memory. This allows the running program to be updated without affecting the application's operation. Furthermore, during the updating process, since the program backup area is located outside the memory, accidental erasures within the memory can be reduced, thereby improving the security and stability of the memory's operation.
[0041] In a possible manner, updating the running program in the running program area of the memory to the target backup program in the program backup area includes: According to a first flag bit, the running program in the running program area of the memory is updated to the backup program in the program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0042] It should be understood that the first flag bit can be identified by different status values, and different status values can be used to indicate the update status or running status of the program in the running program area. For example, when the status value of the first flag bit is 0, it can indicate waiting for a programming request; when the status value of the first flag bit is 1, it can indicate that the running program in the memory needs to be updated to the backup program in the program backup area. This is not specifically limited in the embodiments of the present disclosure.
[0043] Therefore, in the embodiment of the present disclosure, the running program in the memory can be updated to the backup program in the program backup area according to the first flag bit. Updating the running program by using the first flag bit can improve the accuracy of the running program update.
[0044] In a possible manner, updating the running program in the running program area of the memory to the backup program in the program backup area according to the first flag bit includes: When the first flag bit is at the first state value, updating the running program in the running program area of the memory to the backup program in the first program backup area; or When the first flag bit is at the second state value, the running program in the running program area of the memory is updated to the backup program in the second program backup area.
[0045] It should be understood that the first flag bit includes many status values, different status values can represent different meanings, and some status values can be associated with the program backup area. For example, the first status value and the second status value in the first flag bit, the first status value can be associated with the first program backup area, and the second status value can be associated with the second program backup area. Then, when the first flag bit is the first status value, it can represent the need to update the running program to the backup program in the first program backup area. When the first flag bit is the second status value, it can represent the need to update the running program to the backup program in the second program backup area. This is not specifically limited in the embodiments of the present disclosure. Among them, the first status value and the second status value can be a specific number or a letter. This is not specifically limited in the embodiments of the present disclosure. The first status value is different from the second status value.
[0046] Through the status value corresponding to the first flag bit, the running program is updated to the backup program in the program backup area associated with the status value, thereby avoiding update errors, reducing the risk of accidental erasure in the memory, and improving the accuracy and efficiency of the update.
[0047] In a possible embodiment, the method further comprises: After the running program in the running program area of the memory is updated to the backup program in the program backup area or after the running program is burned into the running program area, the first flag bit is set to a third state value to indicate that the program in the running program area is running.
[0048] It should be understood that the third state value in the first flag bit can be used to indicate that the running program in the running program area of the memory continues to run. After the running program is updated to the backup program, the first flag bit can be set to the third state value to indicate that the memory is running the updated backup program.
[0049] Before the application is run, the running program can be burned into the running program area. Afterwards, the first flag bit can be set to a third state value, which can indicate that the running program area in the memory can run the running program. This embodiment of the present disclosure does not specifically limit this. The third state value can be a specific number or a letter. This embodiment of the present disclosure does not specifically limit this.
[0050] In a possible embodiment, the method further comprises: Actively reset the controller where the memory is located, and when detecting that the first flag bit is the third state value, control the running program area of the memory through the controller to run the backup program in the program backup area or the running program.
[0051] It should be understood that after the first flag is set to the third state value, it is necessary to actively reset the controller where the memory is located, and detect the state value of the first flag through the controller. When it is detected that the first flag is the third state value, the running program area in the memory can be controlled by the controller to run the updated backup program or the burned running program. Among them, the controller can be an MCU, and the embodiments of the present disclosure do not make specific limitations on this. By actively resetting the controller to control the running program area to run the backup program or the running program, the running program area can be controlled to run the backup program or the running program without affecting the running of the application.
[0052] In a possible embodiment, the controlling, by the controller, the running program area of the memory to run the backup program in the program backup area or the running program includes: The controller controls the boot program area in the memory to guide the running program area to run the backup program in the program backup area or the running program.
[0053] It should be understood that the memory also includes a boot program area. This boot program area can be a specific area in the memory for storing a boot program. This boot program area can be used to direct the running program to be loaded into the running program area of the memory and run after the controller is actively reset. Therefore, in the embodiments of the present disclosure, after the controller is actively reset, the controller can control the boot program area in the memory to direct the running program area to run the backup program or the running program. This embodiment of the present disclosure does not specifically limit this.
[0054] In a possible embodiment, the method further comprises: Burn the backup program into the program backup area, or burn the running program and the backup program into the program backup area.
[0055] It should be understood that before the running program in the memory is updated to the backup program in the program backup area, the backup program can be burned into the program backup area, or the running program and the backup program can be burned into the program backup area together. The backup program or the running program and the backup program can be stored together in the program backup area that is not in the memory.
[0056] By burning the backup program or the backup program and the running program into the program backup area outside the memory, the running program can be updated without affecting the running of the application, or the running program can be rolled back without affecting the running of the application.
[0057] In a possible manner, burning the backup program into the program backup area includes: In response to the programming request, the backup program is programmed into the program backup area according to a second flag bit, wherein the second flag bit is used to indicate a program programming status.
[0058] It should be understood that the burn request may be an instruction to burn the backup program. When the burn request is received, the backup program may be burned into the program backup area according to the second flag. The second flag may be used to indicate the burn status of the program. The second flag may be a plurality of status values, and each status value may be a letter or a number, and the embodiments of the present disclosure do not make specific limitations on this. For example, when the status value of the second flag is the fourth status value or the fifth status value, it may represent that the program backup area corresponding to the status value may burn the corresponding program. When the status value of the second flag is the sixth status value, it may represent that the running program is burned into the backup program, and the embodiments of the present disclosure do not make specific limitations on this.
[0059] In a possible manner, the step of burning the backup program into the program backup area according to the second flag bit includes: When the second flag bit is in a fourth state value, burning the backup program into the first program backup area; The method further comprises: After the backup program is burned into the first program backup area, the second flag bit is set to a fifth state value to indicate that the burning of the backup program is completed.
[0060] It should be understood that when the second flag bit is the fourth state value, it may represent that the backup program in the second program backup area is in the running state, and the new backup program can be burned into the first program backup area. After that, the state value of the second flag bit can be set to the fifth state value to indicate that the backup program in the first program backup area can be run after the next active reset of the controller, or it may also indicate that the corresponding backup program has been burned in the first program backup area.
[0061] In a possible embodiment, the method further comprises: After setting the second flag bit to the fifth state value, the first flag bit is set to the first state value to indicate that the running program in the running program area of the memory needs to be updated to the backup program in the first program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0062] It should be understood that when the second flag is set to the fifth state value, it can indicate that the backup program in the first program backup area has been burned and can be updated. Thereafter, the first flag can be set to the first state value, thereby indicating that the running program in the memory can be updated to the backup program in the first program backup area.
[0063] In a possible manner, the step of burning the backup program into the program backup area according to the second flag bit includes: When the second flag bit is in the fifth state value, burning the backup program into the second program backup area; The method further comprises: After the backup program is burned into the second program backup area, the second flag bit is set to a fourth state value to indicate that the burning of the backup program is completed.
[0064] It should be understood that when the second flag bit is the fifth state value, it may represent that the backup program in the first program backup area is in the running state, and the new backup program can be burned into the second program backup area. After that, the state value of the second flag bit can be set to the fourth state value to indicate that the backup program in the second program backup area can be run after the next active reset of the controller, or it may also indicate that the corresponding backup program has been burned in the second program backup area.
[0065] In a possible embodiment, the method further comprises: After setting the second flag bit to the fourth state value, the first flag bit is set to the second state value to indicate that the running program in the running program area of the memory needs to be updated to the backup program in the second program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0066] It should be understood that when the second flag is set to the fourth state value, it can indicate that the backup program in the second program backup area has been burned and can be updated. Thereafter, the first flag can be set to the second state value, thereby indicating that the running program in the memory can be updated to the backup program in the second program backup area.
[0067] In a possible manner, burning the running program into the program backup area includes: The running program is burned into the program backup area according to a second flag bit, wherein the second flag bit is used to indicate a program burning status.
[0068] It should be understood that when burning the running program into the program backup area, it can be determined based on the state value of the second flag bit. For example, when the state value of the second flag bit is the sixth state value, it can represent that there is no backup program in any program backup area. Therefore, the running program can be burned into any program backup area for storage.
[0069] In a possible manner, the step of burning the running program into the program backup area according to the second flag bit includes: When the second flag bit is in the sixth state value, the running program is burned into a program backup area, wherein the program backup area is any one of a plurality of program backup areas.
[0070] It should be understood that the sixth state value can be an indicator such as a number, a letter, or a special character, and the embodiments of the present disclosure do not make specific limitations on this. When the second flag bit is the sixth state value, it can represent that no backup program is stored in all program backup areas. Thus, the running program can be burned to any program backup area for backup, and after the burning is completed, the first flag bit in the corresponding program backup area can be set to the third state value to indicate that the running program area in the memory is running the running program, and the embodiments of the present disclosure do not make specific limitations on this.
[0071] In a possible embodiment, the method further comprises: Burning the running program and the backup program into the program backup area; According to the rollback instruction, the backup program in the running program area is updated to the running program in the program backup area.
[0072] It should be understood that after the running program in the memory is updated to the backup program and the backup program is running, the backup program can be rolled back to the program backup area according to user needs, and the running program backed up in the program backup area can be executed in the memory. Specifically, when the controller receives the rollback instruction, it updates the backup program currently running in the memory to the running program backed up in the program backup area according to the rollback instruction, actively resets the controller, and then controls the running program area in the memory to run the running program backed up in the program backup area.
[0073] The above technical solution enables seamless updates of running programs in the MCU, and allows applications to continue running during the program burning process without affecting product use. Furthermore, program burning operates on flash memory outside the memory, ensuring that the flash memory inside the memory is not at risk of being erased during operation, thereby improving the stability and security of memory operation. When updating the running program in the memory, a single active reset of the MCU is sufficient to complete the upgrade to the new version of the program.
[0074] In practical applications, refer to Figure 3 , Figure 3 FIG. 1 is a flow chart showing a program updating method according to an exemplary embodiment of the present disclosure. Figure 3 The specific process is as follows.
[0075] Boot program operation: Burn the boot program into the controller through a modulator or emulator first. The boot program can ensure the normal operation of the memory in the controller.
[0076] Burning the running program: In the process of booting the running program in the boot program area, first determine whether the status value of FLAG1 is 0. If it is 0, wait for the running program burning request. When the running program burning request is detected, the running program can be burned to the running program area of the memory according to the burning process in the relevant technology. After that, the status value of FLAG1 can be set to 3 and reset by actively resetting the controller. Among them, FLAG1 can be the first flag bit, the status value of FLAG1 set to 3 can be the third status value, and the running program area can be the running program area.
[0077] Run the program: After the program is burned and the controller is actively reset, the boot program area in the memory will enter the boot again. When the status value of FLAG1 is detected to be 3 and the program in the program area is checked to be normal, the program will automatically run the corresponding program.
[0078] Running program backup: When running the running program in the running program area in the memory, the status value of FLAG2 is first detected. If the status value of FLAG2 is 0, the running program is burned to the program backup area that is not in the memory, and then the status value of FLAG2 is set to 1. FLAG2 may be the second flag bit, the status value of FLAG2 set to 0 may be the sixth status value, and the status value of FLAG2 set to 1 may be the fourth status value.
[0079] Backup program burning: During the running of the program, if a burning request is detected and the status value of FLAG2 is 1, the backup program will be burned to the second program backup area that does not belong to the memory, and the status values of FLAG2 and FLAG1 can be set to 2. If the status value of FLAG2 is 2 at this time and a burning request is detected, the backup program will be burned to the first program backup area that does not belong to the memory, and the status values of FLAG1 and FLAG2 will be set to 1. When the program needs to be updated, the status value of FLAG1 is set to 1, and the boot is re-entered by actively resetting the controller. Among them, the status value of FLAG2 set to 2 can be the fifth status value, and the status value of FLAG1 set to 1 can be the first status value.
[0080] Backup program update: If the status value of FLAG1 is identified as 1 during booting, and the backup program in the first program backup area is verified to be normal, the backup program in the first program backup area is updated to the running program area. If the status value of FLAG1 is identified as 2, and the backup program in the second program backup area is verified to be normal, the backup program in the second program backup area is updated to the running program area. After the program update is completed, the status value of FLAG3 is set to 3, and the running program is performed by actively resetting the controller. Among them, the status value of FLAG1 set to 2 can be the second status value. When the backup program in the first program backup area or the second program backup area is not verified to be normal, the status value of FLAG1 is set to 0, and the controller is actively reset so that the memory in the controller enters the boot program.
[0081] Backup program operation: The controller enters the boot state after active reset. When the status value of FLAG1 is recognized as 3 and the backup program in the running program area is verified to be normal, the backup program is run.
[0082] With the above technical solution, the program backup area is set in another controller or memory that is not included in the memory. In hardware, the boot program can first be burned into the controller through the emulator, and then the running program can be burned into the running program area of the controller's memory through the CAN burning device. The running program is then backed up to the program backup area through inter-board communication.
[0083] While the application is running, if a write request is received from the CAN programming device, the backup program can be directly written to the second backup area in the running program area via inter-board communication, and the corresponding first and second flags are set. After the chip in the controller actively resets and enters the bootloader, the bootloader identifies the first and second flags and overwrites the running program with the backup program in the second program backup area. If a rollback instruction is received while the backup program is running, a similar process can be used to update the backup program in the running program area to the running program backed up in the program backup area.
[0084] Based on the same concept, this embodiment also provides a program update device, referring to Figure 4 , Figure 4 is a schematic diagram showing a program updating device 400 according to an exemplary embodiment of the present disclosure, such as Figure 4 Shown, including: The updating module 401 is configured to update the running program in the running program area of the memory to the backup program in the program backup area when the application is in the running state, wherein the program backup area is not in the memory.
[0085] Optionally, the updating module 401 is configured to: According to a first flag bit, the running program in the running program area of the memory is updated to the backup program in the program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0086] Optionally, the updating module 401 is configured to: When the first flag bit is at the first state value, updating the running program in the running program area of the memory to the backup program in the first program backup area; or When the first flag bit is at the second state value, the running program in the running program area of the memory is updated to the backup program in the second program backup area.
[0087] Optionally, the program updating device further includes: The first setting module is used to set the first flag bit to a third state value to indicate that the program in the running program area is running after the running program in the running program area of the memory is updated to the backup program in the program backup area or after the running program is burned to the running program area.
[0088] Optionally, the program updating device is further configured to: Actively reset the controller where the memory is located, and when detecting that the first flag bit is the third state value, control the running program area of the memory through the controller to run the backup program in the program backup area or the running program.
[0089] Optionally, the program updating device is further configured to: The controller controls the boot program area in the memory to guide the running program area to run the backup program in the program backup area or the running program.
[0090] Optionally, the program updating device further includes: The first burning module is used to burn the backup program into the program backup area, or to burn the running program and the backup program into the program backup area.
[0091] Optionally, the first programming module is used to: In response to the programming request, the backup program is programmed into the program backup area according to a second flag bit, wherein the second flag bit is used to indicate a program programming status.
[0092] Optionally, the first programming module includes: A second burning module is used to burn the backup program into the first program backup area when the second flag bit is a fourth state value; The program updating device further includes: The second setting module is used to set the second flag bit to a fifth state value after the backup program is burned into the first program backup area to indicate that the burning of the backup program is completed.
[0093] Optionally, the program updating device is further configured to: After setting the second flag bit to the fifth state value, the first flag bit is set to the first state value to indicate that the running program in the running program area of the memory needs to be updated to the backup program in the first program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0094] Optionally, the first programming module includes: a third burning module, configured to burn the backup program into the second program backup area when the second flag bit is in a fifth state value; The program updating device further includes: The third setting module is used to set the second flag bit to a fourth state value after the backup program is burned into the second program backup area to indicate that the burning of the backup program is completed.
[0095] Optionally, the program updating device further includes: A fourth setting module is used to set the first flag bit to the second state value after setting the second flag bit to the fourth state value, so as to indicate that the running program in the running program area of the memory needs to be updated to the backup program in the second program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
[0096] Optionally, the first programming module is further configured to: The running program is burned into the program backup area according to a second flag bit, wherein the second flag bit is used to indicate a program burning status.
[0097] Optionally, the first programming module is further configured to: When the second flag bit is in the sixth state value, the running program is burned into a program backup area, wherein the program backup area is any one of a plurality of program backup areas.
[0098] Optionally, the program updating device further includes: A fourth burning module, used for burning the running program and the backup program into the program backup area; A rollback module is used to update the backup program in the running program area to the running program in the program backup area according to a rollback instruction.
[0099] Based on the same concept, this embodiment further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the program updating method disclosed in this embodiment are implemented.
[0100] Based on the same concept, this embodiment further provides a controller, including: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of the program updating method disclosed in this embodiment.
[0101] Based on the same concept, this embodiment also provides a vehicle, which includes the controller disclosed in this embodiment.
[0102] Figure 5 FIG2 is a block diagram of a vehicle 500 according to an exemplary embodiment. For example, vehicle 500 may be a hybrid vehicle, a non-hybrid vehicle, an electric vehicle, a fuel cell vehicle, or another type of vehicle. Vehicle 500 may be an autonomous vehicle or a semi-autonomous vehicle.
[0103] Reference Figure 5 Vehicle 500 may include various subsystems, such as an infotainment system 510, a perception system 520, a decision-making and control system 530, a drive system 540, and a computing platform 550. Vehicle 500 may also include more or fewer subsystems, and each subsystem may include multiple components. Furthermore, each subsystem and each component of vehicle 500 may be interconnected via wired or wireless means.
[0104] In some embodiments, the infotainment system 510 may include a communication system, an entertainment system, a navigation system, and the like.
[0105] The perception system 520 may include several sensors for sensing information about the environment surrounding the vehicle 500. For example, the perception system 520 may include a global positioning system (which may be a GPS system, a BeiDou system, or another positioning system), an inertial measurement unit (IMU), a laser radar, a millimeter-wave radar, an ultrasonic radar, and a camera.
[0106] The decision control system 530 may include a computing system, a vehicle controller, a steering system, a throttle, and a braking system.
[0107] The drive system 540 may include components that provide power to the vehicle 500. In one embodiment, the drive system 540 may include an engine, a power source, a transmission system, and wheels. The engine may be an internal combustion engine, an electric motor, an air compression engine, or a combination thereof. The engine is capable of converting energy provided by the power source into mechanical energy.
[0108] Some or all functions of the vehicle 500 are controlled by a computing platform 550. The computing platform 550 may include at least one processor 551 and a memory 552. The processor 551 may execute instructions 553 stored in the memory 552.
[0109] The processor 551 can be any conventional processor, such as a commercially available CPU. The processor can also include a graphics processor (GPU), a field programmable gate array (FPGA), a system on chip (SOC), an application specific integrated circuit (ASIC), or a combination thereof.
[0110] The memory 552 may be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0111] In addition to instructions 553 , memory 552 may also store data, such as road maps, route information, and vehicle location, direction, speed, etc. The data stored in memory 552 may be used by computing platform 550 .
[0112] In the embodiment of the present disclosure, the processor 551 may execute the instruction 553 to complete all or part of the steps of the above-mentioned in-vehicle image display method.
[0113] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided. When executed by a processor, the program instructions implement the steps of the program update method described above. For example, the computer-readable storage medium may be the memory 552 including the program instructions described above. The program instructions may be executed by the processor 551 of the vehicle 500 to perform the program update method described above.
[0114] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned program updating method when executed by the programmable device.
[0115] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the scope of protection of the present disclosure.
[0116] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any appropriate manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0117] In addition, the various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A program update method, characterized in that: include: When the application is in a running state, the running program in the running program area of the memory is updated to the backup program in the program backup area, wherein the program backup area is not in the memory.
2. The program updating method according to claim 1, wherein: The updating of the running program in the running program area of the memory to the target backup program in the program backup area includes: According to a first flag bit, the running program in the running program area of the memory is updated to the backup program in the program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
3. The program updating method according to claim 2, wherein: The updating, according to the first flag bit, of the running program in the running program area of the memory to the backup program in the program backup area includes: When the first flag bit is at the first state value, updating the running program in the running program area of the memory to the backup program in the first program backup area; or When the first flag bit is at the second state value, the running program in the running program area of the memory is updated to the backup program in the second program backup area.
4. The program updating method according to claim 2, wherein: The method further comprises: After the running program in the running program area of the memory is updated to the backup program in the program backup area or after the running program is burned into the running program area, the first flag bit is set to a third state value to indicate that the program in the running program area is running.
5. The program updating method according to claim 4, wherein: The method further comprises: Actively reset the controller where the memory is located, and when detecting that the first flag bit is the third state value, control the running program area of the memory through the controller to run the backup program in the program backup area or the running program.
6. The program updating method according to claim 5, wherein: The step of controlling the running program area of the memory to run the backup program in the program backup area or the running program by the controller includes: The controller controls the boot program area in the memory to guide the running program area to run the backup program in the program backup area or the running program.
7. The program updating method according to any one of claims 1 to 6, characterized in that: The method further comprises: Burn the backup program into the program backup area, or burn the running program and the backup program into the program backup area.
8. The program updating method according to claim 7, wherein: Burning the backup program into the program backup area includes: In response to the programming request, the backup program is programmed into the program backup area according to a second flag bit, wherein the second flag bit is used to indicate a program programming status.
9. The program updating method according to claim 8, wherein: The step of burning the backup program into the program backup area according to the second flag bit includes: When the second flag bit is in a fourth state value, burning the backup program into the first program backup area; The method further comprises: After the backup program is burned into the first program backup area, the second flag bit is set to a fifth state value to indicate that the burning of the backup program is completed.
10. The program updating method according to claim 9, wherein: The method further comprises: After setting the second flag bit to the fifth state value, the first flag bit is set to the first state value to indicate that the running program in the running program area of the memory needs to be updated to the backup program in the first program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
11. The program updating method according to claim 8, wherein: The step of burning the backup program into the program backup area according to the second flag bit includes: When the second flag bit is in the fifth state value, burning the backup program into the second program backup area; The method further comprises: After the backup program is burned into the second program backup area, the second flag bit is set to a fourth state value to indicate that the burning of the backup program is completed.
12. The program updating method according to claim 11, wherein: The method further comprises: After setting the second flag bit to the fourth state value, the first flag bit is set to the second state value to indicate that the running program in the running program area of the memory needs to be updated to the backup program in the second program backup area, wherein the first flag bit is used to indicate the update status or running status of the program in the running program area.
13. The program updating method according to claim 7, wherein: Burning the running program into the program backup area includes: The running program is burned into the program backup area according to a second flag bit, wherein the second flag bit is used to indicate a program burning status.
14. The program updating method according to claim 13, wherein: The step of burning the running program into the program backup area according to the second flag bit includes: When the second flag bit is in the sixth state value, the running program is burned into a program backup area, wherein the program backup area is any one of a plurality of program backup areas.
15. The program updating method according to any one of claims 1 to 6, characterized in that: The method further comprises: Burning the running program and the backup program into the program backup area; According to the rollback instruction, the backup program in the running program area is updated to the running program in the program backup area.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.
17. A controller, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 15.
18. A vehicle, characterized in that: The vehicle includes the controller of claim 17.
19. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 15 when the computer program is executed by a processor.