[go: up one dir, main page]

CN114489717B - A system upgrade method, device and system - Google Patents

A system upgrade method, device and system Download PDF

Info

Publication number
CN114489717B
CN114489717B CN202111643662.7A CN202111643662A CN114489717B CN 114489717 B CN114489717 B CN 114489717B CN 202111643662 A CN202111643662 A CN 202111643662A CN 114489717 B CN114489717 B CN 114489717B
Authority
CN
China
Prior art keywords
backup
task
upgrade
upgrading
image backup
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111643662.7A
Other languages
Chinese (zh)
Other versions
CN114489717A (en
Inventor
龙辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Thunder Software Technology Shenzhen Co ltd
Original Assignee
Thunder Software Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Thunder Software Technology Shenzhen Co ltd filed Critical Thunder Software Technology Shenzhen Co ltd
Priority to CN202111643662.7A priority Critical patent/CN114489717B/en
Publication of CN114489717A publication Critical patent/CN114489717A/en
Application granted granted Critical
Publication of CN114489717B publication Critical patent/CN114489717B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种系统升级方法、装置和系统。所述方法包括:基于进入recovery模式,建立镜像备份列表和升级任务列表;将系统升级包中包括的系统升级任务导入升级任务列表中,将每个升级任务与镜像备份列表中镜像备份对象关联;执行系统升级任务的过程中,将系统升级任务的差异性数据实时备份到关联的镜像备份对象中。在不增加分区和设备存储资源的情况下,实现可靠的系统升级,能有效地保证升级数据的完整性。

The present invention discloses a system upgrade method, device and system. The method comprises: based on entering recovery mode, establishing a mirror backup list and an upgrade task list; importing the system upgrade tasks included in the system upgrade package into the upgrade task list, and associating each upgrade task with the mirror backup object in the mirror backup list; in the process of executing the system upgrade task, backing up the differential data of the system upgrade task in real time to the associated mirror backup object. Without increasing partitions and device storage resources, a reliable system upgrade is achieved, and the integrity of the upgrade data can be effectively guaranteed.

Description

System upgrading method, device and system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a system for system upgrade.
Background
The terminal device of the internet of things generally adopts an Over-the-AirTechnology, OTA technology to upgrade the system firmware, and in order to ensure that the device can be started and operated normally after the system is upgraded, a plurality of necessary mechanisms are adopted in the upgrading process to avoid data errors in the upgrading process.
In the traditional OTA upgrading scheme under the single-partition Recovery mode, the integrity of data is verified by adopting a Hash data verification mode, namely, in the upgrading process, the data packet downloaded in the OTA mode is independently subjected to Hash verification so as to ensure the integrity of the data written in each partition. Although the Hash check is performed when data is written, and a rollback mechanism for part of non-critical partitions is added, in the upgrading process related to some important partitions (such as system partitions), if unexpected power failure or artificial forced interference occurs, the upgrade is pushed out, which will cause equipment upgrade errors, and system damage cannot be started.
In order to avoid the problems of the upgrade scheme, an upgrade scheme for improving the scheme, namely a backup recovery scheme based on an AB partition, is also presented in the prior art, and the scheme is characterized in that two independent partitions are opened by increasing the backup capability of the equipment from hardware, and the two independent partitions are not interfered with each other before and after the upgrade, so that the equipment can be recovered to a state before the upgrade under the condition of any error. Although the upgrade scheme based on the AB partition can effectively ensure that the equipment can be backed back to a version before upgrade in any state, the upgrade does not damage the equipment stability and cause equipment to crash, but the scheme is necessary to rely on the improvement of hardware resources, has higher requirements on the storage, memory and CPU processing performance of the equipment, has the requirement of at least 2 times that of the equipment in the case of the non-AB partition, is not suitable for the terminal equipment of the Internet of things with high requirements on large-scale application and cost control, and particularly has low universality in the Internet of things system with a large number of deployed non-AB terminal equipment, and the hardware is necessary to be changed to carry out systematic upgrade to support the AB scheme.
In summary, from the existing system upgrade scheme, for the low-end internet of things terminal device, there is no reliable OTA upgrade scheme without increasing partition and storage resources, so that the integrity of data written into the device in the OTA upgrade process can be ensured under any external interference.
Disclosure of Invention
The present invention has been made in view of the above problems, and it is an object of the present invention to provide a system upgrade method, apparatus and system that overcomes or at least partially solves the above problems.
The embodiment of the invention provides a system upgrading method, which comprises the following steps:
Establishing a mirror image backup list and an upgrade task list based on entering a recovery mode;
Importing system upgrading tasks included in a system upgrading packet into an upgrading task list, and associating each upgrading task with an image backup object in an image backup list;
and in the process of executing the system upgrading task, the differential data of the system upgrading task is backed up to the associated mirror image backup object in real time.
In some alternative embodiments, the establishing the mirror backup list and the upgrade task list includes:
Constructing a mirror image backup list comprising at least one mirror image backup object, wherein the length of the mirror image backup list is the number of partitions, the size of the mirror image backup list is determined based on the difference data of the partitions, and each mirror image backup object comprises a mirror image backup name, a partition name and a physical address of the mirror image backup;
and constructing an upgrade task list comprising a plurality of upgrade tasks, wherein the upgrade task list comprises task IDs, partition names to which the tasks belong, associated mirror image backup objects and backup grades of the tasks.
In some alternative embodiments, the associating each upgrade task with a mirrored backup object in a mirrored backup list includes:
Detecting idle mirror image backup objects in the mirror image backup list, and associating the mirror image backup objects in the mirror image backup list for each upgrading task based on the number of the idle mirror image backup objects being not less than the number of the upgrading tasks;
Based on the fact that the number of idle mirror image backup objects is smaller than the number of upgrading tasks, the mirror image backup objects are associated with the upgrading tasks with the previous execution sequence according to the execution sequence of the upgrading tasks each time until the mirror image backup objects are associated with each upgrading task.
In some optional embodiments, the process of performing the system upgrade task further includes:
monitoring the execution condition of the upgrade task in real time, determining to keep or delete the backup data in the corresponding mirror image backup object according to the backup level of the task and the execution condition of the task, and/or
When an abnormality occurs, backup data is acquired from the corresponding mirror image backup object according to the currently executed task information, and system key data is restored based on the acquired backup data.
In some optional embodiments, the determining to keep or delete the backup data in the corresponding mirror backup object according to the backup level of the task and the execution condition of the task includes:
based on the backup grade of the task as a first grade, deleting backup data in the corresponding mirror image backup object after the upgrading task of the current partition is completed;
Based on the backup grade of the task as a second grade, deleting backup data in the corresponding mirror image backup object after the currently executed upgrading task is completed;
And maintaining the backup data in all mirror image backup objects in the system upgrading process based on the backup level of the task as a third level until the system is successfully upgraded, and deleting the backup data.
In some alternative embodiments, before establishing the mirror backup list and the upgrade task list based on entering the recovery mode, the method further includes:
Acquiring a system upgrade package;
carrying out integrity check on the system upgrade package;
And enabling the device to enter a recovery mode based on the verification passing and restarting the device.
In some optional embodiments, the establishing the mirror backup list and the upgrade task list based on entering the recovery mode includes:
based on entering a recovery mode, reading a recovery mark and a preset mark supporting image backup upgrade;
And establishing an image backup list and an upgrading task list based on the read recovery mark and the mark supporting image backup upgrading.
In some alternative embodiments, the method further comprises:
when the system is initially installed or the system is upgraded for the first time, a mark supporting the image backup upgrade is set.
The embodiment of the invention provides a system upgrading device, which comprises:
The virtual backup system VBS module is used for establishing a mirror image backup list based on entering a recovery mode;
The data protection strategy module DPSM is used for establishing an upgrade task list based on entering a recovery mode;
And the execution module is used for importing the system upgrading tasks included in the system upgrading packet into an upgrading task list, associating each upgrading task with the mirror image backup object in the mirror image backup list, and backing up the differential data of the system upgrading tasks to the associated mirror image backup object in real time in the process of executing the system upgrading tasks.
The embodiment of the invention also provides an Internet of things system, which comprises terminal equipment and a server;
the system upgrading device is arranged in the terminal equipment;
the server is used for pushing the system upgrade package to the terminal equipment.
The embodiment of the invention also provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions realize the system upgrading method when being executed by a processor.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
When the system is upgraded by the system upgrading package, the mirror image backup objects in the mirror image backup list are associated for each upgrading task, the differential data of the system upgrading task are backed up to the associated mirror image backup objects in real time in the process of executing the system upgrading task, the differential data of the upgrading task are backed up and stored by the associated mirror image backup objects, and when the abnormality occurs in the upgrading process, the critical data of the system can be recovered by the backed up data at any time to ensure the integrity of the data in the system upgrading process, avoid the phenomena of dead halt, downtime and the like in the system upgrading process, realize safe and reliable system upgrading without increasing the partition and the storage resources of the equipment under the condition of not increasing the partition, and have strong applicability to the large-scale deployed internet of things equipment.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
The technical scheme of the invention is further described in detail through the drawings and the embodiments.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention. In the drawings:
FIG. 1 is a flowchart of a system upgrade method according to a first embodiment of the present invention;
FIG. 2 is a system upgrade flowchart of a preset upgrade flag in a second embodiment of the present invention;
FIG. 3 is a flowchart of a system upgrade based on mirror backup in a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a system upgrade apparatus according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to solve the problem that in the prior art, an unreliable OTA system upgrading scheme is not available in the process of upgrading the system of the terminal equipment of the Internet of things, and the integrity of data of the writing equipment cannot be effectively guaranteed, the embodiment of the invention provides a system upgrading method, which is used for realizing system upgrading based on a mirror image backup mechanism and an intelligent upgrading control strategy, and can realize safe and reliable system upgrading without increasing partition and hardware storage resources and guaranteeing the integrity of upgrading data. The integrity protection of the upgrade data generally refers to the integrity of the data during the process of transmitting and writing the upgrade data into the device, and the guarantee of the integrity of the upgrade data generally refers to the guarantee of the consistency of the data written into the device and the data on the OTA server.
Example 1
The first embodiment of the invention provides a system upgrading method, the flow of which is shown in fig. 1, comprising the following steps:
And step S101, establishing a mirror image backup list and an upgrade task list based on entering a recovery mode.
Before entering the recovery mode, the OTA can be adopted to download a system upgrade package, and carry out integrity check on the system upgrade package, and based on the check passing, the equipment is restarted, so that the equipment enters the recovery mode.
In the method provided by the embodiment, after the equipment enters the recovery mode, a mirror image backup list and an upgrade task list are established to realize a mirror image backup strategy and an intelligent upgrade strategy. The pre-built mirror image backup list and the upgrade task list can be initialized, and a new mirror image backup list and an upgrade task list can be built after the recovery mode is entered.
The data backup and management in the upgrading process are realized through the mirror image backup list, and the mirror image backup list comprising at least one mirror image backup object can be constructed, wherein the length of the mirror image backup list is the number of partitions, the size of the mirror image backup list is determined based on the difference data of the partitions, and each mirror image backup object comprises a mirror image backup name, a partition name and a physical address of the mirror image backup.
The data backup of the upgrade task is realized by managing the upgrade task through the upgrade task list and associating the image backup object in the image backup list, and the upgrade task list comprising a plurality of upgrade tasks can be constructed, wherein the upgrade task list comprises a task ID, a partition name to which the task belongs, an associated image backup object and a backup grade of the task.
Step S102, importing the system upgrading task included in the system upgrading packet into an upgrading task list, and associating each upgrading task with the image backup object in the image backup list.
After initializing the upgrade task list and the mirror image backup list, decompressing the system upgrade package, and importing the system upgrade task in the system upgrade package into the initialized upgrade task list. And then according to the mirror image backup objects in the mirror image backup list for each upgrading task, carrying out data backup through the mirror image backup objects. When the mirror image backup object is associated for upgrading the task, the idle available mirror image backup object is selected for association, and the idle mirror image backup object can be monitored and detected in real time.
Step S103, in the process of executing the system upgrading task, the differential data of the system upgrading task is backed up to the associated mirror image backup object in real time.
In the process of executing the system upgrading task, the data to be modified is mirror backed up to the corresponding mirror backup object, when an abnormality occurs, the abnormal task can be locked quickly, the mirror backed up data is obtained from the corresponding mirror backup object according to the task information in the task list, and all the recoverable critical data are recovered by using the backed up data, so that the equipment is ensured not to be halted and down or have the problems of upgrading interruption, failure and the like due to the abnormality.
In the method of the embodiment, when the equipment system is upgraded, a system upgrade package is downloaded, after the equipment enters a recovery mode, an image backup list and an upgrade task list are established, when the system is upgraded by the system upgrade package, the image backup objects in the image backup list are associated with each upgrade task, in the process of executing the system upgrade task, the differential data of the system upgrade task are backed up to the associated image backup objects in real time, when the abnormality occurs in the upgrade process, the critical data of the system can be recovered at any time by the backed-up data, so that the integrity of the data in the system upgrade process is ensured, the phenomena of dead halt, downtime and the like in the system upgrade process are avoided, and the safe and reliable system upgrade is realized by the image backup mechanism established in the upgrade process and the adopted intelligent control strategy of the upgrade task under the condition that the partition is not increased and the storage resource of the equipment is not increased, the system upgrade is suitable for large-scale application, the equipment cost is not increased, the system upgrade method can also be suitable for the Internet of things equipment which is deployed in a large scale, and the universality is strong.
In some optional embodiments, the method may be considered that the system supports an image backup upgrade mode, so that after the system upgrade package is obtained, the method is directly executed, in some optional embodiments, for some devices that do not support or do not determine whether to support the image backup upgrade scheme, an image backup upgrade support flag may be preset in a mis partition when the system is initially installed or the system is first upgraded, and in a subsequent system upgrade process, when the system is determined to support the image backup upgrade scheme by reading the image backup upgrade support flag, the upgrade scheme is executed.
Example two
The second embodiment of the present invention provides a specific implementation manner of the system upgrade method, which is described by taking an example that a flag supporting an image backup upgrade is not written when a device presets a system. In this case, a flag supporting the image backup upgrade may be written at the time of the first system upgrade. In this case, the flow of the first system upgrade and the flow of the subsequent system upgrade are different, and are described below.
As shown in fig. 2, the first system upgrade process, that is, the system upgrade process of presetting a flag supporting an image backup upgrade, includes the following steps:
step S201, starting OTA and downloading a system upgrade package.
The system upgrade package downloaded here is a system upgrade package with support for the image backup upgrade algorithm, such as an updata. Zip file.
Step S202, HASH checking is carried out on the system upgrade package, and the integrity of the data package is checked.
Step S203, if the verification is passed, executing step S204, otherwise executing step S207.
Step S204, upgrading the system based on entering a recovery mode.
And when the system is upgraded, saving the recovery partition information which needs to be updated to the equipment, and writing an upgrade recovery partition mark into the MIsc partition. Generally, a bootstrap loader control block (Bootloader Control Block, BCB) is located in a mis partition of the device, and is mainly used for storing Recovery boot information.
Step S205, whether the upgrade is successful in the recovery mode. If yes, step S206 is performed, otherwise step S207 is performed.
And S206, restarting the equipment after the successful system upgrade, finishing the system upgrade, and writing a mark supporting the image backup upgrade into the MIsc partition.
And the device reads an upgrade recovery partition mark in the MIsc partition in the starting process, finishes the upgrade and update of the recovery partition, writes the mark supporting the image backup upgrade into a designated position of the MIsc partition after finishing the upgrade and update of the recovery partition, and can judge whether the image backup upgrade mode is supported or not by detecting the mark in the subsequent starting process.
Optionally, after restarting the device, it is determined whether to upgrade the recovery partition, if yes, the recovery partition is updated, a flag supporting the image backup upgrade is written to the specified location of the risc partition, otherwise, step S207 is executed.
Step S207, reporting errors and writing the error reporting information into a log (log).
The above-mentioned process of first upgrade is carried out on the system which does not support the image backup upgrade mode originally, so that the upgrade in the traditional recovery mode can be compatible, the recovery partition of the internet of things equipment can be upgraded, and the upgraded system can support the image backup upgrade mode.
Fig. 3 shows a subsequent system upgrade process, that is, a system upgrade process based on mirror backup, which includes the following steps:
Step S301, starting OTA and downloading a system upgrade package.
The OTA is used to download the system upgrade package, such as image file update.
And S302, carrying out integrity check on the system upgrade package.
And carrying out HASH verification on the system upgrade package, checking the integrity of the data package, and executing the subsequent steps after the verification is passed. If the verification fails, the verification can be downloaded again or processed by adopting other traditional processing modes.
Step S303, restarting the device and entering a recovery mode.
And step S304, reading a recovery mark and a preset mark supporting image backup upgrade based on entering a recovery mode.
The recovery flag and the flag supporting the image backup upgrade are read from the misc partition. If the recovery flag and the flag supporting the image backup upgrade are read, it is confirmed that the device supports the image backup upgrade mode, and step S305 may be executed to enter the image backup upgrade mode.
If the flag supporting the image backup upgrade is not read, the device is considered to not support the image backup upgrade mode, and the upgrade can be performed in a conventional manner, which is not described herein.
Step S305, based on the read recovery flag and the flag supporting image backup upgrade, an image backup list and an upgrade task list are established.
Referring to step S102, after obtaining the flag supporting the image backup upgrade and confirming that the system supports the image backup upgrade mode, loading a system upgrade package, and establishing an image backup list and an upgrade task list. The mirror backup and intelligent upgrade policies may be implemented specifically by a virtual backup system (vitrual backup system, VBS) module and a data protection policy module (Data Protection Strategy Module, DPSM), where the creation of the mirror backup list and upgrade task list is implemented by initializing the VBS module and the DPSM. VBS is the virtual backup subsystem based on the partition bottom layer in the recovery mode, and DPSM is a module for realizing the OTA upgrade data protection strategy in the recovery mode.
The VBS module is initialized, specifically, a VBS partition key data small block (patch) mirror backup List is initialized, wherein list_ pkm =new { Lpkm _n } (n <16, lpkm_n= mirro _size, max (mirro _size) =1k, lpkm_n= { name, addr }). That is, a mirror image backup list with the length of the partition number n and the size of the minor_size is built in the VBS module according to the partition table, mirro _size is the size of a compressed difference small block (DIFF PATCH) of a corresponding partition block (block) calculated based on a difference algorithm, a maximum limit value, such as 1k or other sizes, may be set, and each mirror image backup object Lpkm _n includes parameters including a mirror image backup name (name), a partition name, and a mirro backup physical address (may be represented by addr).
Initializing a DPSM, wherein the module is mainly responsible for policy execution, and executes related policies according to an added upgrade task (task), an upgrade task List is constructed in the initialization process, wherein Tn= { ID, partition_name, sub_id, list_ pkm _name and grade }, n <16, ID represents the ID of the upgrade task, partition_name represents the name of a partition to which the task belongs, sub_id represents the task ID of the partition to which the task belongs, list_ pkm _name represents the mirror image backup object in an associated VBS module, grade represents the backup grade of the task, for example, grade is 3 at most, represents that backup protection is required until the upgrade is successfully started, grade 2 represents that data in the corresponding mirror image backup object in the VBS can be destroyed after the current task is completed, and grade 1 represents that data in the corresponding mirror image backup object in the VBS can be destroyed after the upgrade task of the current partition is completed. Different backup levels can be set for different partitions, for example, the partition system, dtbo, boot, and kernel levels are up to 3, which means that backup protection is required until the upgrade is successfully started, and the backup level of each partition can be configured, for example, default initialization is 2,2 means that the mirror image backup data backed up in the VBS can be destroyed after the current task is completed, and 1 means that the mirror image backup data backed up in the VBS can be destroyed after the current sub_id task is completed.
Step S306, the system upgrade tasks included in the system upgrade package are imported into the upgrade task list, and each upgrade task is associated with the image backup object in the image backup list.
The method comprises the steps that a system upgrade package is decompressed, upgrade tasks (tasks) are imported into an upgrade task List of a DPSM, the upgrade task List is initialized and constructed according to upgrade task information specified in the system upgrade package, after the initialization of the List task is completed, the DPSM associates a VBS mirror image backup object for each upgrade task, and idle and available VBS objects are automatically searched.
That is, when the image backup objects are associated with the upgrade tasks, the idle image backup objects can be selected, specifically, the idle image backup objects in the image backup list are detected, the image backup objects in the image backup list are associated with each upgrade task based on that the number of the idle image backup objects is not less than the number of the upgrade tasks, the image backup objects are associated with the upgrade tasks with the previous execution sequence according to the execution sequence of the upgrade tasks each time based on that the number of the idle image backup objects is less than the number of the upgrade tasks, and the idle image backup objects are continuously detected until the image backup objects are associated with each upgrade task.
Step S307, executing the system upgrade task.
And upgrading the system according to the upgrading task specified by the script in the system upgrading packet.
And step 308, in the process of executing the system upgrading task, the differential data of the system upgrading task is backed up to the associated mirror image backup object in real time.
According to a backup grade (grade) control strategy in the DPSM, when an upgrade task is executed, a data image needing to be modified is backed up to a VBS object corresponding to a protection partition, meanwhile, the execution of the upgrade task is monitored in real time, whether the data image backup is removed from the image backup object of the VBS or reserved to the next block or the whole equipment is upgraded is determined according to the backup grade control strategy, and the process execution is executed in parallel by an independent thread step S307 until the upgrade is finished.
That is, the following is true. In the process of executing the upgrade task, key data in the upgrade process can be backed up in real time, and backup data in the mirror image backup partition can be reserved or removed according to a preset backup level. Specifically, the execution condition of the upgrade task can be monitored in real time, and the backup data in the corresponding mirror image backup object is ensured to be reserved or deleted according to the backup grade of the task and the execution condition of the task. The backup data in the corresponding mirror image backup object is deleted after the upgrading task of the current partition is completed based on the first grade of the backup grade of the task, the backup data in the corresponding mirror image backup object is deleted after the upgrading task of the current execution is completed based on the second grade of the backup grade of the task, and the backup data in all the mirror image backup objects is reserved in the system upgrading process based on the third grade of the backup grade of the task until the system is successfully upgraded.
Step S309, if an abnormality occurs in the system upgrade process.
Step S310, backup data is acquired from the corresponding mirror image backup object according to the currently executed task information, and system key data is restored based on the acquired backup data.
When an abnormality occurs in the system upgrading process, the DPSM can lock an abnormal task, and then all the recoverable key data are recovered from the VBS according to the task information in the upgrading task list so as to ensure that the equipment cannot be halted.
Step S311, finishing the upgrade and restarting the equipment.
When the upgrade is completed, corresponding information can be written in the MIsc partition according to the upgrade state of the system and the sign information in the VBS, and the equipment is restarted to complete the upgrade.
According to the method, key data mirror protection is achieved based on an intelligent strategy in the upgrading process, the method is based on an OTA system upgrading scheme in a traditional single-partition recovery mode, the recovery partition of upgrading equipment is upgraded for the first time through a traditional OTA upgrading mode, the equipment recovery partition upgrading processing program is updated to support the OTA system upgrading scheme provided by the scheme, after the first upgrading and updating are completed, the equipment enters the recovery mode again to be upgraded, and the OTA upgrading scheme supporting the mirror backup strategy is executed to upgrade the system.
Based on the same inventive concept, an embodiment of the present invention further provides a system upgrade apparatus, where the apparatus may be disposed in a terminal device, and the apparatus has a structure as shown in fig. 4, and includes:
A Virtual Backup System (VBS) module 11, configured to establish a mirror backup list based on entering a recovery mode;
a data protection policy module (DPSM) 12 for establishing an upgrade task list based on entering a recovery mode;
And the execution module 13 is used for importing the system upgrading tasks included in the system upgrading packet into an upgrading task list, associating each upgrading task with the mirror image backup object in the mirror image backup list, and backing up the differential data of the system upgrading tasks to the associated mirror image backup object in real time in the process of executing the system upgrading tasks.
Optionally, the VBS module 11 is specifically configured to construct a mirror backup list including at least one mirror backup object, where the length of the mirror backup list is the number of partitions, and the size of the mirror backup list is determined based on the difference data of the partitions, and each mirror backup object includes a mirror backup name, a partition name, and a physical address of the mirror backup;
Optionally, the DPSM12 is specifically configured to construct an upgrade task list including a plurality of upgrade tasks, where the upgrade task list includes a task ID, a partition name to which the task belongs, an associated mirror backup object, and a backup level of the task.
Optionally, the executing module 13 is specifically configured to detect idle image backup objects in the image backup list, associate the image backup objects in the image backup list for each upgrade task based on the number of idle image backup objects being not less than the number of upgrade tasks, and associate the image backup objects for the upgrade task with each previous execution sequence according to the execution sequence of the upgrade tasks each time based on the number of idle image backup objects being less than the number of upgrade tasks until the image backup objects are associated for each upgrade task.
Optionally, the execution module 13 is further configured to monitor the execution condition of the upgrade task in real time, determine to keep or delete the backup data in the corresponding mirror image backup object according to the backup level of the task and the execution condition of the task, and/or obtain the backup data from the corresponding mirror image backup object according to the task information currently executed when an abnormality occurs, and reply the key data of the system based on the obtained backup data.
Optionally, the executing module 13 is specifically configured to delete the backup data in the corresponding mirror image backup object after the task is upgraded based on the task with the first level, delete the backup data in the corresponding mirror image backup object after the task is upgraded based on the task with the second level, delete the backup data in the corresponding mirror image backup object after the task is upgraded, and retain the backup data in all the mirror image backup objects in the system upgrading process until the system is upgraded successfully based on the task with the third level.
Optionally, the system upgrade device further comprises an OTA module 14, which is further configured to obtain a system upgrade package before the mirror image backup list and the upgrade task list are established based on entering the recovery mode, perform integrity check on the system upgrade package, and restart the device based on the check, so that the device enters the recovery mode.
The execution module 13 is further configured to read a recovery flag and a preset flag supporting image backup upgrade based on entering a recovery mode, and the VBS module is correspondingly configured to establish an image backup list based on the execution module reading the recovery flag and the flag supporting image backup upgrade, and the DPSM module is specifically configured to establish an upgrade task list based on the execution module reading the recovery flag and the flag supporting image backup upgrade.
Optionally, the executing module 13 is further configured to set a flag supporting the image backup upgrade when the system is initially installed or the system is first upgraded, and may preset a flag supporting the image backup upgrade in the misc partition.
The embodiment of the invention also provides an Internet of things system, which comprises terminal equipment and a server;
The terminal equipment is provided with the system upgrading device;
and the server is used for pushing the system upgrade package to the terminal equipment.
The embodiment of the invention also provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions realize the system upgrading method according to any one of claims 1-7 when being executed by a processor.
The specific manner in which the respective modules perform the operations in the system upgrade apparatus in the above-described embodiments has been described in detail in the embodiments related to the method, and will not be described in detail herein.
The method and the device of the embodiment of the invention can be applied to the OTA system upgrading process of the intelligent terminal equipment of the Internet of things to realize the integrity protection of the upgraded data, and the OT system A upgrading technology used in the intelligent terminal of the Internet of things at present usually carries out hash check after the OTA system upgrading packet is downloaded to the equipment end and in the writing process so as to ensure the integrity of the data, but the method can only judge after the downloading or before the writing is finished, can not ensure the integrity of the upgraded data, and causes the probability that partial data is lost or wrong after the OTA system upgrading is finished, and even the equipment cannot be started up by the damaged equipment on some system key data.
According to the method, on the basis of the traditional recovery single-partition OTA system upgrading, the key data mirror protection and intelligent strategy synchronization scheme is introduced, the low-end intelligent terminal equipment of the Internet of things, which is arranged in a large quantity, of the existing Internet of things system can be used, the process shown in the figure 2 is adopted for upgrading only when the currently installed system is upgraded for the first time, the process shown in the figure 3 can be adopted for upgrading when the system is upgraded subsequently, the integrity of data in the OTA system upgrading process can be effectively ensured, the problem of system halt caused by data errors in the OTA system upgrading process can be effectively resisted, when the system is upgraded to the equipment by using the method, the updating of the OTA system can be stopped at any time in the process of updating any partition under the condition of single partition, the key data recovery can not be damaged, any error in the process of the equipment in the upgrading process can be recovered in the next time, the data integrity of the equipment in the OTA system upgrading process can be ensured, and the problem of equipment upgrading failure and halt caused by accidental interruption or damage can be avoided.
The method has the characteristic of usability, introduces a key data mirror protection and intelligent strategy synchronization scheme, realizes data integrity protection with extremely low hardware overhead cost, avoids equipment upgrade failure and halt caused by accidental interruption or damage of upgrade, is compatible with the traditional OTA system upgrade scheme in a single-partition recovery mode, does not need to modify the original OTA scheme of the Internet of things system in a low-end Internet of things terminal system, and can be updated in an OTA mode so that all equipment supports the OTA system upgrade scheme provided by the application.
The method has the characteristics of simplicity in integration and good compatibility, can be compatible with the traditional OTA system upgrading scheme in the single-partition recovery mode, can conveniently realize the upgrading mode supporting the application through the traditional OTA system upgrading mode, is applied to terminal equipment of an Internet of things system, realizes the reinforcement of the traditional OTA system upgrading scheme of the Internet of things terminal system in a low-cost mode, is more stable than the traditional OTA system upgrading scheme in the single-partition recovery mode, can effectively avoid the problems that the data is abnormally halted and cannot be recovered in equipment upgrading, improves the robustness of the OTA system upgrading, has wide application prospect and deep commercial value, and particularly can also comprise the following beneficial effects and scenes:
In the Internet of things system of the low-end terminal equipment, the stability of the OTA equipment upgrading can be effectively improved by applying the scheme, and the problem of data damage and halt in the equipment upgrading process is avoided.
The method has low updating cost, can realize the deployment of the scheme by the traditional OTA system updating mode without changing hardware, and improves the stability and reliability of the updating of the OTA system of the terminal equipment of the whole Internet of things system.
The hardware configuration requirement is low, the scheme can be deployed on most of low-end internet of things intelligent terminal platforms, and compared with an AB (analog to digital) upgrading scheme, the cost performance is higher.
The method greatly improves the stability of the Internet of things system constructed by the low-end intelligent equipment in the upgrading process of the OTA system, enhances the reliability and stability of the OTA system upgrading of the terminal equipment by rapidly deploying the system under the condition of not changing hardware, ensures the data integrity of the OTA system upgrading equipment, and avoids the occurrence of dead halt due to abnormal data after the upgrading.
Unless specifically stated otherwise, terms such as processing, computing, calculating, determining, displaying, or the like, may refer to an action and/or process of one or more processing or computing systems, or similar devices, that manipulates and transforms data represented as physical (e.g., electronic) quantities within the processing system's registers or memories into other data similarly represented as physical quantities within the processing system's memories, registers or other such information storage, transmission or display devices. Information and signals may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that may be referenced throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.
It should be understood that the specific order or hierarchy of steps in the processes disclosed are examples of exemplary approaches. Based on design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy presented.
In the foregoing detailed description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, invention lies in less than all features of a single disclosed embodiment. Thus the following claims are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate preferred embodiment of this invention.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. The processor and the storage medium may reside as discrete components in a user terminal.
For a software implementation, the techniques described in this disclosure may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. These software codes may be stored in memory units and executed by processors. The memory unit may be implemented within the processor or external to the processor, in which case it can be communicatively coupled to the processor via various means as is known in the art.
The foregoing description includes examples of one or more embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the aforementioned embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of various embodiments are possible. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, as used in the specification or claims, the term "comprising" is intended to be inclusive in a manner similar to the term "comprising," as interpreted when employed as a transitional word in a claim. Furthermore, any use of the term "or" in the specification of the claims is intended to mean "non-exclusive or".

Claims (9)

1. A system upgrade method, comprising:
Establishing a mirror image backup list and an upgrade task list based on entering a recovery mode;
Importing system upgrading tasks included in a system upgrading packet into an upgrading task list, and associating each upgrading task with an image backup object in an image backup list;
In the process of executing the system upgrading task, the differential data of the system upgrading task is backed up to an associated mirror image backup object in real time;
The associating each upgrade task with the mirror backup object in the mirror backup list includes:
Detecting idle mirror image backup objects in the mirror image backup list, and associating the mirror image backup objects in the mirror image backup list for each upgrading task based on the number of the idle mirror image backup objects being not less than the number of the upgrading tasks;
Based on the fact that the number of idle mirror image backup objects is smaller than the number of upgrading tasks, the mirror image backup objects are associated with the upgrading tasks with the previous execution sequence according to the execution sequence of the upgrading tasks each time until the mirror image backup objects are associated with each upgrading task.
2. The method of claim 1, wherein establishing the mirrored backup list and the upgrade task list comprises:
Constructing a mirror image backup list comprising at least one mirror image backup object, wherein the length of the mirror image backup list is the number of partitions, the size of the mirror image backup list is determined based on the difference data of the partitions, and each mirror image backup object comprises a mirror image backup name, a partition name and a physical address of the mirror image backup;
and constructing an upgrade task list comprising a plurality of upgrade tasks, wherein the upgrade task list comprises task IDs, partition names to which the tasks belong, associated mirror image backup objects and backup grades of the tasks.
3. The method of claim 1, wherein the performing the system upgrade task further comprises:
monitoring the execution condition of the upgrade task in real time, determining to keep or delete the backup data in the corresponding mirror image backup object according to the backup level of the task and the execution condition of the task, and/or
When an abnormality occurs, backup data is acquired from the corresponding mirror image backup object according to the currently executed task information, and system key data is restored based on the acquired backup data.
4. The method as set forth in claim 3, wherein the determining to keep or delete the backup data in the corresponding mirrored backup object according to the backup level of the task and the execution condition of the task includes:
based on the backup grade of the task as a first grade, deleting backup data in the corresponding mirror image backup object after the upgrading task of the current partition is completed;
Based on the backup grade of the task as a second grade, deleting backup data in the corresponding mirror image backup object after the currently executed upgrading task is completed;
And maintaining the backup data in all mirror image backup objects in the system upgrading process based on the backup level of the task as a third level until the system is successfully upgraded, and deleting the backup data.
5. The method of any one of claim 1 to 4,
Before establishing the mirror image backup list and the upgrade task list based on entering the recovery mode, the method further comprises the following steps:
Acquiring a system upgrade package;
carrying out integrity check on the system upgrade package;
Based on the verification passing, restarting the device to enable the device to enter a recovery mode;
And/or
The establishing a mirror image backup list and an upgrade task list based on entering a recovery mode comprises:
based on entering a recovery mode, reading a recovery mark and a preset mark supporting image backup upgrade;
And establishing an image backup list and an upgrading task list based on the read recovery mark and the mark supporting image backup upgrading.
6. The method of any one of claims 1-4, further comprising:
when the system is initially installed or the system is upgraded for the first time, a mark supporting the image backup upgrade is set.
7. A system upgrade apparatus, comprising:
The virtual backup system VBS module is used for establishing a mirror image backup list based on entering a recovery mode;
The data protection strategy module DPSM is used for establishing an upgrade task list based on entering a recovery mode;
The system upgrading module is used for importing the system upgrading tasks included in the system upgrading package into an upgrading task list and associating each upgrading task with an image backup object in the image backup list;
The associating each upgrade task with the mirror backup object in the mirror backup list includes:
Detecting idle mirror image backup objects in the mirror image backup list, and associating the mirror image backup objects in the mirror image backup list for each upgrading task based on the number of the idle mirror image backup objects being not less than the number of the upgrading tasks;
Based on the fact that the number of idle mirror image backup objects is smaller than the number of upgrading tasks, the mirror image backup objects are associated with the upgrading tasks with the previous execution sequence according to the execution sequence of the upgrading tasks each time until the mirror image backup objects are associated with each upgrading task.
8. An internet of things system comprises terminal equipment and a server;
the system upgrading device according to claim 7 is arranged in the terminal equipment;
the server is used for pushing the system upgrade package to the terminal equipment.
9. A computer storage medium having stored therein computer executable instructions which when executed by a processor implement the system upgrade method of any one of claims 1-6.
CN202111643662.7A 2021-12-29 2021-12-29 A system upgrade method, device and system Active CN114489717B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111643662.7A CN114489717B (en) 2021-12-29 2021-12-29 A system upgrade method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111643662.7A CN114489717B (en) 2021-12-29 2021-12-29 A system upgrade method, device and system

Publications (2)

Publication Number Publication Date
CN114489717A CN114489717A (en) 2022-05-13
CN114489717B true CN114489717B (en) 2025-04-22

Family

ID=81508635

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111643662.7A Active CN114489717B (en) 2021-12-29 2021-12-29 A system upgrade method, device and system

Country Status (1)

Country Link
CN (1) CN114489717B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572229A (en) * 2015-02-12 2015-04-29 西安诺瓦电子科技有限公司 Firmware upgrade method and firmware upgrade device for embedded system
CN106201773A (en) * 2016-06-24 2016-12-07 北京海誉动想科技股份有限公司 The upgrading of instance system, cloud system and instance system or restoration methods

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182103A (en) * 2015-01-19 2018-06-19 青岛海信宽带多媒体技术有限公司 A kind of method that user interface is generated under upgrade mode
CN106663016A (en) * 2015-05-15 2017-05-10 华为技术有限公司 Upgrade method, apparatus and device for terminal device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572229A (en) * 2015-02-12 2015-04-29 西安诺瓦电子科技有限公司 Firmware upgrade method and firmware upgrade device for embedded system
CN106201773A (en) * 2016-06-24 2016-12-07 北京海誉动想科技股份有限公司 The upgrading of instance system, cloud system and instance system or restoration methods

Also Published As

Publication number Publication date
CN114489717A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
KR100750132B1 (en) How to boot, automatically update software and recover from errors, and the system and computer-readable recording media recording the method
US20100169709A1 (en) System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware
US20070074201A1 (en) Method and system for updating software and computer readable recording medium storing the method
US20110283274A1 (en) Firmware image update and management
US20110307879A1 (en) Program update device, program update method, and information processing device
US20070055969A1 (en) System and method for updating firmware
CN112416406B (en) Terminal equipment upgrading method, device, terminal equipment and medium
CN106775610B (en) Electronic equipment starting method and electronic equipment
CN103970564A (en) Automatic repairing and upgrading method of embedded operating system and embedded operating system with automatic repairing and upgrading functions
CN107102871A (en) The method and apparatus of embedded system upgrading
CN102184111A (en) Online upgrade method for operating system and device with operating system
CN113032183A (en) System management method, device, computer equipment and storage medium
WO2015184732A1 (en) Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium
CN113157303A (en) Upgrading method, embedded system, terminal and computer storage medium
CN120179321B (en) Firmware loading method, device, electronic device and storage medium
JP2005284902A (en) Terminal device, control method and control program thereof, host device, control method and control program thereof, and method, system, and program for remote updating
CN114489717B (en) A system upgrade method, device and system
CN114281391A (en) An electronic device and a system software upgrade method, device and medium thereof
WO2026001164A1 (en) Stack file system, system management method, controller, chip device, and vehicle
CN117785238A (en) Firmware upgrade method, device, electronic equipment and computer-readable storage medium
KR101461650B1 (en) Apparatus and method for managing file system of a computing device
US12210784B2 (en) Cache to receive firmware generated data during firmware update
CN119396445A (en) Asymmetric firmware over-the-air upgrade method
CN119806655A (en) System segmented startup method, device, storage medium and electronic device
JP2026005041A (en) Vehicle ECU

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant