Firmware upgrade method, device and storage medium

By receiving and matching broadcast messages and firmware information from the cloud server, and only downloading and upgrading the firmware packages required by the terminal, the problem of storage media space occupied in OTA firmware upgrades is solved, and the firmware upgrade efficiency is improved.

CN113110852BActive Publication Date: 2024-11-08BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010027136.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-10
Publication Date
2024-11-08
Estimated Expiration
2040-01-10

AI Technical Summary

Technical Problem

In the OTA firmware upgrade method, a large number of firmware upgrade packages that do not need to be upgraded are stored in the terminal storage medium, resulting in large storage space occupancy and reducing firmware upgrade efficiency.

Method used

By receiving broadcast messages sent by the cloud server, matching the firmware type and sending corresponding firmware information, receiving and verifying the firmware upgrade package, downloading and upgrading only the required firmware packages to avoid unnecessary firmware package storage.

Benefits of technology

It effectively saves the storage media space of the terminal, improves the efficiency of firmware upgrades, and ensures that only the required firmware packages are upgraded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113110852B_ABST
    Figure CN113110852B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a firmware upgrade method, device and storage medium. The firmware upgrade method is applied to a terminal, and includes: receiving a broadcast message sent by a cloud service end, the broadcast message is used to broadcast the updated firmware type; sending firmware information matching the firmware type to the cloud service end; receiving a firmware upgrade package corresponding to the firmware information pushed by the cloud service end. The present disclosure effectively saves the storage medium space of the terminal and improves the efficiency of firmware upgrade.
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 in particular to a firmware upgrade method, device and storage medium. Background Art

[0002] OTA (Over The Air) is a commonly used firmware upgrade method. In the application process, all firmware upgrade packages need to be packaged into the terminal's storage medium first, and then the firmware upgrade packages packaged into the terminal's storage medium are selected and judged to determine which firmware upgrade packages are the firmware upgrade packages that need to be upgraded for this terminal. Since a large number of firmware upgrade packages that may not need to be upgraded are stored in the storage medium, the storage medium space is occupied, resulting in low efficiency of firmware upgrade. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a firmware upgrade method, device and storage medium.

[0004] According to the first aspect of an embodiment of the present disclosure, a firmware upgrade method is provided, which is applied to a terminal, including: receiving a broadcast message sent by a cloud service end, the broadcast message is used to broadcast an updated firmware type; sending firmware information matching the firmware type to the cloud service end; and receiving a firmware upgrade package corresponding to the firmware information pushed by the cloud service end.

[0005] In one implementation, the firmware upgrade method further includes: downloading the firmware upgrade package based on a download address of the firmware upgrade package, and performing firmware upgrade based on the firmware upgrade package.

[0006] In another embodiment, the firmware upgrade method further includes: writing the data included in the firmware upgrade package into the storage medium partition in a specified data format; and after detecting that the terminal is powered on, reading the data in the storage medium partition to perform the firmware upgrade.

[0007] In another embodiment, firmware information matching the firmware type is sent to a cloud server, including: after the terminal receives the broadcast message, calling a firmware upgrade tool to view the product serial number and firmware version number of the firmware stored locally in the terminal, and sending the product serial number and firmware version number of the firmware to the cloud server.

[0008] In yet another embodiment, sending the firmware information matching the firmware type to the cloud service end includes: sending the firmware information matching the firmware type to the cloud service end in json format.

[0009] In another embodiment, the firmware upgrade method further includes: receiving a verification code sent by the cloud server for verifying the integrity of the firmware upgrade package; based on the verification code, verifying the integrity of the downloaded firmware upgrade package, and performing a firmware upgrade based on the firmware upgrade package when the verification passes.

[0010] In yet another embodiment, the firmware upgrade method further includes: when the integrity check of the downloaded firmware upgrade package fails, re-downloading the firmware upgrade package based on the download address.

[0011] In another embodiment, the specified data format includes: the flag of the firmware upgrade area in the storage medium partition, the product serial number of the firmware, the version number of the local firmware of the terminal found, the version number of the firmware written to the firmware upgrade area in the storage medium partition, the starting address of the firmware written to the firmware upgrade area in the storage medium partition, and the size of the firmware written to the firmware upgrade area in the storage medium partition.

[0012] In another embodiment, data in a storage medium partition is read to perform a firmware upgrade, including: reading data in the storage medium partition according to a specified data format, and reading the product serial number of the firmware found locally; when the information of the firmware product serial number contained in the data in the storage medium partition is consistent with the information of the firmware product serial number found locally, writing the data in the storage medium partition into the firmware storage area; when the data in the storage medium partition is successfully written into the firmware storage area, calling a machine restart instruction to restart the terminal to complete the firmware upgrade.

[0013] In yet another embodiment, the firmware upgrade method further includes: when writing the data in the storage medium partition into the firmware storage area fails, setting a flag bit indicating the upgrade failure in a register of the power management integrated circuit.

[0014] According to the second aspect of an embodiment of the present disclosure, a firmware upgrade method is provided, which is applied to a cloud service end, and includes: when there is an updated firmware, sending a broadcast message, the broadcast message is used to broadcast the updated firmware type; receiving firmware information sent by a terminal that matches the firmware type; and sending a firmware upgrade package corresponding to the firmware information to the terminal.

[0015] In one implementation, the firmware upgrade method further includes: sending a download address of a firmware upgrade package corresponding to the firmware information to the terminal.

[0016] In another implementation, receiving firmware information that matches the firmware type and is sent by a terminal includes: receiving the firmware information that matches the firmware type and is sent by the terminal in a json format.

[0017] In yet another embodiment, the firmware upgrade method further includes: sending a verification code for verifying the integrity of the firmware upgrade package to the terminal.

