System upgrading method, system upgrading device, processor and storage medium

By upgrading the startup program partitions one by one during the firmware upgrade process and using the backup file mechanism to handle power outages, the problem of high firmware upgrade risk is solved, and the upgraded power outage protection and stable system startup is achieved.

CN119847555APending Publication Date: 2025-04-18SCANTECH (HANGZHOU) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411659994.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing firmware upgrade technology has the problem of high upgrade risks, especially when the power is off during the system boot startup stage, which causes the system on-chip to fail to start and requires factory repair.

Method used

During the upgrade process of the target system, upgrade each partition file of the startup program partition in turn, and when a power outage occurs, search and execute the backup file of the partition file after powering on again until the upgrade is successful.

Benefits of technology

It effectively avoids the damage to the startup program partition caused by abnormal power outage, reduces the risk of firmware upgrades, avoids factory repairs, and ensures the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847555A_ABST
    Figure CN119847555A_ABST
Patent Text Reader

Abstract

The invention relates to a system upgrading method, a system upgrading device, a processor and a storage medium, and the system upgrading method comprises the following steps: in the upgrading process of a target system, upgrading each partition file of a starting program partition corresponding to the target system in sequence; if power failure occurs in the process of upgrading the target partition file, searching and executing a backup file of the target partition file after power-on again, and upgrading the target partition file again under the condition that it is detected that the target partition file is not successfully upgraded; after the target partition file is upgraded, upgrading a backup file of the target partition file; and upgrading the to-be-upgraded partition specified by the preset upgrading instruction. Through a backup file mechanism and a mode of upgrading the files one by one, damage to a starting program partition under the conditions of abnormal power failure and the like is avoided, so that power failure protection of upgrading is realized, and the upgrading risk of firmware upgrading is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of firmware upgrade, and in particular to a system upgrade method, a system upgrade device, a processor and a storage medium. Background Art

[0002] At present, when upgrading the system on chip, the upgrade package is often sent through the computer device end based on the network connection, and the upgrade package is stored in the backup partition of the system on chip. After that, the corresponding upgrade instructions are written to the misc partition (a partition for storing system boot configuration parameters, recovery images and other miscellaneous data). After restarting and switching to the startup program, the upgrade instructions in the misc partition are parsed and executed in the startup program to write the upgrade package into the external memory of the system on chip, and all partitions, or some partitions, or several files in some partitions in the external memory are reburned.

[0003] For some SoCs such as zynqmp, if the power is off when upgrading the file allocation partition (FAT32 partition) during the system boot phase (UBOOT phase), or when upgrading the boot file (BOOT.BIN file), the SoC will fail to boot and need to be returned to the factory for repair, resulting in a high upgrade risk in the current firmware upgrade.

[0004] With regard to the problem that firmware upgrades in related technologies have high upgrade risks, no effective solution has been proposed yet. Summary of the invention

[0005] In this embodiment, a system upgrade method, a system upgrade device, a processor and a storage medium are provided to solve the problem of high upgrade risk in firmware upgrade in related technologies.

[0006] In a first aspect, a system upgrade method is provided in this embodiment, including:

[0007] During the upgrade process of the target system, each partition file of the startup program partition corresponding to the target system is upgraded in sequence;

[0008] If a power outage occurs during the process of upgrading the target partition file, the backup file of the target partition file is searched and executed after the power is restored, and if it is detected that the target partition file is not successfully upgraded, the target partition file is upgraded again; wherein the target partition file is any one of the partition files; the partition file at least includes: a boot startup file and a startup command set file;

[0009] After the target partition file is upgraded, the backup file of the target partition file is upgraded;

[0010] Upgrade the partition to be upgraded specified by the preset upgrade instruction.

[0011] In some embodiments, the method further comprises:

[0012] If power failure occurs during the process of upgrading the backup file of the target partition file, the target partition file is searched and executed after power is restored, and if it is detected that the backup file of the target partition file is not upgraded successfully, the backup file of the target partition file is upgraded again.

[0013] In some of the embodiments, during the upgrade process of the target system, each partition file of the startup program partition corresponding to the target system is upgraded in sequence, including:

[0014] After the boot startup file and the backup file of the boot startup file are upgraded, the startup command set file and the backup file of the startup command set file are upgraded in sequence.

[0015] In some embodiments, if a power outage occurs during the process of upgrading the target partition file, searching and executing the backup file of the target partition file after power is restored, and re-updating the target partition file when it is detected that the target partition file has not been successfully upgraded, including:

[0016] If a power outage occurs during the process of upgrading the boot file, searching and executing the backup file of the boot file after power is restored to boot the target system;

[0017] After executing the boot startup file, if it is detected that the startup command set file is missing, searching and executing a backup file of the startup command set file to complete the startup of the target system;

[0018] Re-upgrade the boot startup file and the startup command set file.

[0019] In some embodiments, the method further comprises:

[0020] In the case that both the boot startup file and the backup file of the boot startup file are missing, confirming that the target system fails to start;

[0021] In the case that both the startup command set file and the backup file of the startup command set file are missing, it is confirmed that the startup of the target system fails.

[0022] In some of the embodiments, upgrading the partition to be upgraded specified by the preset upgrade instruction includes:

[0023] Determine whether the flags of all upgrade instructions indicate that the upgrade is completed; if not, continue to obtain a target upgrade instruction whose flag indicates that the upgrade is not completed;

[0024] The partition to be upgraded specified by the target upgrade instruction is upgraded, and after the upgrade is completed, the flag bit of the target upgrade instruction is set to complete the upgrade.

[0025] In a second aspect, a system upgrade device is provided in this embodiment, including: an upgrade module, a power-off protection module, a backup upgrade module, and a designated upgrade module; wherein:

[0026] The upgrade module is used to upgrade each partition file of the startup program partition corresponding to the target system in sequence during the upgrade process of the target system;

[0027] The power-off protection module is used for searching and executing the backup file of the target partition file after power is restored when a power failure occurs during the process of upgrading the target partition file, and re-upgrading the target partition file when it is detected that the target partition file is not successfully upgraded; wherein the target partition file is any one of the partition files; and the partition file is at least one of the following: a boot startup file and a startup command set file;

[0028] The backup upgrade module is used to upgrade the backup file of the target partition file after the target partition file is upgraded;

[0029] The designated upgrade module is used to upgrade the partition to be upgraded specified by the preset upgrade instruction.

[0030] In a third aspect, a processor is provided in this embodiment, including: a boot startup file, a startup command set file, and an upgrade program file; wherein:

[0031] The upgrade program file is used to execute the system upgrade method described in the first aspect above.

[0032] In a fourth aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the system upgrade method described in the first aspect when executing the computer program.

[0033] In a fifth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the system upgrade method described in the first aspect is implemented.

[0034] Compared with the related art, the present embodiment provides a system upgrade method, a system upgrade device, a processor and a storage medium; wherein the system upgrade method, in the process of upgrading the target system, sequentially upgrades each partition file of the boot program partition corresponding to the target system; if a power failure occurs during the process of upgrading the target partition file, the backup file of the target partition file is searched and executed after the power is turned on again, and the target partition file is upgraded again when it is detected that the target partition file has not been successfully upgraded; wherein the target partition file is any one of the partition files; the partition file at least includes: a boot startup file and a startup command set file; after the upgrade of the target partition file is completed, the backup file of the target partition file is upgraded; and the partition to be upgraded specified by the preset upgrade instruction is upgraded. It avoids the damage of the boot program partition in the case of abnormal power failure by means of the backup file mechanism and the way of upgrading files one by one, thereby realizing the power-off protection of the upgrade and reducing the upgrade risk of the firmware upgrade.

[0035] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0037] Figure 1 is a hardware structure block diagram of a terminal of the system upgrade method of this embodiment;

[0038] Figure 2 is a flow chart of the system upgrade method of this embodiment;

[0039] Figure 3 is a schematic diagram of power-on startup of a system on chip of this embodiment;

[0040] Figure 4 is a flowchart of a method for writing an upgrade package in some embodiments;

[0041] Figure 5 is a flowchart of a firmware upgrade method in some embodiments;

[0042] Figure 6 It is a structural block diagram of the system upgrading device of this embodiment. DETAILED DESCRIPTION

[0043] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0044] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0045] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the system upgrade method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0046] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the system upgrade method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0047] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0048] In this embodiment, a system upgrade method is provided. Figure 2 is a flow chart of the system upgrade method of this embodiment. Figure 2 As shown, the process includes the following steps:

[0049] Step S210: during the upgrade process of the target system, each partition file of the startup program partition corresponding to the target system is upgraded in sequence.

[0050] The target system can specifically be a programmable system on chip, such as ZynqMP, or other systems with a boot program partition and a suitable backup file mechanism. The following will mainly describe the system upgrade method of this embodiment in conjunction with the system on chip. The non-volatile memory inside the system on chip contains the program BOOTROM for starting and booting the system. BOOTROM will search for the BOOT.BIN file in the first FAT32 partition of UBOOT to guide the system to start. Among them, FAT32 is a file system, which is an improved version of the file allocation table (FAT) system, and uses 32-bit binary numbers to record and manage disk files. Figure 3This is a schematic diagram of power-on startup of a system on chip of the present embodiment. Specifically, in the power-on startup process of the system on chip, BOOTROM searches for the BOOT.BIN file from the boot program partition (specifically the first FAT32 partition, for the convenience of description, hereinafter referred to as the BOOT partition) of the external memory (such as EMMC). The BOOT.BIN file is a binary file containing startup code, which is used to boot the system. If the BOOT partition is damaged or the BOOT.BIN file is incomplete, the system startup will fail. In addition, after the BOOT.BIN file is loaded, the FSBL code and UBOOT code will be executed respectively. Finally, the UBOOT code will load the boot.scr startup script file, load the image.ub file (the image file in the embedded system) in boot.scr, boot the Linux kernel and start the system. rootfs (root file system) is a key component. Rootfs contains the files and directory structure required for the operation of the operating system, and is the most basic file system that can be accessed and used normally after the operating system is started.

[0051] Among them, FSBL code is the first stage boot loader (First Stage Boot Loader), and UBOOT code is the embedded boot loader. The boot.scr file contains U-Boot commands for loading the kernel, device tree, initializing the RAM disk, and setting kernel startup parameters. These commands are equivalent to a collection of startup commands. The above-mentioned boot startup file can be a BOOT.BIN file, and the above-mentioned startup command collection file can be a boot.scr file.

[0052] Based on the above content, we know that we need to pay attention to the BOOT partition, BOOT.BIN file, and boot.scr file during the upgrade process. Since the BOOTROM fixed code cannot be changed, this step considers starting with the BOOTROM search mechanism.

[0053] Zynqmp's BOOTROM implements a search mechanism for backing up the BOOT.BIN file. When the BOOT.BIN file cannot be found in the BOOT partition, the backup file BOOT1001.BIN of BOOT.BIN will continue to be searched. In this way, in this step, BOOT1001.BIN is used as a backup file for the upgrade process. Similarly, a backup file boot1001.scr is also set for boot.scr. Correspondingly, this step also adds a search rule code corresponding to the above-mentioned backup file in the UBOOT code, so that UBOOT will load the boot1001.scr file after failing to verify the boot.scr file. In this way, when the BOOT.BIN file or the boot.scr file is damaged during the upgrade process, the system can be put into an upgradeable state again based on the corresponding backup file, such as re-upgrading through the dfu mode in UBOOT, thereby avoiding disassembly and returning the machine to the factory for repair and reducing the upgrade risk.

[0054] A sector of the BOOT partition (the first 512 bytes of the partition) stores key information about the partition. If a power outage or other abnormality occurs when upgrading this sector, the BOOT partition will be damaged. Therefore, this step uses the method of updating partition files one by one instead of updating the entire BOOT partition to avoid the risk of partition damage.

[0055] Step S220, if a power outage occurs during the process of upgrading the target partition file, the backup file of the target partition file is searched and executed after the power is restored, and if it is detected that the target partition file has not been upgraded successfully, the target partition file is upgraded again; wherein, the target partition file is any one of the partition files; the partition file includes at least: a boot startup file and a startup command set file.

[0056] Therefore, in this step, based on the backup file mechanism, the upgrade package is first issued through the computer device based on the network connection. The upgrade package is stored in the backup partition (such as the data partition) after the md5 verification. After that, the upgrade instruction is written to the misc partition. The upgrade instruction describes the upgrade file source path, the upgrade target path, and whether it has been upgraded. The number of upgrade instructions is consistent with the number of files or partitions that need to be upgraded. After that, restart the system on chip.

[0057] After restarting, enter the upgrade program, which will first update the BOOT.BIN file. If a power outage occurs during the update process, the BOOT.BIN file will be damaged. After powering on again, BOOTROM will search for the backup file BOOT1001.BIN and start the system-on-chip normally based on BOOT1001.BIN. The upgrade program will read and check the misc partition. If it finds that there is an upgrade instruction but indicates that BOOT.BIN has not been successfully upgraded (for example, the upgrade success flag is not read), it is necessary to restart the upgrade of BOOT.BIN.

[0058] When upgrading the boot.scr file, if power is cut off during the process, the boot.scr file will be damaged. After power is restored, if the upgrade program fails to check the integrity of boor.scr, it will switch to boot1001.scr for execution, and the system will start normally. Then check the misc partition. If the upgrade instruction is found but the boot.scr is not successfully upgraded (for example, the upgrade success flag is not read), the boot.scr file will be upgraded again.

[0059] Step S230: after the target partition file is upgraded, the backup file of the target partition file is upgraded.

[0060] After upgrading the BOOT.BIN file, the corresponding backup file, that is, the BOOT1001.BIN file, is upgraded. The upgrade of BOOT1001.BIN is the same as that of BOOT.BIN. If a power outage occurs during the update process, the BOOT1001.BIN file will be damaged. After powering on again, the BOOTROM will search for the BOOT.BIN file and realize the normal startup of the system on chip based on BOOT.BIN. The upgrade program will read and check the misc partition. When it is found that there is an upgrade instruction but it indicates that BOOT1001.BIN has not been successfully upgraded (for example, the upgrade success flag is not read), it is necessary to restart the upgrade of BOOT1001.BIN.

[0061] After upgrading the boot.scr file, the corresponding backup file, that is, the boot1001.scr file, is upgraded. The upgrade of the boot1001.scr file is the same as that of the boot.scr file. If a power outage occurs during the upgrade of the boot1001.scr file, the boot1001.scr file will be damaged. After power is restored, if the upgrade program fails to check the integrity of boor.scr, it will switch to boot.scr for execution, and the system will start normally. Then check the misc partition. When it is found that there is an upgrade instruction but it indicates that boot1001.scr has not been successfully upgraded (for example, the flag bit indicating successful upgrade is not read), restart the upgrade of the boot1001.scr file. Finally, the image.ub file can also be upgraded. At this point, the BOOT partition is upgraded.

[0062] Step S240: upgrading the partition to be upgraded specified by the preset upgrade instruction.

[0063] For other partitions to be upgraded except the BOOT partition specified by the upgrade command, the upgrade can be achieved by updating the partition as a whole. Cooperate with the power-off protection function of the misc partition. Next, take the upgrade of the roofs partition as an example. If a power outage occurs when upgrading the roofs partition, the upgrade program will check the misc partition after rewriting the power. When it is found that there is an upgrade command to upgrade the roofs partition, but there is no flag bit for the successful upgrade of the roofs partition, the rootfs partition will be upgraded again until the partition is successfully upgraded.

[0064] In the related art, during the upgrade process, if the power is off when upgrading the file allocation partition (FAT32 partition) during the system boot phase (UBOOT phase), or when upgrading the boot file (BOOT.BIN file), the system on chip will fail to boot and need to be returned to the factory for repair, resulting in a high upgrade risk for current firmware upgrades.

[0065] In this regard, this embodiment introduces a backup file mechanism through the above steps S210 to S240 for the BOOT partition that affects the system startup, and combines the file upgrade method one by one to upgrade the partition files in the BOOT partition in sequence, so that even in the event of an abnormal power outage, the BOOT partition will not be damaged, thereby avoiding the problem of the on-chip system failing to start due to the upgrade, avoiding the factory repair caused by the upgrade, and reducing the risk of firmware upgrade.

[0066] Through the above steps S210 to S240, during the upgrade process of the target system, each partition file of the boot program partition corresponding to the target system is upgraded in sequence; if a power outage occurs during the upgrade process of the target partition file, the backup file of the target partition file is searched and executed after the power is turned on again, and when it is detected that the target partition file has not been successfully upgraded, the target partition file is upgraded again; wherein, the target partition file is any one of the partition files; the partition file at least includes: a boot startup file and a startup command set file; after the upgrade of the target partition file is completed, the backup file of the target partition file is upgraded; the partition to be upgraded specified by the preset upgrade instruction is upgraded. It avoids damage to the boot program partition in the case of abnormal power outages through the backup file mechanism and the way of upgrading files one by one, thereby realizing the power-off protection of the upgrade and reducing the upgrade risk of the firmware upgrade.

[0067] In one embodiment, the system upgrade method further includes: if a power outage occurs during the process of upgrading the backup file of the target partition file, searching and executing the target partition file after power is restored, and re-upgrading the backup file of the target partition file when it is detected that the backup file of the target partition file has not been successfully upgraded.

[0068] That is, the target partition file is also used as a backup of its backup file. When the backup file of the target partition file (such as the above BOOT1001.BIN or boot1001.scr) is upgraded, if a power outage occurs, the system is normally started based on the corresponding target partition file, and then the backup file is upgraded again. In this way, the backup file can be upgraded smoothly and timely.

[0069] Additionally, in one embodiment, during the upgrade process of the target system, upgrading each partition file of the startup program partition corresponding to the target system in sequence may include:

[0070] After the boot startup file and the backup file of the boot startup file are upgraded, the boot command set file and the backup file of the boot command set file are upgraded in sequence. Among them, each partition file in the BOOT partition can be upgraded based on the power-on startup sequence of the system on chip. First, the upgrade of the BOOT.BIN file and the corresponding backup file BOOT1001.BIN file is implemented, and then the upgrade of the boot.scr file and the corresponding backup file boot1001.scr file is implemented to complete the smooth and successful upgrade of the BOOT partition.

[0071] In one embodiment, if a power outage occurs during the process of upgrading the target partition file, searching and executing the backup file of the target partition file after power is restored, and re-upgrading the target partition file when it is detected that the target partition file has not been successfully upgraded, may include:

[0072] If a power outage occurs during the process of upgrading the boot file, the backup file of the boot file is searched and executed to boot the target system after power is restored; after the boot file is executed, if it is detected that the startup command set file is missing, the backup file of the startup command set file is searched and executed to complete the startup of the target system; the boot file and the startup command set file are re-upgraded.

[0073] Additionally, in one embodiment, the system upgrade method may further include:

[0074] In the case where both the boot startup file and the backup file of the boot startup file are missing, it is confirmed that the target system fails to start; in the case where both the startup command set file and the backup file of the startup command set file are missing, it is confirmed that the target system fails to start. That is, when both the BOOT.BIN file and the BOOT1001.BIN file are missing, or the boot.scr file or the boot1001.scr file are missing, the system cannot start normally.

[0075] In particular, in one embodiment, based on the above step S240, upgrading the partition to be upgraded specified by the preset upgrade instruction may include:

[0076] Determine whether the flags of all upgrade instructions indicate that the upgrade is completed; if not, continue to obtain a target upgrade instruction whose flag indicates that the upgrade is not completed; upgrade the partition to be upgraded specified by the target upgrade instruction, and set the flag of the target upgrade instruction to complete the upgrade after the upgrade is completed.

[0077] Specifically, it is determined whether all upgrades have been completed according to the flag of the upgrade instruction in a cyclic manner. If so, it is confirmed that the firmware upgrade is completed. Otherwise, the upgrade is continued for the upgrade instruction that has not been completed, and the corresponding flag is set to complete the upgrade after the upgrade is completed. In this way, the present embodiment can implement the upgrade operation of all upgrade instructions one by one.

[0078] Figure 4 is a flowchart of a method for writing an upgrade package in some of the embodiments, such as Figure 4 As shown, the upgrade package writing method includes the following steps:

[0079] Step S401, downloading the upgrade package.

[0080] Step S402, determine whether the md5 verification of the upgrade package is successful; if so, execute step S403; otherwise, execute step S405.

[0081] Step S403: decompress the upgrade file and the upgrade partition image from the upgrade package.

[0082] Step S404, write the upgrade package path into the misc partition and restart the system on chip.

[0083] Step S405, confirming that the upgrade has failed.

[0084] Figure 5 is a flowchart of a firmware upgrade method in some of the embodiments, such as Figure 5 As shown, the firmware upgrade method includes:

[0085] Step S501, the system on chip is powered on or restarted.

[0086] Step S502, determine whether the BOOT.BIN file is found; if so, execute step S503; otherwise, execute step S512;

[0087] Step S503: execute FSBL code.

[0088] Step S504, executing UBOOT code.

[0089] Step S505, determine whether the boot.scr file is complete; if so, execute step S506; otherwise, execute step S513.

[0090] Step S506, check the misc partition and obtain the upgrade instruction in misc.

[0091] Step S507, determine whether the flag bits of all upgrade instructions are completed; if so, execute step S511; otherwise, execute step S508.

[0092] Step S508: obtaining an upgrade instruction indicating that the upgrade is not completed.

[0093] Step S509: Upgrade the corresponding files or partitions.

[0094] Step S510, after the upgrade is completed, the flag bit of the corresponding upgrade instruction is set to complete the upgrade; and the process returns to step S507.

[0095] Step S511, enter the system.

[0096] Step S512, determine whether the BOOT1001.BIN file is found; if so, execute step S503; otherwise, confirm that the startup fails.

[0097] Step S513, determine whether boot1001.scr is complete; if so, execute step S506; otherwise, confirm that the startup failed.

[0098] In this embodiment, a system upgrade device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0099] Figure 6 is a structural block diagram of the system upgrade device 60 of this embodiment, such as Figure 6 As shown, the system upgrade device 60 includes: an upgrade module 62, a power failure protection module 64, a backup upgrade module 66 and a designated upgrade module 68; wherein:

[0100] The upgrade module 62 is used to upgrade the partition files of the startup program partition corresponding to the target system in sequence during the upgrade process of the target system; the power-off protection module 64 is used to search and execute the backup file of the target partition file after power-on again when a power outage occurs during the upgrade process of the target partition file, and re-upgrade the target partition file when it is detected that the target partition file has not been successfully upgraded; wherein the target partition file is any one of the partition files; the partition file is at least one of the following: a boot startup file and a startup command set file; the backup upgrade module 66 is used to upgrade the backup file of the target partition file after the upgrade of the target partition file is completed; the specified upgrade module 68 is used to upgrade the partition to be upgraded specified by the preset upgrade instruction.

[0101] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0102] In this embodiment, a processor is also provided, including: a boot file, a startup command set file and an upgrade program file; wherein: the upgrade program file is used to execute the firmware upgrade method of the system on chip provided by the above embodiment. The upgrade program file can be the sk_update upgrade program file involved in the above embodiment.

[0103] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0104] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0105] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0106] S1, during the upgrade process of the target system, each partition file of the boot program partition corresponding to the target system is upgraded in sequence;

[0107] S2, if a power outage occurs during the process of upgrading the target partition file, searching and executing the backup file of the target partition file after power is restored, and re-upgrading the target partition file when it is detected that the target partition file is not successfully upgraded; wherein the target partition file is any one of the partition files; the partition file at least includes: a boot startup file and a startup command set file;

[0108] S3, after the target partition file is upgraded, the backup file of the target partition file is upgraded;

[0109] S4, upgrading the partition to be upgraded specified by the preset upgrade instruction.

[0110] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0111] In addition, in combination with the system upgrade method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the system upgrade method. The storage medium stores a computer program, and when the computer program is executed by a processor, any system upgrade method in the above embodiments is implemented.

[0112] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0113] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0114] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0115] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0116] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A system upgrade method, characterized in that: include: During the upgrade process of the target system, each partition file of the startup program partition corresponding to the target system is upgraded in sequence; If a power outage occurs during the process of upgrading the target partition file, the backup file of the target partition file is searched and executed after the power is restored, and if it is detected that the target partition file is not successfully upgraded, the target partition file is upgraded again; wherein the target partition file is any one of the partition files; the partition file at least includes: a boot startup file and a startup command set file; After the target partition file is upgraded, the backup file of the target partition file is upgraded; Upgrade the partition to be upgraded specified by the preset upgrade instruction.

2. The system upgrade method according to claim 1, characterized in that: The method further comprises: If power failure occurs during the process of upgrading the backup file of the target partition file, the target partition file is searched and executed after power is restored, and if it is detected that the backup file of the target partition file is not upgraded successfully, the backup file of the target partition file is upgraded again.

3. The system upgrade method according to claim 1, characterized in that: During the upgrade process of the target system, each partition file of the startup program partition corresponding to the target system is upgraded in sequence, including: After the boot startup file and the backup file of the boot startup file are upgraded, the startup command set file and the backup file of the startup command set file are upgraded in sequence.

4. The system upgrade method according to claim 3, characterized in that: If a power outage occurs during the process of upgrading the target partition file, searching and executing the backup file of the target partition file after power is restored, and re-updating the target partition file when it is detected that the target partition file is not successfully upgraded, including: If a power outage occurs during the process of upgrading the boot file, searching and executing the backup file of the boot file after power is restored to boot the target system; After executing the boot startup file, if it is detected that the startup command set file is missing, searching and executing a backup file of the startup command set file to complete the startup of the target system; Re-upgrade the boot startup file and the startup command set file.

5. The system upgrade method according to claim 3, characterized in that: The method further comprises: In the case that both the boot startup file and the backup file of the boot startup file are missing, confirming that the target system fails to start; In the case that both the startup command set file and the backup file of the startup command set file are missing, it is confirmed that the startup of the target system fails.

6. The system upgrade method according to any one of claims 1 to 5, characterized in that: Upgrade the partition to be upgraded specified by the preset upgrade instruction, including: Determine whether the flags of all upgrade instructions indicate that the upgrade is completed; if not, continue to obtain a target upgrade instruction whose flag indicates that the upgrade is not completed; The partition to be upgraded specified by the target upgrade instruction is upgraded, and after the upgrade is completed, the flag bit of the target upgrade instruction is set to complete the upgrade.

7. A system upgrade device, characterized in that: include: Upgrade module, power-off protection module, backup upgrade module and designated upgrade module; among which: The upgrade module is used to upgrade each partition file of the startup program partition corresponding to the target system in sequence during the upgrade process of the target system; The power-off protection module is used for searching and executing the backup file of the target partition file after power is restored when a power failure occurs during the process of upgrading the target partition file, and re-upgrading the target partition file when it is detected that the target partition file is not successfully upgraded; wherein the target partition file is any one of the partition files; and the partition file is at least one of the following: a boot startup file and a startup command set file; The backup upgrade module is used to upgrade the backup file of the target partition file after the target partition file is upgraded; The designated upgrade module is used to upgrade the partition to be upgraded specified by the preset upgrade instruction.

8. A processor, characterized in that: include: Boot startup files, startup command set files, and upgrade program files; among them: The upgrade program file is used to execute the system upgrade method according to any one of claims 1 to 6.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the system upgrade method according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the system upgrade method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Beverage equipment and firmware updating method thereof

    CN120508308A