Program data dual-backup rollback method and system, vehicle and storage medium
By using the dual backup rollback method in software program backup, the backup program is divided into two parts and rolled back according to the checksum, the backup is solved due to the chip size limitation and frequent flashing, ensuring the normality of the vehicle run.
Patent Information
- Application Number
- CN202411239575.9
- 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
In the prior art, software program backup is limited by chip size, and frequent flashing leads to backup disorder, which in turn makes the vehicle unable to operate normally.
The program data double backup rollback method is adopted. After the program to be flashed in the program storage area is completed, the backup program is divided into two parts and backed up to the two backup areas of the external storage module, and determined based on the program checksum. Roll back to the program storage area to ensure the integrity and stability of the backup.
It solves the problem that software program backup is limited by chip size, realizes dual backup and rollback of program data, and ensures the normal operation of the vehicle when it is frequently flashed.
Smart Images

Figure CN119088620A_ABST
Abstract
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 written in the program storage area is written and the program to be written is controlled to run for a first running time, a first backup program of the program to be written is backed up to a first program backup area of an external storage module, and after the current driving cycle running time is greater than a second running time, a second backup program of the first backup program is backed up to a second program backup area of the external storage module;
[0007] When the program to be flashed in the program storage area runs abnormally, it is determined to roll back the first backup program or the second backup program to the program storage area according to the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program, so as 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 first running time, the first backup program or the second backup program is rolled back to the program storage area to be flashed based on the first backup program or the second backup program.
[0010] Optionally, the program data double backup rollback method further includes:
[0011] If a program flashing instruction is received, flashing is performed based on the program to be flashed;
[0012] If the program flashing instruction is not received, the first backup program of the program to be flashed is backed up to the first program backup area of the external storage module, or the second backup program of the first backup program is backed up to the second program backup area of the external storage module.
[0013] Optionally, when backing up the first backup program of the program to be flashed to the first program backup area of the external storage module, the method further includes:
[0014] After receiving the program flashing instruction, the first timing time length is obtained;
[0015] If the first timing time length is less than or equal to the first timing time threshold, determining whether to perform a flash operation;
[0016] If the first timing time length is greater than the first timing time threshold, flashing is performed based on the program to be flashed.
[0017] Optionally, determining whether to perform a flash operation includes:
[0018] If it is determined that a flashing operation is to be performed, flashing is performed based on the program to be flashed;
[0019] If it is determined that the flashing operation is not to be performed, the first backup program of the program to be flashed is continued to be backed up to the first program backup area of the external storage module.
[0020] Optionally, determining to roll back the first backup program or the second backup program to the program storage area according to the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program includes:
[0021] If the program checksum of the program to be flashed is consistent with the first checksum of the first backup program, rolling back the first backup program to the program storage area;
[0022] If the program checksum of the program to be written is inconsistent with the first checksum of the first backup program, after determining that the program checksum of the program to be written is consistent with the second checksum of the second backup program, the second backup program is rolled back to the program storage area.
[0023] Optionally, when determining to roll back the first backup program or the second backup program to the program storage area, the method further includes:
[0024] After receiving the program flashing instruction, the second timing time length is obtained;
[0025] If the second timing time length is less than or equal to the second timing time threshold, determining whether to perform a flash operation;
[0026] If the second timing time length is greater than the second timing time threshold, flashing is performed based on the program to be flashed.
[0027] 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:
[0028] a data backup module, configured to back up a first backup program of the program to be flashed to a first program backup area of an 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 first running time length, and to back up a second backup program of the first backup program to a second program backup area of the external storage module after the running time of a current driving cycle is greater than a second running time length;
[0029] A data rollback module is used to determine whether to roll back the first backup program or the second backup program to the program storage area when the program to be flashed in the program storage area runs abnormally, based on the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program, so as to flash based on the first backup program or the second backup program.
[0030] According to another aspect of the present invention, a vehicle is provided, the vehicle comprising:
[0031] at least one processor; and,
[0032] a memory communicatively connected to the at least one processor; wherein,
[0033] 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.
[0034] 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.
[0035] The technical solution of the embodiment of the present invention is that 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 first running time, the first backup program of the program to be flashed is backed up to the first program backup area of the external storage module, and after the current driving cycle running time is greater than the second running time, the second backup program of the first backup program is backed up to the second program backup area of the external storage module; when the program to be flashed in the program storage area runs abnormally, according to the program checksum of the program to be flashed, the first checksum of the first backup program and the second checksum of the second backup program, it is determined to roll back the first backup program or the second backup program to the program storage area, 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, realizes dual backup of program data, ensures the need for frequent flashing, and can roll back the complete program data to ensure the normal operation of the vehicle.
[0036] 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
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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.
[0038] Figure 1is a flowchart of a program data double backup rollback method provided according to Embodiment 1 of the present invention;
[0039] Figure 2 is a flowchart of a program data double backup rollback method provided according to Embodiment 2 of the present invention;
[0040] Figure 3 is a flowchart of a program data double backup rollback method provided according to Embodiment 3 of the present invention;
[0041] Figure 4 It is a structural schematic diagram of a program data dual backup rollback device provided according to a fourth embodiment of the present invention;
[0042] Figure 5 It is a structural schematic diagram of a vehicle for implementing the program data dual backup rollback method of an embodiment of the present invention. DETAILED DESCRIPTION
[0043] 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.
[0044] 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.
[0045] Embodiment 1
[0046] 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:
[0047] 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 first running time length, a first backup program of the program to be flashed is backed up to a first program backup area of an external storage module, and after the current driving cycle running time is greater than a second running time length, a second backup program of the first backup program is backed up to a second program backup area of the external storage module.
[0048] 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.
[0049] 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.
[0050] 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.
[0051] 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 the first running time, the first backup program or the second backup program is rolled back to the program storage area for flashing based on the first backup program or the second backup program.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] Since the program flashing authority is higher than the backup authority, when the program data is double-backed up, if a program flashing instruction is received, the flashing is performed based on the program to be flashed; if no program flashing instruction is received, the first backup program of the program to be flashed is backed up to the first program backup area of the external storage module, or the second backup program of the first backup program is backed up to the second program backup area of the external storage module.
[0056] On the basis of the above, when the first backup program of the program to be flashed is backed up to the first program backup area of the external storage module, after receiving the program flash instruction, the first timing time length is obtained; if the first timing time length is less than or equal to the first timing time threshold, it is determined whether to perform the flash operation, specifically: if it is determined to perform the flash operation, the flash is performed based on the program to be flashed; if it is determined not to perform the flash operation, the first backup program of the program to be flashed is continued to be backed up to the first program backup area of the external storage module; if the first timing time length is greater than the first timing time threshold, the flash is performed based on the program to be flashed.
[0057] Similarly, when backing up the second backup program of the program to be flashed to the second program backup area of the external storage module, after receiving the program flash instruction, the first timing time length is obtained; if the first timing time length is less than or equal to the first timing time threshold, it is determined whether to perform the flash operation, specifically: if it is determined to perform the flash operation, the flash is performed based on the program to be flashed; if it is determined not to perform the flash operation, the backup of the second backup program of the program to be flashed to the second program backup area of the external storage module continues; if the first timing time length is greater than the first timing time threshold, the flash is performed based on the program to be flashed.
[0058] S120. When the program to be flashed in the program storage area runs abnormally, according to the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program, determine to roll back the first backup program or the second backup program to the program storage area so as to flash based on the first backup program or the second backup program.
[0059] Among them, the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program can be calculated according to preset rules. Optionally, the program checksum, the first checksum, and the second checksum can be calculated and generated by the agreed key data and program identification code. This embodiment does not impose any restrictions on this.
[0060] Specifically, if the program checksum of the program to be flashed is consistent with the first checksum of the first backup program, the first backup program is rolled back to the program storage area; if the program checksum of the program to be flashed is inconsistent with the first checksum of the first backup program, after determining that the program checksum of the program to be flashed is consistent with the second checksum of the second backup program, the second backup program is rolled back to the program storage area.
[0061] On the basis of the above, since the program flashing permission is higher than the rollback permission, when it is determined to roll back the first backup program or the second backup program to the program storage area, after receiving the program flashing instruction, the second timing time length is obtained; if the second timing time length is less than or equal to the second timing time threshold, it is determined whether to perform the flashing operation; if the second timing time length is greater than the second timing time threshold, the flashing is performed based on the program to be flashed.
[0062] The technical solution of the embodiment of the present invention is that 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 first running time length, the first backup program of the program to be flashed is backed up to the first program backup area of the external storage module, and after the current driving cycle running time is greater than the second running time length, the second backup program of the first backup program is backed up to the second program backup area of the external storage module; when the program to be flashed in the program storage area runs abnormally, according to the program checksum of the program to be flashed, the first checksum of the first backup program and the second checksum of the second backup program, it is determined to roll back the first backup program or the second backup program to the program storage area, 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, realizes dual backup of program data, ensures the need for frequent flashing, and can roll back the complete program data to ensure the normal operation of the vehicle.
[0063] Embodiment 2
[0064] Figure 2 This is a flowchart of a program data double backup rollback method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment performs double backup of program data to provide an optional implementation method. Figure 2 As shown, the program data double backup rollback method includes:
[0065] S210, the program to be written in the program storage area is flashed.
[0066] S211, determine whether the running of the program to be flashed exceeds the first running time length, if so, execute step S212, if not, execute step S213.
[0067] The first running time length is a certain length of normal operation after the flashing of the program to be flashed is completed. The first running time length can be calibrated according to the actual situation of the vehicle. The optional first running time length can be 5s.
[0068] It can be known that if the program to be flashed can be controlled to run for more than the first running time length, the backup of the program to be flashed can be started.
[0069] 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.
[0070] S212: Determine whether a program flashing instruction is received, if so, execute step S214, if not, execute step S215.
[0071] 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.
[0072] S213: Roll back the first backup program or the second backup program to the program storage area, so as to perform flashing based on the first backup program or the second backup program.
[0073] Specifically, if the program to be flashed cannot be controlled to run for more than the first running time, it is considered that an operating problem occurs in the program to be flashed, and a rollback is performed directly, that is, the program data in the backup area is flashed to the program storage area. In this embodiment, the first backup program or the second backup program is rolled back to the program storage area, and is flashed based on the first backup program or the second backup program as the program to be flashed.
[0074] S214, flashing based on the program to be flashed.
[0075] Specifically, upon receiving a program flashing instruction, the flashing operation of the program to be flashed is executed.
[0076] S215 , backing up the first backup program of the program to be flashed to the first program backup area of the external storage module.
[0077] Specifically, if the program flashing instruction is not received, the first backup program of the program to be flashed can be backed up to the first program backup area of the external storage module.
[0078] S216. After receiving the program flashing instruction, obtain the first timing time length, and determine whether the first timing time length is less than or equal to the first timing time threshold. If so, execute step S217; if not, execute step S214.
[0079] The first timing time length is the timing time length that starts timing after receiving the program flashing instruction. The first timing time length can be collected by a timing device such as a timer, and this embodiment does not impose any limitation on this.
[0080] The first timing time threshold can be calibrated according to the actual situation of the vehicle, and this embodiment does not impose any limitation on this. Optionally, the first timing time threshold can be 10s.
[0081] Specifically, after receiving a program flash instruction during the dual backup of program data, a timer is started, and a selection is made within the first timing time length range according to whether to perform the flash operation. If the first timing time threshold is exceeded, the flash operation is performed by default. If it is not exceeded, it is determined whether to perform the flash operation.
[0082] S217: Determine whether to perform a flash operation, if yes, execute step S214, if no, execute step S218.
[0083] S218, continue to back up the first backup program of the program to be flashed to the first program backup area of the external storage module.
[0084] Specifically, after receiving the program flash instruction, the first timing time length is less than or equal to the first timing time threshold, and there is no need to perform a flash operation, then the first backup program of the program to be flashed continues to be backed up to the first program backup area of the external storage module until the first backup program is backed up to the first program backup area of the external storage module.
[0085] S219: Determine whether the current driving cycle running time is greater than the second running time length; if so, execute step S220; if not, execute step S213.
[0086] The current driving cycle running time is the timing time length of the current driving cycle timing. The current driving cycle running time can be collected by a timing device such as a timer, and this embodiment does not impose any limitation on this.
[0087] The second running time length can be calibrated according to the actual situation of the vehicle, and this embodiment does not impose any limitation on this. Optionally, the first timing time threshold can be 10 minutes.
[0088] S220, determine whether a program flashing instruction is received, if so, execute step S214, if not, execute step S221.
[0089] S221, backing up the second backup program of the first backup program to a second program backup area of an external storage module.
[0090] Specifically, if the program flashing instruction is not received, the second backup program of the program to be flashed can be backed up to the second program backup area of the external storage module.
[0091] S222. After receiving the program flashing instruction, obtain the first timing time length, and determine whether the first timing time length is less than or equal to the first timing time threshold. If so, execute step S223; if not, execute step S214.
[0092] S223, determine whether to perform a flash operation, if so, execute step S214, if not, execute step S224.
[0093] S224, continue to back up the second backup program of the program to be flashed to the second program backup area of the external storage module.
[0094] Specifically, after receiving the program flash instruction, the first timing time length is less than or equal to the first timing time threshold, and no flash operation is required, then the second backup program of the program to be flashed will continue to be backed up to the second program backup area of the external storage module until the second backup program is backed up to the second program backup area of the external storage module.
[0095] S225. 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 program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program, so as to flash based on the first backup program or the second backup program.
[0096] The technical solution of the embodiment of the present invention is to establish a first program backup area and a second program backup area of an external storage module, wherein the first program backup area backs up the program data to be flashed, and the second program backup area backs up the program data in the first program backup area, thereby avoiding the backup failure caused by another flash instruction during the backup process of the first program backup area, and at the same time ensuring that the program storage area can back up a complete program data that can operate normally, thereby ensuring that the vehicle can operate normally without being affected.
[0097] Embodiment 3
[0098] Figure 3This is a flowchart of a program data double backup rollback method provided in Embodiment 3 of the present invention. Based on the above embodiments, this embodiment performs program data rollback based on double backup program data, providing an optional implementation method. Figure 3 As shown, the program data double backup rollback method includes:
[0099] S310. 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 first running time, a first backup program of the program to be flashed is backed up to a first program backup area of an external storage module, and after the current driving cycle running time is greater than a second running time, a second backup program of the first backup program is backed up to a second program backup area of the external storage module.
[0100] S320: The program to be flashed in the program storage area runs abnormally.
[0101] S330, determining whether the program checksum of the program to be flashed is consistent with the first checksum of the first backup program, if so, executing step S341, if not, executing step S351.
[0102] It can be known that if the program to be flashed in the program storage area runs abnormally, the program data is rolled back from the first program backup area to the program storage area first. Before rolling back the program data, it is determined whether the program checksum of the program to be flashed is consistent with the first checksum of the first backup program in the first program backup area. That is, whether the first backup program in the first program backup area is a complete program data is determined by whether the checksums are consistent.
[0103] S341. Roll back the first backup program to the program storage area.
[0104] Specifically, if the program checksum of the program to be flashed is consistent with the first checksum of the first backup program, that is, the first backup program is complete program data, the first backup program can be rolled back to the program storage area.
[0105] S342: When rolling back the first backup program to the program storage area, obtaining a second timing time length after receiving a program flashing instruction.
[0106] Specifically, when the first backup program is rolled back to the program storage area, a prompt message "rolling back" is sent to the bus, and the second timing time length is obtained after receiving the program flashing instruction.
[0107] S343: Determine whether the second timing time length is less than or equal to the second timing time threshold, if so, execute step S344, if not, execute step S345.
[0108] The second timing time length is the timing time length for starting the timing after receiving the program flashing instruction. The second timing time length can be collected by a timing device such as a timer, and this embodiment does not impose any limitation on this.
[0109] The second timing time threshold can be calibrated according to the actual situation of the vehicle, and this embodiment does not impose any limitation on this. Optionally, the first timing time threshold can be 10s.
[0110] Specifically, after receiving a program flash instruction during the program data rollback process, a timer is started, and a selection is made within the second timing time length range according to whether to perform the flash operation. If the second timing time threshold is exceeded, the flash operation is performed by default. If it is not exceeded, it is determined whether to perform the flash operation.
[0111] S344, flashing based on the first backup program.
[0112] S345: Determine whether to perform a flash operation, if yes, execute step S344, if not, execute step S341.
[0113] S351, determine whether the program checksum of the program to be flashed is consistent with the second checksum of the second backup program, if so, execute step S352, if not, execute step S320.
[0114] Specifically, if the program checksum of the program to be flashed is inconsistent with the first checksum of the first backup program, that is, the first backup program is incomplete program data, then it is determined whether the second backup program in the second program backup area can be rolled back, specifically, whether the program checksum of the program to be flashed is consistent with the second checksum of the second backup program in the second program backup area.
[0115] S352: Roll back the second backup program to the program storage area.
[0116] S353: When rolling back the second backup program to the program storage area, obtaining a second timing time length after receiving a program flashing instruction.
[0117] Similarly, when the second backup program is rolled back to the program storage area, a prompt message "rolling back" is sent to the bus, and the second timing time length is obtained after receiving the program flashing instruction.
[0118] S354: Determine whether the second timing time length is less than or equal to the second timing time threshold, if so, execute step S355, if not, execute step S356.
[0119] S355, flashing based on the second backup program.
[0120] S356: Determine whether to perform a flash operation, if yes, execute step S355, if not, execute step S352.
[0121] The technical solution of the embodiment of the present invention is that when the program to be flashed in the program storage area runs abnormally, the program data of the first backup program in the first program backup area is rolled back first. When the first backup program in the first program backup area does not back up a complete program data, the program data of the second backup program in the second program backup area is rolled back, thereby ensuring that a complete program data can be rolled back. In addition, since the flashing authority is higher than the backup rollback authority, the phenomenon of waiting for the backup rollback during frequent flashing during the test verification process is avoided. When a flashing instruction is received, a timer is started, and a flashing operation is prompted to ensure the normal operation of the vehicle.
[0122] Embodiment 4
[0123] Figure 4 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 4 As shown, the program data double backup rollback device includes:
[0124] The data backup module 410 is used to back up a first backup program of the program to be flashed to a first 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 first running time length, and to back up a second backup program of the first backup program to a second program backup area of the external storage module after the running time of the current driving cycle is greater than a second running time length;
[0125] The data rollback module 420 is used to determine whether to roll back the first backup program or the second backup program to the program storage area when the program to be flashed in the program storage area runs abnormally, based on the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program, so as to flash based on the first backup program or the second backup program.
[0126] Optionally, the program data double backup rollback device further includes:
[0127] The program flashing module is used to execute, if the program to be flashed cannot be run for more than a first running time, rolling back the first backup program or the second backup program to the program storage area, so as to flash based on the first backup program or the second backup program.
[0128] Optionally, the program data double backup rollback device further includes:
[0129] A program flashing instruction module, used for executing, if a program flashing instruction is received, flashing based on the program to be flashed;
[0130] If the program flashing instruction is not received, the first backup program of the program to be flashed is backed up to the first program backup area of the external storage module, or the second backup program of the first backup program is backed up to the second program backup area of the external storage module.
[0131] Optionally, the program data double backup rollback device further includes:
[0132] A first timing judgment module is used to obtain a first timing time length after receiving a program flashing instruction;
[0133] If the first timing time length is less than or equal to the first timing time threshold, determining whether to perform a flash operation;
[0134] If the first timing time length is greater than the first timing time threshold, flashing is performed based on the program to be flashed.
[0135] Optionally, determine whether to perform a flash operation, specifically for:
[0136] If it is determined that a flash operation is to be performed, the flash operation is performed based on the program to be flashed;
[0137] If it is determined that the flashing operation is not to be performed, the first backup program of the program to be flashed is continued to be backed up to the first program backup area of the external storage module.
[0138] Optionally, determining to roll back the first backup program or the second backup program to the program storage area according to the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program is specifically used for:
[0139] If the program checksum of the program to be flashed is consistent with the first checksum of the first backup program, rolling back the first backup program to the program storage area;
[0140] If the program checksum of the program to be written is inconsistent with the first checksum of the first backup program, after determining that the program checksum of the program to be written is consistent with the second checksum of the second backup program, the second backup program is rolled back to the program storage area.
[0141] Optionally, the program data double backup rollback device further includes:
[0142] A second timing judgment module is used to obtain a second timing time length after receiving a program flashing instruction;
[0143] If the second timing time length is less than or equal to the second timing time threshold, determining whether to perform the flash operation;
[0144] If the second timing time length is greater than the second timing time threshold, flashing is performed based on the program to be flashed.
[0145] 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.
[0146] Embodiment 5
[0147] Figure 5 FIG. 5 is a schematic diagram showing a structure of a vehicle 510 that can be used to implement an embodiment of the present invention. Figure 5 As shown, the vehicle 510 includes at least one processor 511, and a memory connected to the at least one processor 511, such as a read-only memory (ROM 512), a random access memory (RAM 513), etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 511 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM 512) or the computer program loaded from the storage unit 518 to the random access memory (RAM 513). In RAM 513, various programs and data required for the operation of the vehicle 510 can also be stored. The processor 511, ROM 512 and RAM 513 are connected to each other through a bus 514. An I / O (input / output) interface 515 is also connected to the bus 514.
[0148] A number of components in the vehicle 510 are connected to the I / O interface 515, including: an input unit 516, such as a keyboard, a mouse, etc.; an output unit 517, such as various types of displays, speakers, etc.; a storage unit 518, such as a disk, an optical disk, etc.; and a communication unit 519, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 519 allows the vehicle 510 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0149] The processor 511 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 511 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 511 executes the various methods and processes described above, such as a program data double backup rollback method.
[0150] 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 518. In some embodiments, part or all of the computer program may be loaded and / or installed on the vehicle 510 via the ROM 512 and / or the communication unit 519. When the computer program is loaded into the RAM 513 and executed by the processor 511, one or more steps of the program data dual backup rollback method described above may be performed. Alternatively, in other embodiments, the processor 511 may be configured to execute the program data dual backup rollback method in any other appropriate manner (e.g., by means of firmware).
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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).
[0155] 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.
[0156] 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.
[0157] 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.
[0158] 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, characterized in that: include: After the program to be written in the program storage area is written and the program to be written is controlled to run for a first running time, a first backup program of the program to be written is backed up to a first program backup area of an external storage module, and after the current driving cycle running time is greater than a second running time, a second backup program of the first backup program is backed up to a second program backup area of the external storage module; When the program to be flashed in the program storage area runs abnormally, it is determined to roll back the first backup program or the second backup program to the program storage area according to the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program, so as 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, 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 first running time, the first backup program or the second backup program is rolled back to the program storage area to be flashed based on the first backup program or the second backup program.
3. The program data double backup rollback method according to claim 1, characterized in that: The program data double backup rollback method also includes: If a program flashing instruction is received, flashing is performed based on the program to be flashed; If the program flashing instruction is not received, the first backup program of the program to be flashed is backed up to the first program backup area of the external storage module, or the second backup program of the first backup program is backed up to the second program backup area of the external storage module.
4. The program data double backup rollback method according to claim 1, characterized in that: When backing up the first backup program of the program to be flashed to the first program backup area of the external storage module, the method further includes: After receiving the program flashing instruction, the first timing time length is obtained; If the first timing time length is less than or equal to the first timing time threshold, determining whether to perform a flash operation; If the first timing time length is greater than the first timing time threshold, flashing is performed based on the program to be flashed.
5. The program data double backup rollback method according to claim 4, characterized in that: Determine whether to perform a flash operation, including: If it is determined that a flashing operation is to be performed, flashing is performed based on the program to be flashed; If it is determined that the flashing operation is not to be performed, the first backup program of the program to be flashed is continued to be backed up to the first program backup area of the external storage module.
6. The program data double backup rollback method according to claim 1, characterized in that: Determining to roll back the first backup program or the second backup program to the program storage area according to the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program includes: If the program checksum of the program to be flashed is consistent with the first checksum of the first backup program, rolling back the first backup program to the program storage area; If the program checksum of the program to be written is inconsistent with the first checksum of the first backup program, after determining that the program checksum of the program to be written is consistent with the second checksum of the second backup program, the second backup program is rolled back to the program storage area.
7. The program data double backup rollback method according to claim 1, characterized in that: When determining to roll back the first backup program or the second backup program to the program storage area, the method further includes: After receiving the program flashing instruction, the second timing time length is obtained; If the second timing time length is less than or equal to the second timing time threshold, determining whether to perform a flash operation; If the second timing time length is greater than the second timing time threshold, flashing is performed based on the program to be flashed.
8. A program data double backup rollback system, characterized in that: include: a data backup module, configured to back up a first backup program of the program to be flashed to a first program backup area of an 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 first running time length, and to back up a second backup program of the first backup program to a second program backup area of the external storage module after the running time of a current driving cycle is greater than a second running time length; A data rollback module is used to determine whether to roll back the first backup program or the second backup program to the program storage area when the program to be flashed in the program storage area runs abnormally, based on the program checksum of the program to be flashed, the first checksum of the first backup program, and the second checksum of the second backup program, so as to flash based on the first backup program or the second backup program.
9. A vehicle, 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, 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.
