Firmware upgrading method and system of equipment, terminal and storage medium
By obtaining and verifying firmware upgrade information from the cloud platform and sending it to the main device and sub-device, synchronous upgrade of the main device and sub-device is achieved, solving the problem of inconsistent firmware upgrades in the existing technology, and ensuring system consistency between devices and Automated management.
Patent Information
- Application Number
- CN202411474177.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the main device and the sub-device cannot be synchronously upgraded according to the same firmware upgrade information, and the general firmware upgrade solution does not consider the device system adaptation relationship, resulting in inconsistent firmware upgrade information received by the sub-device and the main device.
By obtaining the upgrade task of the cloud platform, analyzing the metadata information, downloading and verifying the firmware upgrade information. If the verification is successful, it will be sent to the main device for firmware upgrade, and the upgrade information will be sent to the main device through the cluster communication protocol of the main device. Sub-device, realizes synchronous upgrade of the main device and sub-device.
The firmware upgrade information synchronization between the main device and the sub-device is realized, ensuring system consistency and automated management between the devices, and solving the problem of inconsistent firmware upgrades.
Smart Images

Figure CN118981330A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a device firmware upgrade method, system, terminal and computer-readable storage medium. Background Art
[0002] With the rapid development of computer technologies such as cloud computing, artificial intelligence, and 5G, coupled with the enhancement of chip computing power, we have gradually transitioned from the mobile Internet era to the new era of the Internet of Everything. At present, remote upgrade technology (OTA) is usually used to upgrade the system of related devices. The updated firmware needs to be uploaded to the OTA management service on the server side. The OTA management service then transmits the firmware to the device side through the mobile communication network. Finally, the device side performs the firmware update service. It is more efficient for devices that can be connected to the Internet, but it is ineffective for device terminals that cannot be connected to the Internet. However, in the prior art, the firmware upgrade solution requires the device to be upgraded to be connected to the Internet. If it cannot be connected to the Internet, it cannot be upgraded. At the same time, the general firmware upgrade solution does not take into account the system adaptation relationship of the device, that is, all devices upgrade the same system, which is different from the actual application scenario. The sub-devices and main devices of the device cluster, and the burned firmware between different sub-devices may be different, resulting in inconsistent firmware upgrade information received by the sub-device and the main device, which has become a problem that needs to be solved urgently.
[0003] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0004] The main purpose of the present invention is to provide a device firmware upgrade method, aiming to solve the problem in the prior art that a main device and a sub-device cannot be synchronously upgraded according to the same firmware upgrade information.
[0005] To achieve the above object, the present invention provides a device firmware upgrade method, the device firmware upgrade method comprising the following steps: Obtaining an upgrade task of the cloud platform, parsing metadata information in the upgrade task to obtain a parsing result, and downloading the firmware upgrade information on the main device according to the parsing result; Obtaining a hash check value of the cloud platform, and verifying the firmware upgrade information according to the hash check value to obtain a verification result; If the verification result is successful, the firmware upgrade information is sent to the main device to control the main device to perform firmware upgrade according to the firmware upgrade information, and the firmware upgrade information is sent to the sub-device through the cluster communication protocol of the main device to control the sub-device to perform firmware upgrade.
[0006] Optionally, the device firmware upgrade method, wherein the step of acquiring an upgrade task from a cloud platform, parsing metadata information in the upgrade task to obtain a parsing result, and downloading the firmware upgrade information on a main device according to the parsing result, specifically includes: Acquire an upgrade task of the cloud platform, parse metadata information in the upgrade task to obtain a parsing result, and determine whether the parsing result meets a first preset upgrade condition; If the analysis result meets the first preset upgrade condition, data is downloaded from the main device according to the preset breakpoint resume mechanism, and firmware upgrade information is obtained according to the downloaded data.
[0007] Optionally, the firmware upgrade method of the device, wherein if the verification result is successful, the firmware upgrade information is sent to the master device to control the master device to perform firmware upgrade according to the firmware upgrade information, and the firmware upgrade information is sent to the sub-device through the cluster communication protocol of the master device to control the sub-device to perform firmware upgrade, specifically comprising: Determine whether the verification result is successful; If the verification result is successful, the firmware upgrade information is sent to the master device to control the master device to perform firmware upgrade according to the firmware upgrade information; An upgrade instruction of the metadata information is obtained, the upgrade instruction is sent to the sub-device based on the cluster communication protocol, and the sub-device is controlled to perform firmware upgrade according to the upgrade instruction through the firmware upgrade information.
[0008] Optionally, the device firmware upgrade method, wherein if the verification result is successful, determining to send the firmware upgrade information to the master device for firmware update, further comprises: When the main device completes the firmware upgrade, determining whether the main device performs a system upgrade; If the main device performs a system upgrade, the preset firmware is controlled to perform an automatic check.
[0009] Optionally, the device firmware upgrade method, wherein the acquiring the upgrade instruction of the metadata information, sending the upgrade instruction to the sub-device based on the cluster communication protocol, and controlling the sub-device to perform firmware upgrade through the firmware upgrade information according to the upgrade instruction, specifically includes: Acquire an upgrade instruction from the metadata information, send the upgrade instruction to the sub-device based on the cluster communication protocol, and control the sub-device to perform firmware upgrade according to the upgrade instruction through the firmware upgrade information; When the sub-device performs a firmware upgrade, determining whether the firmware upgrade information meets a second preset upgrade condition; If the firmware upgrade information meets the second preset upgrade condition, the firmware upgrade is performed according to the version information in the firmware upgrade information.
[0010] Optionally, the firmware upgrade method of the device, wherein the step of determining whether the verification result is successful, further comprises: If the verification result is not successful, controlling the master device to re-download the firmware upgrade information; If the verification result is not a successful verification, the sub-device is controlled to trigger a preset update mechanism to perform an update again.
[0011] Optionally, the device firmware upgrade method further comprises: Determine whether a heartbeat signal of the master device is received within a preset time interval; If the heartbeat signal is not received within a preset time interval, the master device is marked as disconnected and a corresponding alarm is triggered to notify the administrator; The heartbeat signal includes: an identifier of the master device, a health status of the master device, and a current firmware version.
[0012] In addition, to achieve the above-mentioned purpose, the present invention further provides a device firmware upgrade system, wherein the device firmware upgrade system: An upgrade information acquisition module is used to acquire the upgrade task of the cloud platform, parse the metadata information in the upgrade task to obtain the parsing result, and download the firmware upgrade information on the main device according to the parsing result; An upgrade information verification module, used to obtain a hash verification value of the cloud platform, verify the firmware upgrade information according to the hash verification value, and obtain a verification result; The firmware upgrade module is used to send the firmware upgrade information to the main device if the verification result is successful, so as to control the main device to perform firmware upgrade according to the firmware upgrade information, and send the firmware upgrade information to the sub-device through the cluster communication protocol of the main device to control the sub-device to perform firmware upgrade.
[0013] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a device firmware upgrade program, and when the device firmware upgrade program is executed by a processor, the steps of the device firmware upgrade method as described above are implemented.
[0014] In the present invention, the upgrade task of the cloud platform is obtained, the metadata information in the upgrade task is parsed to obtain the parsing result, and the firmware upgrade information is downloaded on the main device according to the parsing result to obtain the firmware upgrade information; the hash check value of the cloud platform is obtained, and the firmware upgrade information is verified according to the hash check value to obtain the verification result; if the verification result is a successful verification, the firmware upgrade information is sent to the main device to control the main device to perform firmware upgrade according to the firmware upgrade information, and the firmware upgrade information is sent to the sub-device through the cluster communication protocol of the main device to control the sub-device to perform firmware upgrade. The present invention obtains the upgrade task from the cloud platform, verifies the firmware information, and then sends it to the main device and the sub-device for synchronous upgrade, thereby further realizing the automated management and distribution of firmware upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a flow chart of a preferred embodiment of the firmware upgrade method of the device of the present invention; Figure 2 It is a structural diagram of a device cluster upgrade architecture of a preferred embodiment of the device firmware upgrade method of the present invention; Figure 3 It is a structural schematic diagram of a main device ring topology of a preferred embodiment of the firmware upgrade method of the device of the present invention; Figure 4 It is a structural schematic diagram of a hash algorithm of a preferred embodiment of the firmware upgrade method of the device of the present invention; Figure 5 It is a flow chart of establishing communication between a master device and a preferred embodiment of the method for upgrading the firmware of the device of the present invention; Figure 6 It is a flow chart of device discovery between preferred embodiments of the method for upgrading the firmware of the device of the present invention; Figure 7 It is a schematic diagram of the principle of the device cluster relationship of the device firmware upgrade method of the present invention; Figure 8 It is a structural diagram of a preferred embodiment of the firmware upgrade system of the device of the present invention; Fig. 9 It is a structural diagram of a preferred embodiment of a terminal of the device of the present invention. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0017] In the prior art, all devices upgrade the same system, which is different from the actual application scenario. The sub-devices and the main device of the device cluster may have different firmwares burned between different sub-devices, which leads to the problem that the firmware upgrade information received by the sub-device and the main device is inconsistent. Therefore, a device firmware upgrade system is needed, which can enable the main device and the sub-device to be synchronously upgraded according to the same firmware upgrade information.
[0018] The firmware upgrade method of the device described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the firmware upgrade method of the device includes the following steps: Step S10: Obtain the upgrade task of the cloud platform, parse the metadata information in the upgrade task to obtain the parsing result, download the firmware upgrade information on the main device according to the parsing result.
[0019] Specifically, an upgrade task of the cloud platform is obtained, metadata information in the upgrade task is parsed, and a parsing result, i.e., metadata information of the firmware, such as version number, firmware size, hash check value, download connection address (URL) and any specific upgrade instructions, is obtained, and it is determined whether the parsing result meets the first preset upgrade condition (the master device will decide how to process the request based on the parsing result of the upgrade task, which may include checking the compatibility of the current firmware version with the new firmware version, and verifying whether the device meets the first preset upgrade condition, such as: the battery is sufficiently charged, the device is in an idle state, etc.); if the parsing result meets the first preset upgrade condition, data is downloaded on the master device according to the preset breakpoint resume mechanism, and firmware upgrade information is obtained according to the downloaded data (if the master device determines that the upgrade can be performed, it will download the new firmware through the provided URL. During the download process, the master device needs to ensure that the network connection is stable, and may need to use the preset breakpoint resume mechanism to prevent download interruption), and the upgrade management module of the master device uses the upgrade detection module to verify the upgrade request. After passing, the firmware download module is used to download the firmware from the cloud platform to the master device.
[0020] Furthermore, if Figure 2As shown, based on the communication network, any target master device among the multiple master devices receives the upgrade task sent by the cloud platform (device cluster OTA cloud platform), and downloads the firmware upgrade information through the analysis result according to the firmware download module of the target master device, and sends it to the upgrade detection module and the firmware backup module through the upgrade management module for detection and backup respectively, and then the firmware data and request information are shared to multiple corresponding sub-devices through the device cluster communication module of the target master device. The modules responsible for upgrading inside the master device of the device cluster include but are not limited to the upgrade management module, the upgrade detection module, the firmware download module, the OTA upgrade module, the device cluster communication module, etc., wherein the upgrade management module is used to communicate with the device cluster OTA upgrade cloud platform through the communication network, and the cloud platform is used to The target main device sends firmware upgrade information, and the upgrade management module will process the firmware upgrade information from the cloud platform. Then, the firmware data of the device to be upgraded will be downloaded and verified through the upgrade detection module and the firmware download module. After the verification is successful, it will upgrade itself through the OTA upgrade module, or transmit the firmware to the sub-device through the firmware transmission module and the device cluster communication module. Finally, the OTA upgrade module sends an update instruction to the sub-device to allow the sub-device to upgrade its firmware. The main modules can be divided into three parts: cloud platform (device cluster OTA upgrade cloud platform), main device of the device cluster and sub-device. Among them, the device cluster OTA upgrade cloud platform mainly provides services including but not limited to device system upgrade firmware upload, upgrade task issuance, recording of device upgrade process and device operation status monitoring.
[0021] Step S20: Obtain a hash check value of the cloud platform, and verify the firmware upgrade information according to the hash check value to obtain a verification result.
[0022] Specifically, the hash check value of the cloud platform is obtained, that is, the main device will use the hash check value provided by the cloud platform, such as: hash algorithm (MD5), cryptographic hash function (SHA-256) to verify the integrity and authenticity of the firmware. If the verification fails, the main device will report an error and may re-download the firmware, and verify the firmware upgrade information according to the hash check value to obtain the verification result.
[0023] As an example, Figure 3 and Figure 4 As shown, Figure 3 In order to form a ring topology between multiple master devices, there is no obvious distinction between the primary and secondary. A hash algorithm is needed to distribute the firmware upgrade information to each other master device so that other master devices can process it. Figure 4 The left part represents three requests. The firmware upgrade information is evenly distributed to other main devices through the hash algorithm in the middle. Each request is marked with numbers 1, 2, and 3, and the request distribution is represented by lines of different colors.
[0024] Step S30: If the verification result is successful, the firmware upgrade information is sent to the main device to control the main device to perform firmware upgrade according to the firmware upgrade information, and the firmware upgrade information is sent to the sub-device through the cluster communication protocol of the main device to control the sub-device to perform firmware upgrade.
[0025] Specifically, determine whether the verification result is successful; if the verification result is successful, send the firmware upgrade information to the main device to control the main device to perform firmware upgrade according to the firmware upgrade information (after the firmware verification is successful, the main device will prepare to implement the upgrade, which usually includes notifying the user, if applicable, backing up the current firmware and configuration, setting the upgrade flag, and restarting the main device if necessary); obtain the upgrade instruction of the metadata information, and send the upgrade instruction to the sub-device based on the cluster communication protocol (transmit the firmware to the sub-device through the firmware transmission module and the device cluster communication module, and finally the OTA upgrade module sends the upgrade instruction to the sub-device), according to The upgrade instruction controls the sub-device to perform firmware upgrade through the firmware upgrade information; when the main device completes the firmware upgrade, it determines whether the main device performs a system upgrade; if the main device performs a system upgrade, it controls the preset firmware to perform an automatic check (the main device will perform the firmware upgrade in a safe firmware upgrade environment, which may be a boot loader or a dedicated upgrade partition. During the upgrade process, the main device needs to ensure that the main device will not be unable to start due to unexpected power loss or other interruptions. After the main device upgrade is completed, the main device will start the preset firmware and perform an automatic check to ensure that all functions are normal. The main device will also update the firmware version information and report the upgrade results to the cloud platform).
[0026] As an example, Figure 5 As shown, when both master device 1 and master device 2 are online, a request to create a session is sent through the cluster communication module of master device 1, and the cluster access module of master device 2 receives the request and returns the session channel. Master device 1 and master device 2 obtain the session handle through the cluster access module, and master device 1 and master device 2 establish full-duplex communication.
[0027] Furthermore, an upgrade instruction of the metadata information is obtained, and the upgrade instruction is sent to the sub-device based on the cluster communication protocol, and the sub-device is controlled to perform firmware upgrade through the firmware upgrade information according to the upgrade instruction; when the sub-device performs firmware upgrade, it is determined whether the firmware upgrade information meets the second preset upgrade condition (if the sub-device needs to be upgraded, when the main device receives the upgrade task from the cloud platform, it checks the status and compatibility of the sub-device); if the firmware upgrade information meets the second preset upgrade condition, it is updated according to the version information in the firmware upgrade information (if the sub-device meets the second preset upgrade condition, the main device will establish a connection with the sub-device through the device cluster communication module, and start transmitting firmware upgrade information, and update according to the version information in the firmware upgrade information).
[0028] As an example, Figure 6 As shown, any master device initiates networking and initiates broadcasting, and the broadcasting content includes the identifier of the master device and possible connection parameters. The corresponding multiple slave devices monitor these broadcasts in scanning mode and decide whether to respond and initiate a connection request based on preset rules, such as signal strength, device type identifier, etc. Once the slave device initiates a connection request, the master device will respond and establish a Bluetooth low energy (BLE) connection. After the connection is established, more information can be exchanged through the service discovery protocol, such as unique identifiers (UUIDs) of services and characteristics. Once the services and characteristics are discovered, the master device and the slave device can start firmware upgrade information data transmission (data exchange), wherein data exchange is transmitted through a session channel connected between devices, such as a soft bus. Data exchange includes but is not limited to device ID, device online status, secure digital code (PIN), etc. For example, if the firmware version of the device is higher than the push version, there is no need to push the firmware, otherwise it is necessary to push; furthermore, when the software running on the device firmware does not match the system version, an upgrade can also be forced.
[0029] As an example, determine whether the heartbeat signal of the master device is received within a preset time interval (in order to ensure that the connection between the master device and the cloud platform is active and the device status is up to date, the master device will periodically send a heartbeat signal); if the heartbeat signal is not received within the preset time interval, the master device will be marked as disconnected, and a corresponding alarm will be triggered to notify the administrator; the heartbeat signal includes: the identifier of the master device, the health status of the master device and the current firmware version. This information helps the cloud platform monitor the online status of the device and decide whether a firmware update needs to be pushed.
[0030] As an example, Figure 7As shown, the computer device includes multiple main devices and multiple sub-devices, each of the main devices corresponds to multiple sub-devices, any target main device among the multiple main devices receives the upgrade task of the cloud platform, downloads it on the main device according to the analysis result, and obtains firmware upgrade information, all of the main devices form a first device cluster, each main device and the corresponding multiple sub-devices form a second device cluster, and multiple second device clusters are obtained, and any main device in the first device cluster shares the firmware upgrade information with the corresponding multiple sub-devices through the corresponding second device cluster.
[0031] Furthermore, if Figure 8 As shown, based on the firmware upgrade method of the above device, the present invention also provides a firmware upgrade system for a device, wherein the firmware upgrade system for the device includes: The upgrade information acquisition module 51 is used to acquire the upgrade task of the cloud platform, parse the metadata information in the upgrade task to obtain the parsing result, and download the firmware upgrade information on the main device according to the parsing result; An upgrade information verification module 52 is used to obtain a hash verification value of the cloud platform, verify the firmware upgrade information according to the hash verification value, and obtain a verification result; The firmware upgrade module 53 is used to send the firmware upgrade information to the main device if the verification result is successful, so as to control the main device to perform firmware upgrade according to the firmware upgrade information, and send the firmware upgrade information to the sub-device through the cluster communication protocol of the main device to control the sub-device to perform firmware upgrade.
[0032] Furthermore, if Fig. 9 As shown, based on the firmware upgrade method and system of the above-mentioned device, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Fig. 9 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0033] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a firmware upgrade program 40 of a device is stored on the memory 20, and the firmware upgrade program 40 of the device can be executed by the processor 10, thereby realizing the firmware upgrade method of the device in the present application.
[0034] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing a firmware upgrade method for the device.
[0035] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0036] In one embodiment, when the processor 10 executes the firmware upgrade program 40 of the device in the memory 20, the following steps are implemented: Obtaining an upgrade task of the cloud platform, parsing metadata information in the upgrade task to obtain a parsing result, and downloading the firmware upgrade information on the main device according to the parsing result; Obtaining a hash check value of the cloud platform, and verifying the firmware upgrade information according to the hash check value to obtain a verification result; If the verification result is successful, the firmware upgrade information is sent to the main device to control the main device to perform firmware upgrade according to the firmware upgrade information, and the firmware upgrade information is sent to the sub-device through the cluster communication protocol of the main device to control the sub-device to perform firmware upgrade.
[0037] The step of acquiring the upgrade task of the cloud platform, parsing the metadata information in the upgrade task to obtain the parsing result, and downloading the firmware upgrade information on the main device according to the parsing result specifically includes: Acquire an upgrade task of the cloud platform, parse metadata information in the upgrade task to obtain a parsing result, and determine whether the parsing result meets a first preset upgrade condition; If the analysis result meets the first preset upgrade condition, data is downloaded from the main device according to a preset breakpoint resume mechanism, and firmware upgrade information is obtained according to the downloaded data.
[0038] If the verification result is successful, the firmware upgrade information is sent to the master device to control the master device to perform firmware upgrade according to the firmware upgrade information, and the firmware upgrade information is sent to the slave device through the cluster communication protocol of the master device to control the slave device to perform firmware upgrade, specifically including: Determine whether the verification result is successful; If the verification result is successful, the firmware upgrade information is sent to the master device to control the master device to perform firmware upgrade according to the firmware upgrade information; An upgrade instruction of the metadata information is obtained, the upgrade instruction is sent to the sub-device based on the cluster communication protocol, and the sub-device is controlled to perform firmware upgrade according to the upgrade instruction through the firmware upgrade information.
[0039] If the verification result is successful, it is determined to send the firmware upgrade information to the master device for firmware update, and then the method further includes: When the main device completes the firmware upgrade, determining whether the main device performs a system upgrade; If the main device performs a system upgrade, the preset firmware is controlled to perform an automatic check.
[0040] The acquiring of the upgrade instruction of the metadata information, sending the upgrade instruction to the sub-device based on the cluster communication protocol, and controlling the sub-device to perform firmware upgrade through the firmware upgrade information according to the upgrade instruction specifically include: Acquire an upgrade instruction from the metadata information, send the upgrade instruction to the sub-device based on the cluster communication protocol, and control the sub-device to perform firmware upgrade according to the upgrade instruction through the firmware upgrade information; When the sub-device performs a firmware upgrade, determining whether the firmware upgrade information meets a second preset upgrade condition; If the firmware upgrade information meets the second preset upgrade condition, the firmware upgrade is performed according to the version information in the firmware upgrade information.
[0041] The step of determining whether the verification result is successful may further include: If the verification result is not successful, controlling the master device to re-download the firmware upgrade information; If the verification result is not a successful verification, the sub-device is controlled to trigger a preset update mechanism to perform an update again.
[0042] The device firmware upgrade method further includes: Determine whether a heartbeat signal of the master device is received within a preset time interval; If the heartbeat signal is not received within a preset time interval, the master device is marked as disconnected and a corresponding alarm is triggered to notify the administrator; The heartbeat signal includes: an identifier of the master device, a health status of the master device, and a current firmware version.
[0043] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a device firmware upgrade program, and when the device firmware upgrade program is executed by a processor, the steps of the device firmware upgrade method as described above are implemented.
[0044] In summary, the present invention provides a device firmware upgrade method, system, terminal and storage medium, the method comprising: obtaining an upgrade task of a cloud platform, parsing metadata information in the upgrade task to obtain a parsing result, downloading in a main device according to the parsing result to obtain firmware upgrade information; obtaining a hash check value of the cloud platform, verifying the firmware upgrade information according to the hash check value to obtain a verification result; if the verification result is a successful verification, sending the firmware upgrade information to the main device to control the main device to perform a firmware upgrade according to the firmware upgrade information, and sending the firmware upgrade information to a sub-device through a cluster communication protocol of the main device to control the sub-device to perform a firmware upgrade. The present invention obtains an upgrade task from a cloud platform, parses metadata information to obtain firmware upgrade information, verifies firmware information through a hash check value, and if the verification is successful, sends the firmware upgrade information to the main device for upgrading, and at the same time sends the upgrade information to the sub-device through the communication protocol of the main device for firmware upgrading, further realizing the automated management and distribution of firmware upgrades.
[0045] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or terminal system including the element.
[0046] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0047] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for upgrading the firmware of a device, characterized in that: The firmware upgrade method of the device includes: Obtaining an upgrade task of the cloud platform, parsing metadata information in the upgrade task to obtain a parsing result, and downloading the firmware upgrade information on the main device according to the parsing result; Obtaining a hash check value of the cloud platform, and verifying the firmware upgrade information according to the hash check value to obtain a verification result; If the verification result is successful, the firmware upgrade information is sent to the main device to control the main device to perform firmware upgrade according to the firmware upgrade information, and the firmware upgrade information is sent to the sub-device through the cluster communication protocol of the main device to control the sub-device to perform firmware upgrade.
2. The method for upgrading the firmware of a device according to claim 1, characterized in that: The step of obtaining the upgrade task of the cloud platform, parsing the metadata information in the upgrade task to obtain the parsing result, and downloading the firmware upgrade information on the main device according to the parsing result, specifically includes: Acquire an upgrade task of the cloud platform, parse metadata information in the upgrade task to obtain a parsing result, and determine whether the parsing result meets a first preset upgrade condition; If the analysis result meets the first preset upgrade condition, data is downloaded from the main device according to the preset breakpoint resume mechanism, and firmware upgrade information is obtained according to the downloaded data.
3. The method for upgrading the firmware of a device according to claim 2, characterized in that: If the verification result is successful, the firmware upgrade information is sent to the master device to control the master device to perform firmware upgrade according to the firmware upgrade information, and the firmware upgrade information is sent to the slave device through the cluster communication protocol of the master device to control the slave device to perform firmware upgrade, specifically including: Determine whether the verification result is successful; If the verification result is successful, the firmware upgrade information is sent to the master device to control the master device to perform firmware upgrade according to the firmware upgrade information; An upgrade instruction of the metadata information is obtained, the upgrade instruction is sent to the sub-device based on the cluster communication protocol, and the sub-device is controlled to perform firmware upgrade according to the upgrade instruction through the firmware upgrade information.
4. The method for upgrading the firmware of a device according to claim 3, characterized in that: If the verification result is successful, determining to send the firmware upgrade information to the main device for firmware update, and then further comprising: When the main device completes the firmware upgrade, determining whether the main device performs a system upgrade; If the main device performs a system upgrade, the preset firmware is controlled to perform an automatic check.
5. The method for upgrading the firmware of a device according to claim 3, characterized in that: The step of obtaining an upgrade instruction from the metadata information, sending the upgrade instruction to the sub-device based on the cluster communication protocol, and controlling the sub-device to perform a firmware upgrade through the firmware upgrade information according to the upgrade instruction specifically includes: Acquire an upgrade instruction from the metadata information, send the upgrade instruction to the sub-device based on the cluster communication protocol, and control the sub-device to perform a firmware upgrade through the firmware upgrade information according to the upgrade instruction; When the sub-device performs a firmware upgrade, determining whether the firmware upgrade information meets a second preset upgrade condition; If the firmware upgrade information meets the second preset upgrade condition, the firmware upgrade is performed according to the version information in the firmware upgrade information.
6. The method for upgrading the firmware of a device according to claim 5, characterized in that: The step of determining whether the verification result is successful further includes: If the verification result is not successful, controlling the master device to re-download the firmware upgrade information; If the verification result is not successful, the sub-device is controlled to trigger a preset update mechanism to perform an update again.
7. The method for upgrading the firmware of a device according to claim 1, characterized in that: The firmware upgrade method of the device also includes: Determine whether a heartbeat signal of the master device is received within a preset time interval; If the heartbeat signal is not received within a preset time interval, the master device is marked as disconnected and a corresponding alarm is triggered to notify the administrator; The heartbeat signal includes: an identifier of the master device, a health status of the master device, and a current firmware version.
8. A firmware upgrade system for a device, characterized in that: The firmware upgrade system of the device includes: An upgrade information acquisition module is used to acquire the upgrade task of the cloud platform, parse the metadata information in the upgrade task to obtain the parsing result, and download the firmware upgrade information on the main device according to the parsing result; An upgrade information verification module, used to obtain a hash verification value of the cloud platform, verify the firmware upgrade information according to the hash verification value, and obtain a verification result; The firmware upgrade module is used to send the firmware upgrade information to the main device if the verification result is successful, so as to control the main device to perform firmware upgrade according to the firmware upgrade information, and send the firmware upgrade information to the sub-device through the cluster communication protocol of the main device to control the sub-device to perform firmware upgrade.
9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a device firmware upgrade program stored in the memory and executable on the processor. When the device firmware upgrade program is executed by the processor, the steps of the device firmware upgrade method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a device firmware upgrade program, and when the device firmware upgrade program is executed by a processor, the steps of the device firmware upgrade method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Firmware remote upgrading method and device
CN111796849A
Batch upgrading method for cloud control equipment
CN112929428A
Firmware upgrading method and electronic equipment
CN115061704A
Cited By
Edge IoT (Internet of Things) distributed multi-device trunking communication method and system
CN119012184A
A distributed multi-device cluster communication method and system for edge IoT
CN119012184B
Multi-source sensing water quality monitoring and diagnosing system and method based on cloud-side cooperation
CN120254207A
Method and system for upgrading PCS firmware through collector
CN120447935A
Firmware security upgrading method and device for chip and medium
CN121879808A
