CN111552592A - Double-backup starting method and system - Google Patents
Double-backup starting method and system Download PDFInfo
- Publication number
- CN111552592A CN111552592A CN202010335331.6A CN202010335331A CN111552592A CN 111552592 A CN111552592 A CN 111552592A CN 202010335331 A CN202010335331 A CN 202010335331A CN 111552592 A CN111552592 A CN 111552592A
- Authority
- CN
- China
- Prior art keywords
- backup
- flag information
- image
- operating system
- mirror image
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operations
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1438—Restarting or rejuvenating
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operations
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a double backup starting method and a system, belonging to the embedded technical field, wherein the method comprises the following steps: step S1, judging whether the operating system has abnormal starting; step S2, checking the current system mirror image, and step S3, checking and adjusting the configuration file; step S4, setting the first flag information to indicate that the operating system is abnormally started; step S5, reading the current system image to load the operating system, step S6, setting the first mark information to indicate the operating system is normally started; the system comprises: the device comprises a first judgment unit, an erasing unit, a first verification unit, a second verification unit, a mark setting unit and a second judgment unit; the embedded device has the advantages that the embedded device can work more stably, the cost is saved, and the dependence on hardware resources and network resources is greatly reduced.
Description
Technical Field
The invention relates to the technical field of embedding, in particular to a double-backup starting method and a double-backup starting system.
Background
The embedded type is a device for controlling, monitoring or assisting operation of machines and equipment, takes application as a center, takes computer technology as a basis, can cut software and hardware, and is suitable for a special computer system with strict requirements of an application system on functions, reliability, cost, volume, power consumption and the like; in the embedded industry, there is a great demand for the stability of embedded devices, wherein the stability of the systems used by the embedded devices is crucial, the hardware part of the devices is a problem to be considered by design and production vendors, and the system problem is more encountered by users. When a manufacturer finds out a problem on system software of an embedded device, the system is mostly updated in a mode of remotely pushing an image or a patch. However, in this process, the system image is damaged or the user data is lost due to power failure, poor network quality, or data writing error. When such a problem is encountered, if the factory return maintenance is performed like a hardware problem, a relatively large cost is incurred for users and manufacturers, and in the prior art, many embedded devices are often installed and operated under some relatively severe environmental conditions, because the repair of the system problem is extremely difficult.
In the prior art, methods for solving the above problems are mostly to solve the problem of failure of remote image upgrade, and there is no consideration that even if the remote upgrade is not performed, an error may occur in the system due to illegal operation of a user or other unexpected situations. The existing solutions are implemented by starting a backup system or using a special small system supporting networking, when a problem occurs in the system, starting the system, and then obtaining a normal image from a remote location through a network connection, so as to update the image to solve the problem. However, the system for starting a backup needs to occupy a very large storage space, not only the size of the image itself, but also the same resources as the system for starting a normal image, for example, a file system needs to be additionally constructed. Meanwhile, as the small system specially used for remote upgrading is started, the small system and the normal mirror image are required to be obtained from remote, the dependence of the process on network resources is strong, and the use limitation is large
Disclosure of Invention
According to the problems in the prior art, a dual backup starting method and a dual backup starting system are provided, a system backup with complete functions is additionally maintained, the function of normal system recovery can be completed even if no network exists when the embedded device cannot normally work, on the basis of solving the fundamental problem that the system cannot normally work due to various reasons of the embedded device, the work of the embedded device is more stable, the cost is saved, and the dependence on hardware resources and network resources is greatly reduced.
The technical scheme specifically comprises the following steps:
a double backup starting method is applied to an embedded device, wherein the embedded device comprises a storage module, and the storage module is preset with:
the first storage space stores a current system mirror image and a backup system mirror image which are applied to an operating system of the embedded equipment;
a second storage space, where first flag information, second flag information, and third flag information are stored, where the first flag information is used to identify a reason for restarting the operating system, the second flag information is a check value of the current system image, and the third flag information is a check value of the backup system image;
the third storage space is used for storing a configuration file for ensuring the normal start of the operating system;
the starting method comprises the following steps:
step S1, when the embedded device is started, determining whether the operating system is abnormal by the first flag information:
if yes, erasing the second flag information, and then turning to step S2;
if not, go directly to step S2;
step S2, verifying the current system image according to the second flag information, and determining whether the verification is successful:
if not, updating the current system mirror image in a mode of covering the backup system mirror image, and then turning to the step S3;
if yes, go directly to step S3;
step S3, verifying the configuration file stored in the third storage space, and adjusting the configuration file according to the verification result;
step S4, setting the first flag information to indicate that the operating system is abnormally started;
step S5, reading the current system image to load the operating system, and determining whether the operating system is successfully started:
if not, returning to the step S1;
if yes, go to step S6;
step S6, setting the first flag information to indicate that the operating system is normally started, and then exiting.
Preferably, after the step S6 is completed, the starting method further includes:
step S7, the backup system mirror image is verified according to the third mark information, and the system mirror image corresponding to the normally started operating system is compressed when the verification fails, so as to generate a temporary mirror image, and the backup system mirror image is updated in a mode of covering the temporary mirror image;
step S8, calculating a check value of the temporary image and updating the third flag information.
Preferably, in the step S7, a gzip compression algorithm is adopted to compress the system image corresponding to the operating system that is normally started.
Preferably, the third storage space includes a plurality of storage subspaces, and the configuration files are backed up in multiple copies and then stored in each of the storage subspaces respectively;
the step S3 specifically includes:
step S30, respectively calculating to obtain the check value of the configuration file stored in each storage subspace;
step S31, comparing all the check values pairwise, marking a plurality of identical check values as backup check values, and marking the check values different from the backup check values as damaged check values;
step S32, performing an overlay update on the configuration file corresponding to the damaged check value according to the configuration file corresponding to the backup check value.
Preferably, the operating system is an openwrt operating system.
Preferably, in step S2, the specific step of verifying the current system image according to the second flag information includes:
step S20, performing a decompression operation on the current system image;
step S21, calculating a check value of the decompressed current system image, and comparing the check value with the second flag information:
if the verification value of the current system image is the same as the second flag information, the verification is successful, and then the process goes to the step S3 directly;
if the check value of the current system image is different from the second flag information, indicating that the check is failed, updating the current system image in a manner of being covered by the backup system image, and then turning to step S3.
Preferably, in step S7, the specific step of verifying the backup system image according to the third flag information includes:
step S70, performing decompression operation on the backup system image;
step S71, calculating a check value of the decompressed backup system image, comparing the check value with the third flag information, and considering that the check fails when the check value is different from the third flag information.
A double backup start control system is arranged in an embedded device; the embedded device comprises a storage module, wherein the storage module is preset with:
the first storage space stores a current system mirror image and a backup system mirror image which are applied to an operating system of the embedded equipment;
a second storage space, where first flag information, second flag information, and third flag information are stored, where the first flag information is used to identify a reason for restarting the operating system, the second flag information is a check value of the current system image, and the third flag information is a check value of the backup system image;
the third storage space is used for storing a configuration file for ensuring the normal start of the operating system;
the dual backup start control system specifically includes:
the first judgment unit is used for judging whether the embedded equipment is abnormally started or not according to the first mark information when the embedded equipment starts to be started and outputting a first judgment result;
the erasing unit is connected with the first judging unit and used for erasing the second mark information in the second storage space when the embedded equipment has abnormal starting according to the first judging result;
the first checking unit is used for checking the current system mirror image according to the second mark information in the second storage space in the starting process of the embedded equipment and adopting the backup system mirror image to carry out coverage updating on the current system mirror image when the checking fails;
the second verification unit is used for verifying the configuration file in the starting process of the embedded equipment and adjusting the configuration file according to a verification result;
the mark setting unit is respectively connected with the first checking unit and the second checking unit, and when the current system mirror image checking is finished and the configuration file checking is finished, the mark setting unit sets the first mark information to indicate that the operating system is abnormally started;
the second judgment unit is connected with the mark setting unit and used for judging whether the operating system of the embedded equipment is successfully started or not and outputting a second judgment result;
the flag setting unit is further configured to set the first flag information to indicate that the operating system is normally started when the operating system is successfully started according to the second determination result.
Preferably, the method further comprises the following steps:
a third checking unit, configured to check the backup system image according to the third flag information after the embedded device is successfully started, and output a checking result
And the backup updating unit is connected with the third checking unit and used for compressing the system mirror image corresponding to the normally started operating system when the backup system mirror image is failed to be checked according to the checking result output by the third checking unit so as to generate a temporary mirror image, updating the backup system mirror image in a mode of covering the temporary mirror image, and then calculating the checking value of the temporary mirror image and updating the third mark information.
Preferably, the third storage space includes a plurality of storage subspaces, and the configuration files are backed up in multiple copies and then stored in each of the storage subspaces respectively;
the second verification unit further comprises:
the verification calculation module is used for respectively calculating and obtaining the verification value of the configuration file stored in each storage subspace and outputting the verification value;
the comparison module is connected with the check calculation module and used for comparing all the check values pairwise and outputting all comparison results;
the check setting module is connected with the comparison module and used for marking a plurality of identical check values as backup check values according to the comparison result and marking the check values different from the backup check values as damaged check values;
and the configuration updating module is connected with the check setting module and used for performing coverage updating on the configuration file corresponding to the damaged check value according to the configuration file corresponding to the backup check value.
The beneficial effects of the above technical scheme are that:
by additionally maintaining a system backup with complete functions, the function of normal system recovery can be completed even if no network exists when the embedded device can not work normally, on the basis of solving the fundamental problem that the system can not work normally due to various reasons, the embedded device can work more stably, the cost is saved, and the dependence on hardware resources and network resources is greatly reduced.
Drawings
FIG. 1 is a flow chart illustrating steps of a dual backup boot method according to a preferred embodiment of the present invention;
FIG. 2 is a flow chart illustrating the substeps of step S3 according to the preferred embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a dual backup boot control system according to a preferred embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a second verification unit according to a preferred embodiment of the invention;
FIG. 5 is a schematic diagram of a memory space structure of a memory module according to a preferred embodiment of the present invention;
FIG. 6 is a schematic diagram of the structure of the openwrt system mirror in the preferred embodiment of the present invention;
FIG. 7 is a schematic structural diagram of the operating state of openwrt system in the preferred embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The invention is further described with reference to the following drawings and specific examples, which are not intended to be limiting.
A dual backup start method is applied to an embedded device, as shown in fig. 1, where the embedded device includes a storage module, and the storage module is preset with:
the first storage space stores a current system mirror image and a backup system mirror image of an operating system applied to the embedded equipment;
the first storage space stores first mark information, second mark information and third mark information, the first mark information is used for marking the reason of restarting the operating system, the second mark information is the check value of the current system mirror image, and the third mark information is the check value of the backup system mirror image;
the third storage space is used for storing a configuration file for ensuring normal starting of the operating system;
the starting method comprises the following steps:
step S1, when the embedded device is started, determining whether the operating system is abnormal by the first flag information:
if so, erasing the second flag information, and then going to step S2;
if not, go directly to step S2;
step S2, verifying the current system mirror image according to the second flag information, and determining whether the verification is successful:
if not, updating the current system mirror image in a backup system mirror image covering mode, and then turning to the step S3;
if yes, go directly to step S3;
step S3, checking the configuration file stored in the third storage space, and adjusting the configuration file according to the checking result;
step S4, setting the first flag information to indicate that the operating system is abnormally started;
step S5, reading the current system image to load the operating system, and determining whether the operating system is successfully started:
if not, returning to the step S1;
if yes, go to step S6;
step S6, the first flag information is set to indicate that the operating system is normally started, and then exits.
As a preferred embodiment, the embedded device has the characteristics of low power consumption, high reliability and stability due to its own characteristics, but because the processing resources and the storage resources of the embedded device are limited, it is not possible to implement a complex and resource-consuming manner to maintain the stability of the system like a conventional computer system. In the method, a system image with complete functions is additionally maintained to serve as double backup, the backed-up system image is regarded as pure data processing, different parts can be processed according to functions of all parts forming the complete image, and for a very definite part which is only used in the system starting process, a gzip compression algorithm is adopted for compression and storage, and the part usually occupies a larger proportion, so that a lot of hardware resources can be saved. For the readable and writable portion, only a small portion is usually occupied, and considering that modification is frequently performed, a sufficient amount of space is reserved in the storage medium to implement the backup function of the portion of data. The method additionally maintains a system mirror image with complete functions, so that normal starting can be realized even if no network exists when the embedded equipment cannot work normally, and the problems of system abnormity and the like caused by mirror image upgrading can be solved at low cost.
Specifically, in this embodiment, the first flag information is set only after the system is successfully started, so that the first flag information indicates that the operating system is normally started, and therefore, the first flag information should be reset after the verification of the image file and the configuration file is completed each time the system is restarted, even if the first flag information indicates that the operating system is abnormally started, the accurate recording of the operating state of the system in this time is ensured; after the first mark information is reset, the watchdog module is enabled to prevent the system from being jammed due to reasons such as errors in the starting process of the system, and after the watchdog module is enabled, the system can be automatically restarted if the watchdog module is not subjected to the dog feeding operation for a long time.
When the watchdog module of the operating system can be used, the working of the watchdog module for guiding the starting item can be replaced, in the process, as long as the system is not started and works normally, the starting flag bit can not be set, and because the watchdog module can ensure that the starting process can not be blocked, the system can be restarted no matter what reason causes the failure, the previous steps are carried out again, and finally the success of starting is ensured. After the system is completely started and normally works, the system sets a start flag bit, so that the mirror image can be determined to be normally used at the next time due to normal restart and the like.
In the preferred embodiment of the present invention, the operating system is the openwrt operating system.
Specifically, in this embodiment, the operating system adopts an openwrt operating system, and uboot is used as bootloader to boot the startup of the openwrt image.
In an embodiment of the present invention, a second storage space is specially partitioned in a memory module of the embedded device to store the first flag information, the second flag information, and the third flag information, in this embodiment, the memory module uses a Nor Flash with a size of 32Mb, the first storage space is partitioned in the memory module to store a current system image and a backup system image, and the remaining part is allocated to an operating system for normal use.
As shown in fig. 5, in this embodiment, a current system image is used as a normal image, a backup system image is used as an additional backup image, where 0x0 to 0x8a0000 are contents of storage subspaces belonging to the normal image, and the contents of the storage subspaces are consistent with a most original structure of the openwrt storage subspace, where factory storage subspaces store some parameters of the embedded device, and the first flag information, the second flag information, and the third flag information are also stored in the storage subspaces. The reserve part represents a part of space reserved exclusively for system backup by the storage module.
Specifically, in the starting method, it is first determined whether the operating system has a start abnormality, for example, when the system has a restart condition, uboot determines a reason of the system restart through first flag information when the current system image of the openwrt operating system is booted, if the system is restarted due to soft restart (reboot) or watchdog, it indicates that the normal openwrt image, that is, the current system image has an error, and at this time, second flag information stored in the storage module, that is, a check value of the current system image, is erased to indicate that the current system image is damaged. Subsequently, the second step performs a verification step of the system image.
In a preferred embodiment of the present invention, in step S2, the specific step of verifying the current system image according to the second flag information includes:
step S20, performing decompression operation on the current system image;
step S21, calculating a check value of the decompressed current system image, and comparing the check value with the second flag information:
if the check value of the current system mirror image is the same as the second flag information, the check is successful, and then the process directly goes to step S3;
if the check value of the current system image is different from the second flag information, which indicates that the check fails, the current system image is updated in a manner of being covered by the backup system image, and then the process goes to step S3.
Specifically, in this embodiment, the composition of the image of the openwrt operating system is as shown in fig. 6, where kernel is the image of the linux kernel, and squarhfs is a read-only file system, and a read-write jffs2 file system is constructed according to the file system during the startup of the openwrt system, and the kernel part of the image of the openwrt operating system is only read once from the storage medium during the startup and placed in the memory, and the squarhfs is mounted as a read-only file system, so that for this part, the part is compressed by using a gzip compression algorithm and then stored in the space of the reserve. Then, the uboot calculates a check value of the currently used decompressed current system image, the calculated check value is compared with second mark information stored in the factory storage subspace, if the check is found to be unsuccessful, the backup system image of the backup is copied and updated and written into the position of the current system image, and the original current system image is covered
In a preferred embodiment of the present invention, after the step S6 is completed, the method further includes:
step S7, checking the backup system mirror image according to the third mark information, compressing the system mirror image corresponding to the normally started operating system when the checking fails to generate a temporary mirror image, and updating the backup system mirror image by adopting a temporary mirror image covering mode;
step S8, calculating the check value of the temporary image and updating the third flag information.
In a preferred embodiment of the present invention, in step S7, the step of verifying the backup system image according to the third flag information includes:
step S70, decompressing the backup system image;
step S71, calculating a check value of the decompressed backup system image, comparing the check value with the third flag information, and considering that the check fails when the check value is different from the third flag information.
In the preferred embodiment of the present invention, in step S7, the gzip compression algorithm is used to compress the system image corresponding to the normally started operating system.
Specifically, in this embodiment, in the process of performing the mirror image verification each time, the backup system mirror image is also decompressed, then the verification value of the backup system mirror image is calculated and compared with the third flag information stored in the factor storage subspace, if it is found that the backup system mirror image has a problem, the backup system mirror image with an error is updated and covered after the current normally-started operating system is compressed by using the gzip compression algorithm, and meanwhile, the third flag information stored in the factor storage subspace is updated after the verification value of the temporary mirror image is calculated.
In a preferred embodiment of the present invention, the third storage space includes a plurality of storage subspaces, and the configuration files are backed up in multiple copies and then stored in each storage subspace;
as shown in fig. 2, step S3 specifically includes:
step S30, respectively calculating to obtain the check value of the configuration file stored in each storage subspace;
step S31, comparing all the check values pairwise, marking a plurality of identical check values as backup check values, and marking check values different from the backup check values as damaged check values;
and step S32, according to the configuration file corresponding to the backup check value, performing overlay update on the configuration file corresponding to the damaged check value.
Specifically, in this embodiment, the structure of the system in the openwrt running state is as shown in fig. 7, and this structure is the composition structure in the storage module after the openwrt system runs, where kernel and rootfs are kernel and squarhfs of the openwrt image, and rootfs _ data is jffs2 file system generated according to the squarhfs file system in the openwrt image, because this part is always frequently modified, but most of the files are not important, in a specific embodiment of the present invention, the third storage space includes three storage subspaces, so that the configuration files ensuring normal system startup are separately extracted from rootfs _ data and placed in the first storage subspace (user-data), the second storage subspace (user-data-kup-1) and the third storage subspace (user-data-kup-2), and by calculating the check values of the contents of the three storage subspaces, and comparing the check values by the two systems to determine whether the configuration file is damaged, if the check value of one storage subspace is different from the check values of the other two storage subspaces, considering that the data stored in the storage subspace corresponding to the different check values is damaged, and then copying the data of the undamaged storage subspace to the damaged storage subspace to recover the damaged data.
A dual backup start control system is disposed in an embedded device, as shown in fig. 3, wherein the embedded device includes a storage module, and the storage module is pre-disposed with:
the first storage space stores a current system mirror image and a backup system mirror image of an operating system applied to the embedded equipment;
the first storage space stores first mark information, second mark information and third mark information, the first mark information is used for marking the reason of restarting the operating system, the second mark information is the check value of the current system mirror image, and the third mark information is the check value of the backup system mirror image;
the third storage space is used for storing a configuration file for ensuring normal starting of the operating system;
the dual backup start control system specifically includes:
the first judging unit 1 is used for judging whether the embedded equipment is abnormally started according to the first mark information when the embedded equipment starts to be started, and outputting a first judging result;
the erasing unit 2 is connected with the first judging unit 1 and used for erasing second mark information in the second storage space when the embedded equipment has abnormal starting according to the first judging result;
the first checking unit 3 is used for checking the current system mirror image according to the second mark information in the second storage space in the starting process of the embedded device, and adopting the backup system mirror image to perform coverage updating on the current system mirror image when the checking fails;
the second checking unit 4 is used for checking the configuration file in the starting process of the embedded equipment and adjusting the configuration file according to the checking result;
the mark setting unit 5 is respectively connected with the first checking unit 3 and the second checking unit 4, and when the current system mirror image checking is finished and the configuration file checking is finished, the mark setting unit 5 sets the first mark information to indicate that the operating system is abnormally started;
the second judging unit 6 is connected with the flag setting unit 5 and used for judging whether the operating system of the embedded equipment is successfully started or not and outputting a second judging result;
the flag setting unit 5 is further configured to set the first flag information to indicate that the operating system is normally started when the operating system is successfully started according to the second determination result.
In the preferred embodiment of the present invention, as shown in fig. 3, further includes:
a third checking unit 7, configured to check the backup system image according to the third flag information after the embedded device is successfully started, and output a checking result
And the backup updating unit 8 is connected with the third checking unit 7 and is used for compressing the system image corresponding to the normally started operating system according to the checking result output by the third checking unit 7 when the checking of the backup system image fails so as to generate a temporary image, updating the backup system image in a temporary image covering mode, and then calculating the checking value of the temporary image and updating the third mark information.
In a preferred embodiment of the present invention, the third storage space includes a plurality of storage subspaces, and the configuration files are backed up in multiple copies and then stored in each storage subspace;
as shown in fig. 4, the second verification unit 4 further includes:
the verification calculation module 40 is used for respectively calculating and obtaining the verification value of the configuration file stored in each storage subspace and outputting the verification value;
the comparison module 41 is connected with the check calculation module 40 and used for comparing all the check values in pairs and outputting all comparison results;
the verification setting module 42 is connected to the comparison module 41, and configured to mark a plurality of identical verification values as backup verification values according to the comparison result, and mark a verification value different from the backup verification value as a damaged verification value;
and the configuration updating module 43 is connected to the verification setting module 42, and is configured to perform coverage updating on the configuration file corresponding to the damaged verification value according to the configuration file corresponding to the backup verification value.
The beneficial effects of the above technical scheme are that:
by additionally maintaining a system backup with complete functions, the function of normal system recovery can be completed even if no network exists when the embedded device can not work normally, on the basis of solving the fundamental problem that the system can not work normally due to various reasons, the embedded device can work more stably, the cost is saved, and the dependence on hardware resources and network resources is greatly reduced.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.
Claims (10)
1. A double backup starting method is applied to an embedded device, and is characterized in that the embedded device comprises a storage module, and the storage module is preset with:
the first storage space stores a current system mirror image and a backup system mirror image which are applied to an operating system of the embedded equipment;
a second storage space, where first flag information, second flag information, and third flag information are stored, where the first flag information is used to identify a reason for restarting the operating system, the second flag information is a check value of the current system image, and the third flag information is a check value of the backup system image;
the third storage space is used for storing a configuration file for ensuring the normal start of the operating system;
the starting method comprises the following steps:
step S1, when the embedded device is started, determining whether the operating system is abnormal by the first flag information:
if yes, erasing the second flag information, and then turning to step S2;
if not, go directly to step S2;
step S2, verifying the current system image according to the second flag information, and determining whether the verification is successful:
if not, updating the current system mirror image in a mode of covering the backup system mirror image, and then turning to the step S3;
if yes, go directly to step S3;
step S3, verifying the configuration file stored in the third storage space, and adjusting the configuration file according to the verification result;
step S4, setting the first flag information to indicate that the operating system is abnormally started;
step S5, reading the current system image to load the operating system, and determining whether the operating system is successfully started:
if not, returning to the step S1;
if yes, go to step S6;
step S6, setting the first flag information to indicate that the operating system is normally started, and then exiting.
2. The dual backup boot method according to claim 1, wherein after the step S6, the boot method further comprises:
step S7, the backup system mirror image is verified according to the third mark information, and the system mirror image corresponding to the normally started operating system is compressed when the verification fails, so as to generate a temporary mirror image, and the backup system mirror image is updated in a mode of covering the temporary mirror image;
step S8, calculating a check value of the temporary image and updating the third flag information.
3. The dual backup booting method according to claim 2, wherein in step S7, a gzip compression algorithm is used to compress the system image corresponding to the operating system that is normally booted.
4. The dual backup booting method according to claim 1, wherein the third storage space includes a plurality of storage subspaces, and the configuration file is backed up in a plurality of copies and then stored in each of the storage subspaces;
the step S3 specifically includes:
step S30, respectively calculating to obtain the check value of the configuration file stored in each storage subspace;
step S31, comparing all the check values pairwise, marking a plurality of identical check values as backup check values, and marking the check values different from the backup check values as damaged check values;
step S32, performing an overlay update on the configuration file corresponding to the damaged check value according to the configuration file corresponding to the backup check value.
5. The dual backup boot method of claim 1, wherein the operating system is an openwrt operating system.
6. The dual backup starting method according to claim 1, wherein in the step S2, the specific step of checking the current system image according to the second flag information includes:
step S20, performing a decompression operation on the current system image;
step S21, calculating a check value of the decompressed current system image, and comparing the check value with the second flag information:
if the verification value of the current system image is the same as the second flag information, the verification is successful, and then the process goes to the step S3 directly;
if the check value of the current system image is different from the second flag information, indicating that the check is failed, updating the current system image in a manner of being covered by the backup system image, and then turning to step S3.
7. The dual backup starting method according to claim 2, wherein in the step S7, the specific step of checking the backup system image according to the third flag information includes:
step S70, performing decompression operation on the backup system image;
step S71, calculating a check value of the decompressed backup system image, comparing the check value with the third flag information, and considering that the check fails when the check value is different from the third flag information.
8. The utility model provides a two backup start control systems, sets up in embedded equipment, its characterized in that, embedded equipment includes a memory module, preset in the memory module has:
the first storage space stores a current system mirror image and a backup system mirror image which are applied to an operating system of the embedded equipment;
a second storage space, where first flag information, second flag information, and third flag information are stored, where the first flag information is used to identify a reason for restarting the operating system, the second flag information is a check value of the current system image, and the third flag information is a check value of the backup system image;
the third storage space is used for storing a configuration file for ensuring the normal start of the operating system;
the dual backup start control system specifically includes:
the first judgment unit is used for judging whether the embedded equipment is abnormally started or not according to the first mark information when the embedded equipment starts to be started and outputting a first judgment result;
the erasing unit is connected with the first judging unit and used for erasing the second mark information in the second storage space when the embedded equipment has abnormal starting according to the first judging result;
the first checking unit is used for checking the current system mirror image according to the second mark information in the second storage space in the starting process of the embedded equipment and adopting the backup system mirror image to carry out coverage updating on the current system mirror image when the checking fails;
the second verification unit is used for verifying the configuration file in the starting process of the embedded equipment and adjusting the configuration file according to a verification result;
the mark setting unit is respectively connected with the first checking unit and the second checking unit, and when the current system mirror image checking is finished and the configuration file checking is finished, the mark setting unit sets the first mark information to indicate that the operating system is abnormally started;
the second judgment unit is connected with the mark setting unit and used for judging whether the operating system of the embedded equipment is successfully started or not and outputting a second judgment result;
the flag setting unit is further configured to set the first flag information to indicate that the operating system is normally started when the operating system is successfully started according to the second determination result.
9. The dual backup boot control system of claim 8, further comprising:
a third checking unit, configured to check the backup system image according to the third flag information after the embedded device is successfully started, and output a checking result
And the backup updating unit is connected with the third checking unit and used for compressing the system mirror image corresponding to the normally started operating system when the backup system mirror image is failed to be checked according to the checking result output by the third checking unit so as to generate a temporary mirror image, updating the backup system mirror image in a mode of covering the temporary mirror image, and then calculating the checking value of the temporary mirror image and updating the third mark information.
10. The dual backup boot control system of claim 8, wherein the third storage space comprises a plurality of storage subspaces, and the configuration file is backed up in multiple copies and stored in each of the storage subspaces;
the second verification unit further comprises:
the verification calculation module is used for respectively calculating and obtaining the verification value of the configuration file stored in each storage subspace and outputting the verification value;
the comparison module is connected with the check calculation module and used for comparing all the check values pairwise and outputting all comparison results;
the check setting module is connected with the comparison module and used for marking a plurality of identical check values as backup check values according to the comparison result and marking the check values different from the backup check values as damaged check values;
and the configuration updating module is connected with the check setting module and used for performing coverage updating on the configuration file corresponding to the damaged check value according to the configuration file corresponding to the backup check value.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010335331.6A CN111552592A (en) | 2020-04-24 | 2020-04-24 | Double-backup starting method and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010335331.6A CN111552592A (en) | 2020-04-24 | 2020-04-24 | Double-backup starting method and system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN111552592A true CN111552592A (en) | 2020-08-18 |
Family
ID=72004372
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010335331.6A Pending CN111552592A (en) | 2020-04-24 | 2020-04-24 | Double-backup starting method and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111552592A (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113504946A (en) * | 2021-07-26 | 2021-10-15 | 联想长风科技(北京)有限公司 | Method and system for realizing mirror function when soft RAID logs in OS |
| CN114064136A (en) * | 2021-11-15 | 2022-02-18 | 西安诺瓦星云科技股份有限公司 | Dual-backup system starting method and device, embedded equipment and electronic equipment |
| CN114185606A (en) * | 2021-12-14 | 2022-03-15 | 上海华信长安网络科技有限公司 | Method and device for improving system operation reliability based on embedded system |
| CN114185706A (en) * | 2021-11-12 | 2022-03-15 | 福建星云电子股份有限公司 | Lithium battery detection terminal system fault self-recovery method and system |
| CN114237721A (en) * | 2021-11-24 | 2022-03-25 | 芯发威达电子(上海)有限公司 | Software protection method, system, device and storage medium for mainboard double-boot |
| JP7118212B1 (en) | 2021-05-27 | 2022-08-15 | レノボ・シンガポール・プライベート・リミテッド | Server device, information processing system, information processing device, and information processing method |
| CN116909810A (en) * | 2023-06-30 | 2023-10-20 | 南京国电南自电网自动化有限公司 | Protection control device with double backup programs and starting method thereof |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090222497A1 (en) * | 2008-02-29 | 2009-09-03 | Schlumberger Technology Corp. | Method, system and apparatus for remote software upgrade of an embedded device |
| US20120124415A1 (en) * | 2010-11-17 | 2012-05-17 | International Business Machines Corporation | Memory mirroring with memory compression |
| CN104407888A (en) * | 2014-11-12 | 2015-03-11 | 苏州科达科技股份有限公司 | Method and system for starting embedded type equipment |
| CN106598780A (en) * | 2016-11-22 | 2017-04-26 | 深圳中科讯联科技股份有限公司 | System backup and recovery method and device |
| CN108647119A (en) * | 2018-05-16 | 2018-10-12 | 杭州海兴电力科技股份有限公司 | The startup method, apparatus and equipment of linux system |
| CN109634781A (en) * | 2018-12-06 | 2019-04-16 | 中国航空工业集团公司洛阳电光设备研究所 | One kind is based on embedded program two-region Backup Images system and starting method |
-
2020
- 2020-04-24 CN CN202010335331.6A patent/CN111552592A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090222497A1 (en) * | 2008-02-29 | 2009-09-03 | Schlumberger Technology Corp. | Method, system and apparatus for remote software upgrade of an embedded device |
| US20120124415A1 (en) * | 2010-11-17 | 2012-05-17 | International Business Machines Corporation | Memory mirroring with memory compression |
| CN104407888A (en) * | 2014-11-12 | 2015-03-11 | 苏州科达科技股份有限公司 | Method and system for starting embedded type equipment |
| CN106598780A (en) * | 2016-11-22 | 2017-04-26 | 深圳中科讯联科技股份有限公司 | System backup and recovery method and device |
| CN108647119A (en) * | 2018-05-16 | 2018-10-12 | 杭州海兴电力科技股份有限公司 | The startup method, apparatus and equipment of linux system |
| CN109634781A (en) * | 2018-12-06 | 2019-04-16 | 中国航空工业集团公司洛阳电光设备研究所 | One kind is based on embedded program two-region Backup Images system and starting method |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP7118212B1 (en) | 2021-05-27 | 2022-08-15 | レノボ・シンガポール・プライベート・リミテッド | Server device, information processing system, information processing device, and information processing method |
| JP2022181897A (en) * | 2021-05-27 | 2022-12-08 | レノボ・シンガポール・プライベート・リミテッド | Server device, information processing system, information processing apparatus, and information processing method |
| CN113504946A (en) * | 2021-07-26 | 2021-10-15 | 联想长风科技(北京)有限公司 | Method and system for realizing mirror function when soft RAID logs in OS |
| CN114185706A (en) * | 2021-11-12 | 2022-03-15 | 福建星云电子股份有限公司 | Lithium battery detection terminal system fault self-recovery method and system |
| CN114064136A (en) * | 2021-11-15 | 2022-02-18 | 西安诺瓦星云科技股份有限公司 | Dual-backup system starting method and device, embedded equipment and electronic equipment |
| CN114064136B (en) * | 2021-11-15 | 2024-06-04 | 西安诺瓦星云科技股份有限公司 | Dual-backup system starting method and device, embedded equipment and electronic equipment |
| CN114237721A (en) * | 2021-11-24 | 2022-03-25 | 芯发威达电子(上海)有限公司 | Software protection method, system, device and storage medium for mainboard double-boot |
| CN114185606A (en) * | 2021-12-14 | 2022-03-15 | 上海华信长安网络科技有限公司 | Method and device for improving system operation reliability based on embedded system |
| CN114185606B (en) * | 2021-12-14 | 2023-11-28 | 上海华信长安网络科技有限公司 | Method and device for improving system operation reliability based on embedded system |
| CN116909810A (en) * | 2023-06-30 | 2023-10-20 | 南京国电南自电网自动化有限公司 | Protection control device with double backup programs and starting method thereof |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111552592A (en) | Double-backup starting method and system | |
| CN101329631B (en) | Method and apparatus for automatically detecting and recovering start-up of embedded system | |
| US20070055969A1 (en) | System and method for updating firmware | |
| CN108646982B (en) | Automatic data restoration method and device based on UBIFS | |
| CN102298545B (en) | System startup boot processing method and device | |
| US7941658B2 (en) | Computer system and method for updating program code | |
| CN113064757A (en) | Server firmware self-recovery system and server | |
| CN112015447B (en) | System updating method and device of electronic equipment, electronic equipment and storage medium | |
| CN106775610B (en) | Electronic equipment starting method and electronic equipment | |
| CN108874582A (en) | A kind of system recovery method, device and terminal | |
| CN111143132A (en) | BIOS recovery method, device, equipment and readable storage medium | |
| JP2023064689A (en) | Board management controller for computer system and startup method | |
| CN110928726A (en) | Embedded system self-recovery method and system based on watchdog and PXE | |
| CN110795155B (en) | System starting method and device, electronic equipment and storage medium | |
| WO2021103745A1 (en) | Method for protectively desiging boot program | |
| CN114895845A (en) | EMmC data storage control method and embedded mainboard | |
| US12340201B2 (en) | Server and updating method for MAC address | |
| CN120179321B (en) | Firmware loading method, device, electronic device and storage medium | |
| CN121166439A (en) | Starting method, device, equipment, medium and program product of BMC firmware | |
| CN112882757A (en) | Embedded system double-partition safe starting method | |
| CN116361817A (en) | Protection method of ubi file system under Linux | |
| CN115599417A (en) | MCU firmware updating method of electronic equipment | |
| CN114327535A (en) | BMC firmware update protection method and related components | |
| KR20030062793A (en) | Apparatus and Method for operating recovery and backup of linux operting system | |
| CN112527400A (en) | System starting method and device, electronic equipment and storage medium |
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 | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200818 |
|
| WD01 | Invention patent application deemed withdrawn after publication |