Program data dual-backup rollback method and system, vehicle and storage medium

The dual backup rollback method using external storage modules with identifiers addresses the limitations of chip size and frequent flashing, ensuring stable vehicle operation by managing dual backups and rollbacks.

CN119088621APending Publication Date: 2024-12-06WEICHAI POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411240185.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Current software program backup methods are limited by chip size and frequent flashing can cause backup disorder, leading to vehicle operational failures.

Method used

A program data dual backup rollback method that utilizes two external storage modules with backup identifiers to manage dual backups and rollbacks, ensuring seamless and stable operation by selecting the appropriate backup program based on identifier comparisons.

Benefits of technology

Ensures stable vehicle operation by dynamically managing dual backups and rollbacks, addressing the limitations of chip size and frequent flashing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088621A_ABST
    Figure CN119088621A_ABST
Patent Text Reader

Abstract

The invention discloses a program data dual-backup rollback method and system, a vehicle and a storage medium. The program data dual-backup rollback method comprises the following steps: after a to-be-flashed program in a program storage area is flashed and the to-be-flashed program is controlled to run for a set time length, according to a first backup identifier of a first program backup area and a second backup identifier of a second program backup area of an external storage module, writing the to-be-flashed program in the program storage area; determining that a first backup program of the to-be-flashed program is backed up to a first program backup area or a second backup program of the to-be-flashed program is backed up to a second program backup area; when the program to be flashed in the program storage area runs abnormally, it is determined that the first backup program or the second backup program is rolled back to the program storage area according to the first backup identifier and the second backup identifier, and flashing is conducted based on the first backup program or the second backup program. According to the invention, dynamic program data dual backup based on the backup identifier is realized, and normal operation of the vehicle is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle software program flashing, and in particular to a program data double backup rollback method, system, vehicle and storage medium. Background Art

[0002] Cars are becoming more and more common in our lives. As a result, automobile emission regulations are becoming stricter and ECU control strategies are becoming more and more perfect, which will inevitably lead to an increase in the amount of code in automobile-related software program files. Currently, the program files of National VI automobile-related software are close to 20MB.

[0003] At present, the backup of software programs is based on the size of the most complex software code in the application scenario in the Flash of the current main chip, and a corresponding fixed Flash is divided as a backup area. The backup area can fully cover the code in the program area. After the software is flashed, it is backed up in the backup area. After the next flash fails or the program is abnormal, the intact program in the backup area can be rolled back to the program area. However, with the continuous development of automobile intelligence, the complexity of software programs will become higher and higher, and the amount of code will gradually increase. If it exceeds the size range of the current program area, it will affect the software program backup function. On the other hand, an external Flash chip is used to back up the currently running program, but when the flash is frequently performed, the backup takes time, which will cause the backup area to be disordered, and then the backup area cannot be backed up to a stable and effective software program. Summary of the invention

[0004] The present invention provides a program data dual backup rollback method, system, vehicle and storage medium to solve the problem that current software program backup is limited by chip size and frequent flashing will cause backup disorder, thereby making the vehicle unable to operate normally.

[0005] According to one aspect of the present invention, a program data double backup rollback method is provided, and the program data double backup rollback method comprises:

[0006] After the program to be flashed in the program storage area is flashed and the program to be flashed is controlled to run for a set time length, according to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module, it is determined to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area;

[0007] When the program to be flashed in the program storage area runs abnormally, the first backup program or the second backup program is rolled back to the program storage area according to the first backup identifier and the second backup identifier to flash based on the first backup program or the second backup program.

[0008] Optionally, after the program to be written in the program storage area is flashed, the method further includes:

[0009] If the program to be flashed cannot be run for more than the set time, the first backup program or the second backup program is rolled back to the program storage area according to the first backup identifier and the second backup identifier.

[0010] Optionally, the first backup identifier is a first backup number identifier recording a first backup number of the first program backup area, and the second backup identifier is a second backup number identifier recording a second backup number of the first program backup area;

[0011] Determining, according to a first backup identifier of a first program backup area and a second backup identifier of a second program backup area of ​​an external storage module, to back up a first backup program of the program to be flashed to the first program backup area or to back up a second backup program of the program to be flashed to the second program backup area includes:

[0012] If the first backup number of times indicated by the first backup number identifier is less than the second backup number of times indicated by the second backup number identifier, determining to back up the first backup program of the program to be flashed to the first program backup area, and controlling the first backup number to be incremented by 1;

[0013] If the first backup number is greater than the second backup number, it is determined to back up the second backup program of the program to be flashed to the second program backup area, and the second backup number is controlled to increase by 1.

[0014] Optionally, the first backup identifier is a first backup success identifier indicating that the first backup program has successfully backed up, and the second backup identifier is a second backup success identifier indicating that the second backup program has successfully backed up;

[0015] After determining to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area, the method further includes:

[0016] If the first checksum of the first backup program is consistent with the program checksum of the program to be flashed, then after the first backup program is successfully backed up to the first program backup area, the first backup success flag is set to 1; or,

[0017] If the second checksum of the second backup program is consistent with the program checksum of the program to be flashed, the second backup success flag is set to 1 after the second backup program is successfully backed up to the second program backup area.

[0018] Optionally, the program data double backup rollback method further includes:

[0019] If the first checksum of the first backup program is inconsistent with the program checksum of the program to be flashed, and the first backup number of the first program backup area corresponds to the accumulated backup number does not exceed the set backup number, then the first backup success flag is set to 0; or,

[0020] If the second checksum of the second backup program is inconsistent with the program checksum of the program to be flashed, and the second backup times of the second program backup area corresponding to the accumulated backup times do not exceed the set backup times, the second backup success flag is set to 0.

[0021] Optionally, the program data double backup rollback method further includes:

[0022] After receiving the program flashing instruction, if the backup of the first backup program and / or the second backup program is completed, flashing is performed based on the first backup program or the second backup program.

[0023] Optionally, determining, according to the first backup identifier and the second backup identifier, to roll back the first backup program or the second backup program to the program storage area so as to perform a flash based on the first backup program or the second backup program includes:

[0024] If the identification number of the first backup identifier is greater than the identification number of the second backup identifier, determining to roll back the first backup program to the program storage area to perform a flash based on the first backup program;

[0025] If the identification number of the second backup identifier is greater than the identification number of the first backup identifier, it is determined to roll back the second backup program to the program storage area to perform a flash based on the second backup program.

[0026] According to another aspect of the present invention, a program data dual backup rollback device is provided, the program data dual backup rollback device comprising:

[0027] A program backup module, for determining, after the flashing of the program to be flashed in the program storage area is completed and the program to be flashed is controlled to run for a set time length, to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area according to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module;

[0028] The program flashing module is used to determine whether to roll back the first backup program or the second backup program to the program storage area according to the first backup identifier and the second backup identifier when the program to be flashed in the program storage area runs abnormally, so as to flash based on the first backup program or the second backup program.

[0029] According to another aspect of the present invention, a vehicle is provided, the vehicle comprising:

[0030] at least one processor; and,

[0031] a memory communicatively connected to the at least one processor; wherein,

[0032] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the program data double backup rollback method described in any embodiment of the present invention.

[0033] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the program data double backup rollback method described in any embodiment of the present invention when executed.

[0034] The technical solution of the embodiment of the present invention is to determine whether to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area according to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module after the flashing of the program to be flashed in the program storage area is completed and the program to be flashed is controlled to run for a set time length; when the program to be flashed in the program storage area runs abnormally, the first backup program or the second backup program is determined to be rolled back to the program storage area according to the first backup identifier and the second backup identifier, so as to flash based on the first backup program or the second backup program. The present invention solves the problem that the current software program backup is limited by the chip size, and frequent flashing will cause backup disorder, thereby making the vehicle unable to operate normally. It realizes dual backup of dynamic program data based on backup identifiers, ensures the need for frequent flashing, and can roll back the complete program data to ensure the normal operation of the vehicle.

[0035] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0037] Figure 1 is a flowchart of a program data double backup rollback method provided according to Embodiment 1 of the present invention;

[0038] Figure 2 is a flowchart of a program data double backup rollback method provided according to Embodiment 2 of the present invention;

[0039] Figure 3 2 is a schematic diagram of the structure of a program data dual backup rollback device provided according to Embodiment 3 of the present invention;

[0040] Figure 4 It is a structural schematic diagram of a vehicle for implementing the program data dual backup rollback method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0043] Embodiment 1

