Firmware upgrading method and system, electronic equipment and storage medium
By using wireless communication and data block download between the master and slave devices, and automatically switching transmission modes, the problem of low efficiency and interruption in firmware upgrades for energy storage devices is solved, achieving efficient and secure firmware upgrades.
Patent Information
- Application Number
- CN202511379401.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-12-12
AI Technical Summary
Firmware upgrades for existing energy storage and power pack equipment require manual operation, which is inefficient and can easily damage the equipment. Furthermore, wireless upgrades cannot automatically switch communication methods or resume transmission when the transmission is interrupted.
The firmware upgrade package is downloaded in the form of data blocks through the wireless communication connection between the master and slave devices. The download status is recorded and the transmission mode is automatically switched to realize the interruption resume transmission, so as to ensure the efficient performance of firmware upgrade.
It enables automatic switching and breakpoint resume for wireless firmware upgrades, improving upgrade efficiency, avoiding device disassembly and retransmission, and ensuring the integrity and security of data blocks.
Smart Images

Figure CN121116352A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy storage equipment technology, and more specifically, to a firmware upgrade method and system, electronic equipment, and storage medium. Background Technology
[0002] In existing energy storage and power pack equipment management, equipment upgrades and updates typically require manual operation, such as disassembling the equipment, connecting data cables, and installing new firmware or software. This method is not only inefficient but also prone to damaging the equipment during operation and is cumbersome. Furthermore, this upgrade method is even more difficult and impractical for remote or inaccessible equipment. With the rapid development of wireless communication technology, wireless upgrades have gained widespread attention due to their convenience and real-time performance. However, most current energy storage and power packs only support firmware upgrades via Bluetooth or Wi-Fi / ZigBee transmission modes. If the transmission is interrupted, the firmware needs to be downloaded again, and there is no automatic switching of communication methods or resume capability. Summary of the Invention
[0003] The present invention aims to solve the technical problems existing in the prior art or related technologies.
[0004] Therefore, the first aspect of the present invention proposes a firmware upgrade method.
[0005] A second aspect of the present invention provides a firmware upgrade system.
[0006] A third aspect of the present invention provides an electronic device.
[0007] A fourth aspect of the present invention provides a storage medium.
[0008] In view of this, according to a first aspect of the present invention, a firmware upgrade method is proposed for an energy storage device, the energy storage device comprising a master unit and a slave unit. The firmware upgrade method comprises: controlling the master unit to establish a wireless communication connection with the slave unit; when the slave unit needs to perform a firmware upgrade, the master unit downloads a firmware upgrade package in the form of data blocks from a server or user terminal via a first transmission method, and records the download status of each data block, including: downloaded and not downloaded; when the first transmission method is interrupted, determining the download status of each data block, and controlling the master unit to continue downloading the data blocks with the download status of not downloaded from the server or user terminal in the form of data blocks via a second transmission method; based on the completion of the firmware upgrade package download, the master unit sends the firmware upgrade package to the slave unit; and controlling the slave unit to perform a firmware upgrade using the firmware upgrade package.
[0009] The firmware upgrade method provided by this invention is mainly used in energy storage devices, which include a master unit and a slave unit. The master unit refers to the core device that controls the upgrade process, and the slave unit refers to the energy storage / power-up pack device that receives and executes the upgrade. The firmware upgrade method includes: first, controlling the master unit and the slave unit to establish a wireless communication connection. This eliminates the need for device disassembly, facilitating slave unit upgrades. Then, when the slave unit needs a firmware upgrade, the master unit downloads the firmware upgrade package from a server or user terminal in the form of data blocks via a first transmission method, and records the download status of each data block. The download status can be divided into downloaded and undownloaded. Downloaded data blocks refer to data blocks that have been downloaded from the server or user terminal to the master unit, while undownloaded data blocks refer to data blocks that have not yet been downloaded from the server or user terminal to the master unit. Subsequently, during the download process, when the first transmission method is interrupted—that is, when the host cannot download the firmware upgrade package from the server or user terminal via the first transmission method—the download status of each data block in the firmware upgrade package is determined. The host is then controlled to switch from the first transmission method to the second transmission method and continue downloading the undownloaded data blocks from the server or user terminal via the second transmission method, in the form of data blocks. After the firmware upgrade package is downloaded, the host sends the firmware upgrade package to the slave device, which then performs the firmware upgrade using the firmware upgrade package. In this invention, the host downloads the firmware upgrade package from the server or user terminal via the first transmission method in the form of data blocks and records the download status of each data block. When the first transmission method is interrupted, the host automatically switches to the second transmission method to continue downloading the undownloaded data blocks, thus achieving automatic switching between different transmission methods. Furthermore, because the download is performed in the form of data blocks, and the download status of each data block is recorded in real time during the download process, it is not necessary to restart the firmware upgrade package transmission after switching transmission methods, thereby saving transmission time and improving upgrade efficiency.
[0010] In some technical solutions, optionally, the step of controlling the host and slave to establish a wireless communication connection includes: controlling the slave to broadcast a device identifier and an upgrade signal; and, based on the host receiving the device identifier and upgrade signal, controlling the host to establish a wireless communication connection with the slave and perform authentication.
[0011] In some technical solutions, optionally, before the step of the control host downloading the firmware upgrade package in the form of data blocks from the server or user terminal via a first transmission method and recording the download status of each data block when the slave device needs to be upgraded, the following steps are included: the control host sending a version query request to the slave device; the control slave device sending the first version information of the current firmware to the control host; the control host matching the first version information with the second version information in the server; and determining that the slave device needs to be upgraded based on the difference between the first version information and the second version information.
[0012] In some technical solutions, optionally, the steps of controlling the slave device to perform firmware upgrade using the firmware upgrade package include: after the slave device receives the firmware upgrade package, performing an integrity verification on the firmware upgrade package; after the integrity verification of the firmware upgrade package passes, performing a compatibility check on the firmware upgrade package; and after the compatibility check of the firmware upgrade package passes, controlling the slave device to install the firmware upgrade package.
[0013] In some technical solutions, optionally, the step of controlling the slave device to perform firmware upgrade using the firmware upgrade package further includes: during the installation of the firmware upgrade package, controlling the slave device to send upgrade status information to the master device; and when the upgrade status information indicates that the installation is complete, controlling the master device to send a completion signal to the user terminal.
[0014] In some technical solutions, optionally, the host and slave devices communicate using an encrypted protocol.
[0015] In some technical solutions, the first transmission method may be WIFI transmission, and the second transmission method may be Bluetooth transmission or ZigBee (low-power local area network protocol) transmission.
[0016] According to a second aspect of the present invention, a firmware upgrade system is provided for an energy storage device, the energy storage device comprising a master unit and a slave unit, wherein the firmware upgrade system comprises: a first processing module for controlling the master unit and the slave unit to establish a wireless communication connection; a second processing module for controlling the master unit to download a firmware upgrade package in the form of data blocks from a server or user terminal via a first transmission method when the slave unit needs to perform a firmware upgrade, and recording the download status of each data block, the download status including: downloaded and not downloaded; a third processing module for determining the download status of each data block when the first transmission method is interrupted, and controlling the master unit to continue downloading the data blocks with the download status of not downloaded from the server or user terminal via a second transmission method; a fourth processing module for controlling the master unit to send the firmware upgrade package to the slave unit after the firmware upgrade package download is completed; and a fifth processing module for controlling the slave unit to perform a firmware upgrade using the firmware upgrade package.
[0017] The firmware upgrade system provided by this invention is used in energy storage devices, which include a master unit and a slave unit. The master unit refers to the core device that controls the upgrade process, and the slave unit refers to the energy storage / power-up pack device that receives and executes the upgrade. The firmware upgrade system mainly includes a first processing module, a second processing module, a third processing module, a fourth processing module, and a fifth processing module. The first processing module first controls the master unit and the slave unit to establish a wireless communication connection, eliminating the need for device disassembly and facilitating slave unit upgrades. Then, when the slave unit needs a firmware upgrade, the second processing module controls the master unit to download the firmware upgrade package from a server or user terminal in the form of data blocks via a first transmission method, and records the download status of each data block. The download status can be divided into downloaded and undownloaded. Downloaded data blocks refer to data blocks that have been downloaded from the server or user terminal to the master unit, while undownloaded data blocks refer to data blocks that have not yet been downloaded from the server or user terminal to the master unit. Subsequently, during the download process, when the first transmission method is interrupted—that is, when the host cannot download the firmware upgrade package from the server or user terminal via the first transmission method—the third processing module determines the download status of each data block in the firmware upgrade package and controls the host to switch from the first transmission method to the second transmission method. Simultaneously, the host continues to download the undownloaded data blocks from the server or user terminal via the second transmission method in the form of data blocks. After the firmware upgrade package is downloaded, the fourth processing module controls the host to send the firmware upgrade package to the slave device. Finally, the fifth processing module controls the slave device to perform a firmware upgrade using the firmware upgrade package. In this invention, the host downloads the firmware upgrade package from the server or user terminal via the first transmission method in the form of data blocks and records the download status of each data block. When the first transmission method is interrupted, the host automatically switches to the second transmission method to continue downloading the undownloaded data blocks, thus achieving automatic switching between different transmission methods. Furthermore, because the download is performed in the form of data blocks, and the download status of each data block is recorded in real time during the download process, it is not necessary to restart the firmware upgrade package transmission after switching transmission methods, thereby saving transmission time and improving upgrade efficiency.
[0018] According to a third aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the firmware upgrade method as described above.
[0019] The electronic device provided by the present invention, when the processor executes the computer program, implements the steps of the above firmware upgrade method, and can achieve the technical effects of any of the above technical solutions, which will not be elaborated here.
[0020] According to a fourth aspect of the invention, a storage medium is provided on which a computer program is stored, which, when executed by a processor, implements the steps of the firmware upgrade method as described above.
[0021] The storage medium provided by this invention, when the computer program is executed by the processor, implements the steps of the above firmware upgrade method, and can achieve the technical effects of any of the above technical solutions, which will not be elaborated here.
[0022] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description
[0023] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0024] Figure 1 One of the flowcharts of a firmware upgrade method according to an embodiment of the present invention is shown;
[0025] Figure 2 A flowchart illustrating the steps of controlling the host and slave device to establish a wireless communication connection in a firmware upgrade method according to an embodiment of the present invention is shown.
[0026] Figure 3 This diagram illustrates the process prior to the step in a firmware upgrade method according to an embodiment of the present invention, where, when a slave device needs to perform a firmware upgrade, the control host downloads the firmware upgrade package from a server or user terminal in the form of data blocks via a first transmission method and records the download status of each data block.
[0027] Figure 4 This is a schematic flowchart illustrating one of the steps in a firmware upgrade method according to an embodiment of the present invention, namely controlling a slave device to perform a firmware upgrade using a firmware upgrade package.
[0028] Figure 5 This is a second flowchart illustrating the step of controlling the slave device to perform firmware upgrade using a firmware upgrade package in a firmware upgrade method according to an embodiment of the present invention.
[0029] Figure 6 A second schematic flowchart of a firmware upgrade method according to an embodiment of the present invention is shown;
[0030] Figure 7 This diagram illustrates the firmware upgrade package forwarding process in a firmware upgrade method according to an embodiment of the present invention.
[0031] Figure 8 A structural block diagram of a firmware upgrade system according to an embodiment of the present invention is shown. Detailed Implementation
[0032] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.
[0033] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0034] Figure 1 This diagram illustrates one embodiment of a firmware upgrade method according to the present invention. The firmware upgrade method includes:
[0035] Step 102: The host and slave devices establish a wireless communication connection;
[0036] Step 104: When the slave device needs to be upgraded, the control host downloads the firmware upgrade package from the server or user terminal in the form of data blocks through the first transmission method, and records the download status of each data block. The download status includes: downloaded and not downloaded.
[0037] Step 106: When the first transmission method is interrupted, determine the download status of each data block, and control the host to continue downloading the data blocks with the download status not downloaded from the server or user terminal in the form of data blocks through the second transmission method;
[0038] Step 108: Once the firmware upgrade package download is complete, the control host sends the firmware upgrade package to the slave device;
[0039] Step 110: Control the slave device to perform a firmware upgrade using the firmware upgrade package.
[0040] The firmware upgrade method provided by this invention is mainly used in energy storage devices, which include a master unit and a slave unit. The master unit refers to the core device that controls the upgrade process, and the slave unit refers to the energy storage / power-up pack device that receives and executes the upgrade. The firmware upgrade method includes: first, controlling the master unit and the slave unit to establish a wireless communication connection. This eliminates the need for device disassembly, facilitating slave unit upgrades. Then, when the slave unit needs a firmware upgrade, the master unit downloads the firmware upgrade package from a server or user terminal in the form of data blocks via a first transmission method, and records the download status of each data block. The download status can be divided into downloaded and undownloaded. Downloaded data blocks refer to data blocks that have been downloaded from the server or user terminal to the master unit, while undownloaded data blocks refer to data blocks that have not yet been downloaded from the server or user terminal to the master unit. Subsequently, during the download process, when the first transmission method is interrupted—that is, when the host cannot download the firmware upgrade package from the server or user terminal via the first transmission method—the download status of each data block in the firmware upgrade package is determined. The host is then controlled to switch from the first transmission method to the second transmission method and continue downloading the undownloaded data blocks from the server or user terminal via the second transmission method, in the form of data blocks. After the firmware upgrade package is downloaded, the host sends the firmware upgrade package to the slave device, which then performs the firmware upgrade using the firmware upgrade package. In this invention, the host downloads the firmware upgrade package from the server or user terminal via the first transmission method in the form of data blocks and records the download status of each data block. When the first transmission method is interrupted, the host automatically switches to the second transmission method to continue downloading the undownloaded data blocks, thus achieving automatic switching between different transmission methods. Furthermore, because the download is performed in the form of data blocks, and the download status of each data block is recorded in real time during the download process, it is not necessary to restart the firmware upgrade package transmission after switching transmission methods, thereby saving transmission time and improving upgrade efficiency.
[0041] Figure 2 The diagram illustrates a flowchart of the steps involved in establishing a wireless communication connection between the host and slave device in a firmware upgrade method according to an embodiment of the present invention; wherein, the steps involved in establishing a wireless communication connection between the host and slave device include:
[0042] Step 202: Control the slave broadcast device identification and upgrade signal;
[0043] Step 204: After the host receives the device identifier and upgrade signal, it controls the host to establish a wireless communication connection with the slave device and perform authentication.
[0044] In this embodiment, the step of controlling the host and slave to establish a wireless communication connection includes: firstly, controlling the slave to broadcast a device identifier and upgrade signal to the surrounding area; when the host receives the device identifier and upgrade signal broadcast by the slave, controlling the host to establish a wireless communication connection with the slave, and controlling the host and slave to perform authentication. Here, two-way authentication can be performed using pre-shared keys, digital certificates, etc. By controlling the authentication between the host and the slave, it is ensured that only authorized devices can establish a communication connection.
[0045] Figure 3 This diagram illustrates a flowchart of a firmware upgrade method according to an embodiment of the present invention, prior to the step where, when a slave device needs a firmware upgrade, the control host downloads the firmware upgrade package in the form of data blocks from a server or user terminal via a first transmission method and records the download status of each data block; wherein, prior to the step where, when a slave device needs a firmware upgrade, the control host downloads the firmware upgrade package in the form of data blocks from a server or user terminal via a first transmission method and records the download status of each data block, the following steps are included:
[0046] Step 302: The control host sends a version query request to the slave device;
[0047] Step 304: Control the slave device to send the first version information of the current firmware to the master device;
[0048] Step 306: The control host matches the first version information with the second version information in the server;
[0049] Step 308: If the first version information is different from the second version information, it is determined that the slave device needs to be upgraded with firmware.
[0050] In this embodiment, before the step of the control host downloading the firmware upgrade package in the form of data blocks from the server or user terminal via a first transmission method and recording the download status of each data block when the slave device needs a firmware upgrade, the process includes: after establishing wireless communication between the host and the slave device, the control host sends a version query request to the slave device to query the current firmware version of the slave device. Upon receiving the version query request, the slave device sends the first version information of the current firmware to the host, where the first version information refers to the firmware version information in the current slave device. Subsequently, after receiving the first version information, the host matches the first version information with the second version information in the server, that is, compares the first version information with the second version information, where the second version information in the server is the pre-stored version information, i.e., the version the user wants the slave device to use. When the first version information and the second version information are the same, it means that the firmware version in the slave device is the pre-stored version, and therefore no upgrade is needed. When the first version information and the second version information are different, it means that the firmware version in the slave device is not the pre-stored version, and therefore the firmware in the slave device needs to be upgraded. Therefore, it can be determined that the slave device needs a firmware upgrade. This invention accurately determines whether a slave device needs a firmware upgrade by comparing the current firmware version information of the slave device with the predicted version information in the server.
[0051] Figure 4 This diagram illustrates one of the steps in a firmware upgrade method according to an embodiment of the present invention: controlling a slave device to perform a firmware upgrade using a firmware upgrade package; wherein, the step of controlling the slave device to perform a firmware upgrade using a firmware upgrade package includes:
[0052] Step 402: After receiving the firmware upgrade package, the slave device performs an integrity check on the firmware upgrade package;
[0053] Step 404: After the integrity verification of the firmware upgrade package passes, perform a compatibility check on the firmware upgrade package;
[0054] Step 406: After the compatibility check of the firmware upgrade package passes, control the slave device to install the firmware upgrade package.
[0055] In this embodiment, the step of controlling the slave device to perform a firmware upgrade using the firmware upgrade package includes: after receiving the firmware upgrade package, the slave device first performs an integrity check on the firmware upgrade package to ensure that the firmware upgrade package has not been damaged during transmission. After the integrity check of the firmware upgrade package passes, a compatibility check is performed on the firmware upgrade package to ensure that the firmware upgrade package is compatible with the current slave device model and firmware version. After the compatibility check passes, the slave device begins to install the firmware upgrade package. By performing integrity checks and compatibility checks on the firmware upgrade package sequentially before installation, it is ensured that the firmware in the slave device can be used smoothly after installation.
[0056] For example, as shown in Table 1, Table 1 illustrates the verification algorithms involved in the upgrade process.
[0057] Table 1
[0058]
[0059] As shown in Table 1, when the upgrade scenario involves upgrading the energy storage control board and inverter, the algorithm combination used is RSA (Rivest-Shamir-Adleman, an asymmetric encryption algorithm)-4096 signature algorithm, LZO (Lempel-Ziv-Oberhumer) compression algorithm, and AES (Advanced Encryption Standard) encryption algorithm, thereby achieving the goal of supporting secure transmission and storage optimization of large files. When the upgrade scenario involves gateway OTA upgrade, the algorithm combination used is RSA-2048 algorithm and HMAC-SHA256 (Hash-based Message Authentication Code - Secure Hash Algorithm 256) algorithm, achieving the goal of compatibility with home energy storage devices and moderate security requirements. When the upgrade scenario is a power-on OTA upgrade, the algorithms used are ECDSA (P-256) (Elliptic Curve Digital Signature Algorithm (Prime256-bit) and SHA-256 (SecureHash Algorithm 256), which achieve the goal of balancing security and low computational overhead.
[0060] Subsequently, the integrity verification process involves calculating the hash value of the firmware upgrade package and comparing it with the hash value provided by the server to ensure that the upgrade package has not been tampered with during transmission.
[0061] Table 2
[0062]
[0063]
[0064] Table 2 illustrates different implementation methods for various verification steps. For example, when the verification step is differential packet source verification, the embedded device implementation can be ECDSA (Elliptic Curve Digital Signature Algorithm) / RSA signature verification (Boot Loader public key), while the OTA system implementation can be system signature verification (platform certificate). When the verification step is version consistency verification, the embedded device implementation can be comparing the old version number in the differential packet header, while the OTA system implementation can be checking the build fingerprint. When the verification step is error prevention during the synthesis process, the embedded device implementation can be streaming block CRC (Cyclic Redundancy Check) verification, while the OTA system implementation can be differential array boundary checking. When the verification step is final inspection of the new firmware, the embedded device implementation can be full file SHA-256 comparison, while the OTA system implementation can be partitioned hash tree verification (dm-verity).
[0065] Figure 5 This is a second flowchart illustrating the step of controlling the slave device to perform a firmware upgrade using a firmware upgrade package in a firmware upgrade method according to an embodiment of the present invention; wherein, the step of controlling the slave device to perform a firmware upgrade using a firmware upgrade package further includes:
[0066] Step 502: During the firmware upgrade package installation process, control the slave device to send upgrade status information to the master device;
[0067] Step 504: When the upgrade status information indicates that the installation is complete, the control host sends a completion signal to the user terminal.
[0068] In this embodiment, the step of controlling the slave device to perform firmware upgrade using the firmware upgrade package further includes: during the installation of the firmware upgrade package by the slave device, the slave device needs to maintain a communication connection with the host, and the slave device is controlled to send upgrade progress and upgrade status information to the host. This allows the upgrade device to record error information and send operation instructions to the slave device in case of a fault or abnormality during the upgrade process, so that the slave device can continue or stop the installation. When the upgrade status information indicates that the installation is complete, the host device updates the device status information and sends a completion signal to the user terminal to remind the user to upgrade. By controlling the slave device to send upgrade status information to the host in real time during the installation of the firmware upgrade package, the installation process can be monitored.
[0069] In some embodiments, optionally, the host and slave communicate using an encryption protocol.
[0070] In this embodiment, when a wireless communication connection exists between the host and slave devices, an encryption protocol is used for communication. This encryption protocol can be TLS and / or SSL, etc. By controlling the communication between the host and slave devices to use an encryption protocol, the interception or tampering of firmware upgrade packages is prevented, ensuring data security.
[0071] In some embodiments, the first transmission method may be WIFI transmission, and the second transmission method may be Bluetooth transmission or ZigBee (low-power local area network protocol) transmission.
[0072] In this embodiment, the first transmission method can be Wi-Fi (Wireless Fidelity), and the second transmission method can be Bluetooth or ZigBee (Low Power Local Area Network Protocol). That is, the host and server can first use Wi-Fi to transmit the firmware upgrade package. When Wi-Fi is interrupted, the host can choose either Bluetooth or ZigBee to continue downloading the firmware upgrade package from the server, allowing for switching between transmission methods.
[0073] For example, as shown in Table 3, the parameter thresholds for switching transmission modes are illustrated.
[0074] Table 3
[0075]
[0076] As shown in Table 3, when the Wi-Fi signal strength is >-70dBm, the Wi-Fi backbone network is activated with a response latency of <300ms; when the data packet loss rate is >15% and mobile Bluetooth is detected, Bluetooth Mesh multi-hop relay transmission is used with a response latency of 0.35s; when the device battery is <20% and ZigBee is online, forced degradation is performed, and ZigBee transmission is used with an immediate effect. When network congestion is detected, differential compression transmission is enabled with a response latency of <200ms.
[0077] Figure 6 A second schematic flowchart of a firmware upgrade method according to an embodiment of the present invention is shown; wherein the method includes:
[0078] Step 602: Device Identification and Connection: The power-on package broadcasts the device identification and upgrade signal and transmits them encrypted with TLS / SSL;
[0079] Step 604: The energy storage host and the power pack authenticate each other and establish a wireless connection;
[0080] Step 606: The energy storage host sends a version query request to the power-on package, and the power-on package returns the current firmware or software version information;
[0081] Step 608: The energy storage host compares the received power pack version information with the pre-stored version on the cloud server;
[0082] Step 610: The energy storage host selects the appropriate transmission protocol based on the current connection status of the device;
[0083] Step 612: If the Wi-Fi signal is >-70dBm, enable Wi-Fi;
[0084] Step 614: Data packet loss rate > 15% && Mobile Bluetooth transmission detected;
[0085] Step 616: Device battery level <20% || ZigBee online ZigBee transfer;
[0086] Step 618: The energy storage host sends the upgrade data packet to the power-on package in chunks and records the sending status of each data block;
[0087] Step 620: Power on the package to verify the received upgrade data packet and perform integrity verification using MD5 or SHA-1;
[0088] Step 622: Power on the device, install the upgraded firmware, and send upgrade status and information in real time;
[0089] Step 624: Upgrade complete, and data feedback is sent to the energy storage system and the user's mobile phone for notification.
[0090] In this embodiment, the firmware upgrade method includes: firstly, device identification and connection are performed. Specifically, the power-on package first broadcasts the device identifier and upgrade signal, and transmits them using TLS (Transport Layer Security) / SSL (Secure Sockets Layer) encryption protocol. The energy storage host and the power-on package authenticate each other and establish a wireless connection. Subsequently, the energy storage host sends a version query request to the power-on package, and the power-on package returns the current firmware or software version information. The energy storage host compares the received power-on package version information with the pre-stored version on the cloud server. If they are different, it indicates that the power-on package needs a firmware upgrade. Therefore, the energy storage host prioritizes selecting a suitable transmission protocol based on the current connection status of the device, as shown in Table 4.
[0091] Table 4
[0092]
[0093]
[0094] As shown in Table 4, there are three different transmission methods: Wi-Fi, Bluetooth, and ZigBee. Each method has different protocol characteristics, upgrade procedures, and hardware compatibility. During the selection process, Wi-Fi transmission is enabled when the Wi-Fi signal is >-70dBm; Bluetooth transmission is used when the data packet loss rate is >15% and mobile Bluetooth is detected; and ZigBee transmission is used when the device battery is <20% and ZigBee is online. After the energy storage host receives the upgrade data, it sends the upgrade data to the power-up package in blocks and records the transmission status of each data block. After receiving the upgrade data, the power-up package verifies the upgrade data and performs integrity verification using MD5 (Message-Digest Algorithm 5) or SHA-1. After successful verification, the power-up package installs the upgrade firmware and sends upgrade status and information in real time. When the upgrade is complete, the energy storage host notifies the user via data feedback to the energy storage device and the mobile phone.
[0095] For example, such as Figure 7 As shown, the firmware upgrade package forwarding process in this invention is as follows: The energy storage host downloads the firmware upgrade package from the server via Wi-Fi transmission. Then, the energy storage host distributes the firmware upgrade package to the power supply package. The power supply package installs the firmware upgrade package and, during the installation process, provides real-time feedback on the installation status to the energy storage host. When the installation status indicates safe completion, the energy storage host sends a notification message to the user's mobile phone via Bluetooth to remind the user that the installation is complete. Simultaneously, the user's mobile phone also communicates with the server.
[0096] Figure 8 A structural block diagram of a firmware upgrade system according to an embodiment of the present invention is shown; wherein, the firmware upgrade system 80 includes:
[0097] The first processing module 802 is used to control the wireless communication connection between the host and the slave.
[0098] The second processing module 804 is used to control the host to download the firmware upgrade package from the server or user terminal in the form of data blocks through the first transmission method when the slave device needs to perform a firmware upgrade, and to record the download status of each data block, including: downloaded and not downloaded;
[0099] The third processing module 806 is used to determine the download status of each data block when the first transmission method is interrupted, and to control the host to continue downloading the data blocks with the download status not downloaded from the server or user terminal in the form of data blocks through the second transmission method.
[0100] The fourth processing module 808 is used to control the host to send the firmware upgrade package to the slave device after the firmware upgrade package download is completed;
[0101] The fifth processing module 810 is used to control the slave device to perform firmware upgrades using the firmware upgrade package.
[0102] The firmware upgrade system 80 provided by this invention is used in energy storage devices. The energy storage device includes a host and a slave device. The host refers to the core device controlling the upgrade process, and the slave device refers to the energy storage / power-up package device that receives and executes the upgrade. The firmware upgrade system 80 mainly includes a first processing module 802, a second processing module 804, a third processing module 806, a fourth processing module 808, and a fifth processing module 810. The first processing module 802 first controls the host and slave device to establish a wireless communication connection, eliminating the need for device disassembly and facilitating slave device upgrades. Then, when the slave device needs a firmware upgrade, the second processing module 804 controls the host to download the firmware upgrade package from a server or user terminal in the form of data blocks via a first transmission method, and records the download status of each data block. The download status can be divided into downloaded and undownloaded. Downloaded data blocks refer to data blocks that have been downloaded from the server or user terminal to the host, while undownloaded data blocks refer to data blocks that have not yet been downloaded from the server or user terminal to the host. Subsequently, during the download process, if the first transmission method is interrupted—that is, if the host cannot download the firmware upgrade package from the server or user terminal via the first transmission method—the third processing module 806 determines the download status of each data block in the firmware upgrade package and controls the host to switch from the first transmission method to the second transmission method. Simultaneously, the host continues to download the undownloaded data blocks from the server or user terminal via the second transmission method in the form of data blocks. After the firmware upgrade package is downloaded, the fourth processing module 808 controls the host to send the firmware upgrade package to the slave device. Finally, the fifth processing module 810 controls the slave device to perform a firmware upgrade using the firmware upgrade package. In this invention, the control host downloads the firmware upgrade package from the server or user terminal in the form of data blocks using a first transmission method, and records the download status of each data block. When the first transmission method is interrupted, the control host automatically switches to a second transmission method to continue downloading the undownloaded data blocks, thereby realizing automatic switching between different transmission methods. At the same time, since the download is performed in the form of data blocks, and the download status of each data block is recorded in real time during the download process, it is not necessary to restart the transmission of the firmware upgrade package after switching transmission methods, thus saving the transmission time of the firmware upgrade package and improving the upgrade efficiency.
[0103] In some embodiments, optionally, the first processing module 802 is specifically used to control the slave device to broadcast the device identifier and upgrade signal; based on the host receiving the device identifier and upgrade signal, the host controls the slave device to establish a wireless communication connection and perform authentication.
[0104] In this embodiment, the first processing module 802 is specifically used to first control the slave device to broadcast the device identifier and upgrade signal to the surrounding area. When the master device receives the device identifier and upgrade signal broadcast by the slave device, it controls the master device to establish a wireless communication connection with the slave device and controls the master device and the slave device to perform authentication. Here, two-way authentication can be performed using pre-shared keys, digital certificates, etc. By controlling the authentication between the master device and the slave device, it is ensured that only authorized devices can establish a communication connection.
[0105] In some embodiments, optionally, the firmware upgrade system 80 further includes: a sixth processing module for controlling the host to send a version query request to the slave device; a seventh processing module for controlling the slave device to send the first version information of the current firmware to the host; an eighth processing module for controlling the host to match the first version information with the second version information in the server; and a ninth processing module for determining that the slave device needs to perform a firmware upgrade if the first version information and the second version information are different.
[0106] In this embodiment, the firmware upgrade system 80 further includes a sixth processing module, a seventh processing module, an eighth processing module, and a ninth processing module. After wireless communication is established between the host and the slave device, the sixth processing module controls the host to send a version query request to the slave device to query the current firmware version. Upon receiving the version query request, the seventh processing module controls the slave device to send the first version information of the current firmware to the host, where the first version information refers to the firmware version information in the slave device. Subsequently, after the host receives the first version information, the eighth processing module matches the first version information with the second version information stored on the server. The second version information on the server is the pre-stored version information, i.e., the version the user wants the slave device to use. When the first version information and the second version information are the same, it means that the firmware version in the slave device is the pre-stored version, and therefore no upgrade is needed. When the first version information and the second version information are different, it means that the firmware version in the slave device is not the pre-stored version, and therefore the firmware in the slave device needs to be upgraded. Therefore, the ninth processing module can determine that the slave device needs a firmware upgrade. This invention accurately determines whether a slave device needs a firmware upgrade by comparing the current firmware version information of the slave device with the predicted version information in the server.
[0107] In some embodiments, optionally, the fifth processing module 810 is specifically configured to perform an integrity check on the firmware upgrade package after the slave device receives the firmware upgrade package; perform a compatibility check on the firmware upgrade package after the integrity check of the firmware upgrade package passes; and control the slave device to install the firmware upgrade package after the compatibility check of the firmware upgrade package passes.
[0108] In this embodiment, the fifth processing module 810 is specifically used to, after receiving the firmware upgrade package, first perform an integrity check on the firmware upgrade package to ensure that the firmware upgrade package has not been damaged during transmission. After the integrity check of the firmware upgrade package passes, a compatibility check is performed on the firmware upgrade package to ensure that the firmware upgrade package is compatible with the current device model and firmware version of the slave device. After the compatibility check passes, the slave device is controlled to start installing the firmware upgrade package. By performing integrity checks and compatibility checks on the firmware upgrade package sequentially before installation, it is ensured that the firmware in the slave device can be used smoothly after installation.
[0109] In some embodiments, optionally, the fifth processing module 810 is further configured to control the slave device to send upgrade status information to the host device during the installation of the firmware upgrade package; and to control the host device to send a completion signal to the user terminal when the upgrade status information indicates that the installation is complete.
[0110] In this embodiment, the fifth processing module 810 is further configured to maintain a communication connection between the slave device and the host device during the firmware upgrade package installation process. This module controls the slave device to send upgrade progress and status information to the host, enabling the upgrade device to record error information and send operation instructions to the slave device to continue or stop the installation if a fault or abnormality occurs during the upgrade process. When the upgrade status information indicates installation is complete, the module controls the host device to update the device status information and send a completion signal to the user terminal to remind the user to upgrade. By controlling the slave device to send upgrade status information to the host in real time during firmware upgrade package installation, monitoring of the installation process is achieved.
[0111] In some embodiments, optionally, the host and slave communicate using an encryption protocol.
[0112] In this embodiment, when a wireless communication connection exists between the host and slave devices, an encryption protocol is used for communication. This encryption protocol can be TLS and / or SSL, etc. By controlling the communication between the host and slave devices to use an encryption protocol, the interception or tampering of firmware upgrade packages is prevented, ensuring data security.
[0113] In some embodiments, the first transmission method may be WIFI transmission, and the second transmission method may be Bluetooth transmission or ZigBee (low-power local area network protocol) transmission.
[0114] In this embodiment, the first transmission method can be Wi-Fi (Wireless Fidelity), and the second transmission method can be Bluetooth or ZigBee (Low Power Local Area Network Protocol). That is, the host and server can first use Wi-Fi to transmit the firmware upgrade package. When Wi-Fi is interrupted, the host can choose either Bluetooth or ZigBee to continue downloading the firmware upgrade package from the server, allowing for switching between transmission methods.
[0115] An electronic device according to an embodiment of the present invention includes a memory processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the firmware upgrade method as described above.
[0116] The electronic device provided by the present invention, when the processor executes the computer program, implements the steps of the above firmware upgrade method, and can achieve the technical effects of any of the above embodiments, which will not be repeated here.
[0117] One embodiment of the present invention provides a storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of the firmware upgrade method as described above.
[0118] The storage medium provided by this invention, when the computer program is executed by the processor, implements the steps of the above firmware upgrade method, and can achieve the technical effects of any of the above embodiments, which will not be repeated here.
[0119] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance, unless otherwise expressly specified and limited. The terms "connection," "installation," and "fixing," etc., should be interpreted broadly. For example, "connection" can mean a fixed connection, a detachable connection, or an integral connection; it can mean a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0120] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0121] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A firmware upgrade method for an energy storage device, the energy storage device comprising: The host and slave devices are characterized in that the firmware upgrade method includes: Control the host to establish a wireless communication connection with the slave device; When the slave device needs to be upgraded, the host device is controlled to download the firmware upgrade package from the server or user terminal in the form of data blocks through the first transmission method, and the download status of each data block is recorded, including: downloaded and not downloaded; When the first transmission method is interrupted, the download status of each data block is determined, and the host is controlled to continue downloading the data blocks that are not downloaded from the server or the user terminal in the form of data blocks through the second transmission method. Once the firmware upgrade package download is complete, the host computer is controlled to send the firmware upgrade package to the slave computer. The slave device is controlled to perform a firmware upgrade using the firmware upgrade package.
2. The firmware upgrade method according to claim 1, characterized in that, The step of controlling the host to establish a wireless communication connection with the slave includes: Control the slave broadcast device identifier and upgrade signal; After receiving the device identifier and the upgrade signal, the host controls the host to establish a wireless communication connection with the slave device and perform authentication.
3. The firmware upgrade method according to claim 1, characterized in that, Before the step of controlling the host to download the firmware upgrade package in the form of data blocks from the server or user terminal via a first transmission method when the slave device needs to perform a firmware upgrade, and recording the download status of each data block, the following steps are included: The host machine is controlled to send a version query request to the slave machine; The slave device is controlled to send the first version information of the current firmware to the host device; The host is controlled to match the first version information with the second version information in the server; Based on the difference between the first version information and the second version information, it is determined that the slave device needs to undergo a firmware upgrade.
4. The firmware upgrade method according to claim 1, characterized in that, The step of controlling the slave device to perform a firmware upgrade using the firmware upgrade package includes: After the slave device receives the firmware upgrade package, it performs an integrity check on the firmware upgrade package. After the integrity verification of the firmware upgrade package passes, a compatibility check is performed on the firmware upgrade package. After the compatibility check of the firmware upgrade package passes, the slave device is controlled to install the firmware upgrade package.
5. The firmware upgrade method according to claim 4, characterized in that, The step of controlling the slave device to perform firmware upgrade using the firmware upgrade package further includes: During the installation of the firmware upgrade package, the slave device is controlled to send upgrade status information to the host device; When the upgrade status information indicates that the installation is complete, the host is controlled to send a completion signal to the user terminal.
6. The firmware upgrade method according to any one of claims 1 to 5, characterized in that, The host and the slave communicate using an encryption protocol.
7. The firmware upgrade method according to any one of claims 1 to 5, characterized in that, The first transmission method is WIFI transmission, and the second transmission method is Bluetooth transmission or ZigBee transmission.
8. A firmware upgrade system for an energy storage device, the energy storage device comprising: The host and slave devices are characterized in that the firmware upgrade system includes: A first processing module is used to control the host and the slave to establish a wireless communication connection. The second processing module is used to control the host to download the firmware upgrade package from the server or user terminal in the form of data blocks through the first transmission method when the slave device needs to be upgraded, and to record the download status of each data block, the download status including: downloaded and not downloaded; The third processing module is used to determine the download status of each data block when the first transmission method is interrupted, and to control the host to continue downloading the data blocks that are not downloaded from the server or the user terminal in the form of data blocks through the second transmission method. The fourth processing module is used to control the host to send the firmware upgrade package to the slave device after the firmware upgrade package download is completed. The fifth processing module is used to control the slave device to perform firmware upgrade using the firmware upgrade package.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the firmware upgrade method as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the firmware upgrade method as described in any one of claims 1 to 7.