CN102023908B - Method and device for backing up boot program - Google Patents

Method and device for backing up boot program Download PDF

Info

Publication number
CN102023908B
CN102023908B CN201010571959.2A CN201010571959A CN102023908B CN 102023908 B CN102023908 B CN 102023908B CN 201010571959 A CN201010571959 A CN 201010571959A CN 102023908 B CN102023908 B CN 102023908B
Authority
CN
China
Prior art keywords
memory block
boot
bootstrap program
main bootstrap
upgrading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201010571959.2A
Other languages
Chinese (zh)
Other versions
CN102023908A (en
Inventor
杨细龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201010571959.2A priority Critical patent/CN102023908B/en
Publication of CN102023908A publication Critical patent/CN102023908A/en
Priority to PCT/CN2011/080599 priority patent/WO2012071945A1/en
Application granted granted Critical
Publication of CN102023908B publication Critical patent/CN102023908B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1417Boot up procedures

Abstract

The invention discloses a method for backing up a boot program, which is used for realizing backup of the boot program and improving the reliability of system startup. The method comprises the following steps: obtaining a main boot program in a first memory area according to the default or recorded identification information in the first memory area, and starting up the main boot program, wherein the first memory area is the current memory area; after the main boot program is successfully started up, recording the identification information in the first memory area; and backing up the main boot program in the first memory area to a second memory area in the same memory. The invention also discloses a method for upgrading a boot program, which is used for realizing upgrading of the boot program. The method comprises the following steps: determining whether the boot program is needed to be upgraded after the main boot program in the first memory area is started up; if so, obtaining upgrading information; and upgrading the boot program backed up to the second memory area according to the obtained upgrading information. The invention also discloses a device for realizing the method.

Description

A kind of boot backup method and device
Technical field
The present invention relates to embedded and computer realm, particularly a kind of boot backup method and device.
Background technology
In complicated embedded product, generally need one section of simple boot code in device power or after resetting, necessary configuration is done to CPU, guide CPU minimum system normally to start.After the successful operation of CPU minimum system, refill the driver and system software that carry peripheral function device, and realize the normal operation of embedded product.
Boot code is generally stored in nonvolatile semiconductor memory member, and code size is generally 1K ~ 512K byte.Due to the existence of various abnormal conditions, the data in memory device may change, and cause equipment or single board starting failure, affect the reliability of properties of product.Therefore, necessary backup is done to startup-program code and just seem very important.Comparatively popular start-up code backup method mainly contains following three kinds at present: one, utilize two identical memory devices to back up guidance code, can take more hardware resource like this, also take more storage space; Two, the storer that two store boot is set, and specify that one of them storer is main boot storer, not only need the parts such as amendment corresponding registers during backup boot, also need former boot information to carry out corresponding modify, method of calibration can be made so comparatively complicated; Three, the memory block that two store boot is set in a storer, and specify that one of them memory block is main boot memory block, also add storage hardware in addition to store chip selection signal, system starts at every turn all need from main boot storer, toggle speed can be made slow, starting efficiency is low, increases hardware resource in addition and deposits chip selection signal, cause the waste of hardware resource.Further, said method adds additional device, adds the unreliable factor of system cloud gray model simultaneously.
Summary of the invention
The embodiment of the present invention provides a kind of boot backup method, for realizing the backup to boot, improves the reliability of system.
A kind of boot backup method, comprises the following steps:
According to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area, and described main bootstrap program is the boot stored in current memory area;
Judge that whether start total degree is greater than the first setting value, when judged result is for being, determines to start unsuccessfully, sending warning information;
When judged result is no, receives reset signal, carry out reset operation, restart again after the second memory block is switched to current memory area, and record starts total degree;
Starting successfully, the identification information recording the second memory block is using as the chip selection signal started next time;
Judge that whether the main bootstrap program that the second memory block stores is consistent with the backup boot that the first memory block stores, when judged result is no, the main bootstrap program in the second memory block is backuped to the first memory block in same storer.
A kind of boot upgrade method, comprises the following steps:
According to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area, and described main bootstrap program is the boot stored in current memory area;
Judge that whether start total degree is greater than the first setting value, when judged result is for being, determines to start unsuccessfully, sending warning information;
When judged result is no, receives reset signal, carry out reset operation, restart again after the second memory block is switched to current memory area, and record starts total degree;
Starting successfully, the identification information recording the second memory block is using as the chip selection signal started next time;
After starting according to the main bootstrap program in the second memory block, determine whether to need updated boot programs; Wherein, described second memory block is current memory area;
Judge that whether the main bootstrap program that the second memory block stores is consistent with the backup boot that the first memory block stores, when judged result is no, determine to need updated boot programs, obtain upgrade information;
Upgrade information according to obtaining is upgraded to the backup boot in the first memory block, the first memory block after upgrading is switched to current memory area, and start according to the main bootstrap program in this first memory block, and determine when starting successfully to upgrade successfully.
A kind of boot back-up device, comprising:
Operational module, for according to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area, and described main bootstrap program is the boot stored in current memory area;
Judge module, for when receiving reset signal at every turn, judges whether start total degree is greater than the first setting value;
Control module, for when judged result is for being, determines to start unsuccessfully, sending warning information; And, when judged result is no, receives reset signal, carry out reset operation, and record starts total degree;
Described operational module also restarts after the second memory block is switched to current memory area again;
Described control module, for starting successfully, the identification information recording the second memory block is using as the chip selection signal started next time; And the main bootstrap program stored in judgement first memory block and the backup boot that stores of the second memory block inconsistent time, the main bootstrap program in the second memory block is backuped to the first memory block in same storer.
A kind of boot update device, comprising:
Control module, for starting successfully, the identification information recording the first memory block is using as the chip selection signal started next time; After starting according to the main bootstrap program in the first memory block, determine whether to need updated boot programs; Wherein, described first memory block is current memory area, and described main bootstrap program is the boot stored in current memory area;
Judge module, for when receiving reset signal at every turn, judges whether start total degree is greater than the first setting value;
Described control module, for when judged result is for being, determines to start unsuccessfully, sending warning information; And, when judged result is no, receives reset signal, carry out reset operation, and record starts total degree;
Operational module, restarts after the second memory block is switched to current memory area again; According to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area; And the main bootstrap program stored in judgement second memory block and the backup boot that stores of the first memory block inconsistent time, determine to need updated boot programs to obtain upgrade information, and according to the upgrade information obtained, the backup boot in the first memory block is upgraded, and the first memory block after upgrading is switched to current memory area, and start according to the main bootstrap program in this first memory block, and determine when starting successfully to upgrade successfully.
The embodiment of the present invention according to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area; Starting successfully, recording the identification information of the first memory block; Main bootstrap program in first memory block is backuped to the second memory block in same storer.The embodiment of the present invention provides two boot memory blocks in a storer, can not take too much hardware resource; Whom there is no in regulation two boot memory blocks for main bootstrap program memory block, can start from this boot memory block according to the information starting the boot memory block of preserving successfully last time when system starts, must start from main bootstrap program memory block without the need to limiting, make toggle speed very fast, starting efficiency is higher; After correct startup by the backup code of current memory area in non-present memory block, achieve the backup of boot, ensure that the correctness of backed up boot.In backup procedure, without the need to making amendment to the code of current memory area, and just have modified the parts such as corresponding registers, revised context is less, and checking procedure is fairly simple, can directly back up, and operating process is easy.Further, the identification information recording current memory area can be completed by software as during chip selection signal, without the need to taking hardware resource.
The embodiment of the present invention, also after starting according to the main bootstrap program in the first memory block, determines whether to need updated boot programs; When determining to want updated boot programs, obtain upgrade information; Upgrade information according to obtaining is upgraded to the backup boot in the second memory block.The embodiment of the present invention is selected to upgrade in non-present memory block, to avoid causing veneer again to start because upgrading unsuccessful, improves the reliability of system.
Accompanying drawing explanation
Fig. 1 is the primary structure figure of boot back-up device in the embodiment of the present invention;
Fig. 2 is the detailed structure view of boot back-up device in the embodiment of the present invention;
Fig. 3 is the main flow figure of boot backup method in the embodiment of the present invention;
Fig. 4 judges whether in the embodiment of the present invention to start successful method detailed process flow diagram;
Fig. 5 is the method detailed process flow diagram starting backup boot successfully in the embodiment of the present invention;
Fig. 6 starts successful subsequent to continue the method detailed process flow diagram carrying out upgrading in the embodiment of the present invention;
Fig. 7 is determining to upgrade unsuccessfully the need of the method detailed process flow diagram of upgrading current memory area to non-present memory block in the embodiment of the present invention.
Embodiment
The embodiment of the present invention according to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area; Starting successfully, recording the identification information of the first memory block; Main bootstrap program in first memory block is backuped to the second memory block in same storer.The embodiment of the present invention provides two boot memory blocks in a storer, can not take too much hardware resource; Whom there is no in regulation two boot memory blocks for main bootstrap program memory block, can start from this boot memory block according to the information starting the boot memory block of preserving successfully last time when system starts, must start from main bootstrap program memory block without the need to limiting, make toggle speed very fast, starting efficiency is higher; After correct startup by the backup code of current memory area in non-present memory block, achieve the backup of boot, ensure that the correctness of backed up boot.In backup procedure, without the need to making amendment to the code of current memory area, can directly back up, operating process is easy.Further, the identification information recording current memory area can be completed by software as during chip selection signal, without the need to taking hardware resource.
The embodiment of the present invention, also after starting according to the main bootstrap program in the first memory block, determines whether to need updated boot programs; When determining to want updated boot programs, obtain upgrade information; Upgrade information according to obtaining is upgraded to the backup boot in the second memory block.The embodiment of the present invention is selected to upgrade in non-present memory block, to avoid causing veneer again to start because upgrading unsuccessful, improves the reliability of system.
See Fig. 1, in the embodiment of the present invention, boot back-up device comprises operational module 101 and control module 102.
Operational module 101 for according to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start.The boot stored in current memory area can be called main bootstrap program, the boot stored in non-present memory block is called backup boot, main bootstrap program is comparatively speaking with backup boot, such as, at a time, current memory area is the first memory block, then the boot now stored in the first memory block is main bootstrap program, and the boot stored in the second memory block is backup boot; At subsequent time, current memory area is the second memory block, then the boot now stored in the second memory block is main bootstrap program, and the boot stored in the first memory block is backup boot.After operational module 101 obtains the notice of control module 102, the address information of the boot memory block successfully started according to the last time determines this boot memory block in memory module 103, using this boot memory block as current memory area, and start according to the main bootstrap program stored in this current memory area, namely start according to the code stored in this current memory area.If overflowing for the control counter controlling reset operation in control module 102, then start unsuccessful, carry out reset operation, wherein, if operational module 101 is positioned on veneer, then reset operation can be Reset Board.When control technology device overflows, reset signal can be sent to operational module 101.Described control counter can be house dog counter, when it overflows, can send reset signal, make board resetting.The backup boot stored in second memory block of non-present memory block is switched to main bootstrap program by operational module 101, switch mutually by the first memory block and the second memory block, now the second memory block is current memory area, and operational module 101 restarts according to the main bootstrap program stored in the second memory block.Control module 102 records and starts total degree, often carries out one-shot, then startup total degree is added 1.If the control counter in control module 102 overflows, start still unsuccessful, carry out reset operation, again the backup boot stored in the first memory block is switched to main bootstrap program, operational module 101 starts according to the main bootstrap program stored in the first memory block again, so repeatedly carry out start-up course, if the number of times started reaches the first setting value, such as the first setting value is M, and start still unsuccessful, now warning information can be sent, it can be software alarm, also can be hardware alarm, such as, hardware alarm can be control module 102 using pilot lamp or hummer as alarm signal, then think that system starts unsuccessfully, this single board default.Wherein, number of times M can be preset value, can be kept in control module 102.Can have first counter in control module 102, for recording the startup total degree of operational module 101 in boot backup procedure, operational module 101 often carries out one-shot, then the value of this first counter adds 1.If single board starting success, then operational module 101 notifies that control module 102 preserves the information of current memory area, and described information at least comprises the identification information of current memory area, chip selection signal during to start as next time.Reset and closing control counter, and, if the backup boot in the main bootstrap program in current memory area and non-present memory block is inconsistent, then the boot code in current memory area can copy in non-present memory block by operational module 101, realizes the backup of boot.Start to download complete software version, to start normal work.Operational module 101 also for for when determining to want updated boot programs, obtains upgrade information, and upgrades to the backup boot in the second memory block according to the upgrade information obtained.Start successfully at operational module 101, automatically can carry out escalation process according to arranging of control module 102, or also can carry out escalation process after the upgrade notification receiving control module 102 transmission.Operational module 101 is first according to upgrade information upgrading non-present memory block, and the embodiment of the present invention is the second memory block for non-present memory block.Because current memory area, namely the first memory block can guide operational module 101 normally to start, and time can guarantee to upgrade failure in the second memory block of first upgrading, operational module 101 still normally can start from the first memory block.The backup boot stored in non-present memory block after upgrading is switched to main bootstrap program by operational module 101 after the chip selection signal receiving control module 102, carries out reset operation, and starts according to the main bootstrap program stored in the second memory block.If the control counter in control module 102 overflows, then start unsuccessful, the backup boot stored in the first memory block is switched to main bootstrap program by operational module 101, again upgrades to the second memory block, so repeatedly carries out.If reach the second setting value to the upgrading frequency of failure of the second memory block, such as the second setting value is N, then determine non-present memory block, the i.e. upgrading failure of the second memory block, can send warning information, can be software alarm, also can be hardware alarm, such as, hardware alarm can be send alarm signal by the pilot lamp of control module 102 or hummer.And send inquiry message, whether will continue in current memory area, namely escalation process is carried out in the first memory block to inquire.If select to continue upgrading, then by the information reproduction that stores in the first memory block to the second memory block, first the old information stored will be wiped in the second memory block before copy, and the backup boot stored in the second memory block is switched to main bootstrap program, carry out reset operation, main bootstrap program according to storing in the second memory block starts, and starts to upgrade to the first memory block.If select not continue upgrading, then determine that this is upgraded unsuccessfully.
Wherein, described upgrading frequency of failure N can be preset value, can be kept in control module 102, second counter can be had in control module 102, for calculating the upgrading frequency of failure to a certain boot memory block, once, then the value of the second counter adds 1 in often pair of a certain boot memory block upgrading.
Preferably, operational module 101 can be specially CPU.Operational module 101 can be positioned on veneer.
Main bootstrap program in first memory block, for starting successfully, is backuped to the second memory block in same storer by control module 102; And backing up successfully, record the identification information of the first memory block.Need to start for veneer in the embodiment of the present invention.Control module 102 can store the information that the last success of veneer starts, wherein, the last identification information successfully starting the boot memory block used at least is comprised in this information, comprise two boot memory blocks for the device of program backup in the embodiment of the present invention, this boot bank bit is in memory module 103.Can there be respective identification information two boot memory blocks, and such as, a boot memory block is the first memory block, and another boot memory block is the second memory block.When single board starting success, control module 102 records the identification information of current memory area now, using as the chip selection signal started next time.When veneer needs to start, control module 102 reads the information of the last success startup of veneer that therein stores, the identification information successfully starting used boot memory block according to the last time comprised in described information determines this boot memory block in memory module 103, such as, the address information of this boot memory block can be determined in memory module 103, and using the address information of this boot memory block as chip selection signal, address information according to this boot memory block selects boot memory block, to notify that this boot memory block is switched to current memory area by operational module 101, and start according to the main bootstrap program stored in this current memory area.Wherein, notice can be sent, to notify that operational module 101 starts according to the main bootstrap program stored in this boot memory block by a lead-in wire to operational module 101.A control counter can be comprised in control module 102, control module 102 is also for judging whether this control counter overflows, start this control counter read the information of the upper once success startup that therein stores in control module 102 while, this control counter starts Auto-counting.If single board starting success, then operational module 101 can notify that this control counter resets and cuts out by control module 102.This control counter does not overflow, then determine to start successfully, and if also do not receive clearing or the notice of closing control counter to regular hour control module 102, this control counter will overflow, thus causes interruption, causes system reset.Preferably, this control counter can be house dog counter, when house dog counter overflow, can produce reset signal, make board resetting.If single board starting success, then control module 102 preserves the information of current memory area according to the notice of operational module 101, and described information at least comprises the identification information of current memory area, resets and closes counter.Control module 102 also for after starting according to the main bootstrap program in the first memory block, determines whether to need updated boot programs.Control module 102 also for after operational module 101 starts according to the main bootstrap program in the first memory block, is determined to need updated boot programs.In escalation process, control module 102 is when receiving the notice of comparison module 104, change chip selection signal, the backup boot stored in non-present memory block after upgrading is set to main bootstrap program, such as, upgrade behind the second memory block, second memory block and the first memory block are switched mutually, select the second memory block as current memory area, the backup boot then now stored in the second memory block is main bootstrap program, open control counter, and indicate operational module 101 to carry out reset operation and start according to the main bootstrap program stored in this second memory block.
Preferably, control module 102 can be specially programmable logic device (PLD), such as, can be EPLD (Erasable Programmable Logic Device).Control module 102 can be positioned on veneer, also can not be positioned on veneer.Do not reset when operational module 101 carries out reset operation control module 102.
See Fig. 2, described device also comprises memory module 103, comparison module 104 and judge module 105.
Memory module 103 is for providing boot memory block.In embodiments of the present invention, memory module 103 can comprise two boot memory blocks, i.e. the first memory block and the second memory block, and the first memory block and the second memory block can be arranged in a storer.Wherein, when single board starting, the boot memory block used is called current memory area, and untapped boot memory block is called non-present memory block.Memory module 103 can be positioned on veneer, also can not be positioned on veneer.Do not reset when operational module 101 carries out reset operation memory module 103.
Comparison module 104 is for comparing the boot stored in two boot memory blocks.When after single board starting success, the main bootstrap program that current memory area stores by comparison module 104 and the backup boot that non-present memory block stores compare, and such as, can adopt the mode by bit comparison.Be the first memory block with current memory area, non-present memory block is the second memory block is example.If the backup boot that the main bootstrap program of the first memory block storage and the second memory block store is inconsistent, then notify that the boot that the first memory block stores copies in the second memory block by operational module 101, and need notice operational module 101 first the old backup boot stored in the second memory block to be wiped before copy.If the main bootstrap program stored in the first memory block is consistent with the backup boot that the second memory block stores, then notify that this start-up course of operational module 101 terminates, so that operational module 101 starts normal work.After backup procedure completes, can also notify that control module 102 generates a reset signal, and this reset signal is passed to operational module 101, operational module 101 is made to carry out reset operation, the veneer device resetted except control module 102, and the backup boot stored in the second memory block after backup is switched to main bootstrap program, the main bootstrap program that operational module 101 continues according to storing in this second memory block starts, to judge whether the boot after backing up can make operational module 101 complete startup, the correctness of the boot of checking backup.
Before carrying out escalation process, whether the main bootstrap program that first comparison module 104 compares current memory area storage is consistent with the backup boot that non-present memory block stores, if inconsistent, then notify that operational module 101 can start updating operation, otherwise notice operational module 101 is without the need to upgrading.Be the first memory block with current memory area, non-present memory block is the second memory block is example.In escalation process, after operational module 101 to be upgraded to the second memory block according to the upgrade information self preserved, comparison module 104 is also for comparing the upgrade information preserved in the backup boot stored in the second memory block after upgrading and operational module 101.Wherein, upgraded in the second memory block, be burnt in non-present memory block by the upgrade information in operational module 101.After burning, the backup boot stored in the second memory block after upgrade information in operational module 101 and burning is compared, if the backup boot stored in the second memory block after upgrading is consistent with the upgrade information preserved in operational module 101, then determine burning success, now can notify that the backup boot stored in the second memory block after upgrading is set to main bootstrap program by control module 102, if the upgrade information preserved in the backup boot that stores and operational module 101 in the second memory block after upgrading is inconsistent, then determine burning failure, then can notify that operational module 101 re-starts upgrading, or abandon upgrading.After the backup boot stored in second memory block is upgraded successfully, comparison module 104 can receive the notice of operational module 101, the backup boot stored in the main bootstrap program stored in first memory block and the second memory block is compared, if the backup boot of having upgraded stored in the main bootstrap program of not upgrading stored in the first memory block and the second memory block is inconsistent, then can notify that the boot stored in the second memory block copies in the first memory block by operational module 101.
Judge module 105 is for judging whether start total degree has exceeded the first setting value.First setting value can be M, can be kept in control module 102.When starting unsuccessful, according to the value in the first counter, judge module 105 judges whether startup total degree now reaches M, if the number of times started reaches M, can send warning information, can be software alarm, also can be hardware alarm, such as, hardware alarm can be control module 102 using pilot lamp or hummer as alarm signal, thinks that system starts unsuccessfully, this single board default.If the number of times started does not reach M, then notify that operational module 101 can proceed start-up operation.Judge module 105 is also for judging whether the upgrading frequency of failure has exceeded the second setting value, and the second setting value can be N, can be kept in control module 102.When upgrading unsuccessful, judge module 105 judges now whether reach N to the upgrading frequency of failure of non-present memory block according to the value in the second counter, if the number of times of upgrading reaches N, warning information can be sent, it can be software alarm, also can be hardware alarm, such as, hardware alarm can be control module 102 using pilot lamp or hummer as alarm signal, determine the upgrading failure to non-present memory block, and can notify that operational module 101 sends inquiry message, to inquire the need of continuation in upgrading current memory area.If the number of times of upgrading does not reach N, then notify that operational module 101 can proceed escalation process.
Boot backup method is introduced below by concrete flow process.
See Fig. 3, in the embodiment of the present invention, the main method flow process of boot backup is as follows:
Step 301: according to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start.
Step 302: starting successfully, recording the identification information of the first memory block.
Step 303: the main bootstrap program in the first memory block is backuped to the second memory block in same storer.
See Fig. 4, judge whether to start successful method detailed flow process in the embodiment of the present invention as follows:
Step 401: Board Power up.Whether the embodiment of the present invention starts successfully for veneer.
Step 402: read the boot memory block information that last success starts.Wherein, after operational module 101 successfully starts, control module 102 preserves the information of the boot memory block successfully started, at least comprise the identification information of the boot memory block that this success starts in this information, determine the address information of this boot memory block to make operational module 101 according to this identification information.The first memory block for this boot memory block in the embodiment of the present invention.
Step 403: open control counter.Control module 102 opens control counter, and control counter starts counting.Preferably, this control counter can be house dog counter.
Step 404: the boot stored in the first memory block is switched to main bootstrap program.
Step 405: start to start according to the main bootstrap program stored in this first memory block.Wherein, step 403 and step 404 need be carried out simultaneously.The identification information of this boot memory block is sent to operational module 101 by control module 102, using as chip selection signal, and the identification information of the boot memory block of the successful startup recorded in described chip selection signal and step 402.The boot stored in this first memory block is defined as main bootstrap program according to this chip selection signal by operational module 101, and starts start-up course.
Step 406: judge whether control counter overflows.When judged result is for being, continue step 407.Otherwise continue step 413.
Step 407: judge whether the number of times started is greater than M.When judged result is no, continue step 408, otherwise continue step 412.Judge whether the number of times started is greater than M by the value of the first counter.
Step 408: the backup boot stored in the second memory block is switched to main bootstrap program, and Reset Board.While Reset Board, control module 102 resets and closing control counter, and this control counter starts again to count.If operational module 101 and control module 102 are all positioned on veneer, Reset Board operation then in this step should change reset operation module 101 into, if operational module 101 is positioned at two control modules 102 on veneer and is not positioned on veneer, then can be Reset Board in this step.
Step 409: the main bootstrap program according to storing in the second memory block starts.
Step 410: judge whether control counter overflows.When judged result is for being, continue step 411, otherwise continue step 413.
Step 411: judge whether the number of times started is greater than M.When judged result is no, continue step 404, and also need Reset Board while execution step 404, otherwise continue step 412.
Step 412: determine to start unsuccessfully, send warning information.
Step 413: determine to start successfully, preserves the identification information of current memory area.Control module 102 resets and closes counter simultaneously.
See Fig. 5, the embodiment of the present invention is the method detailed flow process starting backup boot successfully:
Step 501: start successfully, preserves the identification information of current memory area.Step 413 in flow process shown in this step Yu Fig. 4 is same step, can also perform following flow process after executing the step 413 in Fig. 4 flow process.Be the first memory block with current memory area in the embodiment of the present invention, non-present memory block is the second memory block is example.
Step 502: judge that whether the main bootstrap program stored in the first memory block is consistent with the backup boot stored in the second memory block.When judged result is no, continue step 503, otherwise continue step 505.
Step 503: the main bootstrap program stored in the first memory block is backuped to the second memory block.Be about to store in the first memory block after successfully starting main bootstrap program carry out back-up processing.Wherein, backup method can be copy.
Step 504: judge that whether the main bootstrap program stored in the first memory block is consistent with the backup boot stored in the second memory block.When judged result is no, continue step 503, otherwise continue step 505.In backup procedure, mistake is there is in this step in order to prevent.
Step 505: boot has backed up.
After executing the step 505 in Fig. 5 flow process, the backup boot stored in the second memory block can also be continued to switch to main bootstrap program, carry out reset operation, proceed start-up course, to verify whether the boot after backup can make operational module 101 complete startup.
See Fig. 6, starting successful subsequent in the embodiment of the present invention, to continue the method detailed flow process of carrying out upgrading as follows:
Step 601: upgraded in the second memory block.Be burnt in non-present memory block by the upgrade information in operational module 101.In the embodiment of the present invention, described second memory block is non-present memory block, and the first memory block is current memory area.
Step 602: judge that whether the boot of institute's burning in the second memory block is consistent with upgrade information.After burning, the upgrade information preserved in operational module 101 and the boot be burnt in the second memory block are compared, if the upgrade information in operational module 101 is consistent with the boot be burnt in non-present memory block, burning success is then described, if the upgrade information in operational module 101 is inconsistent with the boot be burnt in non-present memory block, then illustrate that burning is unsuccessful, need re-start burning.When judged result is for being, continue step 603, otherwise continue step 601.
Step 603: the chip selection signal after upgrading is sent to operational module 101, opens control counter.The identification information of the second memory block after renewal is sent to operational module 101 as chip selection signal by module 103, and opens control counter, and this control counter starts counting.
Step 604: the backup boot after the upgrading stored in the second memory block is set to main bootstrap program, carry out reset operation, the backup boot after the upgrading stored in the second memory block is set to main bootstrap program according to described chip selection signal by operational module 101.
Step 605: the main bootstrap program according to storing in the second memory block starts.
Step 606: judge whether control counter overflows.When judged result is for being, continue step 607, otherwise continue step 610.When judged result is for being, failure of this time upgrading is described, otherwise explanation upgrades successfully.
Step 607: judge whether the upgrading frequency of failure is greater than N.When judged result is no, continue step 608, otherwise continue step 609.Judge whether the upgrading frequency of failure is greater than N by the value of the second counter.
Step 608: the backup boot stored in the first memory block is switched to main bootstrap program, carries out reset operation.Continue step 601.Now control counter resets by control module 102, and control counter starts again to count.
Step 609: determine to upgrade unsuccessfully in non-present memory block.Now warning information can be sent.
Step 610: determine that non-present memory block upgrades successfully.
See Fig. 7, the embodiment of the present invention be determine to non-present memory block upgrade unsuccessfully the need of upgrading current memory area method detailed flow process:
Step 701: determine to upgrade unsuccessfully in the second memory block.Step 612 in flow process shown in this step Yu Fig. 6 is same step, after executing the step 612 in the flow process shown in Fig. 6, can continue to perform following steps.In the embodiment of the present invention, the second memory block is non-present memory block, and the first memory block is current memory area.
Step 702: judge whether to need upgrading first memory block.When judged result is for being, continue step 703, otherwise process ends.
Step 703: the main bootstrap program stored in the first memory block is copied to the second memory block.Wherein, need before copy first to wipe the backup boot stored in the second memory block.
Step 704: carry out reset operation.Now control counter resets by control module 102, and control counter starts again to count.
Step 705: the backup boot stored in the second memory block is switched to main bootstrap program.
Step 706: upgraded in the first memory block.Be burnt in the first memory block by the upgrade information in operational module 101.Step 601 shown in this step Yu Fig. 6 is same step, and following flow process is also consistent with Fig. 6.Namely, when upgrading unsuccessfully to non-present memory block, attempt proceeding upgrading to current memory area.Wherein, can be automatically upgrade after operational module 101 successfully starts, also can be upgrade after receiving upgrade notification.
The embodiment of the present invention according to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area; Starting successfully, recording the identification information of the first memory block; Main bootstrap program in first memory block is backuped to the second memory block in same storer.The embodiment of the present invention provides two boot memory blocks in a storer, can not take too much hardware resource; Whom there is no in regulation two boot memory blocks for main bootstrap program memory block, can start from this boot memory block according to the information starting the boot memory block of preserving successfully last time when system starts, must start from main bootstrap program memory block without the need to limiting, make toggle speed very fast, starting efficiency is higher; After correct startup by the backup code of current memory area in non-present memory block, achieve the backup of boot, ensure that the correctness of backed up boot.In backup procedure, without the need to making amendment to the code of current memory area, can directly back up, operating process is easy.Further, the identification information recording current memory area can be completed by software as during chip selection signal, without the need to taking hardware resource.Determine to need updated boot programs under the main bootstrap program of the embodiment of the present invention also in the first memory block; Obtain upgrade information; Upgrade information according to obtaining is upgraded to the backup boot in the second memory block.The embodiment of the present invention is selected to upgrade in non-present memory block, to avoid causing veneer again to start because upgrading unsuccessful, improves the reliability of system.Be provided with the higher limit that operational module 101 starts total degree, if start total degree to exceed this higher limit, then determine to start unsuccessfully, avoid operational module 101 ceaselessly to start, waste resource, and easily damage hardware.After operational module 101 correctly starts, or after receiving upgrade notification, operational module 101 can be upgraded to boot memory block, to obtain higher boot version, single-board starting process is optimized more.Before upgrading, the backup boot stored in the main bootstrap program stored in current memory area and non-present memory block is contrasted, if the two is inconsistent, carry out escalation process, otherwise without the need to upgrading, avoid the waste of resource.In escalation process, first upgrade information is verified, to guarantee the correctness of upgrade information, after having upgraded, the boot stored in the boot memory block after according to upgrading is also needed to start, to verify that whether upgrading is successful further, and, upgraded in non-present memory block, to guarantee that operational module 101 can also start according to the main bootstrap program stored in current memory area when upgrading unsuccessful.Further, the method introduced according to the embodiment of the present invention and device, can support online upgrading, is provided with the upper limit of the upgrading frequency of failure, made process, ensure that the correctness of upgrading to the fault that may occur during upgrading.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory and optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the process flow diagram of the method for the embodiment of the present invention, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (6)

1. a boot backup method, is characterized in that, comprises the following steps:
According to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area, and described main bootstrap program is the boot stored in current memory area;
Judge that whether start total degree is greater than the first setting value, when judged result is for being, determines to start unsuccessfully, sending warning information;
When judged result is no, receives reset signal, carry out reset operation, restart again after the second memory block is switched to current memory area, and record starts total degree;
Starting successfully, the identification information recording the second memory block is using as the chip selection signal started next time;
Judge that whether the main bootstrap program that the second memory block stores is consistent with the backup boot that the first memory block stores, when judged result is no, the main bootstrap program in the second memory block is backuped to the first memory block in same storer.
2. a boot upgrade method, is characterized in that, comprises the following steps:
According to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area, and described main bootstrap program is the boot stored in current memory area;
Judge that whether start total degree is greater than the first setting value, when judged result is for being, determines to start unsuccessfully, sending warning information;
When judged result is no, receives reset signal, carry out reset operation, restart again after the second memory block is switched to current memory area, and record starts total degree;
Starting successfully, the identification information recording the second memory block is using as the chip selection signal started next time;
After starting according to the main bootstrap program in the second memory block, determine whether to need updated boot programs; Wherein, described second memory block is current memory area;
Judge that whether the main bootstrap program that the second memory block stores is consistent with the backup boot that the first memory block stores, when judged result is no, determine to need updated boot programs, obtain upgrade information;
Upgrade information according to obtaining is upgraded to the backup boot in the first memory block, the first memory block after upgrading is switched to current memory area, and start according to the main bootstrap program in this first memory block, and determine when starting successfully to upgrade successfully.
3. method as claimed in claim 2, is characterized in that, after starting according to the main bootstrap program stored in this first memory block, also comprise step:
Judge whether control counter overflows, when judged result is no, determines to start successfully, and then determine to upgrade successfully;
When judged result is for being, continue to judge whether the upgrading frequency of failure is greater than the second preset value, when the frequency of failure of upgrading is not more than the second preset value, backup boot in second memory block is switched to main bootstrap program, carry out reset operation, and start according to the main bootstrap program stored in this second memory block;
When the frequency of failure of upgrading is greater than the second preset value, determine the upgrading failure to the first memory block, send warning information, and judge whether to need to upgrade to the second memory block, when needs are upgraded to the second memory block, the information reproduction stored the second memory block, to described first memory block, carries out reset operation, and described first memory block is switched to current memory area, the main bootstrap program according to storing in the first memory block starts.
4. a boot back-up device, is characterized in that, comprising:
Operational module, for according to acquiescence or the identification information of the first memory block of record using as the chip selection signal started next time, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area, and described main bootstrap program is the boot stored in current memory area;
Judge module, for when receiving reset signal at every turn, judges whether start total degree is greater than the first setting value;
Control module, for when judged result is for being, determines to start unsuccessfully, sending warning information; And, when judged result is no, receives reset signal, carry out reset operation, and record starts total degree;
Described operational module also restarts after the second memory block is switched to current memory area again;
Described control module, for starting successfully, is recording the identification information of the second memory block; And the main bootstrap program stored in judgement first memory block and the backup boot that stores of the second memory block inconsistent time, the main bootstrap program in the second memory block is backuped to the first memory block in same storer.
5. a boot update device, is characterized in that, comprising:
Control module, for starting successfully, the identification information recording the first memory block is using as the chip selection signal started next time; After starting according to the main bootstrap program in the first memory block, determine whether to need updated boot programs; Wherein, described first memory block is current memory area, and described main bootstrap program is the boot stored in current memory area;
Judge module, for when receiving reset signal at every turn, judges whether start total degree is greater than the first setting value;
Described control module, for when judged result is for being, determines to start unsuccessfully, sending warning information; And, when judged result is no, receives reset signal, carry out reset operation, and record starts total degree;
Operational module, restarts after the second memory block is switched to current memory area again; According to acquiescence or the identification information of the first memory block of record, obtain the main bootstrap program in the first memory block, and start; Wherein, described first memory block is current memory area; And the main bootstrap program stored in judgement second memory block and the backup boot that stores of the first memory block inconsistent time, determine to need updated boot programs, obtain upgrade information, and according to the upgrade information obtained, the backup boot in the first memory block is upgraded, and the first memory block after upgrading is switched to current memory area, and start according to the main bootstrap program in this first memory block, and determine when starting successfully to upgrade successfully.
6. device as claimed in claim 5, it is characterized in that, described control module, also for judging whether control counter overflows, when judged result is no, is determined to start successfully, and then being determined to upgrade successfully; And when the frequency of failure of upgrading is greater than the second preset value, send warning information;
Also comprising: judge module, for when judged result is for being, continuing to judge whether the upgrading frequency of failure is greater than the second preset value; When the frequency of failure of upgrading is greater than the second preset value, continue to judge whether to need to upgrade to the second memory block;
Described operational module is also for when the frequency of failure of upgrading is not more than the second preset value, and the backup boot in the second memory block is switched to main bootstrap program, carries out reset operation, the main bootstrap program according to storing in this second memory block starts; When the frequency of failure of upgrading is greater than the second preset value, determine the upgrading failure to the first memory block; And when needs are upgraded to the second memory block, the information reproduction stored the second memory block is to described first memory block, carry out reset operation, described first memory block is switched to current memory area, and the main bootstrap program according to storing in the first memory block starts.
CN201010571959.2A 2010-12-03 2010-12-03 Method and device for backing up boot program Active CN102023908B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201010571959.2A CN102023908B (en) 2010-12-03 2010-12-03 Method and device for backing up boot program
PCT/CN2011/080599 WO2012071945A1 (en) 2010-12-03 2011-10-10 Method and device for backing up and upgrading bootstrap

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010571959.2A CN102023908B (en) 2010-12-03 2010-12-03 Method and device for backing up boot program

Publications (2)

Publication Number Publication Date
CN102023908A CN102023908A (en) 2011-04-20
CN102023908B true CN102023908B (en) 2015-06-03

Family

ID=43865229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010571959.2A Active CN102023908B (en) 2010-12-03 2010-12-03 Method and device for backing up boot program

Country Status (2)

Country Link
CN (1) CN102023908B (en)
WO (1) WO2012071945A1 (en)

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023908B (en) * 2010-12-03 2015-06-03 中兴通讯股份有限公司 Method and device for backing up boot program
CN102169445B (en) * 2011-05-13 2013-12-04 合肥华云通信技术有限公司 Security upgrading method for BootRom
CN103136005A (en) * 2011-11-28 2013-06-05 英业达科技有限公司 Method of updating firmware
CN102916776B (en) * 2012-10-15 2015-09-09 青岛海信宽带多媒体技术有限公司 optical module parameter transmission method and device
CN103092662A (en) * 2013-02-04 2013-05-08 烽火通信科技股份有限公司 Software module upgrading method for terminal device based on embedded operating system
JP6364983B2 (en) * 2014-06-10 2018-08-01 富士ゼロックス株式会社 Electronic device and program
CN105320529A (en) * 2014-07-08 2016-02-10 中兴通讯股份有限公司 Boot method and device based on NAND-Flash double-boot guidance
CN105279042A (en) * 2014-07-15 2016-01-27 华耀(中国)科技有限公司 Redundant backup system and method for BSD system
CN104281479B (en) * 2014-10-31 2019-01-08 深圳市大疆创新科技有限公司 A kind of firmware upgrade method and device
CN104915226B (en) * 2015-05-21 2018-12-14 北京星网锐捷网络技术有限公司 A kind of network device software starting method, apparatus and the network equipment
CN105279046A (en) * 2015-11-04 2016-01-27 研华科技(中国)有限公司 Method for improving reliability of embedded system
CN106095619A (en) * 2016-06-08 2016-11-09 杭州华三通信技术有限公司 A kind of virtual machine backup method and device
CN106293822A (en) * 2016-08-04 2017-01-04 青岛海信电器股份有限公司 A kind of from the method and device processing chip upgrade
CN106952425B (en) * 2017-02-15 2019-05-14 深圳市新国都支付技术有限公司 A kind of terminal remote upgrade method and POS terminal
CN109375941B (en) * 2018-09-29 2022-01-07 延锋伟世通电子科技(南京)有限公司 Novel master-slave flash boot loader software upgrading method applied to combination instrument
CN109656602A (en) * 2019-01-09 2019-04-19 合肥联宝信息技术有限公司 A kind of code upgrade method and electronic equipment
CN110007971A (en) * 2019-03-25 2019-07-12 联想(北京)有限公司 A kind of information processing method and device, equipment, storage medium
CN110427286B (en) * 2019-08-09 2022-11-11 成都千立网络科技有限公司 Gateway server main and standby system recovery method
CN110532014B (en) * 2019-08-20 2023-06-30 海信(广东)空调有限公司 Program upgrading method, device, terminal equipment and computer readable storage medium
CN110688135A (en) * 2019-09-20 2020-01-14 浙江吉利汽车研究院有限公司 Program flashing method, device and medium for controller
CN111061514A (en) * 2019-10-30 2020-04-24 翱捷智能科技(上海)有限公司 Flash device, integrated circuit and Flash device starting method
CN111352798A (en) * 2020-01-19 2020-06-30 湖北三江航天红峰控制有限公司 DSP chip-based multi-boot program execution method and device
CN112130914A (en) * 2020-09-04 2020-12-25 山东云海国创云计算装备产业创新中心有限公司 Uboot starting method, device, equipment and medium
CN112612642A (en) * 2020-12-17 2021-04-06 上海芯安信息科技有限公司 Software starting and upgrading failure backspacing method and device and terminal equipment
WO2022133873A1 (en) * 2020-12-24 2022-06-30 Intel Corporation Configurable fault tolerant mechanism
CN112650513B (en) * 2020-12-28 2024-01-16 深圳市亚辉龙生物科技股份有限公司 Program upgrading method, device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101169728A (en) * 2007-11-22 2008-04-30 中兴通讯股份有限公司 Dualboot starting device and method
CN101256527A (en) * 2008-03-12 2008-09-03 中兴通讯股份有限公司 Backup method and apparatus for bootstrap

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1293904A1 (en) * 2001-09-14 2003-03-19 Hewlett-Packard Company Method of initiating a backup procedure
CN100343807C (en) * 2004-09-14 2007-10-17 华为技术有限公司 Upgrading method for Boot software and recovering method for Boot software
CN100549959C (en) * 2007-10-26 2009-10-14 中兴通讯股份有限公司 Bootstrap on-line upgrading method
CN102023908B (en) * 2010-12-03 2015-06-03 中兴通讯股份有限公司 Method and device for backing up boot program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101169728A (en) * 2007-11-22 2008-04-30 中兴通讯股份有限公司 Dualboot starting device and method
CN101256527A (en) * 2008-03-12 2008-09-03 中兴通讯股份有限公司 Backup method and apparatus for bootstrap

Also Published As

Publication number Publication date
CN102023908A (en) 2011-04-20
WO2012071945A1 (en) 2012-06-07

Similar Documents

Publication Publication Date Title
CN102023908B (en) Method and device for backing up boot program
US8683457B1 (en) Updating firmware of an electronic device by storing a version identifier in a separate header
CN103455354B (en) Method and equipment for preventing hardware update from failing
CN105094927B (en) A kind of device firmware upgrade method and apparatus
CN108153849B (en) Database table segmentation method, device, system and medium
US7421573B2 (en) Apparatus and method for updating firmware
CN105677398A (en) Universal embedded computer software on-line upgrading method
US11314665B2 (en) Information processing system, information processing device, BIOS updating method for information processing device, and BIOS updating program for information processing device
CN112612524A (en) Method, device and equipment for starting Linux system and storage medium
WO2018024198A1 (en) Application upgrade method and system for set-top box, and set-top box
CN107566169A (en) A kind of firmware upgrade method and router based on openwrt
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN108733517A (en) SSD firmware upgrades guard method and device
CN109375953B (en) Operating system starting method and device
CN105677409A (en) System upgrading method and device
WO2018049798A1 (en) Method and apparatus for reconstructing cache partition
CN114840242A (en) System upgrading method and device of electronic equipment and readable storage medium
WO2021012170A1 (en) Firmware booting method and device, and computer-readable storage medium
CN115617488A (en) Operating system migration method and device, computing equipment and storage medium
CN113377425B (en) BMC firmware generation method and device, BMC starting method and device and storage medium
CN114995852A (en) Equipment upgrading method, equipment and computer readable storage medium
CN101546281A (en) Method and device for improving reliability of embedded system
JPWO2012077604A1 (en) Processing apparatus, program update method, and program
JPWO2016136014A1 (en) Surveillance recorder
CN112395130A (en) System backup method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant