Firmware upgrading method, system and device, medium and program product

By obtaining the target upgrade channel and firmware upgrade protocol during the firmware upgrade process, upgrading the firmware, and automatically verifying it after the upgrade, the problem of poor stability and low reliability of firmware upgrade in the existing technology is solved, and higher firmware upgrade reliability and stability are achieved.

CN120215988APending Publication Date: 2025-06-27HUADA SEMICON CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510404922.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The existing firmware upgrade technology has problems of poor stability and low reliability, especially when the upgrade channel communication fails, and the firmware version cannot be intuitively known after the upgrade is successful.

Method used

When there is no firmware in at least one block or the firmware data verification fails, the target upgrade channel and firmware upgrade protocol are obtained, the firmware is upgraded based on this information, and automatically restarts after the upgrade is completed to ensure the upgrade is successful.

Benefits of technology

Improves the reliability and stability of firmware upgrades, ensuring that failures can be handled effectively during the upgrade process and ensuring that the system can operate normally after the upgrade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215988A_ABST
    Figure CN120215988A_ABST
Patent Text Reader

Abstract

The invention provides a firmware upgrading method, system and device, a medium and a program product, and the method comprises the steps: obtaining a target upgrading channel and a firmware upgrading protocol corresponding to the target upgrading channel in response to the situation that at least one block does not have firmware or firmware data in the at least one block does not pass verification; and upgrading the firmware based on the target upgrading channel and the firmware upgrading protocol to obtain the upgraded firmware. The method comprises the following steps: when at least one block does not have firmware or firmware data in at least one block does not pass verification, obtaining a target upgrading channel and a firmware upgrading protocol corresponding to the target upgrading channel; and the firmware is upgraded based on the target upgrading channel and the firmware upgrading protocol, the upgraded firmware is obtained, and the reliability and stability of firmware upgrading are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of firmware upgrade, and particularly relates to a firmware upgrade method, system, device, medium and program product. Background Art

[0002] The existing firmware upgrade technology is mainly one-way and single-channel upgrade, and its limitations are as follows: if the upgrade channel communication fails, the upgrade cannot be performed; after the upgrade is successful, the firmware running after the system restarts cannot directly know the exact version; writing data to the storage medium unidirectionally, and data cannot be read from the storage medium, resulting in poor stability and low reliability of firmware upgrade. Summary of the Invention

[0003] The technical problem to be solved by the present disclosure is to overcome the deficiencies of poor stability and low reliability in the existing firmware upgrade method, and provide a firmware upgrade method, system, device, medium and program product.

[0004] The present disclosure solves the above technical problem through the following technical solutions:

[0005] The first aspect of the present disclosure provides a firmware upgrade method, including:

[0006] In response to that there is no firmware in at least one block or the firmware data in at least one block fails the verification, obtain a target upgrade channel and a firmware upgrade protocol corresponding to the target upgrade channel;

[0007] Upgrade the firmware based on the target upgrade channel and the firmware upgrade protocol to obtain the upgraded firmware.

[0008] Preferably, it further includes:

[0009] After the firmware upgrade is completed and the system automatically restarts, verify the at least one block to obtain a verification result.

[0010] Preferably, it further includes:

[0011] In response to that the verification result includes that there is a bootloader in at least one block and the firmware data in at least one block passes the verification, obtain the new version information of the upgraded firmware;

[0012] Run the upgraded firmware based on the new version information.

[0013] Preferably, it further includes:

[0014] In response to that the verification result includes that there is firmware in only one block or only the firmware data in one block passes the verification among the at least one block, run the firmware that passes the verification.

[0015] Preferably, it further includes:

[0016] Upon response to a firmware upgrade failure, obtain the old version information of the firmware;

[0017] Based on the old version information, run the firmware after the upgrade failure.

[0018] Preferably, it further includes:

[0019] Obtain the retry count of the password required for enabling serial debugging and / or reading memory data;

[0020] Upon response to the retry count being greater than the preset retry count, control the serial debugging interface to be unable to open.

[0021] A second aspect of the present disclosure provides a firmware upgrade system, including:

[0022] A first acquisition module, configured to obtain a target upgrade channel and a firmware upgrade protocol corresponding to the target upgrade channel upon response to there being no firmware in at least one block or the firmware data in at least one block failing the verification;

[0023] An upgrade module, configured to upgrade the firmware based on the target upgrade channel and the firmware upgrade protocol to obtain the upgraded firmware.

[0024] Preferably, it further includes:

[0025] A verification module, configured to verify the at least one block after an automatic restart upon completion of the firmware upgrade to obtain a verification result.

[0026] Preferably, it further includes:

[0027] A second acquisition module, configured to obtain the new version information of the upgraded firmware upon response to the verification result including that there is a bootloader in at least one block and the firmware data in at least one block passes the verification;

[0028] A first operation module, configured to run the upgraded firmware based on the new version information.

[0029] Preferably, it further includes:

[0030] A second operation module, configured to run the firmware that passes the verification upon response to the verification result including that there is firmware in only one block or only the firmware data in one block passes the verification among the at least one block.

[0031] Preferably, it further includes:

[0032] A third acquisition module, configured to obtain the old version information of the firmware upon response to a firmware upgrade failure;

[0033] A third operation module, configured to operate the firmware after the upgrade fails based on the old version information.

[0034] Preferably, it further includes:

[0035] A fourth acquisition module, configured to acquire the number of retries required when enabling serial debugging and / or reading memory data;

[0036] A control module, configured to control that the serial debugging interface cannot be opened in response to the number of retries being greater than a preset number of retries.

[0037] A third aspect of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored on the memory and configured to run on the processor. When the processor executes the computer program, the firmware upgrade method described in the first aspect is implemented.

[0038] A fourth aspect of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the firmware upgrade method described in the first aspect is implemented.

[0039] A fifth aspect of the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the firmware upgrade method described in the first aspect is implemented.

[0040] On the basis of conforming to common knowledge in the art, the above preferred conditions can be combined arbitrarily to obtain various preferred examples of the present disclosure.

[0041] The positive and progressive effects of the present disclosure are as follows:

[0042] When there is no firmware in at least one block or the firmware data in at least one block fails the verification, the target upgrade channel and the firmware upgrade protocol corresponding to the target upgrade channel are acquired; the firmware is upgraded based on the target upgrade channel and the firmware upgrade protocol to obtain the upgraded firmware, improving the reliability and stability of the firmware upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flowchart of the firmware upgrade method provided in Embodiment 1 of the present disclosure.

[0044] Figure 2 It is a schematic diagram of the modules of the firmware upgrade system provided in Embodiment 2 of the present disclosure.

[0045] Figure 3 It is a schematic diagram of the structure of the electronic device for implementing the firmware upgrade method in Embodiment 3 of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0046] The present disclosure will be further described below by way of examples, but the present disclosure is not limited to the scope of the described examples accordingly.

[0047] In the embodiments of the present disclosure, prefix words such as "first" and "second" are only used to distinguish different described objects, and have no restrictive effect on the position, order, priority, quantity, content, etc. of the described objects. The use of ordinal numbers and other prefix words for distinguishing described objects in the embodiments of the present disclosure does not constitute a restriction on the described objects. For the description of the described objects, reference may be made to the claims or the description in the context of the embodiments, and no redundant restriction should be formed due to the use of such prefix words. In addition, in the description of this embodiment, unless otherwise specified, "a plurality" means two or more.

[0048] In the embodiments of the present disclosure, the processing of collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information complies with the provisions of relevant laws and regulations and does not violate public order and good customs.

[0049] Embodiment 1

[0050] Figure 1 is a flowchart of a firmware upgrade method provided for Embodiment 1 of the present disclosure. As Figure 1 shown, it includes:

[0051] S1. In response to the absence of firmware in at least one block or the failure of firmware data verification in at least one block, obtain a target upgrade channel and a firmware upgrade protocol corresponding to the target upgrade channel;

[0052] S2. Upgrade the firmware based on the target upgrade channel and the firmware upgrade protocol to obtain the upgraded firmware.

[0053] In the specific implementation process, first, the user prepares a new firmware to be upgraded (for example, a system firmware), and ensures that the selected communication interface is physically connected, and then starts the firmware upgrade. There are two ways to start the firmware upgrade: 1. Invocation by the BootStrap (a front-end toolkit for quickly developing web applications) bootstrap. 2. Invocation of an interface function.

[0054] Further, taking the number of at least one block as two as an example, for example, the firmware area is divided into two parts: SysApp1 and SysApp2. The new and old version firmwares are alternately stored in the two areas.

[0055] When the chip powers on and starts the BootStrap, when there is no firmware in both the SysApp1 block and the SysApp2 block, or the firmware data in these two blocks fails the verification, the firmware upgrade is automatically started, and the newly upgraded firmware is written into SysApp1.

[0056] When there is no firmware in at least one block or the firmware data in at least one block fails the verification, obtain the target upgrade channel and the firmware upgrade protocol corresponding to the target upgrade channel; upgrade the firmware based on the target upgrade channel and the firmware upgrade protocol to obtain the upgraded firmware, improving the reliability and stability of the firmware upgrade.

[0057] In an optional embodiment, it further includes:

[0058] After the firmware upgrade is completed and in the case of automatic restart, verify at least one block to obtain a verification result.

[0059] In an optional embodiment, it further includes:

[0060] In response to the verification result including that there is a bootloader in at least one block and the firmware data in at least one block passes the verification, obtain the new version information of the upgraded firmware;

[0061] Run the upgraded firmware based on the new version information.

[0062] In this embodiment, after the firmware upgrade is completed, automatically restart and enter BootStrap to verify the SysApp1 and SysApp2 blocks. If the verifications all pass, then jump to run at the firmware.

[0063] Furthermore, if there is a bootloader in both the SysApp1 and SysApp2 blocks and both pass the verification, after restart, check and obtain the new version information of the upgraded firmware, and run the upgraded firmware based on the new version information.

[0064] In an optional embodiment, it further includes:

[0065] In response to the verification result including that there is firmware in only one block or only the firmware data in one block passes the verification among at least one block, run the firmware that passes the verification.

[0066] In this embodiment, if there is only one firmware or only one firmware passes the verification at SysApp1 and SysApp2, then run the firmware that passes the verification.

[0067] In an optional embodiment, it further includes:

[0068] In response to the firmware upgrade failure, obtain the old version information of the firmware;

[0069] Run the firmware after the upgrade failure based on the old version information.

[0070] In an optional embodiment, it further includes:

[0071] Obtain the retry count of the password required when enabling serial debugging and / or reading memory data;

[0072] In response to the number of retries being greater than the preset number of retries, control the serial debug interface to be unable to open.

[0073] In the specific implementation process, select a specified upgrade channel (for example, the target upgrade channel), start the firmware upgrade through the bootloader or interface function, download the latest firmware, and at the same time retain the content of the previous version of the firmware in case the firmware upgrade fails. At the same time, the invention also provides functions of enabling SWD (serial debug), querying version information, and reverse-reading memory data.

[0074] Further, if the firmware upgrade module is skipped and the firmware is directly entered after restart, and at this time an upgrade is desired, it can be started in the background by calling the interface function. When upgrading software comes in through different channels, different interrupt functions will be generated, different flags will be generated, and thus the firmware upgrade functions of different channels will be entered. The process of firmware upgrade locates the slave end locally, and the upgrade tool is set as the master end, and the upgrade is carried out in a master-slave manner.

[0075] There is a fixed firmware upgrade protocol between the upgrade end and the device end. The content of the firmware upgrade protocol is as follows:

[0076] Sending data: 1. Send firmware length information; 2. Send firmware data; 3. Send firmware information header data; 4. Send system control functions (distinguished by different keys).

[0077] Reading data: 1. Read the current communication status; 2. Read the current flash operation status; 3. Read the header information of the firmware; 4. Read the header information of the upgrade software; 5. Read the bootstrap version information.

[0078] Among them, there are also two hidden functions: Master enables SWD (command + key); reads specified Memory data (command + key + address + length). When the user's product is released, after the firmware burning is completed, a software switch will be provided to close the SWD port to prevent data from being maliciously stolen. At this time, SWD can be enabled through the interface reserved for firmware upgrade. There are specified retry opportunities for the password when enabling SWD and reading Memory (memory) data. If the specified number of times (for example, the preset number of retries) is exceeded, that is, the chip is locked and the interface cannot be opened.

[0079] In addition, after the upgrade process is completed, restart immediately; the entire firmware reserves a background program for upgrade. After the current task ends, the upgrade can be started at any time.

[0080] The purpose of implementing multi-channel firmware upgrade in this embodiment is to improve reliability and versatility on the basis of the basic firmware upgrade function. Specifically, the multi-channel upgrade function is extended, and the stability is improved. The storage area adopts a dual-partition mode to maintain the reliability of the upgrade; multiple query functions are added to facilitate users to query information in real time. While implementing the basic firmware upgrade function, a hidden function is added to achieve versatility, ensuring the safe use of the product. At the same time, the firmware upgrade is designed as a separate firmware module for easy calling, greatly improving the development flexibility.

[0081] Embodiment 2

[0082] Corresponding to the foregoing embodiment of a firmware upgrade method, the present disclosure also provides an embodiment of a firmware upgrade system.

[0083] Figure 2 It is a schematic diagram of the modules of a firmware upgrade system provided in Embodiment 2 of the present disclosure. As Figure 2 shown, it includes:

[0084] A first acquisition module 21, configured to obtain a target upgrade channel and a firmware upgrade protocol corresponding to the target upgrade channel in response to that there is no firmware in at least one block or the firmware data in at least one block fails the verification.

[0085] An upgrade module 22, configured to upgrade the firmware based on the target upgrade channel and the firmware upgrade protocol to obtain the upgraded firmware.

[0086] In the specific implementation process, first, the user prepares a new firmware to be upgraded (for example, the system firmware), and ensures that the selected communication interface is physically connected, and then starts the firmware upgrade. There are two ways to start the firmware upgrade: 1. Invocation by the BootStrap bootloader. 2. Invocation of the interface function.

[0087] Further, taking the number of at least one block as two as an example, for example, the firmware area is divided into two parts: SysApp1 and SysApp2. The new and old version firmwares are alternately stored in the two areas.

[0088] When the chip powers on and starts the BootStrap, when there is no firmware in both the SysApp1 block and the SysApp2 block, or the firmware data in these two blocks fails the verification, the firmware upgrade is automatically started, and the newly upgraded firmware is written into SysApp1.

[0089] When there is no firmware in at least one block or the firmware data in at least one block fails the verification, obtain the target upgrade channel and the firmware upgrade protocol corresponding to the target upgrade channel; upgrade the firmware based on the target upgrade channel and the firmware upgrade protocol to obtain the upgraded firmware, which improves the reliability and stability of the firmware upgrade.

[0090] In an optional embodiment, it further includes:

[0091] A verification module, configured to verify the at least one block after automatic restart after the firmware upgrade is completed, and obtain a verification result.

[0092] In an optional embodiment, it further includes:

[0093] A second acquisition module, configured to obtain the new version information of the upgraded firmware in response to the verification result including that there is a bootloader in at least one block and the firmware data in at least one block passes the verification;

[0094] A first operation module, configured to operate the upgraded firmware based on the new version information.

[0095] In this embodiment, after the firmware upgrade is completed, it automatically restarts and enters BootStrap to verify the SysApp1 and SysApp2 blocks. If both verifications pass, it jumps to run at the firmware.

[0096] Further, if there is a bootloader in both the SysApp1 and SysApp2 blocks and both pass the verification, after restart, check and obtain the new version information of the upgraded firmware, and operate the upgraded firmware based on the new version information.

[0097] In an optional embodiment, it further includes:

[0098] A second operation module, configured to operate the firmware that passes the verification in response to the verification result including that there is firmware in only one of the at least one block or only the firmware data in one of the at least one block passes the verification.

[0099] In this embodiment, if only one of the firmwares at SysApp1 and SysApp2 or only one of the firmwares passes the verification, operate the firmware that passes the verification.

[0100] In an optional embodiment, it further includes:

[0101] A third acquisition module, configured to obtain the old version information of the firmware in response to the failure of the firmware upgrade;

[0102] A third operation module, configured to operate the firmware after the upgrade failure based on the old version information.

[0103] In an optional embodiment, it further includes:

[0104] A fourth acquisition module, configured to obtain the retry times required for enabling serial debugging and / or reading memory data.

[0105] A control module, configured to control that the serial debugging interface cannot be opened in response to the retry times being greater than a preset retry times.

[0106] In a specific implementation process, a specified upgrade channel (for example, a target upgrade channel) is selected, and firmware upgrade is started through a bootloader or an interface function to download the latest firmware while retaining the content of the previous version of the firmware in case the firmware upgrade fails. At the same time, the invention also provides functions of enabling SWD (serial debugging), querying version information, and reverse-reading memory data.

[0107] Further, if the firmware upgrade module is skipped and the firmware is directly entered after a restart, and at this time an upgrade is desired, it can be started in the background by calling an interface function. When upgrading software from different channels, different interrupt functions will be generated, different flags will be generated, and thus firmware upgrade functions for different channels will be entered. In the process of firmware upgrade, the local end is positioned as the slave end and the upgrade tool is set as the master end, and the upgrade is performed in a master-slave manner.

[0108] There is a fixed firmware upgrade protocol between the upgrade end and the device end, and the content of the firmware upgrade protocol is as follows:

[0109] Sending data: 1. Sending firmware length information; 2. Sending firmware data; 3. Sending firmware information header data; 4. Sending system control functions (distinguished by different key areas);

[0110] Reading data: 1. Reading the current communication status; 2. Reading the current flash operation status; 3. Reading the header information of the firmware; 4. Reading the header information of the upgrade software; 5. Reading the bootstrap version information;

[0111] Among them, there are also two hidden functions: Master enabling SWD (command + key); Reading specified Memory data (command + key + address + length). When the user product is released, after the firmware burning is completed, a software switch will be provided to close the SWD port to prevent data from being maliciously stolen. At this time, SWD can be enabled through the interface reserved for firmware upgrade. There are specified retry opportunities for the password when enabling SWD and reading Memory (memory) data. If the specified number of times (for example, the preset retry times) is exceeded, the chip will be locked and the interface cannot be opened.

[0112] In addition, after the upgrade process is completed, a restart is performed immediately; the entire firmware reserves a background program for upgrade, and after the current task is ended, the upgrade can be started at any time.

[0113] The purpose of implementing multi-channel firmware upgrade in this embodiment is to improve reliability and versatility on the basis of the basic functions of firmware upgrade. Specifically, the multi-channel upgrade function is extended, and the stability is improved. The storage area adopts a dual-partition mode to maintain the reliability of the upgrade; multiple query functions are added to facilitate users to query information in real time. While implementing the basic functions of firmware upgrade, a hidden function is added to achieve versatility, ensure the safe use of the product, and at the same time design the firmware upgrade into a separate firmware module for easy calling, which greatly improves the development flexibility.

[0114] Embodiment 3

[0115] Figure 3 FIG. 7 is a schematic structural diagram of an electronic device shown in Embodiment 3 of the present disclosure. The electronic device includes a memory, a processor, and a computer program stored in the memory and configured to run on the processor. When the processor executes the computer program, the firmware upgrade method described in any of the above embodiments is implemented. Figure 3 The displayed electronic device 90 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0116] As Figure 3 shown, the electronic device 90 may be presented in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one of the above processors 91, at least one of the above memories 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).

[0117] The bus 93 includes a data bus, an address bus, and a control bus.

[0118] The memory 92 may include volatile memory, such as random access memory (RAM) 921 and / or cache memory 922, and may further include read-only memory (ROM) 923.

[0119] The memory 92 may further include a program tool 925 (or utility) having a set of (at least one) program modules 924. Such program modules 924 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.

[0120] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the firmware upgrade method provided in any of the above embodiments.

[0121] The electronic device 90 can also communicate with one or more external devices 94 (such as a keyboard, a pointing device, etc.). Such communication can be carried out through the input / output (I / O) interface 95. Moreover, the electronic device 90 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 96. As Figure 3 shown, the network adapter 96 communicates with other modules of the electronic device 90 through the bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (redundant array of independent disks) systems, tape drives, and data backup storage systems, etc.

[0122] It should be noted that, although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above can be further divided and embodied by multiple units / modules.

[0123] Embodiment 4

[0124] Embodiment 4 of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the firmware upgrade method provided in any one of the above embodiments.

[0125] Among them, the more specific readable storage medium can include but not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0126] Embodiment 5

[0127] Embodiment 5 of the present disclosure also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the firmware upgrade method described in any one of the above.

[0128] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed entirely on the user device, partially on the user device, executed as an independent software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0129] Although the specific embodiments of the present disclosure have been described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Without departing from the principles and essence of the present disclosure, those skilled in the art can make various changes or modifications to these embodiments, but these changes and modifications all fall within the protection scope of the present disclosure.

Claims

1. A firmware upgrade method, characterized in that: include: In response to the fact that there is no firmware in at least one block or the firmware data in at least one block all fail verification, obtaining a target upgrade channel and a firmware upgrade protocol corresponding to the target upgrade channel; The firmware is upgraded based on the target upgrade channel and the firmware upgrade protocol to obtain upgraded firmware.

2. The firmware upgrade method according to claim 1, wherein: Also includes: After the firmware upgrade is completed and the system automatically restarts, the at least one block is verified to obtain a verification result.

3. The firmware upgrade method according to claim 2, characterized in that: Also includes: In response to the verification result including that the at least one block has a boot program and the firmware data in the at least one block has passed the verification, obtaining new version information of the upgraded firmware; The upgraded firmware is run based on the new version information.

4. The firmware upgrade method according to claim 2, wherein: Also includes: In response to the verification result including that only one of the at least one block has firmware or only one block has firmware data that has passed verification, the firmware that has passed the verification is run.

5. The firmware upgrade method according to claim 1, wherein: Also includes: In response to a firmware upgrade failure, obtaining old version information of the firmware; The firmware after the failed upgrade is run based on the old version information.

6. The firmware upgrade method according to any one of claims 1 to 5, characterized in that: Also includes: Get the number of password retries required to enable serial debugging and / or read memory data; In response to the retry number being greater than the preset retry number, the serial debugging interface is controlled to be unable to be opened.

7. A firmware upgrade system, characterized in that: include: A first acquisition module, configured to acquire a target upgrade channel and a firmware upgrade protocol corresponding to the target upgrade channel in response to the fact that there is no firmware in at least one block or the firmware data in at least one block all fail verification; The upgrade module is used to upgrade the firmware based on the target upgrade channel and the firmware upgrade protocol to obtain the upgraded firmware.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, the firmware upgrade method according to any one of claims 1 to 6 is implemented.

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

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the firmware upgrade method according to any one of claims 1 to 6 is implemented.