[0018] According to the third aspect of an embodiment of the present disclosure, a firmware upgrade device is provided, which is applied to a terminal and includes: a broadcast receiving module, which is used to receive a broadcast message sent by a cloud server, and the broadcast message is used to broadcast an updated firmware type; a firmware information sending module, which is used to send firmware information matching the firmware type to the cloud server; and a firmware upgrade package receiving module, which is used to receive a firmware upgrade package pushed by the cloud server and corresponding to the firmware information.

[0019] In one embodiment, the firmware upgrade device further includes: an upgrade module, configured to download the firmware upgrade package based on the download address of the firmware upgrade package, and perform firmware upgrade based on the firmware upgrade package.

[0020] In another embodiment, the upgrade module is further used to: write the data included in the firmware upgrade package into the storage medium partition in a specified data format; and after detecting that the terminal is powered on, read the data in the storage medium partition to perform a firmware upgrade.

[0021] In another embodiment, the firmware information sending module is used to: after the terminal receives the broadcast message, call the firmware upgrade tool to view the product serial number and firmware version number of the firmware stored locally in the terminal, and send the firmware product serial number and firmware version number to the cloud service end.

[0022] In yet another embodiment, the firmware information sending module is used to send the firmware information matching the firmware type to the cloud service end in JSON format.

[0023] In another embodiment, the firmware upgrade package receiving module is also used to: receive a verification code sent by the cloud server for verifying the integrity of the firmware upgrade package; the upgrade module is also used to: verify the integrity of the downloaded firmware upgrade package based on the verification code, and perform firmware upgrade based on the firmware upgrade package when the verification passes.

[0024] In yet another embodiment, the firmware upgrade device further includes: a download module, configured to re-download the firmware upgrade package based on the download address when the integrity check of the downloaded firmware upgrade package fails.

[0025] In another embodiment, the specified data format includes: the flag of the firmware upgrade area in the storage medium partition, the product serial number of the firmware, the version number of the local firmware of the terminal found, the version number of the firmware written to the firmware upgrade area in the storage medium partition, the starting address of the firmware written to the firmware upgrade area in the storage medium partition, and the size of the firmware written to the firmware upgrade area in the storage medium partition.

[0026] In another embodiment, the upgrade module is also used to: read the data in the storage medium partition according to the specified data format, and read the product serial number of the firmware found locally; when the information of the firmware product serial number contained in the data in the storage medium partition is consistent with the information of the firmware product serial number found locally, write the data in the storage medium partition into the firmware storage area; when the data in the storage medium partition is successfully written into the firmware storage area, call the machine restart instruction to restart the terminal to complete the firmware upgrade.

[0027] In yet another embodiment, the upgrade module is further configured to: when writing the data in the storage medium partition into the firmware storage area fails, set a flag bit indicating the upgrade failure in a register of the power management integrated circuit.

[0028] According to the fourth aspect of an embodiment of the present disclosure, a firmware upgrade device is provided, which is applied to a cloud service end, and includes: a broadcast sending module, which is used to send a broadcast message when there is an updated firmware, and the broadcast message is used to broadcast the updated firmware type; a firmware information receiving module, which is used to receive firmware information matching the firmware type sent by a terminal; and a firmware upgrade package sending module, which is used to send a firmware upgrade package corresponding to the firmware information to the terminal.

[0029] In one implementation, the firmware upgrade package sending module is further used to: send a download address of the firmware upgrade package corresponding to the firmware information to the terminal.

[0030] In another implementation, the firmware information receiving module is used to: receive firmware information matching the firmware type sent by the terminal in JSON format.

[0031] In yet another embodiment, the module for sending the firmware upgrade package is further used to: send a verification code for verifying the integrity of the firmware upgrade package to the terminal.

[0032] According to a fifth aspect of an embodiment of the present disclosure, a firmware upgrade device is provided, comprising: a memory configured to store instructions; and a processor configured to call the instructions to execute the firmware upgrade method described in the first aspect or any one of the embodiments of the first aspect.

[0033] According to the sixth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they execute the firmware upgrade method described in the first aspect or any one of the embodiments of the first aspect.

[0034] According to the seventh aspect of an embodiment of the present disclosure, a firmware upgrade device is provided, including: a memory configured to store instructions; and a processor configured to call the instructions to execute the firmware upgrade method described in the second aspect or any one of the implementations of the second aspect.

[0035] According to an eighth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, wherein the non-temporary computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the firmware upgrade method described in the second aspect or any one of the embodiments of the second aspect is executed.

[0036] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: receiving a firmware upgrade package of the firmware that the terminal needs to upgrade, without receiving a firmware upgrade package of the firmware that the terminal does not need to upgrade, thereby effectively saving the space of the terminal's storage medium and improving the efficiency of firmware upgrade.

[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 is a flowchart illustrating a firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0040] Figure 2 is a flow chart showing another firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0041] Figure 3 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0042] Figure 4 is a flow chart showing another firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0043] Figure 5 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0044] Figure 6 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0045] Figure 7 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0046] Figure 8 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0047] Fig. 9 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0048] Fig.10 is an interaction diagram illustrating a firmware upgrade method according to an exemplary embodiment of the present disclosure;

[0049] Fig.11 is a schematic diagram showing a firmware upgrade device according to an exemplary embodiment of the present disclosure;

[0050] Fig.12 is a schematic diagram showing another firmware upgrade device according to an exemplary embodiment of the present disclosure;

[0051] Fig.13 A block diagram of a device for firmware upgrading. DETAILED DESCRIPTION

[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0053] Figure 1 is a flowchart illustrating a firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0054] like Figure 1 As shown, the firmware upgrade method provided by the present disclosure is applied to a terminal, wherein the firmware upgrade method includes step S101, step S102 and step S103. The following will introduce each step separately.

[0055] In step S101, a broadcast message sent by a cloud service end is received.

[0056] The broadcast message is used to broadcast the updated firmware type.

[0057] The cloud server can be understood as a one-stop cloud service software that can provide terminals with services such as data synchronization, backup, device search, space expansion, account management, firmware update, etc. The cloud server and the terminal are connected through communication.

[0058] The broadcast message may be a firmware type that is broadcast to each terminal that is connected to the cloud server for communication, such as a camera module, a display module, a touch module, or a fingerprint unlocking module.

[0059] In step S102, the firmware information matching the firmware type is sent to the server.

[0060] The terminal searches for a match between the type of the firmware of the terminal and the type of the updated firmware in the broadcast message. For example, if the type of the updated firmware in the broadcast message is a camera module, the camera module of the terminal found by the terminal matches the broadcast message.

[0061] When the terminal finds the firmware that matches the broadcasted updated firmware type, it sends the firmware information of the found firmware to the cloud service end.

[0062] The terminal can call the local ffu_tool of the terminal to find the product serial number and firmware version number of the local firmware of the terminal. The terminal sends the found firmware information of the firmware to the cloud server through the cat bottom node, such as proc / mv.

[0063] In step S103, a firmware upgrade package corresponding to the firmware information pushed by the cloud service end is received.

[0064] After receiving the firmware information sent by the terminal, the cloud server searches for a firmware upgrade package corresponding to the firmware information, such as an upgrade package for the camera module, and pushes the firmware upgrade package to the terminal.

[0065] The firmware upgrade method provided by the present disclosure effectively saves the space of the terminal's storage medium and improves the efficiency of firmware upgrade by receiving the firmware upgrade package of the terminal that needs to be upgraded without receiving the firmware upgrade package of the firmware that the terminal does not need to upgrade.

[0066] Figure 2 is a flow chart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0067] In an exemplary embodiment of the present disclosure, Figure 2 As shown, the firmware upgrade method includes step S104 and step S105 in addition to step S101, step S102, and step S103. Step S104 and step S105 will be described below.

[0068] In step S104, the firmware upgrade package is downloaded based on the download address of the firmware upgrade package.

[0069] After receiving the firmware information sent by the terminal, the cloud server searches for the firmware upgrade package corresponding to the firmware information, such as the upgrade package of the camera module, and sends the download address of the upgrade package to the terminal. The terminal downloads the firmware upgrade package based on the download address of the upgrade package.

[0070] In step S105, the firmware is upgraded based on the firmware upgrade package.

[0071] The terminal upgrades the corresponding firmware based on the downloaded firmware upgrade package.

[0072] By receiving the download address of the firmware upgrade package that matches the terminal's firmware sent by the cloud service end, the firmware upgrade package is downloaded to the terminal, and the terminal's firmware is upgraded based on the firmware upgrade package.

[0073] The firmware upgrade package of the firmware that needs to be upgraded for the terminal is downloaded, and the firmware is upgraded without downloading the firmware upgrade package of the firmware that does not need to be upgraded, which effectively saves the storage medium space of the terminal and improves the efficiency of firmware upgrade.

[0074] Figure 3 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0075] In an exemplary embodiment of the present disclosure, Figure 3 As shown, the firmware upgrade method includes step S106 and step S107 in addition to step S101, step S102, and step S103. Step S106 and step S107 will be described below.

[0076] In step S106, the data contained in the firmware upgrade package is written into the storage medium partition in a specified data format.

[0077] In step S107, after detecting that the terminal is powered on, the data in the storage medium partition is read to perform a firmware upgrade.

[0078] The storage medium partition can be understood as a storage area for storing firmware upgrade packages. When the firmware upgrade package is downloaded to the terminal, ffu_tool can be called to write the information of the firmware upgrade package to the corresponding storage area. This provides a basis for clearly reading and obtaining relevant information of the upgrade firmware package during the subsequent firmware upgrade process.

[0079] When the terminal is detected to be powered on, the firmware upgrade process is completed, and the firmware upgrade process is implemented by writing the relevant information of the upgrade firmware package stored in the storage medium partition into the designated firmware storage area.

[0080] In this way, the firmware can be upgraded without requiring the user to manually click on the update button.

[0081] Since the terminal only stores the upgrade firmware package of the firmware that needs to be upgraded, it can be ensured that the firmware upgrade can be completed when the terminal is detected to be powered on, while occupying a small amount of terminal memory, thereby achieving a fast upgrade of the firmware.

[0082] In an exemplary embodiment of the present disclosure, sending firmware information matching the firmware type to the cloud service end includes: after the terminal receives the broadcast message, calling the firmware upgrade tool to view the product serial number and firmware version number of the firmware stored locally in the terminal, and sending the product serial number and firmware version number of the firmware to the cloud service end.

[0083] The firmware upgrade tool can be ffu_tool. The local ffu_tool of the terminal is called to find the product serial number and firmware version number of the local firmware of the terminal. The terminal sends the found product serial number and firmware version number of the firmware to the cloud server through the cat bottom node, such as proc / mv.

[0084] In an exemplary embodiment of the present disclosure, the firmware information matching the firmware type is sent to the cloud service end in json format.

[0085] After the terminal finds and obtains the product serial number and firmware version number of the local firmware of the terminal, it can generate the firmware information in JSON format and send it to the cloud server so that the cloud server can read the firmware information.

[0086] Correspondingly, after receiving the firmware information in JSON format, the cloud server will parse the firmware information in JSON format to obtain the corresponding firmware information.

[0087] After obtaining the firmware information on the cloud server, the firmware upgrade package corresponding to the firmware information is searched, and the download address of the upgrade package is sent to the terminal. The terminal downloads the firmware upgrade package based on the download address of the upgrade package and performs firmware upgrade based on the firmware upgrade package.

[0088] Figure 4 is a flow chart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0089] In an exemplary embodiment of the present disclosure, Figure 4 As shown, the firmware upgrade method includes step S108 and step S109 in addition to step S101, step S102, step S103 and step S104. Step S108 and step S109 will be described below.

[0090] In step S108, a verification code for verifying the integrity of the firmware upgrade package sent by the cloud service end is received.

[0091] When the cloud server sends the download address of the firmware upgrade package to the terminal, it also sends a verification code for verifying the integrity of the firmware upgrade package to the terminal. The verification code corresponds to the firmware upgrade package one by one.

[0092] In step S109, the integrity of the downloaded firmware upgrade package is verified based on the verification code, and the firmware upgrade is performed based on the firmware upgrade package when the verification passes.

[0093] The verification code may be an MD5 verification code, which is used to verify the integrity of the firmware upgrade package transmitted and downloaded to the terminal. If the verification passes, it means that the firmware upgrade package transmitted and downloaded is complete. At this time, the terminal can perform a firmware upgrade on the corresponding firmware based on the downloaded firmware upgrade package.

[0094] Figure 5 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0095] In an exemplary embodiment of the present disclosure, Figure 5 As shown, the firmware upgrade method includes step S110 in addition to step S101, step S102, step S103, step S104, step S108 and step S109. Step S110 will be described below.

[0096] In step S110, when the integrity check of the downloaded firmware upgrade package fails, the firmware upgrade package is downloaded again based on the download address.

[0097] If the verification fails, it means that the transmitted and downloaded firmware upgrade package is incomplete. At this time, the terminal cannot upgrade the corresponding firmware based on the downloaded firmware upgrade package, but needs to download the firmware upgrade package again based on the download address.

[0098] In an exemplary embodiment of the present disclosure, the specified data format includes: a flag bit of the firmware upgrade area in the storage medium partition, the product serial number of the firmware, the version number of the local firmware of the terminal found, the version number of the firmware written to the firmware upgrade area in the storage medium partition, the starting address of the firmware written to the firmware upgrade area in the storage medium partition, and the size of the firmware written to the firmware upgrade area in the storage medium partition.

[0099] The flag bit of the firmware upgrade area in the storage medium partition indicates that starting from this bit, the storage medium partition is a partition for firmware upgrade. Through the flag bit, it is possible to effectively distinguish which bit in the storage medium partition starts as the partition for firmware upgrade, providing a basis for subsequent reading of relevant information about the firmware upgrade package.

[0100] The data in the above-mentioned specified data format may be written sequentially in the first 128 bytes of the storage medium partition, and the upgrade firmware corresponding to the firmware upgrade package may be written starting from the 256 bytes of the storage medium partition until the upgrade firmware is completely written.

[0101] Figure 6 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0102] In an exemplary embodiment of the present disclosure, Figure 6 As shown, step S107 of the firmware upgrade method of the present disclosure may include step S1071, step S1072 and step S1073. Step S1071, step S1072 and step S1073 will be introduced below respectively.

[0103] In step S1071, data in the storage medium partition is read according to a specified data format, and the product serial number of the firmware found locally is read.

[0104] In step S1072, when the information of the firmware product serial number contained in the data in the storage medium partition is consistent with the information of the firmware product serial number found locally, the data in the storage medium partition is written into the firmware storage area.

[0105] In step S1073, when the data in the storage medium partition is successfully written into the firmware storage area, a machine restart instruction is called to restart the terminal to complete the firmware upgrade.

[0106] During the firmware upgrade process, in order to further ensure that the firmware to be upgraded by the terminal matches the downloaded firmware, that is, to prevent the cloud server from sending the wrong upgrade firmware package to the terminal, for example, the firmware to be upgraded by the terminal is the camera module produced by Company A, and the cloud server sends the firmware upgrade package of the camera module produced by Company B. The firmware upgrade method will also determine whether the product serial number in the data information of the upgrade firmware package stored in the storage medium partition is consistent with the firmware to be upgraded by the terminal, that is, the product serial number of the firmware found locally.

[0107] If they are consistent, it means that the cloud server did not send the wrong upgrade firmware package to the terminal. At this time, the terminal can write the data of the upgrade firmware package stored in the storage medium partition into the firmware storage area, and after the data is written successfully, call the machine restart instruction to restart the terminal, such as calling machine_restart, to complete the firmware upgrade.

[0108] In the process of writing data into the firmware storage area, the scsi_execute function may be used to write the data of the upgrade firmware package into the firmware storage area.

[0109] If there is any inconsistency, it means that the cloud server sent the wrong upgrade firmware package to the terminal. At this time, you can send the firmware information of the firmware that matches the broadcast message to the cloud server again, and based on the download address of the firmware upgrade package corresponding to the firmware information sent by the cloud server, download the firmware upgrade package and perform firmware upgrade based on the firmware upgrade package.

[0110] Figure 7 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0111] In an exemplary embodiment of the present disclosure, Figure 7 As shown, the firmware upgrade method of the present disclosure further includes step S111 in addition to step S101 , step S102 , step S103 , step S106 and step S107 .

[0112] In step S111, when writing of data in the storage medium partition into the firmware storage area fails, a flag indicating upgrade failure is set in a register of the power management integrated circuit.

[0113] In order to prevent the cloud server from sending the wrong firmware upgrade package to the terminal, the terminal restarts repeatedly during the firmware upgrade process. You can mark the firmware that failed the last upgrade. Before the terminal restarts, read the flag. If the flag indicating the last upgrade failure is found, you can directly start and restart the terminal normally.

[0114] That is, when the data in the storage medium partition fails to be written into the firmware storage area, a mark can be made in any bit of QPNP_PON_XVDD_RB_SPARE in the register of the power management integrated circuit (pmic). For example, the 7th bit in QPNP_PON_XVDD_RB_SPARE can be marked as 1, indicating that the last upgrade failed.

[0115] If the upgrade is successful, you can mark the 7th bit in QPNP_PON_XVDD_RB_SPARE as 0 and call machine_restart to restart the terminal.

[0116] Figure 8 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0117] Based on the same inventive concept, Figure 8 As shown, the firmware upgrade method is applied to the cloud service end, including: step S201, step S202 and step S203. Step S201, step S202 and step S203 will be introduced respectively below.

[0118] In step S201, when updated firmware exists, a broadcast message is sent.

[0119] The broadcast message is used to broadcast the updated firmware type.

[0120] In step S202, firmware information matching the firmware type sent by the terminal is received.

[0121] In step S203, a firmware upgrade package corresponding to the firmware information is sent to the terminal.

[0122] The cloud server only sends the firmware upgrade package that matches the terminal firmware, and the firmware upgrade package of the firmware that does not need to be upgraded in the terminal is stored in the cloud server. In this way, the storage medium space of the terminal can be effectively saved and the efficiency of firmware upgrade can be improved.

[0123] In an exemplary embodiment of the present disclosure, the firmware upgrade method further includes: sending a download address of a firmware upgrade package corresponding to the firmware information to the terminal.

[0124] In an exemplary embodiment of the present disclosure, receiving the firmware information that matches the firmware type and is sent by the terminal includes: receiving the firmware information that matches the firmware type and is sent by the terminal in a json format.

[0125] Fig. 9 is a flowchart illustrating another firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0126] In an exemplary embodiment of the present disclosure, Fig. 9 As shown, the firmware upgrade method includes step S204 in addition to step S201, step S202 and step S203.

[0127] In step S204, a verification code for verifying the integrity of the firmware upgrade package is sent to the terminal.

[0128] The method execution process involved in the firmware upgrade method applied to the cloud server in the embodiment of the present disclosure is similar to that of the firmware upgrade method applied to the terminal. Therefore, for any parts where the description of the firmware upgrade method applied to the cloud server is not detailed enough, please refer to the above-mentioned firmware upgrade method applied to the terminal, which will not be described in detail here.

[0129] Fig.10 is an interaction diagram illustrating a firmware upgrade method according to an exemplary embodiment of the present disclosure.

[0130] In an exemplary embodiment of the present disclosure, Fig.10 As shown, the interactive process of the firmware upgrade method includes the following steps.

[0131] In step S301, when there is updated firmware on the cloud server, a broadcast message is sent, wherein the broadcast message is used to broadcast the type of updated firmware.

[0132] When there is an updated firmware, the cloud server sends a broadcast message about the firmware type of the updated firmware to each terminal. The terminal receives the broadcast message sent by the cloud server.

[0133] In step S302, the terminal searches for firmware matching the firmware type based on the received broadcast message.

[0134] After receiving the broadcast message sent by the cloud service end, the terminal checks whether the type of the firmware of the terminal matches the type of the updated firmware broadcast in the received broadcast message.

[0135] In step S303, when the terminal finds the firmware matching the firmware type, the terminal sends the found firmware information to the cloud service end.

[0136] The terminal can call the local ffu_tool of the terminal to find the product serial number and firmware version number of the local firmware of the terminal. And judge whether the type of the found firmware matches the type of firmware broadcasted by the cloud server through the product serial number and firmware version number of the firmware. If they match, the terminal can send the firmware information of the found firmware to the cloud server through the node at the bottom of cat. The cloud server receives the firmware information sent by the terminal.

[0137] In step S304, the cloud server searches for a firmware upgrade package corresponding to the firmware information.

[0138] The cloud server receives the firmware information sent by the terminal and searches for a firmware upgrade package corresponding to the firmware information, wherein the firmware information sent by the terminal corresponds one-to-one to the firmware upgrade package in the cloud server.

[0139] After the cloud server finds the firmware upgrade package corresponding to the firmware information, it can determine the download address of the firmware upgrade package.

[0140] In step S305, the cloud service sends the download address of the firmware upgrade package to the terminal.

[0141] The cloud server determines the download address of the firmware upgrade package based on the firmware upgrade package found corresponding to the firmware information sent by the terminal. The cloud server sends the download address to the terminal for the terminal to download the corresponding firmware upgrade package.

[0142] In step S306, the terminal downloads the firmware upgrade package based on the download address of the firmware upgrade package sent by the cloud server.

[0143] The terminal will download the firmware upgrade package to the local device according to the download address of the firmware upgrade package sent by the cloud server.

[0144] In step S307, the terminal performs firmware upgrade based on the firmware upgrade package.

[0145] After the terminal downloads the firmware upgrade package to the local computer, it will perform a firmware upgrade on the corresponding firmware.

[0146] Fig.11 is a schematic diagram showing a firmware upgrade device according to an exemplary embodiment of the present disclosure.

[0147] Based on the same inventive concept, Fig.11 As shown, a firmware upgrade device is applied to a terminal, comprising: a broadcast receiving module 401, a firmware information sending module 402 and a firmware upgrade package receiving module 403. The following will introduce the situation of each module respectively.

[0148] The broadcast receiving module 401 is used to receive a broadcast message sent by the cloud service end, and the broadcast message is used to broadcast the updated firmware type.

[0149] The firmware information sending module 402 is used to send the firmware information matching the firmware type to the cloud service end.

[0150] The firmware upgrade package receiving module 403 is used to receive a firmware upgrade package corresponding to the firmware information pushed by the cloud server.

[0151] In an exemplary embodiment of the present disclosure, the firmware upgrade apparatus further includes an upgrade module, which is used to download the firmware upgrade package based on the download address of the firmware upgrade package, and perform firmware upgrade based on the firmware upgrade package.

[0152] In an exemplary embodiment of the present disclosure, the upgrade module is further used to: write the data contained in the firmware upgrade package into the storage medium partition in a specified data format; after detecting that the terminal is powered on, read the data in the storage medium partition to perform firmware upgrade.

[0153] In an exemplary embodiment of the present disclosure, the firmware information sending module is used to: after the terminal receives the broadcast message, call the firmware upgrade tool to view the product serial number and firmware version number of the firmware stored locally in the terminal, and send the firmware product serial number and firmware version number to the cloud service end.

[0154] In an exemplary embodiment of the present disclosure, the firmware information sending module is used to send the firmware information matching the firmware type to the cloud service end in JSON format.

[0155] In an exemplary embodiment of the present disclosure, the module for receiving the firmware upgrade package is also used to: receive a verification code sent by the cloud service end for verifying the integrity of the firmware upgrade package; the upgrade module is also used to: verify the integrity of the downloaded firmware upgrade package based on the verification code, and perform firmware upgrade based on the firmware upgrade package when the verification passes.

[0156] In an exemplary embodiment of the present disclosure, the firmware upgrade apparatus further includes: a download module, configured to re-download the firmware upgrade package based on the download address when the integrity check of the downloaded firmware upgrade package fails.

[0157] In an exemplary embodiment of the present disclosure, the specified data format includes: a flag bit of the firmware upgrade area in the storage medium partition, the product serial number of the firmware, the version number of the local firmware of the terminal found, the version number of the firmware written to the firmware upgrade area in the storage medium partition, the starting address of the firmware written to the firmware upgrade area in the storage medium partition, and the size of the firmware written to the firmware upgrade area in the storage medium partition.

[0158] In an exemplary embodiment of the present disclosure, the upgrade module is also used to: read the data in the storage medium partition according to the specified data format, and read the product serial number of the firmware found locally; when the information of the firmware product serial number contained in the data in the storage medium partition is consistent with the information of the firmware product serial number found locally, write the data in the storage medium partition into the firmware storage area; when the data in the storage medium partition is successfully written into the firmware storage area, call the machine restart instruction to restart the terminal to complete the firmware upgrade.

[0159] In an exemplary embodiment of the present disclosure, the upgrade module is further configured to: when writing data in the storage medium partition into the firmware storage area fails, set a flag bit indicating upgrade failure in a register of the power management integrated circuit.

[0160] Fig.12 is a schematic diagram showing another firmware upgrade device according to an exemplary embodiment of the present disclosure.

[0161] Based on the same inventive concept, Fig.12 As shown, a firmware upgrade device is applied to a cloud server, comprising: a broadcast sending module 501, a firmware information receiving module 502, and a firmware upgrade package sending module 503. The following will introduce each module separately.

[0162] The broadcast sending module 501 is used to send a broadcast message when there is updated firmware, and the broadcast message is used to broadcast the type of updated firmware.

[0163] The firmware information receiving module 502 is used to receive firmware information matching the firmware type sent by the terminal.

[0164] The firmware upgrade package sending module 503 is used to send a firmware upgrade package corresponding to the firmware information to the terminal.

[0165] In an exemplary embodiment of the present disclosure, the firmware upgrade package sending module 503 is further used to: send a download address of the firmware upgrade package corresponding to the firmware information to the terminal.

[0166] In an exemplary embodiment of the present disclosure, the firmware information receiving module 502 is used to receive firmware information matching the firmware type sent by the terminal in JSON format.

[0167] In an exemplary embodiment of the present disclosure, the firmware upgrade package sending module 503 is further used to: send a verification code for verifying the integrity of the firmware upgrade package to the terminal.

[0168] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0169] Fig.13 The invention is a block diagram of a device for firmware upgrade. Fig.13 It can represent a block diagram of a device used for the firmware upgrade method described in the first aspect of the present disclosure, and can also represent a block diagram of a device used for the firmware upgrade method described in the second aspect of the present disclosure.

[0170] The devices for firmware upgrade can be mobile phones, computers, digital broadcast terminals, messaging devices, game consoles, tablet devices, medical devices, fitness equipment, personal digital assistants, etc.

[0171] Reference Fig.13 The firmware upgrade device may include one or more of the following components: a processing component 1302, a memory 1304, a power component 1306, a multimedia component 1308, an audio component 1310, an input / output (I / O) interface 1312, a sensor component 1314, and a communication component 1316.

[0172] The processing component 1302 generally controls the overall operation of the device, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1302 may include one or more processors 1320 to execute instructions to perform all or part of the steps of the above-mentioned method. In addition, the processing component 1302 may include one or more modules to facilitate the interaction between the processing component 1302 and other components. For example, the processing component 1302 may include a multimedia module to facilitate the interaction between the multimedia component 1308 and the processing component 1302.

[0173] The memory 1304 is configured to store various types of data to support the operation of the device. Examples of such data include instructions for any application or method operating on the device for firmware upgrades, contact data, phone book data, messages, pictures, videos, etc. The memory 1304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0174] The power component 1306 provides power to the various components of the device. The power component 1306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device.

[0175] The multimedia component 1308 includes a screen that provides an output interface between the device for firmware upgrade and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1308 includes a front camera and / or a rear camera. When the device is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0176] The audio component 1310 is configured to output and / or input audio signals. For example, the audio component 1310 includes a microphone (MIC), and when the device for firmware upgrade is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal may be further stored in the memory 1304 or sent via the communication component 816. In some embodiments, the audio component 1310 also includes a speaker for outputting audio signals.

[0177] I / O interface 1312 provides an interface between processing component 1302 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0178] The sensor assembly 1314 includes one or more sensors for providing various aspects of status assessment for the firmware upgrade device. For example, the sensor assembly 1314 can detect the open / closed state of the device, the relative positioning of components, such as the display and keypad of the firmware upgrade device, and the sensor assembly 1314 can also detect the position change of the firmware upgrade device or a component of the firmware upgrade device, the presence or absence of user contact with the firmware upgrade device, the orientation or acceleration / deceleration of the firmware upgrade device, and the temperature change of the firmware upgrade device. The sensor assembly 1314 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1314 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0179] The communication component 1316 is configured to facilitate wired or wireless communication between the device for firmware upgrade and other devices. The device for firmware upgrade can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1316 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1316 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0180] In an exemplary embodiment, the firmware upgrade device can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0181] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1304 including instructions, and the instructions can be executed by a processor 1320 of the device for firmware upgrade to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0182] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1304 including instructions, and the instructions can be executed by a processor 1320 of the device for firmware upgrade to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0183] It is further understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar thereto. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.

[0184] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order shown or in a serial order, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.

[0185] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0186] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A firmware upgrade method, characterized in that: Applied to terminals, including: Receiving a broadcast message sent by a cloud server, wherein the broadcast message is used to broadcast an updated firmware type; Sending firmware information matching the firmware type to the cloud service end; Receiving a firmware upgrade package corresponding to the firmware information pushed by the cloud server; Writing the data contained in the firmware upgrade package into a storage medium partition in a specified data format; After detecting that the terminal is powered on, reading the data in the storage medium partition and performing a firmware upgrade; The sending of firmware information matching the firmware type to a cloud service end includes: After the terminal receives the broadcast message, it calls the firmware upgrade tool to view the product serial number and firmware version number of the firmware stored locally in the terminal, and sends the product serial number and firmware version number of the firmware to the cloud service end; The specified data format includes: The flag of the firmware upgrade area in the storage medium partition, the product serial number of the firmware, the version number of the local firmware found on the terminal, the version number of the firmware written to the firmware upgrade area in the storage medium partition, the starting address of the firmware written to the firmware upgrade area in the storage medium partition, and the size of the firmware written to the firmware upgrade area in the storage medium partition; The step of reading data in the storage medium partition and performing firmware upgrade includes: Read the data in the storage medium partition according to the specified data format, and read the product serial number of the firmware found locally; When the information of the product serial number of the firmware contained in the data in the storage medium partition is consistent with the information of the product serial number of the firmware found locally, writing the data in the storage medium partition into the firmware storage area; When the data in the storage medium partition is successfully written into the firmware storage area, the machine restart instruction is called to restart the terminal to complete the firmware upgrade.

2. The firmware upgrade method according to claim 1, characterized in that: The firmware upgrade method further includes: The firmware upgrade package is downloaded based on the download address of the firmware upgrade package, and firmware upgrade is performed based on the firmware upgrade package.

3. The firmware upgrade method according to claim 1, characterized in that: The sending the firmware information matching the firmware type to the cloud service end includes: The firmware information matching the firmware type is sent to the cloud service end in JSON format.

4. The firmware upgrade method according to claim 2, characterized in that: The firmware upgrade method further includes: Receiving a verification code sent by the cloud service end for verifying the integrity of the firmware upgrade package; Based on the verification code, the integrity of the downloaded firmware upgrade package is verified, and when the verification passes, the firmware upgrade is performed based on the firmware upgrade package.

5. The firmware upgrade method according to claim 4, characterized in that: The firmware upgrade method further includes: When the integrity check of the downloaded firmware upgrade package fails, the firmware upgrade package is downloaded again based on the download address.

6. The firmware upgrade method according to claim 1, characterized in that: The firmware upgrade method further includes: When writing the data in the storage medium partition into the firmware storage area fails, a flag bit indicating the upgrade failure is set in a register of the power management integrated circuit.

7. A firmware upgrade method, characterized in that: Applied to cloud servers, including: When there is updated firmware, sending a broadcast message, where the broadcast message is used to broadcast the type of updated firmware; receiving firmware information matching the firmware type sent by the terminal; Sending a firmware upgrade package corresponding to the firmware information to the terminal; The firmware upgrade package includes data written into the storage medium partition in a specified data format; In response to detecting that the terminal is powered on, determining data in a storage medium partition of the terminal and performing a firmware upgrade; The step of determining the data in the terminal storage medium partition and performing firmware upgrade includes: Determining that the terminal reads the data in the storage medium partition according to the specified data format, based on the product serial number of the firmware found locally read by the terminal; When the information of the product serial number of the firmware contained in the data in the storage medium partition is consistent with the information of the product serial number of the firmware found locally, writing the data in the storage medium partition into the firmware storage area based on the terminal; In response to the terminal successfully writing the data in the storage medium partition into the firmware storage area, the terminal invoking a machine restart instruction based on the terminal to restart the terminal and complete the firmware upgrade; The firmware information matching the firmware type sent by the receiving terminal includes: In response to determining that the terminal has received the broadcast message, based on the terminal receiving the product serial number and the firmware version number of the firmware, the product serial number and the firmware version number of the firmware are the product serial number and the firmware version number of the firmware stored locally in the terminal and viewed by the terminal calling a firmware upgrade tool; The specified data format includes: The flag position of the firmware upgrade area in the terminal storage medium partition, the product serial number of the firmware, the version number of the local firmware of the terminal found, the version number of the firmware written to the firmware upgrade area in the storage medium partition, the starting address of the firmware written to the firmware upgrade area in the storage medium partition, and the size of the firmware written to the firmware upgrade area in the storage medium partition.

8. The firmware upgrade method according to claim 7, characterized in that: The firmware upgrade method further includes: Sending a download address of a firmware upgrade package corresponding to the firmware information to the terminal.

9. The firmware upgrade method according to claim 7, characterized in that: The firmware information matching the firmware type sent by the receiving terminal includes: The firmware information matching the firmware type sent by the terminal is received in JSON format.

10. The firmware upgrade method according to claim 7, characterized in that: The firmware upgrade method further includes: A verification code for verifying the integrity of the firmware upgrade package is sent to the terminal.

11. A firmware upgrade device, characterized in that: Applied to terminals, including: A broadcast receiving module, used to receive a broadcast message sent by a cloud server, wherein the broadcast message is used to broadcast the updated firmware type; A firmware information sending module, used for sending firmware information matching the firmware type to the cloud service end; A firmware upgrade package receiving module, used to receive a firmware upgrade package corresponding to the firmware information pushed by the cloud server; An upgrade module is used to write the data contained in the firmware upgrade package into a storage medium partition in a specified data format; after detecting that the terminal is powered on, read the data in the storage medium partition to perform a firmware upgrade; read the data in the storage medium partition according to the specified data format, and read the product serial number of the firmware found locally; when the information of the product serial number of the firmware contained in the data in the storage medium partition is consistent with the information of the product serial number of the firmware found locally, write the data in the storage medium partition into a firmware storage area; when the data in the storage medium partition is successfully written into the firmware storage area, call a machine restart instruction to restart the terminal to complete the firmware upgrade; The firmware information sending module sends the firmware information matching the firmware type to the cloud service end in the following manner: After receiving the broadcast message, the terminal calls the firmware upgrade tool to check the product serial number and firmware version number of the firmware stored locally in the terminal, and sends the product serial number and firmware version number of the firmware to the cloud service end; The specified data format includes: the flag of the firmware upgrade area in the storage medium partition, the product serial number of the firmware, the version number of the local firmware of the terminal found, the version number of the firmware written to the firmware upgrade area in the storage medium partition, the starting address of the firmware written to the firmware upgrade area in the storage medium partition, and the size of the firmware written to the firmware upgrade area in the storage medium partition.

12. The firmware upgrade device according to claim 11, characterized in that: The upgrade module is also used for: The firmware upgrade package is downloaded based on the download address of the firmware upgrade package, and firmware upgrade is performed based on the firmware upgrade package.

13. The firmware upgrade device according to claim 11, characterized in that: The firmware information sending module is used for: The firmware information matching the firmware type is sent to the cloud service end in JSON format.

14. The firmware upgrade device according to claim 12, characterized in that: The firmware upgrade package receiving module is further used to: receive a verification code sent by the cloud service end for verifying the integrity of the firmware upgrade package; The upgrade module is also used to: verify the integrity of the downloaded firmware upgrade package based on the verification code, and perform firmware upgrade based on the firmware upgrade package when the verification passes.

15. The firmware upgrade device according to claim 14, characterized in that: The firmware upgrade device also includes: The download module is used to re-download the firmware upgrade package based on the download address when the integrity check of the downloaded firmware upgrade package fails.

16. The firmware upgrade device according to claim 11, characterized in that: The upgrade module is also used for: When writing the data in the storage medium partition into the firmware storage area fails, a flag bit indicating the upgrade failure is set in a register of the power management integrated circuit.

17. A firmware upgrade device, characterized in that: Applied to cloud servers, including: A broadcast sending module, used for sending a broadcast message when there is an updated firmware, wherein the broadcast message is used for broadcasting the updated firmware type; A firmware information receiving module, used for receiving firmware information matching the firmware type sent by the terminal; A firmware upgrade package sending module, used for sending a firmware upgrade package corresponding to the firmware information to the terminal; The firmware upgrade package includes data written into the storage medium partition in a specified data format; in response to detecting that the terminal is powered on, determining the data in the storage medium partition of the terminal and performing a firmware upgrade; The module for sending the firmware upgrade package determines the data in the terminal storage medium partition and performs the firmware upgrade in the following manner: Determine that the terminal reads the data in the storage medium partition according to the specified data format, and reads the product serial number of the firmware found locally; When the information of the product serial number of the firmware contained in the data in the storage medium partition is consistent with the information of the product serial number of the firmware found locally, writing the data in the storage medium partition into the firmware storage area; In response to the terminal successfully writing the data in the storage medium partition into the firmware storage area, the terminal invoking a machine restart instruction based on the terminal to restart the terminal and complete the firmware upgrade; The firmware information receiving module receives the firmware information matching the firmware type sent by the terminal in the following manner: In response to determining that the terminal has received the broadcast message, based on the terminal receiving the product serial number and the firmware version number of the firmware, the product serial number and the firmware version number of the firmware are the product serial number and the firmware version number of the firmware stored locally in the terminal and viewed by the terminal calling a firmware upgrade tool; The specified data format includes: The flag position of the firmware upgrade area in the terminal storage medium partition, the product serial number of the firmware, the version number of the local firmware of the terminal found, the version number of the firmware written to the firmware upgrade area in the storage medium partition, the starting address of the firmware written to the firmware upgrade area in the storage medium partition, and the size of the firmware written to the firmware upgrade area in the storage medium partition.

18. The firmware upgrade device according to claim 17, characterized in that: The module for sending the firmware upgrade package is also used for: Sending a download address of a firmware upgrade package corresponding to the firmware information to the terminal.

19. The firmware upgrade device according to claim 17, characterized in that: The firmware information receiving module is used for: Receives firmware information matching the firmware type sent by the terminal in JSON format.

20. The firmware upgrade device according to claim 17, characterized in that: The module for sending the firmware upgrade package is also used for: A verification code for verifying the integrity of the firmware upgrade package is sent to the terminal.

21. A firmware upgrade device, characterized in that: The firmware upgrade device comprises: a memory configured to store instructions; and A processor is configured to call the instruction to execute the firmware upgrade method described in any one of claims 1 to 6.

22. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the firmware upgrade method according to any one of claims 1 to 6 is executed.

23. A firmware upgrade device, characterized in that: The firmware upgrade device comprises: a memory configured to store instructions; and A processor is configured to call the instruction to execute the firmware upgrade method described in any one of claims 7 to 10.

24. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the firmware upgrade method according to any one of claims 7 to 10 is executed.