Firmware upgrade methods, devices, equipment and media

By acquiring and upgrading firmware based on priority and upgrade status information in a firmware-dependent system, the problem of repeated resource occupation after system power failure is solved, enabling timely upgrades of critical firmware and normal system startup, thus improving system reliability.

CN122308857APending Publication Date: 2026-06-30GOLDCARD HIGH TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In firmware-dependent systems, when the system is upgraded again after a power outage, resources are repeatedly occupied, critical firmware cannot be upgraded in a timely manner, and the normal startup of the system is affected.

Method used

After the target system is powered on, the upgrade status and priority information of the firmware to be upgraded are obtained. The upgrade is performed according to the priority and upgrade status information, prioritizing the upgrade of high-priority firmware, and using differential or full upgrade methods to avoid duplicate backup and upgrade operations.

Benefits of technology

Optimize storage space and bandwidth resource usage, reduce upgrade time, ensure timely upgrades of critical firmware, guarantee normal system startup, and improve system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308857A_ABST
    Figure CN122308857A_ABST
Patent Text Reader

Abstract

This application provides a firmware upgrade method, apparatus, device, and medium. The method includes: after the target system is powered on, acquiring upgrade status information and priority information corresponding to at least two firmware files to be upgraded for the target system application; the priority information indicates the priority of the at least two firmware files to be upgraded; upgrading the at least two firmware files according to the upgrade status information and priority information, and updating the corresponding upgrade status information according to the current upgrade progress of the firmware files to be upgraded, until the firmware files to be upgraded are upgraded to the corresponding target firmware. This method ensures normal system startup and improves system reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer technology, and more particularly to a firmware upgrade method, apparatus, device, and medium. Background Technology

[0002] Firmware-dependent systems typically run in specific hardware environments, and their firmware controls the basic operation and functions of the hardware devices. Therefore, firmware upgrades are an extremely common and crucial task in firmware-dependent systems.

[0003] Currently, known technologies typically perform firmware upgrades using a specified upgrade method. Specifically, the upgrade method can be a full upgrade or a differential upgrade. If the system experiences a sudden power outage during either upgrade method, the upgrade process will be interrupted, requiring the system to power on again to resume the upgrade.

[0004] It is understandable that when there are multiple firmware updates to be performed on the system, re-upgrading after a power outage will result in repeated resource consumption, which may prevent the timely upgrade of critical firmware and thus hinder the normal startup of the system. Summary of the Invention

[0005] This application provides a firmware upgrade method, apparatus, device, and medium to ensure that the system can start normally, thereby improving the system's reliability.

[0006] Firstly, this application provides a firmware upgrade method, the method comprising:

[0007] After the target system is powered on, upgrade status information and priority information of at least two firmware files to be upgraded for the target system are obtained; the priority information is used to indicate the priority of the at least two firmware files to be upgraded.

[0008] The at least two firmware files to be upgraded are upgraded according to the upgrade status information and the priority information, and the corresponding upgrade status information is updated according to the current upgrade progress of the firmware files to be upgraded, until the firmware files to be upgraded are upgraded to the corresponding target firmware.

[0009] In another possible implementation, upgrading the at least two firmware files to be upgraded based on the upgrade status information and the priority information includes:

[0010] The upgrade order of at least two firmware to be upgraded is determined based on the priority information, wherein the firmware to be upgraded with the higher priority indicated by the priority information is upgraded first; the priority is determined based on any of the following: the system attributes of the target system, the user's historical usage habits, and user commands;

[0011] According to the upgrade order, the at least two firmware files to be upgraded are upgraded based on the upgrade status information, and the corresponding upgrade status information is updated according to the current upgrade progress of the firmware files to be upgraded, until the firmware files to be upgraded are upgraded to the corresponding target firmware.

[0012] In another possible implementation, upgrading the at least two firmware files to be upgraded based on the upgrade status information and the priority information includes:

[0013] For each firmware to be upgraded, obtain the firmware header information of the firmware to be upgraded. The firmware header information is used to indicate the upgrade method of the firmware to be upgraded. The upgrade method includes full upgrade and differential upgrade.

[0014] The firmware to be upgraded is upgraded according to the upgrade method indicated in the firmware header information and the upgrade progress.

[0015] In another possible implementation, the upgrade method indicated by the firmware header information, and the upgrade progress of upgrading the firmware to be upgraded, include:

[0016] If the upgrade method is differential upgrade, then the firmware to be upgraded is upgraded according to the differential data sum between the target firmware and the firmware to be upgraded, and the following are performed: update the upgrade status information according to the current upgrade progress, and perform CRC verification according to the CRC algorithm indicated by the firmware header information;

[0017] If the upgrade method is a full upgrade, then the firmware to be upgraded is upgraded according to the full data of the target firmware, and the following are performed: the upgrade status information is updated according to the current upgrade progress, and CRC verification is performed according to the CRC algorithm indicated by the header information.

[0018] In another possible implementation, the target system includes at least two storage areas; the method further includes:

[0019] Establish a mapping relationship between the at least two firmware files to be upgraded and at least two storage areas, so that the firmware file to be upgraded corresponds to a unique target storage area;

[0020] Upon receiving any firmware upgrade request, the upgrade status information is generated based on the upgrade progress of the firmware to be upgraded as indicated by the firmware upgrade request, and the upgrade status information is stored in the target storage area corresponding to the firmware to be upgraded.

[0021] The step of obtaining upgrade status information corresponding to at least two firmware files to be upgraded for the target system application includes:

[0022] Determine the target storage area corresponding to the firmware to be upgraded, and obtain the upgrade status information from the target storage area.

[0023] In another possible implementation, the method further includes:

[0024] Upon receiving any firmware upgrade request for the first time, the firmware to be upgraded, as indicated in the firmware upgrade request, is backed up to the target storage area.

[0025] In another possible implementation, the method further includes:

[0026] When upgrading the firmware to be upgraded in response to the firmware upgrade request, a CRC check is performed;

[0027] If the CRC check passes, the upgrade status information in the target storage area is cleared;

[0028] If the CRC check fails and the number of failures reaches a preset number, the firmware to be upgraded is retrieved from the target storage area and restored.

[0029] Secondly, this application provides a firmware upgrade device, the device comprising:

[0030] The acquisition module is used to acquire upgrade status information and priority information corresponding to at least two firmware files to be upgraded for the target system after the target system is powered on; the priority information is used to indicate the priority of the at least two firmware files to be upgraded.

[0031] The upgrade module is used to upgrade the at least two firmwares to be upgraded according to the upgrade status information and the priority information, and update the corresponding upgrade status information according to the current upgrade progress of the firmware to be upgraded, until the firmware to be upgraded is upgraded to the corresponding target firmware.

[0032] Thirdly, this application provides an electronic device, including: at least one processor and a memory;

[0033] The memory stores computer-executed instructions;

[0034] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any of the first aspects above.

[0035] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a central processing unit, are used to implement the method described in any of the first aspects above.

[0036] Fifthly, this application provides a computer program product, including a computer program that, when executed by a central processing unit, implements the method described in any of the first aspects.

[0037] This application provides a firmware upgrade method, apparatus, device, and medium. Specifically, the method is executed by any electronic device. For at least two firmware files to be upgraded, when the target system is powered on, the electronic device can sequentially upgrade the at least two firmware files based on their upgrade status and priority information. This avoids redundant use of the target system's storage space and the repeated execution of some upgrade steps, optimizing the use of storage space and bandwidth resources, reducing upgrade time and resource consumption, and facilitating timely completion of firmware upgrades. Furthermore, it ensures that firmware files with higher priority are upgraded first, thereby ensuring normal system startup and improving system reliability. Attached Figure Description

[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0039] Figure 1 This is a schematic diagram illustrating an application scenario of a firmware upgrade method provided in an embodiment of this application.

[0040] Figure 2 A flowchart illustrating a firmware upgrade method provided in this application embodiment. Figure 1 ;

[0041] Figure 3 A flowchart illustrating a firmware upgrade method provided in this application embodiment. Figure 2 ;

[0042] Figure 4 A flowchart illustrating a firmware upgrade method provided in this application embodiment. Figure 3 ;

[0043] Figure 5 A process example diagram of a firmware upgrade method provided in an embodiment of this application;

[0044] Figure 6 This is a schematic diagram of the structure of a firmware upgrade device provided in an embodiment of this application;

[0045] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0046] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0048] Firmware-dependent systems are widely used in numerous fields, including smart home devices, industrial automation control systems, automotive electronic systems, and medical devices. Currently, with the continuous evolution and development of technology, the environment and requirements faced by firmware-dependent systems are constantly changing. Furthermore, because firmware-dependent systems typically operate in specific hardware environments, and their firmware controls the basic operation and functions of the hardware devices, firmware upgrades are an extremely common and crucial task in firmware-dependent systems.

[0049] Currently, there are various firmware upgrade methods and technologies available on the market, typically including full upgrades and differential upgrades. Known technologies usually perform firmware upgrades according to a specified method, either a full upgrade or a differential upgrade. Specifically, a full upgrade requires the target system to download the entire new firmware file and replace the currently running firmware. A differential upgrade, on the other hand, only downloads the changed portions of the firmware file, not the entire file.

[0050] Understandably, systems often have diverse functions, thus requiring multiple firmware versions to work together. In practical applications, a target system may need to upgrade at least two firmware versions simultaneously. In known technologies, a sudden power outage may occur while the target system is upgrading at least two firmware versions. In this case, the upgrade process for at least two firmware versions will be interrupted, and the upgrade will resume only after the target system is powered on again.

[0051] During the aforementioned process, when the target system is powered on again and at least two firmware updates are re-upgraded, resource duplication typically occurs. For example, the need to back up the firmware again leads to duplicate storage space usage, and the need to repeat the upgrade process performed before the power outage results in duplicate resource usage. Consequently, some critical firmware updates cannot be completed in a timely manner after the target system is powered on again, leading to the target system's inability to boot normally. Specifically, critical firmware may include the motherboard's Basic Input / Output System (BIOS).

[0052] For example, if a system boot firmware and a device driver firmware need to be upgraded, and the power is interrupted halfway through the boot firmware upgrade, the subsequent backup process will prolong the entire upgrade process. As a result, the device driver firmware may fail to install properly because the boot firmware has not been upgraded in a timely and correct manner, ultimately leading to the failure to upgrade critical firmware in a timely manner.

[0053] Therefore, this application provides a firmware upgrade method, apparatus, device, and medium to solve the above-mentioned problems. Specifically, in the method of this application, after the target system is powered on, the firmware to be upgraded continues to be upgraded according to the upgrade progress of the firmware to be upgraded before the power failure, and when the target system contains at least two firmwares to be upgraded, the at least two firmwares to be upgraded are upgraded according to their priorities.

[0054] The method described in this application avoids redundant backups of firmware to be upgraded and re-execution of already performed upgrade operations when the target system is powered on again after a power outage, thus ensuring that each firmware to be upgraded can be upgraded in a timely manner. Furthermore, it enables higher-priority firmware to be upgraded to complete the upgrade promptly, further ensuring that the target system can boot normally.

[0055] It is understood that the firmware upgrade method of this application can be applied to any system that needs to be upgraded. Figure 1 This is a schematic diagram illustrating an application scenario of a firmware upgrade method provided in an embodiment of this application, such as... Figure 1 As shown, the method of this application can be applied to environmental control systems. Specifically, the environmental control system includes at least one sensor and an actuator, such as... Figure 1 As shown, the environmental control system includes a first firmware for automatically adjusting the operation of air conditioning or heating equipment based on user-defined temperature targets and feedback information from indoor and outdoor temperature sensors, as well as a second firmware for critical components.

[0056] like Figure 1As shown, the environmental control system is connected to an electronic device via wired or wireless means. The electronic device upgrades the firmware included in the environmental control system using the method of this application. Using the method of this application, if the environmental control system experiences a power outage while upgrading the first and second firmware, the electronic device can continue the upgrade process according to the upgrade status information corresponding to the first and second firmware respectively after the environmental control system is powered on again, thereby avoiding redundant resource usage. Furthermore, the second firmware, which has a higher priority, can be prioritized for upgrade, thus ensuring the normal startup of the environmental control system.

[0057] It is understood that electronic devices can be set up independently of the environmental control system or integrated into the environmental control system; this application does not limit this. When electronic devices are set up independently, in addition to the aforementioned environmental control system, they can also be connected to other firmware-dependent systems for firmware upgrades; this application also does not limit this.

[0058] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Where the embodiments do not conflict, the following embodiments and features thereof can be combined with each other.

[0059] This application provides a firmware upgrade method. Figure 2 A flowchart illustrating a firmware upgrade method provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the method provided in this embodiment includes:

[0060] S201: After the target system is powered on, obtain the upgrade status information and priority information of at least two firmware files to be upgraded for the target system application.

[0061] The priority information is used to indicate the priority of at least two firmware files to be upgraded.

[0062] In this embodiment, the electronic device upgrades at least two firmware files to be upgraded for the target system application through the target system's bootloader. Specifically, when the electronic device detects that the target system is powered on, it first initializes the hardware and peripherals through the bootloader, and then obtains the upgrade status information and priority information corresponding to the at least two firmware files to be upgraded for the target system application, in order to determine the upgrade progress and priority of the at least two firmware files to be upgraded.

[0063] As a preferred example, the target system includes at least two storage areas, and the electronic device maintains upgrade status information for at least two firmware files to be upgraded in the at least two storage areas. Specifically, the electronic device establishes a mapping relationship between at least two firmware files to be upgraded and at least two storage areas, so that each firmware file to be upgraded corresponds to a unique target storage area.

[0064] Furthermore, upon receiving any firmware upgrade request, upgrade status information is generated based on the upgrade progress of the firmware to be upgraded as indicated in the firmware upgrade request, and the upgrade status information is stored in the target storage area corresponding to the firmware to be upgraded.

[0065] Based on this, after the electronic device is powered on by the target system, it determines the target storage area corresponding to the firmware to be upgraded, and then enables the bootloader to obtain the upgrade status information of the corresponding firmware to be upgraded from the corresponding target storage area.

[0066] In the above settings, upgrade status information is maintained in the storage area of ​​the target system. When needed, the electronic device can obtain the upgrade status information from the corresponding target storage area in a timely manner, which is conducive to quickly and conveniently obtaining the upgrade status information of each firmware to be upgraded.

[0067] In practical applications, electronic devices can also provide feedback to users to instruct them to input the upgrade progress of the firmware to be upgraded and generate upgrade status information based on the upgrade progress input by the user. This embodiment does not limit this.

[0068] In this embodiment, when the electronic device powers on the target system, it determines the priority information based on any one of the following: the target system's system attributes, the user's historical usage habits, and user instructions. Specifically, the target system's system attributes indicate whether the firmware to be upgraded is critical firmware, the user's historical usage habits indicate the user's habits of using the applications corresponding to each firmware to be upgraded after using the target system, and the user instructions directly indicate the priority of the firmware to be upgraded.

[0069] As a preferred example, the electronic device determines the priority of the firmware to be upgraded based on the system attributes of the target system and the user's historical usage habits. Specifically, critical firmware and non-critical firmware are first identified. The priority of the firmware to be upgraded that is critical firmware is further determined based on the user's historical usage habits, and the priority of the firmware to be upgraded that is non-critical firmware is further determined based on the user's historical usage habits, so that the priority of critical firmware is higher than that of non-critical firmware, and the priority of firmware to be upgraded that has been used earlier and more frequently by the user is even higher.

[0070] For example, in an industrial automation control system, system attributes indicate that the operating system firmware and communication module firmware of the programmable logic controller are marked as critical firmware. Electronic devices can assign a higher, fixed priority value to critical firmware based on this system attribute; for example, in a priority range of 1-10, critical firmware might be set to priority 1-3, and other non-critical firmware to priority 4-10. When the system is powered on, the upgrade order is determined by querying the critical firmware markers and their corresponding priority values.

[0071] Furthermore, for each critical firmware and non-critical firmware, the priority usage frequency is determined based on the user's historical usage habits. A higher priority value is assigned to firmware with higher usage frequency, which can be a value in the range of 0-1.

[0072] Based on this, the priority value for each firmware is determined by combining the priority value determined by system attributes and the priority value determined by usage frequency. Specifically, the two are added together to obtain the priority value of the corresponding firmware.

[0073] This setting ensures the target system's normal startup, thus guaranteeing its reliability. Furthermore, it prioritizes upgrading firmware that users urgently need, thereby improving the user experience.

[0074] Understandably, in practical applications, each firmware to be upgraded can also be stored in the corresponding target storage area, and the electronic device can obtain the priority information of the corresponding firmware to be upgraded by accessing the target storage area.

[0075] S202, upgrade at least two firmwares to be upgraded according to upgrade status information and priority information, and update the corresponding upgrade status information according to the current upgrade progress of the firmware to be upgraded, until the firmware to be upgraded is upgraded to the corresponding target firmware.

[0076] In this embodiment, the electronic device enables the Bootloader to upgrade at least two firmware files based on the upgrade progress indicated by the upgrade status information of at least two firmware files to be upgraded, and the priority of at least two firmware files to be upgraded indicated by the priority information.

[0077] During the upgrade process, for each firmware to be upgraded, the electronic device maintains its corresponding upgrade status information based on its current upgrade progress until the upgrade of that firmware is completed. In this embodiment, the upgrade progress specifically refers to which step the upgrade has reached.

[0078] Specifically, in this embodiment, the electronic device determines the upgrade order of at least two firmware to be upgraded based on priority information; according to the upgrade order, the at least two firmware to be upgraded are upgraded based on the upgrade status information, and the corresponding upgrade status information is updated according to the current upgrade progress of the firmware to be upgraded, until the firmware to be upgraded is upgraded to the corresponding target firmware.

[0079] Among them, the priority information indicates that the firmware to be upgraded with the higher priority will be upgraded first; the priority is determined according to any of the following: the system attributes of the target system, the user's historical usage habits, and user instructions.

[0080] Understandably, firmware with higher priority will be upgraded earlier in the upgrade order. The electronic device will instruct the bootloader to upgrade the firmware in this order. Optionally, if at least two firmware files can be upgraded in parallel, the firmware with the earlier upgrade order will be prioritized for upgrade.

[0081] Specifically, for each firmware to be upgraded, the electronic device continues to upgrade it according to the upgrade progress indicated by the upgrade status information, and the bootloader continues to upgrade it.

[0082] In the method provided in this embodiment, after the electronic device powers on the target system, it acquires the upgrade status information and priority information corresponding to at least two firmware files to be upgraded, in order to determine the upgrade progress and processing priority of the at least two firmware files to be upgraded. Further, based on the upgrade progress and processing priority of the at least two firmware files to be upgraded, the at least two firmware files to be upgraded are upgraded, and the upgrade status information of the at least two firmware files to be upgraded is updated during the upgrade process, until the firmware files to be upgraded are upgraded to the corresponding target firmware.

[0083] The method described in this embodiment allows for the continued upgrading of firmware after a power outage and subsequent power-on, based on the upgrade progress prior to the power outage. This avoids redundant use of the target system's storage space and the repetitive execution of certain upgrade steps. On one hand, it optimizes the use of storage space and bandwidth resources, reducing upgrade time and resource consumption. On the other hand, it ensures timely upgrades of firmware requiring immediate updates, thereby improving user experience. Furthermore, when there are at least two firmware updates to be performed, the system prioritizes the firmware with the higher priority, ensuring normal system startup and improving system reliability.

[0084] This application also provides an embodiment of a firmware upgrade method. Figure 3 A flowchart illustrating a firmware upgrade method provided in this application embodiment. Figure 2 This embodiment, based on the foregoing embodiments, provides a detailed description of the upgrade process for each firmware to be upgraded in the foregoing embodiments. For example... Figure 3 As shown, the method in this embodiment includes:

[0085] S301: For each firmware to be upgraded, obtain the firmware header information of the firmware to be upgraded.

[0086] The firmware header information indicates the upgrade method for the firmware to be upgraded, which includes full upgrade and differential upgrade.

[0087] In this embodiment, the target system has a storage space for storing the firmware file for each firmware to be upgraded. The electronic device reads the firmware file from the corresponding storage space and parses the firmware header information indicating the upgrade method. Specifically, in this embodiment, in addition to the upgrade method, the firmware header information also includes the following: target firmware version number, CRC algorithm, target firmware size, target firmware download package size, etc.

[0088] More specifically, the electronic device determines the upgrade method for the firmware to be upgraded based on the value of the "upgrade method" field in the storage space.

[0089] Furthermore, the electronic device upgrades the firmware to be upgraded according to the upgrade method indicated in the firmware header information and the upgrade progress. See S302 and S303 for details.

[0090] S302, if the upgrade method is differential upgrade, then upgrade the firmware to be upgraded according to the differential data of the target firmware, and perform the following: update the upgrade status information according to the current upgrade progress, and perform CRC verification according to the CRC algorithm indicated by the firmware header information.

[0091] S303 If the upgrade method is a full upgrade, then the firmware to be upgraded will be upgraded based on the full data of the target firmware, and the following will be performed: update the upgrade status information according to the current upgrade progress, and perform CRC verification according to the CRC algorithm indicated by the firmware header information.

[0092] It is understandable that, in addition to the aforementioned firmware header information, the firmware files in the storage space also include upgrade packages, which are specifically differential or full data of the target firmware.

[0093] In this embodiment, when the upgrade method is differential upgrade, the electronic device obtains differential data from the corresponding storage space and instructs the bootloader to upgrade the firmware to be upgraded from the current upgrade progress based on the differential data. During the upgrade process, CRC verification is performed according to the CRC algorithm indicated in the firmware header information to determine data integrity. Simultaneously, the upgrade status information is updated according to the current upgrade progress.

[0094] Similarly, when the upgrade method is a full upgrade, the electronic device retrieves all data from the corresponding storage space and instructs the bootloader to upgrade the firmware to be upgraded from the current upgrade progress based on the full data. During the upgrade process, CRC verification is performed according to the CRC algorithm indicated in the firmware header information to determine data integrity. At the same time, the upgrade status information is updated according to the current upgrade progress.

[0095] Specifically, in this embodiment, the upgrade method can be carried by the host computer of the target system when the user inputs the firmware file to the target system, or it can be determined by the electronic device itself based on the current system state. In this case, the electronic device updates the firmware header information of the corresponding storage space according to the current system state. Specifically, the system state includes communication resources, etc.

[0096] In the method provided in this embodiment, for each firmware to be upgraded, the electronic device can determine its corresponding upgrade method by reading the corresponding firmware header information from the corresponding storage space, and enable the Bootloader to upgrade the firmware to be upgraded according to the corresponding upgrade method. This achieves the self-adaptation of the upgrade method, making the method of this application applicable to more scenarios, such as differential upgrade scenarios that support low-bandwidth communication methods such as NB-IoT, and full upgrade scenarios when after-sales personnel come to the site for repair, thereby improving the flexibility and reliability of firmware upgrades.

[0097] This application also provides an embodiment of a firmware upgrade method. Figure 4 A flowchart illustrating a firmware upgrade method provided in this application embodiment. Figure 3 This embodiment, based on the foregoing embodiments, further explains the upgrade process for each firmware to be upgraded in the foregoing embodiments. For example... Figure 4 As shown, the method in this embodiment includes:

[0098] S401, upon receiving any firmware upgrade request for the first time, backs up the firmware to be upgraded as indicated in the firmware upgrade request to the target storage area.

[0099] In this embodiment, when the target system receives any firmware upgrade request for the first time, it backs up the corresponding firmware to be upgraded to the target storage area, that is, it backs up the current version of the firmware to the target storage area for later use.

[0100] S402 performs CRC verification when completing the firmware upgrade in response to a firmware upgrade request.

[0101] Specifically, the electronic device reads the firmware header information from the corresponding storage area to determine the CRC algorithm. When upgrading the firmware, it performs a CRC check based on the CRC algorithm to ensure data integrity. More specifically, the CRC algorithm can be CRC32 or CRC64, etc. This embodiment does not limit this; the specific algorithm can be set according to the verification requirements.

[0102] S403 If the CRC check passes, clear the upgrade status information in the target storage area.

[0103] S404 If the CRC check fails and the number of failures reaches the preset number, the firmware to be upgraded is retrieved from the target storage area and restored.

[0104] In this embodiment, the electronic device only clears the upgrade status information corresponding to the firmware to be upgraded when the CRC check passes. If the CRC check fails the first time, the CRC check process is re-executed according to the CRC algorithm. If the CRC check fails repeatedly and the number of failures reaches a preset number, the backed-up firmware to be upgraded is read from the target storage area and restored to ensure the normal startup of the target system and the normal use of the corresponding applications.

[0105] Specifically, the preset number of times can be two or three times; this embodiment does not limit this.

[0106] In the method provided in this embodiment, upon receiving the firmware upgrade request for the first time, the firmware to be upgraded is backed up so that it can be restored to the firmware to be upgraded if necessary, ensuring the normal startup and operation of the target system. After completing the upgrade of the firmware to be upgraded, a CRC check is performed on the firmware to ensure data integrity, which also helps to ensure the normal startup and operation of the system.

[0107] Furthermore, in this embodiment, by setting a preset number of times, the CRC check is repeated when the upgraded target firmware fails the CRC check, which can avoid inaccuracies caused by calculation errors or mistakes.

[0108] As an example, suppose the target system has two firmware versions, Firmware 1 and Firmware 2, that need to be upgraded. Figure 5 A process example diagram of a firmware upgrade method provided in this application embodiment is shown below. Figure 5 As shown, when the target system is powered off and then powered on again, the upgrade status and priority information of the two firmwares to be upgraded, Firmware 1 and Firmware 2, are obtained. Based on the priority information, it is determined whether Firmware 1 has a higher priority. If so, it is further determined whether its upgrade method is a full upgrade. If so, a full upgrade is performed, and Firmware 1 is upgraded according to the upgrade progress indicated by the upgrade status information. Otherwise, a differential upgrade is performed, and Firmware 1 is upgraded according to the upgrade progress indicated by the upgrade status information.

[0109] Furthermore, determine whether the firmware 2 upgrade method is a full upgrade. If so, perform a full upgrade and upgrade the firmware 2 according to the upgrade status information. Otherwise, perform a differential upgrade and upgrade the firmware 2 according to the upgrade progress indicated by the upgrade status information.

[0110] like Figure 5 As shown, during the upgrade process, the upgrade status information must be updated according to the current upgrade progress.

[0111] Similarly, if firmware 2 is determined to have a higher priority based on priority information, then firmware 2 will be upgraded first, followed by firmware 1. The specific process is as follows: Figure 5 As shown, it will not be elaborated further here.

[0112] like Figure 5 As shown, when firmware 1 and / or firmware 2 complete the upgrade, a CRC check is performed on firmware 1 and / or firmware 2 to determine if the check passes. If yes, the corresponding upgrade status information is cleared. If no, the CRC check process is repeated until the number of failures reaches three, at which point the backed-up firmware 1 and / or firmware 2 is obtained and restored to firmware 1 and / or firmware 2.

[0113] The above embodiments describe a firmware upgrade method from the perspective of process flow. The following embodiments describe a firmware upgrade device from the perspective of virtual module or virtual unit. For details, please refer to the following embodiments.

[0114] This application provides a firmware upgrade device. Figure 6 This is a schematic diagram of the structure of a firmware upgrade device provided in an embodiment of this application, as shown below. Figure 6 As shown, the device includes, wherein,

[0115] The acquisition module 61 is used to acquire upgrade status information and priority information corresponding to at least two firmware files to be upgraded for the target system after the target system is powered on; the priority information is used to indicate the priority of the at least two firmware files to be upgraded.

[0116] The upgrade module 62 is used to upgrade at least two firmwares to be upgraded according to upgrade status information and priority information, and update the corresponding upgrade status information according to the current upgrade progress of the firmware to be upgraded, until the firmware to be upgraded is upgraded to the corresponding target firmware.

[0117] In another possible implementation of this application embodiment, the upgrade module 62 is specifically used for:

[0118] The upgrade order of at least two firmware files to be upgraded is determined based on priority information. The firmware file with the higher priority indicated by the priority information will be upgraded first. The priority is determined based on any of the following: system attributes of the target system, user's historical usage habits, or user commands.

[0119] According to the upgrade order, at least two firmware files to be upgraded are upgraded based on the upgrade status information, and the corresponding upgrade status information is updated according to the current upgrade progress of the firmware files to be upgraded, until the firmware files to be upgraded are upgraded to the corresponding target firmware.

[0120] In another possible implementation of this application embodiment, the upgrade module 62 is specifically used for:

[0121] For each firmware to be upgraded, obtain the firmware header information of the firmware to be upgraded. The firmware header information is used to indicate the upgrade method of the firmware to be upgraded. The upgrade method includes full upgrade and differential upgrade.

[0122] Upgrade the firmware according to the upgrade method indicated in the firmware header information and the upgrade progress.

[0123] In another possible implementation of this application embodiment, the upgrade module 62 is specifically used for:

[0124] If the upgrade method is differential upgrade, the firmware to be upgraded will be upgraded according to the differential data between the target firmware and the firmware to be upgraded, and the following will be performed: update the upgrade status information according to the current upgrade progress, and perform CRC verification according to the CRC algorithm indicated by the firmware header information.

[0125] If the upgrade method is a full upgrade, the firmware to be upgraded will be upgraded based on the full data of the target firmware, and the following will be performed: update the upgrade status information according to the current upgrade progress, and perform CRC verification according to the CRC algorithm indicated by the header information.

[0126] In another possible implementation of this application embodiment, the target system includes at least two storage areas; the acquisition module 61 is further configured to:

[0127] Establish a mapping relationship between at least two firmware files to be upgraded and at least two storage regions, so that each firmware file to be upgraded corresponds to a unique target storage region;

[0128] Upon receiving any firmware upgrade request, upgrade status information is generated based on the upgrade progress of the firmware to be upgraded as indicated in the firmware upgrade request, and the upgrade status information is stored in the target storage area corresponding to the firmware to be upgraded.

[0129] Module 61 is specifically used for:

[0130] Determine the target storage area corresponding to the firmware to be upgraded, and obtain the upgrade status information from the target storage area.

[0131] In another possible implementation of this application embodiment, the acquisition module 61 is further configured to:

[0132] Upon receiving any firmware upgrade request for the first time, back up the firmware to be upgraded as indicated in the firmware upgrade request to the target storage area.

[0133] In another possible implementation of this application embodiment, the upgrade module 62 is further used for:

[0134] When completing the firmware upgrade in response to a firmware upgrade request, a CRC check is performed.

[0135] If the CRC check passes, the upgrade status information in the target storage area is cleared.

[0136] If the CRC check fails and the number of failures reaches the preset number, the firmware to be upgraded is retrieved from the target storage area and restored.

[0137] The firmware upgrade device provided in this application is applicable to the above-described method embodiments, and will not be described again here.

[0138] This application provides an electronic device. Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, Figure 7 The illustrated electronic device includes a processor 71 and a memory 72. The processor 71 and the memory 72 are connected, for example, via a bus 73. Optionally, the electronic device may also include a transceiver 74. It should be noted that in practical applications, the transceiver 74 is not limited to one type, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.

[0139] Processor 71 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 71 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0140] Bus 73 may include a pathway for transmitting information between the aforementioned components. Bus 73 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 73 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single thick line, but this does not mean that there is only one bus 73 or one type of bus 73.

[0141] The memory 72 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0142] The memory 72 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 71. The processor 71 is used to execute the application code stored in the memory 72 to implement the content shown in the foregoing method embodiments.

[0143] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores program instructions, which are used to implement the methods in the above embodiments.

[0144] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the technical solution of the above method embodiments. Its implementation principle and technical effects are similar, and will not be repeated here.

[0145] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.

[0146] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A firmware upgrade method characterized by comprising: The method includes: After the target system is powered on, upgrade status information and priority information of at least two firmware files to be upgraded for the target system are obtained; the priority information is used to indicate the priority of the at least two firmware files to be upgraded. The at least two firmware files to be upgraded are upgraded according to the upgrade status information and the priority information, and the corresponding upgrade status information is updated according to the current upgrade progress of the firmware files to be upgraded, until the firmware files to be upgraded are upgraded to the corresponding target firmware.

2. The method of claim 1, wherein, Upgrading the at least two firmware files to be upgraded based on the upgrade status information and the priority information includes: The upgrade order of at least two firmware to be upgraded is determined based on the priority information, wherein the firmware to be upgraded with the higher priority indicated by the priority information is upgraded first; the priority is determined based on any of the following: the system attributes of the target system, the user's historical usage habits, and user commands; According to the upgrade order, the at least two firmware files to be upgraded are upgraded based on the upgrade status information, and the corresponding upgrade status information is updated according to the current upgrade progress of the firmware files to be upgraded, until the firmware files to be upgraded are upgraded to the corresponding target firmware.

3. The method according to claim 1 or 2, characterized in that, Upgrading the at least two firmware files to be upgraded based on the upgrade status information and the priority information includes: For each firmware to be upgraded, obtain the firmware header information of the firmware to be upgraded. The firmware header information is used to indicate the upgrade method of the firmware to be upgraded. The upgrade method includes full upgrade and differential upgrade. The firmware to be upgraded is upgraded according to the upgrade method indicated in the firmware header information and the upgrade progress.

4. The method of claim 3, wherein, The upgrade method, as indicated by the firmware header information, and the upgrade progress, include upgrading the firmware to be upgraded according to the upgrade progress, including: If the upgrade method is differential upgrade, then the firmware to be upgraded is upgraded according to the differential data sum between the target firmware and the firmware to be upgraded, and the following are performed: update the upgrade status information according to the current upgrade progress, and perform CRC verification according to the CRC algorithm indicated by the firmware header information; If the upgrade method is a full upgrade, then the firmware to be upgraded is upgraded according to the full data of the target firmware, and the following are performed: the upgrade status information is updated according to the current upgrade progress, and CRC verification is performed according to the CRC algorithm indicated by the header information.

5. The method according to claim 1 or 2, characterized in that, The target system includes at least two storage areas; the method further includes: Establish a mapping relationship between the at least two firmware files to be upgraded and at least two storage areas, so that the firmware file to be upgraded corresponds to a unique target storage area; Upon receiving any firmware upgrade request, the upgrade status information is generated based on the upgrade progress of the firmware to be upgraded as indicated by the firmware upgrade request, and the upgrade status information is stored in the target storage area corresponding to the firmware to be upgraded. The step of obtaining upgrade status information corresponding to at least two firmware files to be upgraded for the target system application includes: Determine the target storage area corresponding to the firmware to be upgraded, and obtain the upgrade status information from the target storage area.

6. The method of claim 5, wherein, The method further includes: Upon receiving any firmware upgrade request for the first time, the firmware to be upgraded, as indicated in the firmware upgrade request, is backed up to the target storage area.

7. The method of claim 6, wherein, The method further includes: When upgrading the firmware to be upgraded in response to the firmware upgrade request, a CRC check is performed; If the CRC check passes, the upgrade status information in the target storage area is cleared; If the CRC check fails and the number of failures reaches a preset number, the firmware to be upgraded is retrieved from the target storage area and restored.

8. A firmware upgrade apparatus characterized by comprising: The device includes: The acquisition module is used to acquire upgrade status information and priority information corresponding to at least two firmware files to be upgraded for the target system after the target system is powered on; the priority information is used to indicate the priority of the at least two firmware files to be upgraded. The upgrade module is used to upgrade the at least two firmwares to be upgraded according to the upgrade status information and the priority information, and update the corresponding upgrade status information according to the current upgrade progress of the firmware to be upgraded, until the firmware to be upgraded is upgraded to the corresponding target firmware.

9. An electronic device, comprising: The electronic device includes a processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.