WO2012071945A1 - Procédé et dispositif pour la sauvegarde et la mise à niveau d'une amorce - Google Patents

Procédé et dispositif pour la sauvegarde et la mise à niveau d'une amorce Download PDF

Info

Publication number
WO2012071945A1
WO2012071945A1 PCT/CN2011/080599 CN2011080599W WO2012071945A1 WO 2012071945 A1 WO2012071945 A1 WO 2012071945A1 CN 2011080599 W CN2011080599 W CN 2011080599W WO 2012071945 A1 WO2012071945 A1 WO 2012071945A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage area
boot program
upgrade
backup
module
Prior art date
Application number
PCT/CN2011/080599
Other languages
English (en)
Chinese (zh)
Inventor
杨细龙
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012071945A1 publication Critical patent/WO2012071945A1/fr

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

Definitions

  • the present invention relates to the field of embedded and computer, and in particular, to a method and apparatus for booting and upgrading a boot program. Background technique
  • the central processing unit (CPU) is configured to boot the minimum system startup. After the CPU's minimum system has successfully run, the drivers and system software of the peripheral function devices are loaded and the embedded products are functioning properly.
  • the boot code is generally stored in a non-volatile memory device, and the code size is generally 1K to 512K bytes. Due to various abnormal conditions, the data in the storage device may change, causing the device or board to fail to start, which affects the reliability of the product performance. Therefore, it is important to make the necessary backups of the startup program code.
  • startup code backup methods there are three popular startup code backup methods: 1. Using two identical storage devices to back up the boot code, which will occupy more hardware resources and occupy more storage space. Store the memory of the boot program, and specify one of the memories as the main boot memory.
  • the embodiment of the invention provides a method for booting and upgrading a boot program, which is used for implementing backup of the boot program and improving the reliability of the system.
  • a bootloader backup method comprising:
  • the first storage area is a current storage area
  • the identification information of the first storage area is recorded
  • a bootloader upgrade method comprising:
  • the first storage area After starting according to the main boot program in the first storage area, determine if an upgrade is required! a program; wherein, the first storage area is a current storage area;
  • the backup boot program in the second storage area is upgraded according to the obtained upgrade information.
  • a boot program backup device includes: an operation module and a control module; wherein, the operation module is configured to obtain a main boot program in the first storage area according to the default or the recorded identification information of the first storage area, And starting, wherein the first storage area is a current storage area;
  • control module configured to: after the startup is successful, record the identification information of the first storage area; and back up the primary boot program in the first storage area to the second storage area in the same storage.
  • a booting program upgrading apparatus comprising: a control module and an operation module; wherein, the control module is configured to determine whether the booting program needs to be upgraded after starting according to the main booting program in the first storage area;
  • the first storage area is the current storage area;
  • the operation module is configured to obtain upgrade information when determining that the boot program is to be upgraded, and upgrade the backup boot program in the second storage area according to the obtained upgrade information.
  • the first a main boot program in a storage area, and is started; wherein, the first storage area is a current storage area; after the startup is successful, the identification information of the first storage area is recorded; and the main boot program in the first storage area is Back up to the second storage area in the same storage.
  • the embodiment of the present invention provides two boot program storage areas in one memory, which does not occupy excessive hardware resources; no one of the two boot program storage areas is specified as the main boot program storage area, and the system can be started according to the last boot time.
  • the information of the boot program storage area saved after successful is started from the boot program storage area, and it is not necessary to be booted from the main boot program storage area, so that the startup speed is faster and the startup efficiency is higher; after the correct startup, the current storage area is The code is backed up to the non-current storage area, and the backup of the boot program is realized, which ensures the correctness of the boot program being backed up.
  • the backup process there is no need to modify the code of the current storage area, but only the corresponding register and other parts are modified, the modification content is small, the verification process is relatively simple, and the backup can be directly performed, and the operation process is simple.
  • the identification information of the current storage area is recorded as the chip selection signal, it can be completed by software without occupying hardware resources.
  • the embodiment of the present invention determines whether the boot program needs to be upgraded; when it is determined that the boot program is to be upgraded, the upgrade information is obtained; and the obtained upgrade information is used in the second storage area.
  • the backup bootloader is upgraded.
  • the embodiment of the present invention selects an upgrade in a non-current storage area to prevent the board from being restarted because the upgrade is unsuccessful, thereby improving the reliability of the system.
  • FIG. 1 is a main structural diagram of a bootloader backup device according to an embodiment of the present invention.
  • FIG. 1 is a detailed structural diagram of a bootloader backup device according to an embodiment of the present invention.
  • FIG. 3 is a main flowchart of a method for backing up a boot program according to an embodiment of the present invention
  • FIG. 4 is a flowchart of a detailed method for determining whether a startup is successful according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of whether it is required to upgrade after failing to upgrade a non-current storage area according to an embodiment of the present invention. Detailed method flow chart for the current storage area. detailed description
  • the embodiment of the present invention obtains the main booting program in the first storage area according to the default or the recorded identification information of the first storage area, and starts, wherein the first storage area is the current storage area; after the startup is successful And recording the identification information of the first storage area; and backing up the main navigation program in the first storage area to the second storage area in the same storage.
  • the embodiment of the present invention provides two boot program storage areas in one memory, which does not occupy excessive hardware resources; no one of the two boot program storage areas is specified as the main boot program storage area, and the program storage area is started, without limitation It must be started from the main boot program storage area to make the startup speed faster and the startup efficiency higher.
  • the current storage area code is backed up to the non-current storage area, which realizes the backup of the boot program and ensures the backup.
  • the correctness of the bootloader is During the backup process, there is no need to modify the code of the current storage area, and the backup can be directly performed, and the operation process is simple.
  • the identification information of the current storage area is recorded as a chip select signal, it can be completed by software without occupying hardware resources.
  • the embodiment of the present invention determines whether the boot program needs to be upgraded; when it is determined that the boot program is to be upgraded, the upgrade information is obtained; and the obtained upgrade information is used in the second storage area.
  • the backup bootloader is upgraded.
  • the embodiment of the present invention selects an upgrade in a non-current storage area to prevent the board from being restarted because the upgrade is unsuccessful, thereby improving the reliability of the system.
  • the bootloader backup device includes an operation module 101 and a control module 102.
  • the operation module 101 is configured to obtain a main booting program in the first storage area according to the default or the first identification information of the recorded storage area, and start, wherein the first storage area is a current storage area;
  • the boot program stored in the current storage area is referred to as a main boot program
  • the boot program stored in the non-current storage area is referred to as a backup boot program
  • the main boot program and the backup boot program are relatively speaking, for example, at a certain
  • the current storage area is the first storage area
  • the boot program stored in the first storage area is the main boot program
  • the boot program stored in the second storage area is the backup boot program
  • the current storage area For the second storage area, the boot program stored in the second storage area is the main boot program, and the boot program stored in the first storage area is the backup boot program.
  • the boot program storage area is determined in the storage module 103 according to the address information of the boot program storage area that was successfully started last time, and the boot program storage area is used as the current storage area. And starting according to the main boot program stored in the current storage area, that is, starting according to the code stored in the current storage area.
  • the startup is unsuccessful, and the reset operation is performed.
  • the reset operation may be a reset board. When the control technology overflows, a reset signal is sent to the operating module 101.
  • the control counter may be a watchdog counter, and when it overflows, a reset signal may be issued to reset the board.
  • the operation module 101 switches the backup boot program stored in the second storage area of the non-current storage area as the main boot program, that is, the first storage area and the second storage area are mutually switched, and the second storage area is the current storage area, and the operation is performed. The module 101 is restarted according to the main boot program stored in the second storage area.
  • the control module 102 records the total number of starts, and each time the start is performed, the total number of starts is incremented by one. If the control counter in the control module 102 overflows, the startup is still unsuccessful, the reset operation is performed, and the backup boot program stored in the first storage area is switched to the main boot program again, and the operation module 101 again according to the main storage stored in the first storage area. The boot program is started, and the startup process is repeated. If the number of startups reaches the first set value, for example, the first set value is M, and the startup is still unsuccessful, an alarm message may be sent, which may be a software alarm. It can also be a hardware alarm. For example, the hardware alarm can be the control module 102 with an indicator light or a buzzer.
  • the control module 102 can have a first counter for recording the total number of starts of the operation module 101 during the boot program backup process. The value of the first counter is incremented by one each time the operation module 101 starts. If the board is successfully started, the operation module 101 notifies the control module 102 to save the information of the current storage area, where the information includes at least the identification information of the current storage area, as the chip selection signal at the next startup.
  • the operation module 101 can copy the boot program code in the current storage area to the non-current storage area.
  • the backup of the bootloader Start downloading the full software version to get started.
  • the operation module 101 is further configured to: when it is determined that the boot program is to be upgraded, obtain upgrade information, and upgrade the backup boot program in the second storage area according to the obtained upgrade information.
  • the upgrade process may be automatically performed according to the setting of the control module 102, or may be performed after receiving the upgrade notification sent by the control module 102.
  • the operation module 101 first upgrades the non-current storage area according to the upgrade information.
  • the embodiment of the present invention takes the non-current storage area as the second storage area as an example. Because the current storage area, that is, the first storage area has been able to boot the operation module 101 to start normally, upgrading the second storage area first can ensure that the operation module 101 can still be normally started from the first storage area when the upgrade fails.
  • the operation module 101 After receiving the chip selection signal of the control module 102, the operation module 101 switches the upgraded boot program stored in the non-current storage area to the main boot program, performs a reset operation, and according to the main boot program stored in the second storage area. Start up. If the control counter in the control module 102 overflows, the startup is unsuccessful, and the operation module 101 switches the backup boot program stored in the first storage area to the main boot program, and upgrades the second storage area again, and thus repeats. If the number of upgrade failures of the second storage area reaches the second set value, for example, the second set value is N, it is determined that the upgrade to the non-current storage area, that is, the second storage area fails, and an alarm information may be sent, It is a software alarm or a hardware alarm.
  • the hardware alarm may be an alarm signal sent by the indicator light or buzzer of the control module 102.
  • an inquiry message is sent to ask whether to continue the upgrade process in the current storage area, that is, the first storage area. If the upgrade is selected to continue, the information stored in the first storage area is copied to the second storage area, and the old information stored in the second storage area is first erased before copying, and the backup stored in the second storage area is stored.
  • the boot program switches to the main boot program, performs a reset operation, starts according to the main boot program stored in the second storage area, and starts upgrading the first storage area. If you choose not to continue the upgrade, it is determined that the upgrade failed.
  • the number of upgrade failures N may be a preset value, and may be saved in the control module 102.
  • the control module 102 may have a second counter for calculating the number of upgrade failures for a bootloader storage area. When a bootloader is upgraded once, the value of the second counter is incremented by one.
  • the operation module 101 can be specifically a CPU.
  • the operation module 101 can be located on a single board.
  • the control module 102 is configured to record the identification information of the first storage area after the startup is successful; and back up the main boot program in the first storage area to the second storage area in the same storage.
  • a board needs to be started as an example.
  • the control module 102 can store information of a successful startup on the board, where the information includes at least the identification information of the bootloader storage area used in the last successful startup.
  • the device backed up by the program includes two bootstraps.
  • the program storage area is located in the storage module 103.
  • the two bootloader storage areas may have respective identification information, for example, one bootloader storage area is the first storage area and the other bootloader storage area is the second storage area.
  • the control module 102 reads the information of one successful startup of the board stored in the internal storage, and the storage module 103 according to the identifier information of the boot program storage area used in the last successful startup included in the information.
  • Determine the bootloader store for example,
  • the address information of the boot program storage area may be determined in the storage module 103, and the address information of the boot program storage area is used as a chip select signal, according to the!
  • the address information of the program storage area selects the boot program storage area to notify the operation module 101 to switch the boot program storage area to the current storage area, and starts according to the main boot program stored in the current storage area.
  • the notification may be sent to the operation module 101 through a lead to notify the operation module 101 according to the main stored in the boot program storage area!
  • the program starts.
  • control module 102 may include a control counter, and the control module 102 is further configured to determine whether the control counter overflows, and start the control counter while the control module 102 reads the information of the last successful startup stored in the internal control system.
  • the control counter starts counting automatically. If the board is successfully booted, the operation module 101 notifies the control module 102 to clear and close the control counter. If the control counter does not overflow, it is determined that the startup is successful, and if the control module 102 has not received the notification of clearing or closing the control counter for a certain period of time, the control counter will overflow, causing an interrupt, causing a system reset.
  • the control counter can be a watchdog counter.
  • the control module 102 When the watchdog counter overflows, a reset signal is generated to reset the board. If the board is successfully started, the control module 102 saves the information of the current storage area according to the notification of the operation module 101, and the information includes at least the identification information of the current storage area, and the counter is cleared and closed. The control module 102 is further configured to determine whether the boot program needs to be upgraded after booting according to the main boot program in the first storage area.
  • control module 102 is further configured to determine that the boot program needs to be upgraded after the operation module 101 starts according to the main boot program in the first storage area.
  • the control module 102 changes the chip selection signal, and sets the backup boot program stored in the upgraded non-current storage area as the main boot program, for example, upgrading the second storage area.
  • the second storage area and the first storage area are switched to each other, and the second storage area is selected as the current storage area.
  • the backup boot program stored in the second storage area is the main boot program, the control counter is turned on, and the operation is instructed.
  • Module 101 performs a reset operation and according to the main memory stored in the second storage area The bootloader starts.
  • control module 102 can be a programmable logic device, for example, an EPLD (Erasable Programmable Logic Device).
  • EPLD Erasable Programmable Logic Device
  • the control module 102 may or may not be located on a single board.
  • the control module 102 is not reset when the operation module 101 performs a reset operation.
  • FIG. 2 is a detailed structural diagram of a bootloader backup device according to an embodiment of the present invention. As shown in FIG. 2, the device further includes a storage module 103, a comparison module 104, and a determination module 105.
  • the storage module 103 is configured to provide Bootloader storage area.
  • the storage module 103 may include two boot program storage areas, that is, a first storage area and a second storage area, and the first storage area and the second storage area may be located in one memory.
  • the bootloader storage area used is called the current storage area when the board is booted, and the unused bootloader storage area is called the non-current storage area.
  • the storage module 103 can be located on the board or not on the board.
  • the memory module 103 is not reset when the operation module 101 performs a reset operation.
  • the comparison module 104 is configured to compare the bootstrap stored in the two bootloader storage areas.
  • the comparison module 104 compares the main boot program stored in the current storage area with the backup boot program stored in the non-current storage area. For example, a bitwise comparison manner may be adopted. Take the current storage area as the first storage area and the non-current storage area as the second storage area as an example. If the primary boot program stored in the first storage area is inconsistent with the backup boot program stored in the second storage area, the operation module 101 is notified to copy the boot program stored in the first storage area into the second storage area, and needs to be notified before copying. The operation module 101 first erases the old backup boot program stored in the second storage area.
  • the operation module 101 is notified that the startup process ends, so that the operation module 101 starts normal operation.
  • the control module 102 can be notified to generate a reset signal, and the reset signal is transmitted to the operation module 101, so that the operation module 101 performs a reset operation, resets the single-board device except the control module 102, and prepares the device.
  • the backup boot program stored in the second storage area is switched to the main boot program, and the operation module 101 continues to boot according to the main boot program stored in the second storage area to determine the backup! Whether the program can enable the operation module 101 to complete the startup, and verify the correctness of the backup boot program.
  • the comparison module 104 Before the upgrade process, the comparison module 104 first compares whether the main boot program stored in the current storage area is consistent with the backup boot program stored in the non-current storage area. If not, the operation module 101 can be notified to start the upgrade operation, otherwise the operation module 101 is notified. No upgrade is required. Take the current storage area as the first storage area and the non-current storage area as the second storage area as an example. In the upgrade process, after the operation module 101 upgrades the second storage area according to the upgrade information saved by itself, the comparison module 104 is further configured to save the backup boot program stored in the upgraded second storage area and the operation module 101. The upgrade information is compared. The second storage area is upgraded, and the upgrade information in the operation module 101 is burned into the non-current storage area.
  • the upgrade information in the operation module 101 is compared with the backup boot program stored in the second storage area after the burning, if the backup boot program stored in the upgraded second storage area is in the operation module 101. If the saved upgrade information is consistent, it is determined that the programming is successful. At this time, the control module 102 may be notified to set the backup boot program stored in the upgraded second storage area as the main boot program, if the upgraded second storage area is stored. If the backup boot program is inconsistent with the upgrade information saved in the operation module 101, if it is determined that the burning fails, the operation module 101 may be notified to perform the upgrade again, or the upgrade may be abandoned.
  • the comparison module 104 can receive the notification of the operation module 101, and perform the main boot program stored in the first storage area and the backup boot program stored in the second storage area. For comparison, if the unupgraded primary boot program stored in the first storage area is inconsistent with the upgraded backup boot program stored in the second storage area, the operation module 101 may be notified to copy the boot program stored in the second storage area to In the first storage area.
  • the determining module 105 is configured to determine whether the total number of starts exceeds the first set value.
  • the first set value may be M, and may be saved in the control module 102.
  • the determining module 105 determines, according to the value in the first counter, the total number of startups at this time is If the number of starts reaches M, the alarm information may be sent, which may be a software alarm or a hardware alarm.
  • the hardware alarm may be the control module 102 using an indicator light or a buzzer as an alarm signal. The system fails to start and the board is faulty. If the number of starts does not reach M, the notification operation module 101 can continue the startup operation.
  • the determining module 105 is further configured to determine whether the number of upgrade failures exceeds a second set value, and the second set value may be N, which may be saved in the control module 102.
  • the determining module 105 determines, according to the value in the second counter, whether the number of upgrade failures to the non-current storage area reaches N at this time. If the number of upgrades reaches N, an alarm message may be sent, which may be a software alarm. It can also be a hardware alarm.
  • the hardware alarm may be that the control module 102 uses an indicator light or a buzzer as an alarm signal to determine that the upgrade of the non-current storage area fails, and may notify the operation module 101 to send an inquiry message to ask whether Need to continue to upgrade the current storage area. If the number of upgrades does not reach N, the notification operation module 101 can continue the upgrade process.
  • the following describes the bootloader backup method through a specific process.
  • FIG. 3 is a main flowchart of a method for backing up a boot program according to an embodiment of the present invention. As shown in FIG. 3, the main method for booting a backup program in the embodiment of the present invention is as follows:
  • Step 301 Obtain a primary booting program in the first storage area according to the default or the recorded identification information of the first storage area, and start.
  • Step 302 After the startup is successful, record the identification information of the first storage area.
  • Step 303 Back up the main boot program in the first storage area to the second storage area in the same storage.
  • the method further includes: performing a reset operation, switching the second storage area to the current storage area, restarting, and recording the total number of startups.
  • the method further includes: determining whether the total number of startups is greater than the first set value, and when the determination result is yes, determining that the startup fails, and issuing an alarm message, Otherwise continue the reset operation.
  • the method further includes: determining whether the primary boot program stored in the first storage area is The backup boot program stored in the second storage area is consistent. When the determination result is no, the primary boot program stored in the first storage area is backed up to the second storage area.
  • the present invention also includes a bootloader upgrade method, the method comprising: determining whether a bootloader needs to be upgraded after booting according to a primary bootloader in the first storage area; wherein the first storage area is a current storage area When you are sure that you need to upgrade the bootloader, get the upgrade information; upgrade the backup bootloader in the second storage area according to the obtained upgrade information.
  • the method further includes: determining whether the primary booting program stored in the first storage area is consistent with the backup booting program stored in the second storage area, and determining whether the result is negative Upgrade the bootstrap.
  • the method further includes: switching the upgraded second storage area to the current storage area; according to the second storage area
  • the main boot program in the startup starts, and the upgrade is successful when the startup is successful.
  • the method further includes:
  • the determination result is yes, it is determined whether the number of upgrade failures is greater than a second preset value.
  • the backup boot program in the first storage area is switched to the primary boot program. Reset operation, and starting according to the main boot program stored in the first storage area;
  • the backup boot program in the first storage area is copied to the second storage area to perform a reset operation. And switching the second storage area to the current storage area, according to the main storage stored in the second storage area! The program starts.
  • FIG. 4 is a flowchart of a detailed method for determining whether the startup is successful according to an embodiment of the present invention. As shown in FIG. 4, the detailed method for determining whether the startup is successful in the embodiment of the present invention is as follows:
  • Step 401 The board is powered on. In the embodiment of the present invention, whether the board is successfully started is taken as an example; Step 402: reading the boot program storage area information that was successfully started last time;
  • the control module 102 saves the information of the boot program storage area that is successfully started, and the information includes at least the identification information of the successfully booted boot program storage area, so that the operation module 101 is based on the identification information.
  • the boot storage area is a first storage area as an example.
  • Step 403 Turn on the control counter.
  • the control module 102 turns on the control counter, and controls the counter to start counting;
  • control counter can be a watchdog counter.
  • Step 404 Place the bow stored in the first storage area! The program switches to the main boot program;
  • Step 405 According to the main memory stored in the first storage area! The program starts to start;
  • Step 403 and step 404 need to be performed simultaneously.
  • the control module 102 sends the identification information of the boot program storage area to the operation module 101 as a chip select signal, which is the identification information of the successfully booted boot program storage area recorded in step 402.
  • the operation module 101 determines the boot program stored in the first storage area as the main boot program according to the chip select signal, and starts the boot process.
  • Step 406 Determine whether the control counter overflows. When the result of the determination is YES, the process proceeds to step 407. Otherwise continue to step 413;
  • Step 407 Determine whether the number of starts is greater than M. When the judgment result is no, continue the step. 408, otherwise proceed to step 412;
  • Step 408 Switch the backup boot program stored in the second storage area to the main boot program, and reset the board.
  • control module 102 clears and closes the control counter while resetting the board, and the control counter starts counting again. If the operation module 101 and the control module 102 are both located on the board, the reset board operation in this step should be changed to the reset operation module 101. If the operation module 101 is located on the board and the control module 102 is not located on the board, then This step can be to reset the board.
  • Step 409 Start according to the main boot program stored in the second storage area
  • Step 410 Determine whether the control counter overflows. When the determination result is yes, proceed to step 411, otherwise continue to step 413;
  • Step 411 Determine whether the number of starts is greater than M, when the determination result is no, proceed to step 404, and still need to reset the board while performing step 404, otherwise continue to step 412;
  • Step 412 Determine that the startup fails, and issue an alarm message
  • Step 413 Determine that the startup is successful, and save the identification information of the current storage area. At the same time, control module 102 clears and closes the counter.
  • Step 501 The startup succeeds, and the identifier information of the current storage area is saved.
  • this step is the same as step 413 in the flow shown in FIG. 4, and after the step 413 in the flow of FIG. 4 is executed, the following flow can also be executed.
  • the current storage area is the first storage area
  • the non-current storage area is the second storage area.
  • Step 502 determining whether the primary boot program stored in the first storage area is consistent with the backup boot program stored in the second storage area, and if the determination result is no, proceed to step 503, otherwise proceed to step 505; Step 503: Back up the main boot program stored in the first storage area to the second storage area.
  • the backup is specifically performing backup processing on the main boot program stored in the first storage area after the successful startup.
  • the backup method can be copy.
  • Step 504 It is determined whether the primary boot program stored in the first storage area is consistent with the backup boot program stored in the second storage area. When the determination result is no, proceed to step 503, otherwise continue the step.
  • this step is to prevent errors during the backup process.
  • Step 505 The bootloader backup is complete.
  • the backup boot program stored in the second storage area can be further switched to the main boot program, the reset operation is performed, and the boot process is continued to verify whether the boot program after the backup can be The operation module 101 is caused to complete startup.
  • Step 601 Upgrade the second storage area
  • the upgrade information in the operation module 10 ⁇ is burned into the non-current storage area.
  • the second storage area is a non-current storage area
  • the first storage area is a current storage area.
  • Step 602 Determine whether the boot program burned in the second storage area is consistent with the upgrade information. When the determination result is yes, proceed to step 603, otherwise continue to step 601;
  • the upgrade information saved in the operation module 101 is compared with the boot program burned into the second storage area, if the upgrade information in the operation module 101 is burned into the non-current storage area. If the boot program is consistent, the burning is successful. If the upgrade information in the operation module 101 is inconsistent with the boot program in the non-current storage area, the burning is unsuccessful and the burning is required.
  • Step 603 Send the updated chip select signal to the operation module 101, and turn on the control counter.
  • the module 103 sends the updated identification information of the second storage area to the operation module 101 as a chip selection signal, and turns on the control counter, and the control counter starts counting.
  • Step 604 Set the upgraded backup boot program stored in the second storage area as the main boot program, perform a reset operation, and the operation module 101 stores the upgraded backup boot program stored in the second storage area according to the chip select signal. Set as the main boot program;
  • Step 605 Start according to the main boot program stored in the second storage area
  • Step 606 Determine whether the control counter overflows, when the determination result is yes, proceed to step 607, otherwise continue to step 610;
  • Step 607 determining whether the number of upgrade failures is greater than N, when the determination result is no, proceed to step 608, otherwise proceed to step 609;
  • Step 608 Switch the backup boot program stored in the first storage area to the main boot program, perform a reset operation, and continue to step 601.
  • the control module 102 clears the control counter, and the control counter starts to recount;
  • Step 609 Determine that the non-current storage area upgrade fails, and the alarm information may be sent;
  • Step 610 Determine that the non-current storage area is successfully upgraded.
  • FIG. 7 is a flowchart of a detailed method for determining whether to upgrade a current storage area after a failure to upgrade a non-current storage area according to an embodiment of the present invention. As shown in FIG. 7, the embodiment of the present invention determines that the upgrade to a non-current storage area fails. Whether you need to upgrade the current storage area detailed method flow:
  • Step 701 Determine that the second storage area upgrade fails.
  • this step is the same step as step 612 in the flow shown in FIG. 6.
  • the second storage area is a non-current storage area
  • the first storage area is a current storage area.
  • Step 702 Determine whether it is necessary to upgrade the first storage area. When the judgment result is yes, continue step Step 703, otherwise the process ends;
  • Step 703 Copy the primary boot program stored in the first storage area to the second storage area; wherein, the backup boot program stored in the second storage area needs to be erased before copying.
  • Step 704 Perform a reset operation. At this time, the control module 102 clears the control counter, and controls the counter to start counting again.
  • Step 705 Switch the backup boot program stored in the second storage area to the primary boot program.
  • Step 706 Upgrade the first storage area.
  • the upgrade information in the operation module 101 is burned into the first storage area. This step is the same as step 601 shown in Fig. 6.
  • the following flow is also consistent with Fig. 6. That is, when the upgrade to the non-current storage area fails, an attempt is made to continue the upgrade of the current storage area.
  • the operation module 101 may be automatically upgraded after being successfully started, or may be upgraded after receiving the upgrade notification.
  • the embodiment of the present invention obtains the main booting program in the first storage area according to the default or the recorded identification information of the first storage area, and starts, wherein the first storage area is the current storage area; after the startup is successful And recording the identification information of the first storage area; and backing up the main boot program in the first storage area to the second storage area in the same storage.
  • the embodiment of the present invention provides two boot program storage areas in one memory, which does not occupy excessive hardware resources; no one of the two boot program storage areas is specified as the main boot program storage area, and the system can be started according to the last boot time.
  • the information of the boot program storage area saved after successful is started from the boot program storage area, and it is not necessary to be booted from the main boot program storage area, so that the startup speed is faster and the startup efficiency is higher; after the correct startup, the current storage area is The code is backed up to the non-current storage area, and the backup of the boot program is realized, which ensures the correctness of the boot program being backed up.
  • the backup process there is no need to modify the code of the current storage area, and the backup can be directly performed, and the operation process is simple.
  • the identification information of the current storage area is recorded as the chip selection signal, it can be completed by software without occupying hardware resources.
  • the embodiment of the present invention further determines that the boot program needs to be upgraded under the main boot program in the first storage area; obtains the upgrade information; and performs the backup boot program in the second storage area according to the obtained upgrade information. Upgrade.
  • the embodiment of the present invention selects the upgrade in the non-current storage area to prevent the board from being restarted due to the unsuccessful upgrade, thereby improving the reliability of the system.
  • the upper limit value of the total number of times of starting the operation module 101 is set. If the total number of startups exceeds the upper limit value, it is determined that the startup fails, the operation module 101 is prevented from being continuously started, resources are wasted, and the hardware is easily damaged.
  • the operation module 101 can upgrade the boot program storage area to obtain a higher boot program version, and the board startup process is more optimized.
  • the master stored in the current store! The program is compared with the backup boot program stored in the non-current storage area. If the two are inconsistent, the upgrade process is performed. Otherwise, no upgrade is required to avoid waste of resources.
  • the upgrade information is first verified to ensure the correctness of the upgrade information. After the upgrade is completed, it is also required to start according to the boot program stored in the upgraded boot program storage area to further verify whether the upgrade is successful.
  • the non-current storage area is upgraded to ensure that when the upgrade is unsuccessful, the operation module 101 can also start according to the main boot program stored in the current storage area.
  • the method and device according to the embodiment of the present invention can support online upgrade, set an upper limit of the number of upgrade failures, and deal with faults that may occur during the upgrade, thereby ensuring the correctness of the upgrade.
  • embodiments of the present invention can be provided as a method, system, or computer program product.
  • the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) in which computer usable program code is embodied.
  • These computer program instructions can be provided to a processor of a general purpose computer, a special purpose computer, an embedded processor or other programmable data processing device to generate a A device that, by means of instructions executed by a processor of a computer or other programmable data processing device, produces means for implementing the functions specified in one or more flows of the flowchart, and/or in a block or blocks of the block diagram. .
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more flows of the flowchart, and/or in a block or blocks of the block diagram.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more flows of the flowchart, and/or in a block or blocks of the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

