CN105138430A - Embedded operating system backup and restoration method and device - Google Patents

Embedded operating system backup and restoration method and device Download PDF

Info

Publication number
CN105138430A
CN105138430A CN201510522512.9A CN201510522512A CN105138430A CN 105138430 A CN105138430 A CN 105138430A CN 201510522512 A CN201510522512 A CN 201510522512A CN 105138430 A CN105138430 A CN 105138430A
Authority
CN
China
Prior art keywords
partition holding
current
partition
image
mark
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
Application number
CN201510522512.9A
Other languages
Chinese (zh)
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.)
Inspur Group Co Ltd
Original Assignee
Inspur Group 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 Inspur Group Co Ltd filed Critical Inspur Group Co Ltd
Priority to CN201510522512.9A priority Critical patent/CN105138430A/en
Publication of CN105138430A publication Critical patent/CN105138430A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an embedded operating system backup and restoration method and device. The method includes the steps that at least two storage partition areas are divided, mirror image documents of an embedded operating system are stored in the storage partition areas, and a guiding identifier is arranged in the appointed storage partition area of the at least two storage partition areas; the current first storage partition area currently provided with the guiding identifier is detected; the guiding identifier is transferred to the current second storage partition area of the at least two storage partition areas; the mirror image documents in the current first storage partition area are loaded, and the embedded operating system is started; whether the embedded operating system is successfully started or not is judge; if yes, the guiding identifier is transferred to the current first storage partition area, if not, the current second storage partition area serves as the first storage partition area, and the operation of detecting the current first storage partition area with the guiding identifier is executed again. The scheme can shorten time needed for restoration of the embedded operating system.

Description