[0044] Figure 1A flowchart of a program data double backup rollback method is provided for the first embodiment of the present invention. This embodiment is applicable to the case where program data can be fully rolled back after double backup of program data. The program data double backup rollback method can be executed by a program data double backup rollback device. The program data double backup rollback device can be implemented in the form of hardware and / or software. The program data double backup rollback device can be configured in a vehicle with an ECU flashing system. Figure 1 As shown, the program data double backup rollback method includes:

[0045] S110. After the flashing of the program to be flashed in the program storage area is completed and the program to be flashed is controlled to run for a set time length, according to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module, determine whether to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area.

[0046] Among them, the program storage area is a fixed area used to store relevant application software program data in the vehicle. The application software program data can be the vehicle's own setting software or additional downloaded software programs. This embodiment does not impose any restrictions on the amount of application software program data in the program storage area and the specific software program type.

[0047] The program storage area may be the vehicle's built-in main chip FLASH flash memory. FLASH flash memory is a non-volatile memory that can retain data for a long time even without current supply. Its storage characteristics are equivalent to a hard disk.

[0048] The program to be flashed can be the program data currently running in the vehicle, and the program to be flashed can be any application software program data in the vehicle. This embodiment does not impose any restrictions on the program to be flashed. Optionally, the program to be flashed can be any program in the engine control program, the engine calibration program, or the engine offline system program.

[0049] Based on the above, after the program to be flashed in the program storage area is flashed, if the program to be flashed cannot run for more than a set time, the first backup program or the second backup program is rolled back to the program storage area according to the first backup identifier and the second backup identifier.

[0050] The external storage module may also use FLASH flash memory or other erasable non-volatile storage media, and this embodiment does not impose any limitation on its specific form.

[0051] In this embodiment, the external storage module is divided into two backup areas, namely a first program backup area and a second program backup area. The first program backup area is an area for normal storage of backup program data to be flashed, and the second program backup area is an area for storing the program data to be flashed backed up in the first program backup area.

[0052] That is, the first program backup area backs up the program data of the program to be flashed, that is, the first backup program of the program to be flashed is the program data of the program to be flashed backed up in the first program backup area; the second program backup area backs up the program data of the first program backup area, that is, the second backup program of the first backup program is the program data of the program to be flashed backed up in the first program backup area.

[0053] In this embodiment, the first backup identifier is two 32-byte identifiers reserved at the beginning of the first program backup area. The first 32-byte identifier is used to record the first backup number of the first program backup area, that is, an identification number of the first backup identifier can be generated, and then the identification number can be used to identify whether the first program backup area is the latest backup area at this time; the second 32-byte identifier is used to store the first checksum of the first backup program in the first program backup area (occupying 31 bytes), and the first backup success identifier (occupying 1 byte) indicating that the first backup program is successfully backed up.

[0054] The second backup identifier is two 32-byte identifiers reserved at the beginning of the second program backup area. The first 32-byte identifier is used to record the second backup times of the second program backup area, that is, an identification number of the second backup identifier can be generated, and then the identification number can be used to identify whether the second program backup area is the latest backup area at this time; the second 32-byte identifier is used to store the second checksum of the second backup program in the second program backup area (occupying 31 bytes), and the second backup success identifier (occupying 1 byte) indicating that the second backup program is successfully backed up.

[0055] Specifically, the first backup identifier is a first backup number identifier that records the first backup number of the first program backup area, and the second backup identifier may be a second backup number identifier that records the second backup number of the first program backup area. If the first backup number of the first backup number identifier is less than the second backup number of the second backup number identifier, it is determined that the first backup program of the program to be flashed is backed up to the first program backup area, and the first backup number is controlled to increase by 1; if the first backup number is greater than the second backup number, it is determined that the second backup program of the program to be flashed is backed up to the second program backup area, and the second backup number is controlled to increase by 1.

[0056] Furthermore, the first backup identifier is a first backup success identifier indicating that the first backup program is successfully backed up, and the second backup identifier is a second backup success identifier indicating that the second backup program is successfully backed up; then, after determining that the first backup program of the program to be flashed is backed up to the first program backup area or that the second backup program of the program to be flashed is backed up to the second program backup area, if the first checksum of the first backup program is consistent with the program checksum of the program to be flashed, then after the first backup program is successfully backed up to the first program backup area, the first backup success identifier is set to 1; or, if the second checksum of the second backup program is consistent with the program checksum of the program to be flashed, then after the second backup program is successfully backed up to the second program backup area, the second backup success identifier is set to 1.

[0057] On the contrary, if the first checksum of the first backup program is inconsistent with the program checksum of the program to be flashed, and the first backup number of the first program backup area corresponds to the cumulative backup number does not exceed the set backup number, then the first backup success flag is set to 0; or, if the second checksum of the second backup program is inconsistent with the program checksum of the program to be flashed, and the second backup number of the second program backup area corresponds to the cumulative backup number does not exceed the set backup number, then the second backup success flag is set to 0.

[0058] On the basis of the above, after receiving the program flashing instruction, if the backup of the first backup program and / or the second backup program is completed, the flashing is performed based on the first backup program or the second backup program.

[0059] S120: When the program to be flashed in the program storage area runs abnormally, determine to roll back the first backup program or the second backup program to the program storage area according to the first backup identifier and the second backup identifier, so as to flash the program based on the first backup program or the second backup program.

[0060] Specifically, when the program to be flashed in the program storage area runs abnormally, if the identification number of the first backup identifier is greater than the identification number of the second backup identifier, it is determined to roll back the first backup program to the program storage area for flashing based on the first backup program; if the identification number of the second backup identifier is greater than the identification number of the first backup identifier, it is determined to roll back the second backup program to the program storage area for flashing based on the second backup program.

[0061] The technical solution of the embodiment of the present invention is to determine whether to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area according to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module after the flashing of the program to be flashed in the program storage area is completed and the program to be flashed is controlled to run for a set time length; when the program to be flashed in the program storage area runs abnormally, the first backup program or the second backup program is rolled back to the program storage area according to the first backup identifier and the second backup identifier, so as to flash based on the first backup program or the second backup program. The present invention solves the problem that the current software program backup is limited by the chip size, and frequent flashing will cause backup disorder, thereby making the vehicle unable to operate normally. It realizes dual backup of dynamic program data based on backup identifiers, ensures the need for frequent flashing, and can roll back the complete program data to ensure the normal operation of the vehicle.

[0062] Embodiment 2

[0063] Figure 2 This is a flowchart of a program data double backup rollback method provided in Embodiment 2 of the present invention. This embodiment provides an optional implementation method based on the above embodiment. Figure 2 As shown, the program data double backup rollback method includes:

[0064] S210, the program to be written in the program storage area is flashed.

[0065] S220, determining whether the running of the program to be flashed exceeds a set time length, if so, executing step S230, if not, executing step S290.

[0066] The set time length is a certain length of normal operation time after the flashing program is completed. The set time length can be calibrated according to the actual situation of the vehicle. Optionally, the set time length can be 5s.

[0067] It can be known that if the program to be flashed can be controlled to run for more than a set time length, the backup of the program to be flashed can be started.

[0068] It should be noted that the dual backup of program data in this application is a seamless backup, that is, a backup that the vehicle user is unaware of.

[0069] S230, determining a first backup identifier of a first program backup area and a second backup identifier of a second program backup area of ​​an external storage module, wherein the first backup identifier is a first backup number identifier recording a first backup number of times the first program backup area is backed up, and a first backup success identifier indicating a successful backup of the first backup program; and the second backup identifier is a second backup number identifier recording a second backup number of times the first program backup area is backed up, and a second backup success identifier indicating a successful backup of the second backup program is backed up.

[0070] S240, determining whether the first backup number identified by the first backup number is less than the second backup number identified by the second backup number, if so, executing step S250, if not, executing step S260.

[0071] S250, determining to back up the first backup program of the program to be flashed to the first program backup area, and controlling the first backup count to increase by 1, and executing step S251.

[0072] S260, determining to back up the second backup program of the program to be flashed to the second program backup area, and controlling the second backup count to increase by 1, and executing step S261.

[0073] S251, determine whether the first checksum of the first backup program is consistent with the program checksum of the program to be flashed, if so, execute step S252, if not, execute step S253.

[0074] Among them, the first checksum of the first backup program and the program checksum of the program to be flashed can be calculated according to preset rules. Optionally, the program checksum and the first checksum can be calculated and generated by the agreed key data and program identification code. This embodiment does not impose any restrictions on this.

[0075] S252: After the first backup program is successfully backed up to the first program backup area, a first backup success flag is set to 1.