L'invention concerne un procédé pour sauvegarder une amorce, pour obtenir la sauvegarde de l'amorce et améliorer la fiabilité du démarrage d'un système. Le procédé consiste à : acquérir une amorce maîtresse dans une première zone de stockage et effectuer le démarrage à partir des informations d'identification par défaut ou enregistrées concernant la première zone de stockage, la première zone de stockage étant une zone de stockage courante ; enregistrer les informations d'identification concernant la première zone de stockage une fois que le démarrage a été effectué avec succès ; et sauvegarder l'amorce maîtresse de la première zone de stockage dans une deuxième zone de stockage du même dispositif de stockage. L'invention concerne également un procédé servant à mettre à niveau une amorce et à obtenir la mise à niveau de l'amorce. Le procédé consiste à : déterminer si une amorce doit subir une mise à niveau après un démarrage sur une amorce maîtresse de la première zone de stockage; acquérir les informations de mise à niveau s'il est déterminé que l'amorce doit être mise à niveau ; et mettre à niveau l'amorce sauvegardée dans une deuxième zone de stockage à partir des informations de mise à niveau acquises. L'invention concerne également un dispositif permettant de mettre en œuvre le procédé.
PCT/CN2011/080599 2010-12-03 2011-10-10 Procédé et dispositif pour la sauvegarde et la mise à niveau d'une amorce WO2012071945A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010571959.2 2010-12-03
CN201010571959.2A CN102023908B (zh) 2010-12-03 2010-12-03 一种引导程序备份方法及装置

Publications (1)

Publication Number Publication Date
WO2012071945A1 true WO2012071945A1 (fr) 2012-06-07

Family

ID=43865229

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/080599 WO2012071945A1 (fr) 2010-12-03 2011-10-10 Procédé et dispositif pour la sauvegarde et la mise à niveau d'une amorce

Country Status (2)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915226A (zh) * 2015-05-21 2015-09-16 北京星网锐捷网络技术有限公司 一种网络设备软件启动方法、装置及网络设备
CN110427286A (zh) * 2019-08-09 2019-11-08 成都千立网络科技有限公司 网关服务器主备系统恢复方法

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023908B (zh) * 2010-12-03 2015-06-03 中兴通讯股份有限公司 一种引导程序备份方法及装置
CN102169445B (zh) * 2011-05-13 2013-12-04 合肥华云通信技术有限公司 一种BootRom的安全升级方法
CN103136005A (zh) * 2011-11-28 2013-06-05 英业达科技有限公司 更新固件的方法
CN102916776B (zh) * 2012-10-15 2015-09-09 青岛海信宽带多媒体技术有限公司 光模块参数传输方法及装置
CN103092662A (zh) * 2013-02-04 2013-05-08 烽火通信科技股份有限公司 一种基于嵌入式操作系统的终端设备的软件模块升级方法
JP6364983B2 (ja) * 2014-06-10 2018-08-01 富士ゼロックス株式会社 電子機器及びプログラム
CN105320529A (zh) * 2014-07-08 2016-02-10 中兴通讯股份有限公司 基于NAND-Flash双启动引导的启动方法及装置
CN105279042A (zh) * 2014-07-15 2016-01-27 华耀(中国)科技有限公司 一种bsd系统的冗余备份系统及方法
CN104281479B (zh) * 2014-10-31 2019-01-08 深圳市大疆创新科技有限公司 一种固件升级方法及装置
CN105279046A (zh) * 2015-11-04 2016-01-27 研华科技(中国)有限公司 一种提高嵌入式系统可靠性的方法
CN106095619A (zh) * 2016-06-08 2016-11-09 杭州华三通信技术有限公司 一种虚拟机备份方法及装置
CN106293822A (zh) * 2016-08-04 2017-01-04 青岛海信电器股份有限公司 一种从处理芯片升级的方法及装置
CN106952425B (zh) * 2017-02-15 2019-05-14 深圳市新国都支付技术有限公司 一种终端远程升级方法和pos终端
CN109375941B (zh) * 2018-09-29 2022-01-07 延锋伟世通电子科技(南京)有限公司 一种应用于组合仪表的新型主从式flash boot loader软件升级方法
CN109656602A (zh) * 2019-01-09 2019-04-19 合肥联宝信息技术有限公司 一种代码升级方法及电子设备
CN110007971A (zh) * 2019-03-25 2019-07-12 联想(北京)有限公司 一种信息处理方法及装置、设备、存储介质
CN110532014B (zh) * 2019-08-20 2023-06-30 海信(广东)空调有限公司 程序升级方法、装置、终端设备及计算机可读存储介质
CN110688135A (zh) * 2019-09-20 2020-01-14 浙江吉利汽车研究院有限公司 一种控制器的程序刷写方法、装置及介质
CN111061514A (zh) * 2019-10-30 2020-04-24 翱捷智能科技(上海)有限公司 Flash器件、集成电路及Flash器件启动方法
CN111352798A (zh) * 2020-01-19 2020-06-30 湖北三江航天红峰控制有限公司 一种基于dsp芯片的多次引导程序执行方法及装置
CN112130914A (zh) * 2020-09-04 2020-12-25 山东云海国创云计算装备产业创新中心有限公司 一种uboot的启动方法、装置、设备及介质
CN112612642A (zh) * 2020-12-17 2021-04-06 上海芯安信息科技有限公司 软件启动和升级失败回退方法和装置、终端设备
WO2022133873A1 (fr) * 2020-12-24 2022-06-30 Intel Corporation Mécanisme configurable insensible aux défaillances
CN112650513B (zh) * 2020-12-28 2024-01-16 深圳市亚辉龙生物科技股份有限公司 程序升级方法、装置、计算机设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1293904A1 (fr) * 2001-09-14 2003-03-19 Hewlett-Packard Company Méthode pour initialiser une procédure de sauvegarde
CN101158907A (zh) * 2007-10-26 2008-04-09 中兴通讯股份有限公司 引导程序在线升级方法
CN101169728A (zh) * 2007-11-22 2008-04-30 中兴通讯股份有限公司 双引导启动装置及方法
CN101256527A (zh) * 2008-03-12 2008-09-03 中兴通讯股份有限公司 一种引导程序的备份方法及其备份装置
CN102023908A (zh) * 2010-12-03 2011-04-20 中兴通讯股份有限公司 一种引导程序备份方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100343807C (zh) * 2004-09-14 2007-10-17 华为技术有限公司 一种Boot软件升级方法和一种Boot软件恢复方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1293904A1 (fr) * 2001-09-14 2003-03-19 Hewlett-Packard Company Méthode pour initialiser une procédure de sauvegarde
CN101158907A (zh) * 2007-10-26 2008-04-09 中兴通讯股份有限公司 引导程序在线升级方法
CN101169728A (zh) * 2007-11-22 2008-04-30 中兴通讯股份有限公司 双引导启动装置及方法
CN101256527A (zh) * 2008-03-12 2008-09-03 中兴通讯股份有限公司 一种引导程序的备份方法及其备份装置
CN102023908A (zh) * 2010-12-03 2011-04-20 中兴通讯股份有限公司 一种引导程序备份方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915226A (zh) * 2015-05-21 2015-09-16 北京星网锐捷网络技术有限公司 一种网络设备软件启动方法、装置及网络设备
CN110427286A (zh) * 2019-08-09 2019-11-08 成都千立网络科技有限公司 网关服务器主备系统恢复方法
CN110427286B (zh) * 2019-08-09 2022-11-11 成都千立网络科技有限公司 网关服务器主备系统恢复方法