A kind of embedded OS backup and the method recovered and device
Technical field
The present invention relates to field of computer technology, particularly a kind of embedded OS backup and the method recovered and device.
Background technology
Embedded OS is the operating system of embedded system, that one embeds controlled device inside completely, the dedicated computer system designed for application-specific, distributed by the whole softwares to embedded system, hardware resource, realize controlling, monitoring or utility appliance, machine and plant operation, perform the predefined task with particular requirement.
Embedded OS in actual use, due to power down, user error or modify to data mala fide and to delete and a part mistake etc. of abundant test under development all cannot can cause embedded OS disabler, the serious embedded OS that also may cause is paralysed.
At present, when embedded OS go wrong cannot start time, need manually system is upgraded, rearrange embedded OS.
Because the nonvolatile memory storing embedded OS is generally all positioned at device interior, during by manually upgrading embedded OS, due to the reason of nonvolatile memory installation site, cause embedded OS to upgrade difficulty, embedded OS recovers to need the long period.
Summary of the invention
The invention provides the backup of a kind of embedded OS and the method recovered and device, the time needed for embedded OS recovery can be reduced.
Embodiments provide the backup of a kind of embedded OS and the method recovered, divide at least two partition holdings, the image file of described embedded OS is all stored in each described partition holding, designated store subregion in described at least two partition holdings is arranged and guides mark, also comprise:
Detect current current first partition holding with described guiding mark;
Current second partition holding at least two partition holdings described in described guiding mark is transferred to;
Load the described image file in described current first partition holding, start described embedded OS;
Judge whether described embedded OS starts successfully;
If so, described guiding mark is transferred to described current first partition holding, if not, using described current second partition holding as the first partition holding, returns and perform current current first partition holding with described guiding mark of described detection.
Preferably, when described partition holding number is greater than two, carry out cyclic ordering to partition holding described in each, described designated store subregion is: arrange the partition holding in first;
Described current second partition holding comprises: if described current first partition holding is last partition holding in the sequence of described partition holding, then described current second partition holding is first partition holding in the sequence of described partition holding, if described current first partition holding is not last in the sequence of described partition holding, then described current second partition holding is the next partition holding adjacent with described current first partition holding.
Preferably, after judging the failure of described starting of embedded operation system, and described using described current second partition holding as the first partition holding, return perform described detection current have described guide mark current taking a step forward of first partition holding comprise:
The image file stored in described current second partition holding is copied in described current first partition holding, covers original image file in described current first partition holding.
Preferably, the method comprises further: for each described partition holding arranges corresponding boot parameter r_active;
Described setting the designated store subregion in described at least two partition holdings guides mark to comprise: boot parameter r_active corresponding for described designated store subregion is set to YES;
Described setting the designated store subregion in described at least two partition holdings guides mark to comprise further: boot parameter r_active corresponding for partition holding described in other each is set to NO;
Current current first partition holding with described guiding mark of described detection comprises: according to the ranking results of described partition holding, detect the boot parameter r_active that each partition holding described is corresponding successively, if the boot parameter r_active that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, if the boot parameter r_active that current partition holding is corresponding is NO, then continue to detect next partition holding, until detect that boot parameter r_active is the partition holding of YES.
Preferably, the method comprises further: for each described partition holding arranges corresponding image recovery mark rec_image, wherein, the default value of described image recovery mark rec_image is NO;
Described by described guide mark be transferred to described in after current second partition holding at least two partition holdings, and to comprise loading the taking a step forward of described image file in described current first partition holding: image recovery corresponding for described current first partition holding mark rec_image is set to YES;
Describedly the image file stored in described current second partition holding is copied to described current first partition holding comprise: according to the ranking results of described partition holding, detect the image recovery mark rec_image that each partition holding described is corresponding successively, if the image recovery mark rec_image that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, the image file stored in described current second partition holding is copied in described current first partition holding, if the image recovery mark rec_image that current partition holding is corresponding is NO, then continue to detect next partition holding, until detect that image recovery mark rec_image is described current first partition holding of YES, perform and described the image file stored in described current second partition holding is copied in described current first partition holding,
Described, the described image file stored in described current second partition holding is copied in described current first partition holding, to cover in described current first partition holding after original described image file, and described using described current second partition holding as the first partition holding, return perform described detection current have described guide mark current taking a step forward of first partition holding comprise: by image recovery corresponding for described current first partition holding mark rec_image be set to NO;
Described described guiding mark is transferred to described current first partition holding after comprise further: image recovery corresponding for described current first partition holding mark rec_image is set to NO.
The embodiment of the present invention additionally provides the backup of a kind of embedded OS and the device recovered, and comprising:
Zoning unit, for dividing at least two partition holdings;
Storage unit, for all storing the image file of described embedded OS in each described partition holding that described zoning unit divides;
First setting unit, arranges for the designated store subregion at least two partition holdings dividing described zoning unit and guides mark;
Detecting unit, for detecting current current first partition holding with the guiding mark that described first setting unit is arranged;
Buanch unit, the guiding mark for being arranged by described first setting unit is transferred to current second partition holding at least two partition holdings of described division unit division;
Loading unit, for loading the described image file of described cell stores in described current first partition holding, starts described embedded OS;
Judging unit, for judging whether described embedded OS starts successfully;
Performance element, for the judged result according to described judging unit, if, described guiding mark is transferred to described current first partition holding, if not, using described current second partition holding as the first partition holding, detect current current first partition holding with described guiding mark by described detecting unit.
Preferably, this device comprises further: sequencing unit;
Described sequencing unit, for when described partition holding number is greater than two, carries out cyclic ordering to partition holding described in each;
Described first setting unit, for the ranking results according to described partition holding, arranges described guiding mark to the described partition holding arranged in first;
Described buanch unit, if for last partition holding that described current first partition holding is in the sequence of described partition holding, then guide described current second partition holding identifying and be transferred to and be positioned at described partition holding sequence first, if described current first partition holding is not last in the sequence of described partition holding, then guide described the next one and current second partition holding be adjacent that identify and be transferred to described current first partition holding.
Preferably, this device comprises further: copied cells;
Described copied cells, for judge the failure of described starting of embedded operation system at described judging unit after, and at described performance element using described current second partition holding as the first partition holding, before there is current first partition holding of described guiding mark by described detecting unit detection is current, the image file stored in described current second partition holding is copied in described current first partition holding, covers original image file in described current first partition holding.
Preferably, this device comprises further: the second setting unit;
Described second setting unit, for arranging corresponding boot parameter r_active for each described partition holding;
Described first setting unit, for boot parameter r_active corresponding for described designated store subregion is set to YES, the boot parameter r_active that partition holding described in other each is corresponding is set to NO;
Described detecting unit, for the ranking results according to described partition holding, detect the boot parameter r_active that each partition holding described is corresponding successively, if the boot parameter r_active that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, if boot parameter r_active corresponding to current partition holding is NO, then continue to detect next partition holding, until detect that boot parameter r_active is the partition holding of YES.
Preferably, this device comprises further: the 3rd setting unit, the 4th setting unit, the 5th setting unit and the 6th setting unit;
Described 3rd setting unit, for arranging corresponding image recovery mark rec_image for each described partition holding, wherein, the default value of described image recovery mark rec_image is NO;
Described 4th setting unit, for described buanch unit by described guide mark be transferred to described in after current second partition holding at least two partition holdings, and before described loading unit loads the described image file in described current first partition holding, image recovery corresponding for described current first partition holding mark rec_image is set to YES;
Described copied cells, for the ranking results according to described partition holding, detect the image recovery mark rec_image that each partition holding described is corresponding successively, if the image recovery mark rec_image that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, the image file stored in described current second partition holding is copied in described current first partition holding, if the image recovery mark rec_image that current partition holding is corresponding is NO, then continue to detect next partition holding, until detect that image recovery mark rec_image is described current first partition holding of YES, perform and described the image file stored in described current second partition holding is copied in described current first partition holding,
Described 5th setting unit, for the described image file stored in described current second partition holding being copied in described current first partition holding at described copied cells, to cover in described current first partition holding after original described image file, and at described performance element using described current second partition holding as the first partition holding, before there is current first partition holding of described guiding mark by described detecting unit detection is current, image recovery corresponding for described current first partition holding mark rec_image is set to NO;
Described 6th setting unit, after described guiding mark being transferred to described current first partition holding at described performance element, is set to NO by image recovery corresponding for described current first partition holding mark rec_image.
Embodiments provide the backup of a kind of embedded OS and the method recovered and device, by dividing at least two partition holdings, the image file of embedded OS is stored in each partition holding, one of them partition holding of specifying is arranged and guides mark, when after system electrification, detect current current first partition holding with guiding mark, and the guiding mark on current first partition holding is transferred in current second partition holding, load the image file stored in current first partition holding, start embedded OS, then judge whether embedded OS starts successfully, if start successfully, again the guiding mark on current second partition holding is transferred back to current first partition holding, if start unsuccessfully, then using current second partition holding as the first partition holding, return and perform current current first partition holding with guiding mark of described detection, like this, after embedded OS powers on, after the current partition holding having and guide mark being detected, guiding mark is transferred on another partition holding, start from current partition holding, if start successfully, illustrate that the image file stored in current partition holding is available, the transfer of guiding mark is returned, next time, embedded OS still started from current partition holding, if start unsuccessfully, then automatically, to start from another partition holding, thus without the need to being upgraded embedded OS by artificial mode, decrease the time needed for embedded OS recovery.
Accompanying drawing explanation
Fig. 1 is the one embodiment of the invention a kind of embedded OS backup provided and the method flow diagram recovered;
Fig. 2 is the another embodiment of the present invention a kind of embedded OS backup provided and the method flow diagram recovered;
Fig. 3 is the one embodiment of the invention a kind of embedded OS backup provided and the device schematic diagram recovered.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described.Obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
As shown in Figure 1, one embodiment of the invention provides the backup of a kind of embedded OS and the method recovered, and comprising:
Step 101: divide at least two partition holdings;
Step 102: the image file all storing described embedded OS in each described partition holding;
Step 103: the designated store subregion in described at least two partition holdings is arranged and guides mark;
Step 104: detect current current first partition holding with described guiding mark;
Step 105: guide current second partition holding identifying and be transferred in described two partition holdings by described;
Step 106: load the described image file in described current first partition holding, start described embedded OS;
Step 107: judge whether described embedded OS starts successfully, if so, performs step 108, otherwise performs step 109;
Step 108: described guiding mark is transferred to described current first partition holding;
Step 109: using described current second partition holding as the first partition holding, returns and performs step 104.
Embodiments provide the backup of a kind of embedded OS and the method recovered, by dividing at least two partition holdings, the image file of embedded OS is stored in each partition holding, one of them partition holding of specifying is arranged and guides mark, when after system electrification, detect current current first partition holding with guiding mark, and the guiding mark on current first partition holding is transferred in current second partition holding, load the image file stored in current first partition holding, start embedded OS, then judge whether embedded OS starts successfully, if start successfully, again the guiding mark on current second partition holding is transferred back to current first partition holding, if start unsuccessfully, then using current second partition holding as the first partition holding, return and perform current current first partition holding with guiding mark of described detection, like this, after embedded OS powers on, after the current partition holding having and guide mark being detected, guiding mark is transferred on another partition holding, start from current partition holding, if start successfully, illustrate that the image file stored in current partition holding is available, the transfer of guiding mark is returned, next time, embedded OS still started from current partition holding, if start unsuccessfully, then automatically, to start from another partition holding, thus without the need to being upgraded embedded OS by artificial mode, decrease the time needed for embedded OS recovery.
In an embodiment of the invention, when the number of partition holding is greater than two, cyclic ordering can be carried out to each partition holding divided, and guiding mark is arranged to the partition holding arranged in first, after embedded OS powers on, detect and guide mark to be on current partition holding, if current partition holding is last in partition holding sequence, guiding mark on current partition holding is just transferred to the partition holding of partition holding sequence first by that, if current partition holding is not last in partition holding sequence, then the guiding mark on current partition holding is transferred to the next and adjacent with it partition holding of current partition holding, like this, can each partition holding of poll, ensure that each partition holding plays a role, reduce embedded OS and disabled probability occurs, improve the stability of embedded OS.
In an embodiment of the invention, after judging starting of embedded operation system failure, the image file stored in current second partition holding is copied in current first partition holding, cover original image file in current first partition holding, then embedded OS is started from current second partition holding, like this, after the image file stored in one of them partition holding goes wrong and cannot start, the image file stored in other partition holdings is copied when in this partition holding, the image file gone wrong is covered, thus realize the backup of embedded OS, realize the automatic reparation to the partition holding that goes wrong, ensure that embedded OS can both normally start all the time, improve the availability of embedded OS.
In an embodiment of the invention, for each partition holding arranges corresponding boot parameter r_active, during initialization, the boot parameter r_active of designated store subregion is set to YES, the boot parameter r_active of other partition holdings is all set to NO, after embedded OS powers on, according to the ranking results of partition holding, whether the boot parameter r_active detecting each partition holding is successively YSE, if it is stop, and start embedded OS from this partition holding, if not, then continue to detect partition holding below, until find boot parameter r_active to be the partition holding of YES, so just determine the partition holding of priming during each starting of embedded operation system.
In an embodiment of the invention, for each partition holding arranges corresponding image recovery mark rec_image, wherein the default value of image recovery mark rec_image is NO, when starting embedded OS from current partition holding, according to the ranking results of partition holding, after the boot parameter r_active of the next partition holding of current partition holding is set to YES, the image recovery of current partition holding mark rec_image is set to YES, if embedded OS starts successfully from current partition holding, then after guiding mark is transferred to current partition holding, the image recovery of current partition holding mark rec_image is set to NO, if embedded OS starts unsuccessfully from current partition holding, then after embedded OS resets, according to the result of partition holding sequence, whether the image recovery mark rec_image detecting each partition holding is successively YES, if, then stop detecting, then the image file stored in the next partition holding of this partition holding is copied in this partition holding, cover original image file, if not, then continue to detect partition holding below, until detect that image recovery mark rec_image is the partition holding of YES, and the image file stored covers, after the image file identified by image recovery again in the partition holding that rec_image is YES covers, the image recovery of this partition holding mark rec_image is set to NO, like this, achieve the identification of the partition holding to the image file place that goes wrong, further the image file gone wrong is covered.
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with drawings and the specific embodiments, the present invention is described in further detail.
As shown in Figure 2, one embodiment of the invention provides the backup of a kind of embedded OS and the method recovered, and when comprising 3 partition holdings, the method comprises:
Step 201: divide 3 partition holdings, store the image file of embedded OS in each partition holding, and each partition holding is carried out cyclic ordering.
In an embodiment of the invention, nonvolatile memory NandFlash divides 3 partition holdings, in each partition holding, stores the image file of identical embedded OS, and 3 partition holdings are carried out cyclic ordering.3 partition holdings such as divided on nonvolatile memory NandFlash are partition holding 1, partition holding 2 and partition holding 3, store identical embedded OS image file in 3 partition holdings after, cyclic ordering is carried out to 3 partition holdings, ranking results is partition holding 1-partition holding 2-partition holding 3, if embedded OS starts unsuccessful from partition holding 3, then return and start from partition holding 1, realize the cyclic ordering of 3 partition holdings.
Step 202: arrange boot parameter r_active and image recovery mark rec_image to each partition holding, wherein the initial value of image recovery mark rec_image is NO.
In an embodiment of the invention, corresponding boot parameter r_active and image recovery mark rec_image is arranged to three partition holdings, the boot parameter of partition holding 1 correspondence is r_active_1, image recovery is designated rec_image_1, the boot parameter of partition holding 2 correspondence is r_active_2, image recovery is designated rec_image_2, the boot parameter of partition holding 3 correspondence is r_active_3, image recovery is designated rec_image_3, and wherein the initial value of rec_image_1, rec_image_2 and rec_image_3 is NO.
Step 203: boot parameter r_active corresponding for the partition holding of sequence first is set to YES, the boot parameter r_active that other partition holdings are corresponding is set to NO.
In an embodiment of the invention, according to the result of partition holding cyclic ordering, be that r_active_1 is set to YES by the boot parameter of partition holding 1 correspondence, the boot parameter r_active_2 of partition holding 2 correspondence is set to NO, the boot parameter r_active_3 of partition holding 3 correspondence is set to NO, during such embedded OS initial start-up, will from partition holding 1 load images file.
Step 204: detect current first partition holding having and guide mark.
In an embodiment of the invention, after embedded OS powers on or resets, according to the result of partition holding sequence, detect the boot parameter r_active that each partition holding is corresponding successively, judge whether the boot parameter r_active that each partition holding is corresponding is YES successively, next if not then continuing to detect, until find boot parameter r_active to be current first partition holding of YES, then stop detecting, determine to start embedded OS from current first partition holding.Such as, whether the boot parameter r_active_1 first detecting partition holding 1 correspondence is YES, if not, whether the boot parameter r_active_2 then detecting partition holding 2 correspondence is YES, if so, then stop detecting, determine to start embedded OS from partition holding 2.
Step 205: by next and adjacent with it current second partition holding guiding mark to be transferred to current first partition holding.
In an embodiment of the invention, after determining that boot parameter r_active that current first partition holding is corresponding is YES, according to the result of partition holding sequence, boot parameter r_active corresponding for current first partition holding is set to NO, and by the next one of current first partition holding and boot parameter r_active corresponding to current second partition holding be adjacent is set to YES, like this, if the image file existing problems stored in current first partition holding, when causing embedded OS to start, embedded OS will start from current second partition holding.Such as, the boot parameter r_active_2 of partition holding 2 correspondence is set to NO, and the boot parameter r_active_3 of partition holding 3 correspondence is set to YES.
Step 206: image recovery corresponding for current first partition holding mark rec_image is set to YES.
In an embodiment of the invention, after boot parameter r_active corresponding for current first partition holding is set to NO, image recovery corresponding for current first partition holding mark rec_image is set to YES, like this, if when embedded OS cannot start from current first partition holding, after embedded OS resets can to image recovery mark rec_image be YES partition holding in image file cover, thus the image file that store in in-problem current first partition holding to be covered.Such as, the image recovery of partition holding 2 correspondence mark rec_image is set to YES.
Step 207: load the image file in current first partition holding, starts embedded OS.
In an embodiment of the invention, after embedded OS powers on or resets, load the image file stored in current first partition holding that corresponding boot parameter r_active is YES, start embedded OS.Such as, the image file stored in load store subregion 2, system embedment formula operating system.
Step 208: judge whether embedded OS starts successfully, if so, performs step 209, otherwise performs step 211.
In an embodiment of the invention, loading the image file stored in current first partition holding, after starting embedded OS, judge whether embedded OS starts successfully, if, then embedded OS normally runs, corresponding execution step 209, if not, embedded OS starts unsuccessfully from current first partition holding, need to start from other partition holdings, and the image file stored in current first partition holding is recovered, corresponding execution step 211.
Step 209: guiding mark is transferred to current first partition holding.
In an embodiment of the invention, when embedded OS starts successfully from current first partition holding, illustrate that the image file stored in current first partition holding is safe and complete, the normal startup of embedded OS can be ensured, so next embedded OS still starts from current first partition holding, so boot parameter r_active corresponding for current first partition holding is set to YES, boot parameter r_active corresponding for current second partition holding is set to NO, startup mark is transferred to current first partition holding again.Such as, the boot parameter r_active_2 of partition holding 2 correspondence is set to YES, the boot parameter r_active_3 of partition holding 3 correspondence is set to NO.
Step 210: image recovery corresponding for current first partition holding mark rec_image is set to NO.
In an embodiment of the invention, after boot parameter r_active corresponding for current first partition holding is set to YES, the image file no problem stored in current first partition holding is described, without the need to covering it, so image recovery corresponding for current first partition holding mark rec_image is set to NO.Such as, the image recovery of partition holding 2 correspondence mark rec_image_2 is set to NO.
Step 211: the image file in current second partition holding is copied in current first partition holding, covers original image file.
In an embodiment of the invention, when after starting of embedded operation system failure, the image file existing problems stored in current first partition holding are described, according to the result of partition holding sequence, detect the image recovery mark rec_image that each partition holding is corresponding successively, if the image recovery mark rec_image that partition holding is corresponding is not YES, then detect next partition holding, until find corresponding image recovery mark rec_image to be current first partition holding of YES, stop detecting, the image file stored in current second partition holding is copied in current first partition holding, cover original image file in current first partition holding, the image file stored in current first partition holding is recovered, use in order to the later stage.Such as, detect the image recovery mark rec_image_1 of partition holding 1 correspondence, rec_image_1 is NO, the picture continuing to detect partition holding 2 correspondence recovers mark rec_image_2, rec_image_2 is YES, stop detecting, the image file stored in partition holding 3 is copied in partition holding 2, cover original image file in partition holding 2.
Step 212: image recovery corresponding for current first partition holding mark rec_image is set to NO.
In an embodiment of the invention, the image file stored in current second partition holding is copied to after in current first partition holding, the image file stored in current first partition holding is recovered, image recovery corresponding for current first partition holding mark rec_image is set to NO, in order to avoid the image file repeated storing in current first partition holding recovers.Such as, the image recovery of partition holding 2 correspondence mark rec_image_2 is set to NO.
Step 213: using current second partition holding as the first partition holding, returns and performs step 204.
In an embodiment of the invention, due to the image file existing problems stored in current first partition holding, embedded OS is caused successfully not start, the boot parameter r_active that now current second partition holding system is corresponding is YES, current second partition holding as the first partition holding, will return and perform step 204.Such as, using partition holding 3 as current first partition holding, return and perform step 204.
As shown in Figure 3, one embodiment of the invention additionally provides the backup of a kind of embedded OS and the device recovered, and comprising: zoning unit 301, storage unit 302, first setting unit 303, detecting unit 304, buanch unit 305, loading unit 306, judging unit 307 and performance element 308;
Zoning unit 301, for dividing at least two partition holdings;
Storage unit 302, for all storing the image file of described embedded OS in each described partition holding of described zoning unit 301 division;
First setting unit 303, arranges for the designated store subregion at least two partition holdings to described zoning unit 301 division and guides mark;
Detecting unit 304, for detecting current current first partition holding with the guiding mark that described first setting unit 303 is arranged;
Buanch unit 305, the guiding mark for described first setting unit being arranged 303 is transferred to current second partition holding at least two partition holdings that described division unit 301 divides;
Loading unit 306, being stored in described image file in described current first partition holding for loading described storage unit 302, starting described embedded OS;
Judging unit 307, for judging whether described embedded OS starts successfully;
Performance element 308, for the judged result according to described judging unit, if, described guiding mark is transferred to described current first partition holding, if not, using described current second partition holding as the first partition holding, detect current current first partition holding with described guiding mark by described detecting unit 304.
In an embodiment of the invention, this device comprises further: sequencing unit;
Described sequencing unit, for when described partition holding number is greater than two, carries out cyclic ordering to partition holding described in each;
Described first setting unit 303, for the ranking results according to described partition holding, arranges described guiding mark to the described partition holding arranged in first;
Described buanch unit 305, if for last partition holding that described current first partition holding is in the sequence of described partition holding, then guide described current second partition holding identifying and be transferred to and be positioned at described partition holding sequence first, if described current first partition holding is not last in the sequence of described partition holding, then guide described the next one and current second partition holding be adjacent that identify and be transferred to described current first partition holding.
In an embodiment of the invention, this device comprises further: copied cells;
Described copied cells, for judge the failure of described starting of embedded operation system at described judging unit after, and at described performance element using described current second partition holding as the first partition holding, before there is current first partition holding of described guiding mark by described detecting unit detection is current, the image file stored in described current second partition holding is copied in described current first partition holding, covers original image file in described current first partition holding.
In an embodiment of the invention, this device comprises further: the second setting unit;
Described second setting unit, for arranging corresponding boot parameter r_active for each described partition holding;
Described first setting unit 303, for boot parameter r_active corresponding for described designated store subregion is set to YES, the boot parameter r_active that partition holding described in other each is corresponding is set to NO;
Described detecting unit 304, for the ranking results according to described partition holding, detect the boot parameter r_active that each partition holding described is corresponding successively, if the boot parameter r_active that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, if boot parameter r_active corresponding to current partition holding is NO, then continue to detect next partition holding, until detect that boot parameter r_active is the partition holding of YES.
In an embodiment of the invention, this device comprises further: the 3rd setting unit, the 4th setting unit, the 5th setting unit and the 6th setting unit;
Described 3rd setting unit, for arranging corresponding image recovery mark rec_image for each described partition holding, wherein, the default value of described image recovery mark rec_image is NO;
Described 4th setting unit, for described buanch unit by described guide mark be transferred to described in after current second partition holding at least two partition holdings, and before described loading unit loads the described image file in described current first partition holding, image recovery corresponding for described current first partition holding mark rec_image is set to YES;
Described copied cells, for the ranking results according to described partition holding, detect the image recovery mark rec_image that each partition holding described is corresponding successively, if the image recovery mark rec_image that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, the image file stored in described current second partition holding is copied in described current first partition holding, if the image recovery mark rec_image that current partition holding is corresponding is NO, then continue to detect next partition holding, until detect that image recovery mark rec_image is described current first partition holding of YES, perform and described the image file stored in described current second partition holding is copied in described current first partition holding,
Described 5th setting unit, for the described image file stored in described current second partition holding being copied in described current first partition holding at described copied cells, to cover in described current first partition holding after original described image file, and at described performance element using described current second partition holding as the first partition holding, before there is current first partition holding of described guiding mark by described detecting unit detection is current, image recovery corresponding for described current first partition holding mark rec_image is set to NO;
Described 6th setting unit, after described guiding mark being transferred to described current first partition holding at described performance element, is set to NO by image recovery corresponding for described current first partition holding mark rec_image.
The content such as information interaction, implementation between each unit in the said equipment, due to the inventive method embodiment based on same design, particular content can see in the inventive method embodiment describe, repeat no more herein.
According to such scheme, a kind of embedded OS backup that embodiments of the invention provide and the method recovered and device, at least have following beneficial effect:
1, in the embodiment of the present invention, by dividing at least two partition holdings, the image file of embedded OS is stored in each partition holding, one of them partition holding of specifying is arranged and guides mark, when after system electrification, detect current current first partition holding with guiding mark, and the guiding mark on current first partition holding is transferred in current second partition holding, load the image file stored in current first partition holding, start embedded OS, then judge whether embedded OS starts successfully, if start successfully, again the guiding mark on current second partition holding is transferred back to current first partition holding, if start unsuccessfully, then using current second partition holding as the first partition holding, return and perform current current first partition holding with guiding mark of described detection, like this, after embedded OS powers on, after the current partition holding having and guide mark being detected, guiding mark is transferred on another partition holding, start from current partition holding, if start successfully, illustrate that the image file stored in current partition holding is available, the transfer of guiding mark is returned, next time, embedded OS still started from current partition holding, if start unsuccessfully, then automatically, to start from another partition holding, thus without the need to being upgraded embedded OS by artificial mode, decrease the time needed for embedded OS recovery.
2, in the embodiment of the present invention, corresponding boot parameter r_active and image recovery mark rec_image is arranged to each partition holding, by arranging YES or the NO state of boot parameter r_active and image recovery mark rec_image, the partition holding that the partition holding of guiding and needs carry out recovering can be differentiated clearly, improve embedded OS backup and the accuracy recovered like this.
3, in the embodiment of the present invention, when the image file stored in a partition holding goes wrong, when embedded OS normally cannot be started from this subregion, the image file stored in other partition holdings is copied in this partition holding, cover original image file, embedded OS starts from other partition holding, like this, when in a partition holding, image file goes wrong, embedded OS starts from other partition holdings, and the image file in the partition holding gone wrong is recovered, ensure that embedded OS has multiple image file for subsequent use all the time, reduce the probability that embedded OS can not start, improve availability and the stability of embedded OS.
4, in the embodiment of the present invention, when marking off multiple partition holding, cyclic ordering is carried out to each partition holding, when embedded OS cannot be started from partition holding for one, then according to the result of partition holding sequence, start embedded OS from the next partition holding of this partition holding, like this, all partition holdings will be made all to play a role, the utilization factor of storage resources will be provided, improve the stability of embedded OS.
It should be noted that, in this article, the relational terms of such as first and second and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element " being comprised " limited by statement, and be not precluded within process, method, article or the equipment comprising described key element and also there is other same factor.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that programmed instruction is relevant, aforesaid program can be stored in the storage medium of embodied on computer readable, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium in.
Finally it should be noted that: the foregoing is only preferred embodiment of the present invention, only for illustration of technical scheme of the present invention, be not intended to limit protection scope of the present invention.All any amendments done within the spirit and principles in the present invention, equivalent replacement, improvement etc., be all included in protection scope of the present invention.

Claims (10)

1. an embedded OS backup and the method recovered, it is characterized in that, divide at least two partition holdings, the image file of described embedded OS is all stored in each described partition holding, designated store subregion in described at least two partition holdings is arranged and guides mark, also comprise:
Detect current current first partition holding with described guiding mark;
Current second partition holding at least two partition holdings described in described guiding mark is transferred to;
Load the described image file in described current first partition holding, start described embedded OS;
Judge whether described embedded OS starts successfully;
If so, described guiding mark is transferred to described current first partition holding, if not, using described current second partition holding as the first partition holding, returns and perform current current first partition holding with described guiding mark of described detection.
2. method according to claim 1, is characterized in that, when described partition holding number is greater than two, carry out cyclic ordering to partition holding described in each, described designated store subregion is: arrange the partition holding in first;
Described current second partition holding comprises: if described current first partition holding is last partition holding in the sequence of described partition holding, then described current second partition holding is first partition holding in the sequence of described partition holding, if described current first partition holding is not last in the sequence of described partition holding, then described current second partition holding is the next partition holding adjacent with described current first partition holding.
3. method according to claim 1, it is characterized in that, after judging the failure of described starting of embedded operation system, and described using described current second partition holding as the first partition holding, return perform described detection current have described guide mark current taking a step forward of first partition holding comprise:
The image file stored in described current second partition holding is copied in described current first partition holding, covers original image file in described current first partition holding.
4. method according to claim 2, is characterized in that, comprises further: for each described partition holding arranges corresponding boot parameter r_active;
Described setting the designated store subregion in described at least two partition holdings guides mark to comprise: boot parameter r_active corresponding for described designated store subregion is set to YES;
Described setting the designated store subregion in described at least two partition holdings guides mark to comprise further: boot parameter r_active corresponding for partition holding described in other each is set to NO;
Current current first partition holding with described guiding mark of described detection comprises: according to the ranking results of described partition holding, detect the boot parameter r_active that each partition holding described is corresponding successively, if the boot parameter r_active that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, if the boot parameter r_active that current partition holding is corresponding is NO, then continue to detect next partition holding, until detect that boot parameter r_active is the partition holding of YES.
5. method according to claim 3, is characterized in that, comprises further: for each described partition holding arranges corresponding image recovery mark rec_image, wherein, the default value of described image recovery mark rec_image is NO;
Described by described guide mark be transferred to described in after current second partition holding at least two partition holdings, and to comprise loading the taking a step forward of described image file in described current first partition holding: image recovery corresponding for described current first partition holding mark rec_image is set to YES;
Describedly the image file stored in described current second partition holding is copied to described current first partition holding comprise: according to the ranking results of described partition holding, detect the image recovery mark rec_image that each partition holding described is corresponding successively, if the image recovery mark rec_image that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, the image file stored in described current second partition holding is copied in described current first partition holding, if the image recovery mark rec_image that current partition holding is corresponding is NO, then continue to detect next partition holding, until detect that image recovery mark rec_image is described current first partition holding of YES, perform and described the image file stored in described current second partition holding is copied in described current first partition holding,
Described, the described image file stored in described current second partition holding is copied in described current first partition holding, to cover in described current first partition holding after original described image file, and described using described current second partition holding as the first partition holding, return perform described detection current have described guide mark current taking a step forward of first partition holding comprise: by image recovery corresponding for described current first partition holding mark rec_image be set to NO;
Described described guiding mark is transferred to described current first partition holding after comprise further: image recovery corresponding for described current first partition holding mark rec_image is set to NO.
6. embedded OS backup and the device recovered, is characterized in that, comprising:
Zoning unit, for dividing at least two partition holdings;
Storage unit, for all storing the image file of described embedded OS in each described partition holding that described zoning unit divides;
First setting unit, arranges for the designated store subregion at least two partition holdings dividing described zoning unit and guides mark;
Detecting unit, for detecting current current first partition holding with the guiding mark that described first setting unit is arranged;
Buanch unit, the guiding mark for being arranged by described first setting unit is transferred to current second partition holding at least two partition holdings of described division unit division;
Loading unit, for loading the described image file of described cell stores in described current first partition holding, starts described embedded OS;
Judging unit, for judging whether described embedded OS starts successfully;
Performance element, for the judged result according to described judging unit, if, described guiding mark is transferred to described current first partition holding, if not, using described current second partition holding as the first partition holding, detect current current first partition holding with described guiding mark by described detecting unit.
7. device according to claim 6, is characterized in that, comprises further: sequencing unit;
Described sequencing unit, for when described partition holding number is greater than two, carries out cyclic ordering to partition holding described in each;
Described first setting unit, for the ranking results according to described partition holding, arranges described guiding mark to the described partition holding arranged in first;
Described buanch unit, if for last partition holding that described current first partition holding is in the sequence of described partition holding, then guide described current second partition holding identifying and be transferred to and be positioned at described partition holding sequence first, if described current first partition holding is not last in the sequence of described partition holding, then guide described the next one and current second partition holding be adjacent that identify and be transferred to described current first partition holding.
8. device according to claim 6, is characterized in that, comprises further: copied cells;
Described copied cells, for judge the failure of described starting of embedded operation system at described judging unit after, and at described performance element using described current second partition holding as the first partition holding, before there is current first partition holding of described guiding mark by described detecting unit detection is current, the image file stored in described current second partition holding is copied in described current first partition holding, covers original image file in described current first partition holding.
9. device according to claim 7, is characterized in that, comprises further: the second setting unit;
Described second setting unit, for arranging corresponding boot parameter r_active for each described partition holding;
Described first setting unit, for boot parameter r_active corresponding for described designated store subregion is set to YES, the boot parameter r_active that partition holding described in other each is corresponding is set to NO;
Described detecting unit, for the ranking results according to described partition holding, detect the boot parameter r_active that each partition holding described is corresponding successively, if the boot parameter r_active that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, if boot parameter r_active corresponding to current partition holding is NO, then continue to detect next partition holding, until detect that boot parameter r_active is the partition holding of YES.
10. device according to claim 8, is characterized in that, comprises further: the 3rd setting unit, the 4th setting unit, the 5th setting unit and the 6th setting unit;
Described 3rd setting unit, for arranging corresponding image recovery mark rec_image for each described partition holding, wherein, the default value of described image recovery mark rec_image is NO;
Described 4th setting unit, for described buanch unit by described guide mark be transferred to described in after current second partition holding at least two partition holdings, and before described loading unit loads the described image file in described current first partition holding, image recovery corresponding for described current first partition holding mark rec_image is set to YES;
Described copied cells, for the ranking results according to described partition holding, detect the image recovery mark rec_image that each partition holding described is corresponding successively, if the image recovery mark rec_image that current partition holding is corresponding is YES, then stop detecting, current bay is described current first partition holding, the image file stored in described current second partition holding is copied in described current first partition holding, if the image recovery mark rec_image that current partition holding is corresponding is NO, then continue to detect next partition holding, until detect that image recovery mark rec_image is described current first partition holding of YES, perform and described the image file stored in described current second partition holding is copied in described current first partition holding,
Described 5th setting unit, for the described image file stored in described current second partition holding being copied in described current first partition holding at described copied cells, to cover in described current first partition holding after original described image file, and at described performance element using described current second partition holding as the first partition holding, before there is current first partition holding of described guiding mark by described detecting unit detection is current, image recovery corresponding for described current first partition holding mark rec_image is set to NO;
Described 6th setting unit, after described guiding mark being transferred to described current first partition holding at described performance element, is set to NO by image recovery corresponding for described current first partition holding mark rec_image.
CN201510522512.9A 2015-08-24 2015-08-24 Embedded operating system backup and restoration method and device Pending CN105138430A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510522512.9A CN105138430A (en) 2015-08-24 2015-08-24 Embedded operating system backup and restoration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510522512.9A CN105138430A (en) 2015-08-24 2015-08-24 Embedded operating system backup and restoration method and device

Publications (1)

Publication Number Publication Date
CN105138430A true CN105138430A (en) 2015-12-09

Family

ID=54723786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510522512.9A Pending CN105138430A (en) 2015-08-24 2015-08-24 Embedded operating system backup and restoration method and device

Country Status (1)

Country Link
CN (1) CN105138430A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598780A (en) * 2016-11-22 2017-04-26 深圳中科讯联科技股份有限公司 System backup and recovery method and device
CN106855834A (en) * 2015-12-08 2017-06-16 华为技术有限公司 A kind of data back up method, device and system
CN107368315A (en) * 2017-07-20 2017-11-21 郑州云海信息技术有限公司 A kind of startup method and device of double hard disk dual systems
CN109634781A (en) * 2018-12-06 2019-04-16 中国航空工业集团公司洛阳电光设备研究所 One kind is based on embedded program two-region Backup Images system and starting method
CN109783150A (en) * 2019-01-31 2019-05-21 深兰科技(上海)有限公司 A kind of anti-brick method and device of embedded system starting
CN110083483A (en) * 2018-01-26 2019-08-02 北京京东尚科信息技术有限公司 The method and apparatus for removing terminal data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010056425A1 (en) * 2000-06-19 2001-12-27 Hewlett-Packard Company Automatic backup/recovery process
CN102073517A (en) * 2009-11-23 2011-05-25 中兴通讯股份有限公司 Upgrading and backup method and device for embedded system
CN102243594A (en) * 2011-07-26 2011-11-16 重庆大唐科技股份有限公司 Method for safely and remotely upgrading embedded Linux system software
CN103678030A (en) * 2012-09-04 2014-03-26 杭州海康威视数字技术股份有限公司 Multi-system equipment start system and method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010056425A1 (en) * 2000-06-19 2001-12-27 Hewlett-Packard Company Automatic backup/recovery process
CN102073517A (en) * 2009-11-23 2011-05-25 中兴通讯股份有限公司 Upgrading and backup method and device for embedded system
CN102243594A (en) * 2011-07-26 2011-11-16 重庆大唐科技股份有限公司 Method for safely and remotely upgrading embedded Linux system software
CN103678030A (en) * 2012-09-04 2014-03-26 杭州海康威视数字技术股份有限公司 Multi-system equipment start system and method thereof

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106855834A (en) * 2015-12-08 2017-06-16 华为技术有限公司 A kind of data back up method, device and system
CN106598780A (en) * 2016-11-22 2017-04-26 深圳中科讯联科技股份有限公司 System backup and recovery method and device
CN107368315A (en) * 2017-07-20 2017-11-21 郑州云海信息技术有限公司 A kind of startup method and device of double hard disk dual systems
CN110083483A (en) * 2018-01-26 2019-08-02 北京京东尚科信息技术有限公司 The method and apparatus for removing terminal data
CN109634781A (en) * 2018-12-06 2019-04-16 中国航空工业集团公司洛阳电光设备研究所 One kind is based on embedded program two-region Backup Images system and starting method
CN109783150A (en) * 2019-01-31 2019-05-21 深兰科技(上海)有限公司 A kind of anti-brick method and device of embedded system starting