[0076] S253, determining whether the first backup number of the first program backup area corresponds to the accumulated backup number of times exceeding the set backup number, if so, executing step S250, if not, executing step S254.

[0077] Among them, the number of backup times can be set according to the actual situation of the vehicle. Optionally, the number of backup times can be set to 3 times.

[0078] S254, set the first backup success flag to 0, and execute step S270.

[0079] S261, determine whether the second checksum of the second backup program is consistent with the program checksum of the program to be flashed, if so, execute step S262, if not, execute step S263.

[0080] The second checksum of the second backup program may be calculated according to a preset rule. Optionally, the second checksum may be generated by calculating the agreed key data and the program identification code, and this embodiment does not impose any limitation on this.

[0081] S262: After the second backup program is successfully backed up to the second program backup area, the second backup success flag is set to 1.

[0082] S263, determining whether the second backup number of the second program backup area corresponds to the accumulated backup number exceeding the set backup number, if so, executing step S260, if not, executing step S264.

[0083] S264, set the second backup success flag to 0, and execute step S270.

[0084] S270, receiving a program flashing instruction during the dual backup process of program data, determining whether the first backup program and / or the second backup program has been backed up, if so, executing step S271, if not, executing step S240.

[0085] Among them, the program flashing instruction is a flashing instruction generated in the process of dual backup of program data. The program flashing instruction can be selected and generated by the vehicle control system according to the flashing requirements, and this embodiment does not impose any restrictions on this.

[0086] Specifically, during the dual backup of program data, if a program flashing instruction is received, it is first determined whether one of the first program backup area and the second program backup area is complete, that is, whether the first program backup area and the second program backup area have backed up a complete program data; if both the first program backup area and the second program backup area are incomplete, flashing is not allowed, and priority is given to backing up a complete program data to the first program backup area and the second program backup area.

[0087] S271. Flashing is performed based on the first backup program or the second backup program.

[0088] Specifically, if the backup of the first backup program is completed, that is, the first program backup area has backed up a complete program data, the flashing can be performed based on the first backup program.

[0089] If the backup of the first backup program is not completed, but the backup of the second backup program is completed, that is, the second program backup area has backed up a complete set of program data, then the flashing can be performed based on the second backup program.

[0090] If the backup of the first backup program and the backup of the second backup program are both completed, that is, the first program backup area and the second program backup area have backed up a complete program data, the flashing can be performed based on the first backup program.

[0091] S280: The program to be flashed in the program storage area runs abnormally.

[0092] S290, determine whether the identification number of the first backup identification is greater than the identification number of the second backup identification, if so, execute step S291, if not, execute step S292.

[0093] The identification number of the first backup identification can be calculated based on the program identification code, and the identification number of the second backup identification can be calculated based on the program identification code.

[0094] S291. Determine to roll back the first backup program to the program storage area, and execute step S293.

[0095] S292. Determine to roll back the second backup program to the program storage area, and execute step S293.

[0096] S293. Send an identification message to the bus during the rollback process.

[0097] Specifically, during the rollback process, an identification message is sent to the bus to remind the program operator not to perform any operation. If the program operator does not want to roll back and wants to rewrite the latest program, rewriting the latest program is allowed.

[0098] S294: Determine whether to perform a flash operation, if yes, execute step S271, if not, execute step S293.

[0099] The technical solution of the embodiment of the present invention realizes the dynamic backup of the first program backup area and the second program backup area, and makes a backup mark at the beginning of the program. Each backup is dynamically increased by 1 to facilitate identification of which is the latest backup area. Each time a backup is performed, an older area is selected for backup storage. When the program is frequently rewritten, a complete backup can be guaranteed to prevent the backup failure from causing the program to be abnormal and unable to be rolled back. In addition, when rolling back, the latest first program backup area or second program backup area is judged to be rolled back to the program storage area through the mark. If the program data of the latest first program backup area or second program backup area is incomplete or abnormal, the program data of the old first program backup area or second program backup area can be rolled back to ensure that there is an area that is successfully backed up and can be rolled back to a normal and executable version, thereby ensuring stable operation of the vehicle.

[0100] Embodiment 3

[0101] Figure 3 This is a schematic diagram of the structure of a program data double backup rollback device provided by Embodiment 3 of the present invention. Figure 3 As shown, the program data double backup rollback device includes:

[0102] The program backup module 310 is used to determine whether to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area according to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module after the flashing of the program to be flashed in the program storage area is completed and the program to be flashed is controlled to run for a set time length;

[0103] The program flashing module 320 is used to determine to roll back the first backup program or the second backup program to the program storage area according to the first backup identifier and the second backup identifier when the program to be flashed in the program storage area runs abnormally, so as to flash based on the first backup program or the second backup program.

[0104] Optionally, the program data double backup rollback device further includes:

[0105] The program rollback module is used to execute, if the program to be flashed cannot be run for more than a set time, rolling back the first backup program or the second backup program to the program storage area according to the first backup identifier and the second backup identifier.

[0106] Optionally, the first backup identifier is a first backup number identifier for recording a first backup number of the first program backup area, and the second backup identifier is a second backup number identifier for recording a second backup number of the first program backup area;

[0107] According to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module, determining to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area is specifically used for:

[0108] If the first backup number of times indicated by the first backup number indicator is less than the second backup number of times indicated by the second backup number indicator, it is determined that the first backup program of the program to be flashed is backed up to the first program backup area, and the first backup number is controlled to be increased by 1;

[0109] If the first backup number is greater than the second backup number, it is determined to back up the second backup program of the program to be flashed to the second program backup area, and the second backup number is controlled to increase by 1.

[0110] Optionally, the first backup identifier is a first backup success identifier indicating that the first backup program has successfully backed up, and the second backup identifier is a second backup success identifier indicating that the second backup program has successfully backed up;

[0111] After determining to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area, the method further includes:

[0112] If the first checksum of the first backup program is consistent with the program checksum of the program to be flashed, then after the first backup program is successfully backed up to the first program backup area, the first backup success flag is set to 1; or,

[0113] If the second checksum of the second backup program is consistent with the program checksum of the program to be flashed, the second backup success flag is set to 1 after the second backup program is successfully backed up to the second program backup area.

[0114] Optionally, the program data dual backup rollback device further includes:

[0115] A backup success identification module is used to set the first backup success identification to 0 if the first checksum of the first backup program is inconsistent with the program checksum of the program to be flashed, and the first backup number of the first program backup area corresponds to the accumulated backup number of times does not exceed the set backup number; or

[0116] If the second checksum of the second backup program is inconsistent with the program checksum of the program to be flashed, and the second backup times of the second program backup area corresponding to the accumulated backup times do not exceed the set backup times, the second backup success flag is set to 0.

[0117] Optionally, the program data dual backup rollback device further includes:

[0118] The backup completion flashing module is used to execute, after receiving the program flashing instruction, if the backup of the first backup program and / or the second backup program is completed, flashing is performed based on the first backup program or the second backup program.

[0119] Optionally, determining to roll back the first backup program or the second backup program to the program storage area according to the first backup identifier and the second backup identifier so as to perform a flash based on the first backup program or the second backup program is specifically used for:

[0120] If the identification number of the first backup identifier is greater than the identification number of the second backup identifier, determining to roll back the first backup program to the program storage area to perform a flash based on the first backup program;

[0121] If the identification number of the second backup identifier is greater than the identification number of the first backup identifier, it is determined to roll back the second backup program to the program storage area so as to perform a flashing operation based on the second backup program.

[0122] The program data dual backup rollback device provided in the embodiment of the present invention can execute the program data dual backup rollback method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the program data dual backup rollback method.

[0123] Embodiment 4

[0124] Figure 4FIG. 4 is a schematic diagram showing a structure of a vehicle 410 that can be used to implement an embodiment of the present invention. Figure 4 As shown, the vehicle 410 includes at least one processor 411, and a memory connected to the at least one processor 411, such as a read-only memory (ROM 412), a random access memory (RAM 413), etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM 412) or the computer program loaded from the storage unit 418 to the random access memory (RAM 413). In RAM 413, various programs and data required for the operation of the vehicle 410 can also be stored. The processor 411, ROM 412 and RAM 413 are connected to each other via a bus 414. An I / O (input / output) interface 415 is also connected to the bus 414.

[0125] A number of components in the vehicle 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the vehicle 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0126] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as a program data double backup rollback method.

[0127] In some embodiments, the program data dual backup rollback method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the vehicle 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the program data dual backup rollback method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to execute the program data dual backup rollback method in any other appropriate manner (e.g., by means of firmware).