Also Published As

Publication number Publication date
CN102023908B (zh) 2015-06-03
CN102023908A (zh) 2011-04-20

Similar Documents

Publication Publication Date Title
WO2012071945A1 (fr) Procédé et dispositif pour la sauvegarde et la mise à niveau d'une amorce
JP5607863B2 (ja) セキュア・リカバリ装置及び方法
JP5575338B2 (ja) 情報処理装置、情報処理方法、およびコンピュータプログラム
JP5431111B2 (ja) 情報処理装置及びシステム設定方法
CN108304282B (zh) 一种双bios的控制方法及相关装置
WO2012079400A1 (fr) Procédé et appareil de mise à niveau d'une rom de démarrage d'un système embarqué
TW201222554A (en) Handling errors during device bootup from a non-volatile memory
JP2008084291A (ja) 記憶装置、制御方法及び制御装置
WO2008104117A1 (fr) Équipement électronique.sa méthode d'activation et méthode et dispositif de mise à niveau de bios
WO2014161339A1 (fr) Dispositif de procédé de mise à niveau de micro-logiciel
US10223217B2 (en) Information processing device, method for booting information processing device, and non-transitory recording medium
US20100125752A1 (en) System for auto-operating backup firmware and method thereof
TW200847021A (en) Automatic backup, restore and update BIOS computer system
JP2009514042A (ja) ネットワーク装置およびこの種の装置のスタートアップを監視するための方法
TWI441081B (zh) 更新韌體方法與開機方法及使用其之電子裝置
CN113254048B (zh) 引导程序更新方法、装置、设备及计算机可读介质
JP4620430B2 (ja) アダプタの高速ロードのための装置、システム、方法、記録媒体、およびプログラム
CN106775674B (zh) 一种基于通用引导加载程序的设备及其启动方法
JP2007058699A (ja) 情報処理装置、情報処理装置制御プログラム、情報処理装置制御方法
JP6482211B2 (ja) 情報処理装置、その制御方法、及びプログラム
WO2012097570A1 (fr) Procédé et dispositif de mise en œuvre de synchronisation de version de logiciel
JPH10307726A (ja) 起動エラー時におけるファームウェアリカバリ方式
JP5418348B2 (ja) 情報処理装置およびカラオケ装置
TW200925890A (en) Computer system and starting method thereof
JP2018156230A (ja) 情報処理装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11844457

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11844457

Country of ref document: EP

Kind code of ref document: A1