Similar Documents

Publication Publication Date Title
CN105138430A (en) Embedded operating system backup and restoration method and device
CN110765026B (en) Automatic test method, device, storage medium and equipment
CN101882085B (en) System starting method and embedded equipment
CN103842968B (en) A kind of moving method of internal storage data, computing machine and device
CN102722394B (en) Start upgrading method of embedded equipment
CN103902399B (en) Software system repair processing method and software system repair processing device
CN102855174A (en) Automatic-recovery target program run control method and device in automated testing
CN103970557A (en) Storage device and system starting method thereof
CN104281479A (en) Firmware upgrading method and device
EP3879399A1 (en) Method and apparatus for upgrading vehicle-mounted tbox, device, and storage medium
CN104536841B (en) A kind of android system Data subregions self-repair method and system
CN108345464A (en) A kind of the startup method and Android vehicle device of Android system
CN109189485A (en) A kind of system starting management of embedded device, operating system configuration method
CN102043662A (en) Data modification method for multiple operation systems
CN110597532A (en) Data acquisition module, firmware upgrading method thereof and storage medium
CN111309388B (en) Automatic rollback system and method for system software version of equipment
CN115080076B (en) Cloud mobile phone software management method
CN111984195A (en) Method and device for improving stability of embedded Linux system
CN104699569B (en) A kind of MQX operation system images structure, MQX operating systems, power information acquisition terminal and image update method
CN107193603A (en) The upgrade method and device of a kind of intelligent appliance
CN116627519A (en) Multisystem starting method of embedded equipment
CN102999353B (en) Create method and the device of device node
CN110990052B (en) Configuration preservation method and device
CN110795155B (en) System starting method and device, electronic equipment and storage medium
CN113467797B (en) Program updating method, device and system and computer readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20151209

WD01 Invention patent application deemed withdrawn after publication