[0128] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0129] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0130] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0131] To provide interaction with a user, the systems and techniques described herein can be implemented on a vehicle having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the vehicle. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0132] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0133] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0134] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0135] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A program data double backup rollback method, It is characterized in that include: After the program to be flashed in the program storage area is flashed and the program to be flashed is controlled to run for a set time length, according to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module, it is determined to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area; When the program to be flashed in the program storage area runs abnormally, the first backup program or the second backup program is rolled back to the program storage area according to the first backup identifier and the second backup identifier to flash based on the first backup program or the second backup program.

2. The program data double backup rollback method according to claim 1, It is characterized in that After the program to be written in the program storage area is written, it also includes: If the program to be flashed cannot be run for more than the set time, the first backup program or the second backup program is rolled back to the program storage area according to the first backup identifier and the second backup identifier.

3. The program data double backup rollback method according to claim 1, It is characterized in that The first backup identifier is a first backup number identifier that records the first backup number of the first program backup area, and the second backup identifier is a second backup number identifier that records the second backup number of the first program backup area; Determining, according to a first backup identifier of a first program backup area and a second backup identifier of a second program backup area of ​​an external storage module, to back up a first backup program of the program to be flashed to the first program backup area or to back up a second backup program of the program to be flashed to the second program backup area includes: If the first backup number of times indicated by the first backup number identifier is less than the second backup number of times indicated by the second backup number identifier, determining to back up the first backup program of the program to be flashed to the first program backup area, and controlling the first backup number to be incremented by 1; If the first backup number is greater than the second backup number, it is determined to back up the second backup program of the program to be flashed to the second program backup area, and the second backup number is controlled to increase by 1.

4. The program data double backup rollback method according to claim 1, It is characterized in that The first backup identifier is a first backup success identifier of a successful backup of the first backup program, and the second backup identifier is a second backup success identifier of a successful backup of the second backup program; After determining to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area, the method further includes: If the first checksum of the first backup program is consistent with the program checksum of the program to be flashed, then after the first backup program is successfully backed up to the first program backup area, the first backup success flag is set to 1; or, If the second checksum of the second backup program is consistent with the program checksum of the program to be flashed, the second backup success flag is set to 1 after the second backup program is successfully backed up to the second program backup area.

5. The program data double backup rollback method according to claim 4, It is characterized in that The program data double backup rollback method also includes: If the first checksum of the first backup program is inconsistent with the program checksum of the program to be flashed, and the first backup number of the first program backup area corresponds to the accumulated backup number does not exceed the set backup number, then the first backup success flag is set to 0; or, If the second checksum of the second backup program is inconsistent with the program checksum of the program to be flashed, and the second backup times of the second program backup area corresponding to the accumulated backup times do not exceed the set backup times, the second backup success flag is set to 0.

6. The program data double backup rollback method according to claim 1, It is characterized in that The program data double backup rollback method also includes: After receiving the program flashing instruction, if the backup of the first backup program and / or the second backup program is completed, flashing is performed based on the first backup program or the second backup program.

7. The program data double backup rollback method according to claim 1, It is characterized in that Determining, according to the first backup identifier and the second backup identifier, to roll back the first backup program or the second backup program to the program storage area so as to perform a flash based on the first backup program or the second backup program includes: If the identification number of the first backup identifier is greater than the identification number of the second backup identifier, determining to roll back the first backup program to the program storage area to perform a flash based on the first backup program; If the identification number of the second backup identifier is greater than the identification number of the first backup identifier, it is determined to roll back the second backup program to the program storage area to perform a flash based on the second backup program.

8. A program data double backup rollback device, It is characterized in that include: A program backup module, for determining, after the flashing of the program to be flashed in the program storage area is completed and the program to be flashed is controlled to run for a set time length, to back up the first backup program of the program to be flashed to the first program backup area or to back up the second backup program of the program to be flashed to the second program backup area according to the first backup identifier of the first program backup area and the second backup identifier of the second program backup area of ​​the external storage module; The program flashing module is used to determine whether to roll back the first backup program or the second backup program to the program storage area according to the first backup identifier and the second backup identifier when the program to be flashed in the program storage area runs abnormally, so as to flash based on the first backup program or the second backup program.

9. A vehicle, It is characterized in that The vehicle comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the program data double backup rollback method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the program data double backup rollback method according to any one of claims 1 to 7 when executed.