System upgrading method and device for energy storage equipment
By performing multiple checksum copies during the OTA upgrade process of energy storage equipment, we ensure that each packet of upgraded firmware data is received and stored when the previous packet passes the verification. Combined with the overall and separate data verification, the problem of wrong firmware installation in the OTA upgrade of energy storage equipment is solved, and the normal operation and safe upgrade of the equipment are achieved.
Patent Information
- Application Number
- CN202510262008.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, energy storage equipment is prone to misinstalling firmware suitable for other models during the OTA upgrade process, resulting in abnormal operation, and the encryption algorithm is complex and takes up a lot of memory, affecting the normal use and performance of the equipment.
After the energy storage device successfully shakes hands with the firmware supply server, it receives and verifies the multi-package upgraded firmware data, ensures that each packet of data is stored in a temporary storage area after passing the verification, and then copies it to the program operation area, and performs overall verification, ensuring that each packet of data is copied when the previous packet is passed, combining overall and separate data verification, covering all stages of the upgrade process to avoid incorrect data installation.
Ensure the accuracy and security of the upgrade process, avoid equipment abnormalities caused by wrong versions, reduce system unstable state caused by some data errors, and ensure normal use of the equipment.
Smart Images

Figure CN120234023A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of system upgrades, and particularly to a method and device for system upgrades of energy storage devices. Background Art
[0002] In the production and sales links of energy storage devices, product maintenance work often needs to be carried out due to changes in the market demand for energy storage devices or detection of software design defects in energy storage devices. In product maintenance, software upgrade of the product is one of the key measures.
[0003] In the related art, the Over-The-Air (OTA) technology can usually be used to upgrade the product software of energy storage device products that have been produced offline or put on the market for sale. During the OTA upgrade process, in order to prevent energy storage device products from being maliciously attacked from the outside, data from being stolen, and malicious code from being implanted, etc., it is often necessary to use an encryption algorithm to encrypt the upgrade firmware.
[0004] However, in some cases, the same encryption algorithm is applicable to multiple different versions of firmware. Once the wrong firmware version is uploaded during the upgrade process, the encryption algorithm cannot identify the wrong version either, resulting in the possibility of installing the firmware applicable to other models on the energy storage device by mistake, thereby causing abnormal operation of the energy storage device and affecting the normal use and performance of the energy storage device. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a method and device for system upgrades of energy storage devices, which can accurately identify wrong versions during the upgrade process and ensure the normal operation of the upgrade process.
[0006] In a first aspect, this application provides a method for system upgrades of energy storage devices, including:
[0007] When the handshake between the energy storage device and the firmware supply server is successful, receive multiple packets of upgrade firmware data sequentially sent by the firmware supply server; wherein, each packet of upgrade firmware data is received when the previous packet of upgrade firmware data passes the verification, and after each packet of upgrade firmware data passes the verification, it will be stored in the temporary storage area of the energy storage device;
[0008] Perform an overall verification on all the upgrade firmware data in the temporary storage area. If all the upgrade firmware data in the temporary storage area passes the overall verification, then sequentially copy the multiple packets of upgrade firmware data in the temporary storage area to the program operation area of the energy storage device; each packet of upgrade firmware data in the program operation area is copied when the previous copied packet of upgrade firmware data passes the verification;
[0009] Perform an overall verification on all the upgraded firmware data in the program running area. If the overall verification of all the upgraded firmware data in the program running area passes, it is determined that the system upgrade of the energy storage device is successful.
[0010] In one embodiment, the method further includes:
[0011] If the verification of any received packet of upgraded firmware data fails, a retransmission request is sent back to the firmware supply server;
[0012] Receive the upgraded firmware data sent by the firmware supply server based on the retransmission request;
[0013] When the verification of the upgraded firmware data sent based on the retransmission request passes, store the upgraded firmware data sent based on the retransmission request in the temporary storage area, and receive the next packet of upgraded firmware data sent by the firmware supply server.
[0014] In one embodiment, the method further includes:
[0015] When the verification of the upgraded firmware data sent based on the retransmission request fails, continue to execute the step of sending a retransmission request back to the firmware supply server;
[0016] If the verification of the upgraded firmware data sent based on the retransmission request fails within the repeated transmission times, output a first prompt message; the first prompt message is used to prompt that there is an abnormal verification during the process of receiving the upgraded firmware data by the energy storage device.
[0017] In one embodiment, performing an overall verification on all the upgraded firmware data in the temporary storage area includes:
[0018] Verify the integrity of all the upgraded firmware data in the temporary storage area;
[0019] When the integrity verification of all the upgraded firmware data in the temporary storage area passes, verify the adaptability of the binary file messages in all the upgraded firmware data;
[0020] If the adaptability verification passes, it is determined that the overall verification of all the upgraded firmware data in the temporary storage area passes.
[0021] In one embodiment, the method further includes:
[0022] When the integrity verification of all the upgraded firmware data in the temporary storage area fails, output a second prompt message; the second prompt message is used to prompt that there is an abnormal integrity verification of all the upgraded firmware data in the temporary storage area by the energy storage device;
[0023] When the adaptability check fails, output a third prompt message; the third prompt message is used to prompt that the adaptability check of all the upgraded firmware data in the temporary storage area by the energy storage device is abnormal.
[0024] In one embodiment, the method further includes:
[0025] If the check of any package of upgraded firmware data in the program running area fails, copy the upgraded firmware data from the temporary storage area to the program running area again;
[0026] If the check of the upgraded firmware data in the program running area passes within the first repeated copy count, copy the next package of upgraded firmware data from the temporary storage area to the program running area;
[0027] If the checks of all the upgraded firmware data in the program running area fail within the first repeated copy count, output a fourth prompt message; the fourth prompt message is used to prompt that the check of the upgraded firmware data in the program running area by the energy storage device is abnormal.
[0028] In one embodiment, the method further includes:
[0029] If the overall check of all the upgraded firmware data in the program running area fails, repeatedly execute the step of copying multiple packages of upgraded firmware data in the temporary storage area to the program running area of the energy storage device in sequence;
[0030] If the check of each package of upgraded firmware data in the program running area passes within the second repeated copy count, and the overall check of all the upgraded firmware data in the program running area passes, determine that the system upgrade of the energy storage device is successful.
[0031] In one embodiment, the method further includes:
[0032] When the program legality check in the program running area passes after the energy storage device is powered on, receive the handshake command sent by the firmware supply server;
[0033] Check the firmware identification information carried in the handshake command;
[0034] If the firmware identification information carried in the handshake command passes the check, determine that the handshake is successful; if the firmware identification information carried in the handshake command fails the check, output a fifth prompt message; the fifth prompt message is used to prompt that the handshake between the energy storage device and the firmware supply service fails.
[0035] In one embodiment, the method further includes:
[0036] When the program legality check in the program running area fails after the energy storage device is powered on, copy the program files in the program emergency area of the energy storage device to the program running area in sequence;
[0037] If the copy is completed, perform the step of receiving the handshake command sent by the firmware supply server.
[0038] In a second aspect, the present application further provides a system upgrade device for an energy storage device, including:
[0039] A first receiving module, configured to receive multiple packets of upgraded firmware data sequentially sent by the firmware supply server when the energy storage device successfully shakes hands with the firmware supply server; wherein, each packet of upgraded firmware data is received when the previous packet of upgraded firmware data passes the verification, and after each packet of upgraded firmware data passes the verification, it is stored in the temporary storage area of the energy storage device;
[0040] A processing module, configured to perform an overall verification on all the upgraded firmware data in the temporary storage area. If all the upgraded firmware data in the temporary storage area passes the overall verification, sequentially copy the multiple packets of upgraded firmware data in the temporary storage area to the program running area of the energy storage device; each packet of upgraded firmware data in the program running area is copied when the previous copied packet of upgraded firmware data passes the verification;
[0041] A verification module, configured to perform an overall verification on all the upgraded firmware data in the program running area. If all the upgraded firmware data in the program running area passes the overall verification, determine that the system upgrade of the energy storage device is successful.
[0042] The system upgrade method and device for the above energy storage device receive multiple packets of upgraded firmware data sequentially sent by a firmware supply server when the handshake between the energy storage device and the firmware supply server is successful. Among them, each packet of upgraded firmware data is received when the previous packet of upgraded firmware data passes the verification, and after each packet of upgraded firmware data passes the verification, it will be stored in the temporary storage area of the energy storage device. Overall verification is performed on all the upgraded firmware data in the temporary storage area. If all the upgraded firmware data in the temporary storage area passes the overall verification, the multiple packets of upgraded firmware data in the temporary storage area will be sequentially copied to the program running area of the energy storage device. Each packet of upgraded firmware data in the program running area is copied when the previous copied packet of upgraded firmware data passes the verification. Overall verification is performed on all the upgraded firmware data in the program running area. If all the upgraded firmware data in the program running area passes the overall verification, it is determined that the system upgrade of the energy storage device is successful. This method performs verification at any stage of the system upgrade. Specifically, each packet of upgraded firmware data is received only when the previous packet of upgraded firmware data passes the verification, and is stored in the temporary storage area only after each packet of upgraded firmware data passes the verification. Also, each packet of upgraded firmware data in the program running area is copied only when the previous copied packet of upgraded firmware data passes the verification. This greatly ensures the accuracy of each packet of upgraded firmware data received and copied, and avoids subsequent upgrade failures caused by receiving incorrect data. In addition, whether it is the completion stage of receiving the upgraded firmware data or the completion stage of copying the upgraded firmware data, overall verification is also required for all the upgraded firmware data stored in the temporary storage area and all the upgraded firmware data copied in the program running area, further ensuring the security of the data during the upgrade process and reducing the instability of the overall system upgrade process due to some incorrect data. That is to say, by combining overall verification and individual data verification, all stages of the upgrade process can be fully covered, ensuring the normal operation of the upgrade process, thus ensuring the normal use of the energy storage device, and avoiding the misinstallation of firmware applicable to other models on the energy storage device due to failure to recognize incorrect versions. Description of the Drawings
[0043] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0044] Figure 1 It is an application environment diagram of the system upgrade method for an energy storage device in an embodiment;
[0045] Figure 2Schematic diagram of the internal area division of the Flash of a single-chip microcomputer chip in an embodiment;
[0046] Figure 3 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0047] Figure 4 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0048] Figure 5 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0049] Figure 6 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0050] Figure 7 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0051] Figure 8 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0052] Figure 9 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0053] Figure 10 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0054] Figure 11 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0055] Figure 12 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0056] Figure 13 Flow schematic diagram of the system upgrade method of an energy storage device in an embodiment;
[0057] Figure 14 Block diagram of the structure of the system upgrade device of an energy storage device in an embodiment. Specific embodiments
[0058] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the following further details the present application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] Before introducing the technical solutions of the present application in detail, a brief description of the background technology of the present application is given first.
[0060] During the production and sales process of energy storage devices, due to changes in the product requirements of energy storage devices or the discovery of software design defects in energy storage device products, maintenance of energy storage devices is required.
[0061] Taking the program upgrade process of energy storage devices as an example, if OTA technology is not added to the energy storage device and maintenance personnel need to visit the site for maintenance when the energy storage device needs to be iterated, it is time-consuming and laborious, and it is even more likely that the device needs to be disassembled or even damaged. If OTA technology is added to the energy storage device, the energy storage devices that have been produced or sold can be simply and conveniently upgraded and iterated through OTA technology. In short, OTA technology provides a convenient and efficient way to upgrade the program of energy storage devices, reducing the maintenance cost.
[0062] Over The Air (OTA) technology is a technology that remotely manages the data of mobile terminal devices through the air interface of mobile communication and can also provide a new service download function for mobility. To implement the OTA function, at least two devices are required, namely a server and a client. The server is connected to the client through serial port, CAN, WiFi or Bluetooth, etc. The firmware file to be downloaded is stored in the client, and commands and firmware are sent to the server through the file transfer protocol. For example, the server can be a firmware supply server, and the client can be an energy storage device.
[0063] In related technologies, during the OTA upgrade process, in order to prevent the energy storage device products from being maliciously attacked from the outside, data being stolen, and malicious code being implanted, etc., it is often necessary to use an encryption algorithm to encrypt the upgraded firmware.
[0064] However, in some cases, the same encryption algorithm is applicable to multiple different versions of firmware. Once the wrong firmware version is uploaded during the upgrade process, the encryption algorithm cannot identify the wrong version either, resulting in the possibility of accidentally installing the firmware applicable to other models on the energy storage device, which may further cause abnormal operation of the energy storage device and affect the normal use and performance of the energy storage device. Abnormal situations or upgrade failures may occur during the upgrade process through OTA technology, resulting in the risk of "bricking" of the energy storage device. In addition, most encryption algorithms are relatively complex and occupy a large amount of memory of the energy storage device. If the memory of the energy storage device is small, there will be greater limitations.
[0065] In view of the above problems, the present application provides a system upgrade method and device for energy storage devices, which can identify wrong versions through multiple verification processes during the upgrade process, avoid installing the firmware applicable to other models on the energy storage device, and ensure that the energy storage device can be normally upgraded. At the same time, before the upgrade, this method can perform encryption processing through a relatively simple algorithm, which can reduce the memory occupation of the energy storage device.
[0066] Certainly, the technical solutions provided in the embodiments of the present application are not limited to only solving the above problems, and there are other technical effects. For specific details, please refer to the following embodiments. Next, the technical solutions of the present application will be introduced in detail.
[0067] The system upgrade method for the energy storage device provided in the embodiments of the present application can be applied to an application environment as Figure 1 shown. This application environment includes an energy storage device 101 and a firmware supply server 102. The energy storage device 101 includes a processor. When the firmware supply server 102 successfully shakes hands with the energy storage device 101, it can send upgrade firmware data to the energy storage device 101. The processor in the energy storage device 101 can perform multiple verifications during the reception process and copy process of the upgrade firmware data to avoid installing the firmware of other models on the energy storage device 101 and ensure the normal operation of the energy storage device. Among them, the processor can be, but is not limited to, a pulse width modulation (PWM) control chip, a control integrated circuit (IC), a voltage reference source, a phase locked loop (PLL) control chip, a current detection chip, a metal-oxide-semiconductor field-effect transistor (MOSFET) driver chip, etc.
[0068] Taking the processor in the above energy storage system 101 as a single-chip microcomputer chip Flash as an example, Figure 2 Fig. shows a schematic diagram of the internal area division of the single-chip microcomputer chip Flash. It can be seen from the figure that the single-chip microcomputer chip Flash includes five areas, namely the Boot area, the OTA flag area, the software application (APP) running area, the APP receiving area, and the APP emergency area. Among them, the Boot area is used to save the boot program and cannot be erased; the OTA flag area is used to save the status flag during OTA upgrade; the APP running area is used to save the business logic code, and this area is the core running area for executing business logic; the APP receiving area is used to save the temporary files during OTA, and when the file verification passes, it is copied to the APP running area; the APP emergency area is programmed before leaving the factory and will never be changed. It is used for the emergency program after the upgrade fails and can ensure that the single-chip microcomputer will not become a brick.
[0069] In the following embodiment description, the APP receiving area is represented by the temporary storage area, the program running area is the APP running area, and the program emergency area is the APP emergency area for description.
[0070] In an exemplary embodiment, as Figure 3As shown, a system upgrade method for an energy storage device is provided. Taking the processor of the energy storage device to which this method is applied as an example in Figure 1 , the method includes the following steps 101 to 102. Among them: Figure 1 When the handshake between the energy storage device and the firmware supply server is successful, receive multiple packets of upgraded firmware data sequentially sent by the firmware supply server. Among them, each packet of upgraded firmware data is received when the previous packet of upgraded firmware data passes the verification, and after each packet of upgraded firmware data passes the verification, it will be stored in the temporary storage area of the energy storage device.
[0071] The OTA upgrade process mainly includes a handshake phase, an upgraded firmware data transmission phase, and an upgraded firmware data copy phase.
[0072] For the handshake phase, the handshake process between the energy storage device and the firmware supply server is a key step in the system upgrade. When the energy storage device needs to upgrade the system, the firmware supply server can actively upgrade the system in the energy storage device when a preset condition is met (for example, the usage time of the system in the energy storage device reaches a preset duration, the old system in the energy storage device is phased out). In this case, the firmware supply server can send a handshake command to the processor in the energy storage device. After receiving the handshake command, the processor in the energy storage device verifies the information carried in the handshake command. If the verification is successful, the processor in the energy storage device sends a handshake response signal to the firmware supply server. At this time, the handshake between the energy storage device and the firmware supply server is successful. If the verification fails, the processor in the energy storage device sends a reject handshake signal to the firmware supply server. At this time, the handshake between the energy storage device and the firmware supply server fails.
[0073] In the case where the handshake between the energy storage device and the firmware supply server is successful, it comes to the upgraded firmware data transmission phase, that is, the firmware supply server sends upgraded firmware data to the processor in the energy storage device. In this phase, in order to ensure the correctness of the upgraded firmware data transmission, the upgraded firmware data will be split into multiple packets of upgraded firmware data. For example, the data of each packet of upgraded firmware data can be set to 1024 bytes. Then, according to the order of the multiple packets of upgraded firmware data, the upgraded firmware data is sent to the processor in the energy storage device in sequence.
[0074] In the embodiment of the present application, every time the processor in the energy storage device receives a packet of upgraded firmware data sent by the firmware supply server, it needs to verify the upgraded firmware data. If the verification is successful, the upgraded firmware data will be stored in the temporary storage area of the energy storage device, that is
[0075] Figure 2 The APP receiving area in [device name]. And continue to receive the next package of upgraded firmware data sent by the firmware supply server, and continue to verify the next package of upgraded firmware data until the verification of all upgraded firmware data is successful. That is to say, each package of upgraded firmware data is received when the previous package of upgraded firmware data passes the verification.
[0076] For the specific verification process, the processor in the energy storage device can obtain the serial number of the upgraded firmware data and determine whether the serial number is consecutive with the serial number of the previous package of upgraded firmware data. Also, the processor in the energy storage device can obtain the data volume of the upgraded firmware data and determine whether the data volume meets the preset data volume. In addition, the processor in the energy storage device can calculate the hash value of the upgraded firmware data and compare the calculated hash value with the hash value provided by the firmware supply server to determine whether the upgraded firmware data can pass the verification. Of course, CRC16 or other methods can also be used for verification. The processor in the energy storage device can select one of the methods for verification, or can verify through all of the above methods. If each method passes the verification, it means that the upgraded firmware data passes the verification.
[0077] S102, perform an overall verification on all the upgraded firmware data in the temporary storage area. If all the upgraded firmware data in the temporary storage area passes the overall verification, then copy the multiple packages of upgraded firmware data in the temporary storage area to the program running area of the energy storage device in sequence; each package of upgraded firmware data in the program running area is copied when the previous copied package of upgraded firmware data passes the verification.
[0078] In the embodiment of the present application, when each received package of upgraded firmware data passes the verification, all the upgraded firmware data is stored in the temporary storage area. At this time, an overall verification can be performed on all the upgraded firmware data in the temporary storage area. For example, the overall verification can be the integrity verification of the upgraded firmware data, the compatibility verification of the upgraded firmware data with the energy storage device, etc. If both the integrity verification and the compatibility verification pass, it means that the overall verification of all the upgraded firmware data in the temporary storage area passes. If any one of the integrity verification and the compatibility verification fails, it means that the overall verification of all the upgraded firmware data in the temporary storage area fails.
[0079] Based on the overall verification of all the upgraded firmware data in the temporary storage area passing, the stage of copying the upgraded firmware data begins. Similarly, in this stage, to ensure the correctness of the process of copying the upgraded firmware data, all the upgraded firmware data in the temporary storage area can be split to obtain multiple packets of upgraded firmware data. For example, each packet of the split upgraded firmware data can be 24 bytes. Then, each packet of the upgraded firmware data is successively copied from the temporary storage area to the program running area. During the copying process, when each packet of the upgraded firmware program is added to the program running area, it is necessary to verify the added upgraded firmware program. Only when the verification passes, can the next packet of the upgraded firmware program be continuously copied to the program running area.
[0080] Specifically, during the verification process, the processor in the energy storage device can read back and compare the upgraded firmware program in the program running area, that is, compare the upgraded firmware data copied to the program running area with the upgraded firmware data previously stored in the temporary storage area. Based on the comparison result, it is determined whether the copied upgraded firmware data passes the verification. Similarly, the processor in the energy storage device can also verify the integrity, sequentiality, adaptability, etc. of the copied upgraded firmware program. The embodiments of the present application do not limit the specific verification method.
[0081] S103, perform an overall verification on all the upgraded firmware data in the program running area. If the overall verification of all the upgraded firmware data in the program running area passes, it is determined that the system upgrade of the energy storage device is successful.
[0082] In the embodiments of the present application, when all the upgraded firmware data in the temporary storage area are copied to the program running area, it indicates that the individual verification results of each packet of the upgraded firmware data all pass the verification. To further ensure the accuracy of the upgrade process, it is also necessary to perform an overall verification on all the upgraded firmware data in the program running area. The overall verification here can be the same as the overall verification method for all the upgraded firmware data in the temporary storage area.
[0083] When the overall verification of all the upgraded firmware data in the program running area passes, perform the subsequent operations of the system upgrade to complete the system upgrade of the energy storage device. For example, the subsequent operations can be processes such as restarting the energy storage device, updating and installing application programs, and checking and optimizing.
[0084] It should be emphasized that the above embodiments are all described under the condition that the verification is passed during the program upgrade. Assuming that any one of the verification processes of the firmware upgrade data transmission, the overall verification, and the firmware upgrade data copy fails, or fails after the verification of the repeated transmission times, then the processor in the energy storage device will output a prompt message to the firmware supply server. The content of the prompt message may include the upgrade failure and the stage where the upgrade fails. For example, the stage where the upgrade fails may be any one of the failure of the firmware upgrade data transmission stage, the failure of the verification of all the firmware upgrade data in the temporary storage area, the failure of the verification during the firmware upgrade data transmission process, and the failure of the verification of all the firmware upgrade data in the program operation area.
[0085] In the system upgrade method of the above energy storage device, when the handshake between the energy storage device and the firmware supply server is successful, multiple packets of firmware upgrade data sent by the firmware supply server in sequence are received; among them, each packet of firmware upgrade data is received when the previous packet of firmware upgrade data passes the verification, and after each packet of firmware upgrade data passes the verification, it is stored in the temporary storage area of the energy storage device; the overall verification of all the firmware upgrade data in the temporary storage area is performed. If all the firmware upgrade data in the temporary storage area passes the overall verification, the multiple packets of firmware upgrade data in the temporary storage area are sequentially copied to the program operation area of the energy storage device; each packet of firmware upgrade data in the program operation area is copied when the previous copied packet of firmware upgrade data passes the verification; the overall verification of all the firmware upgrade data in the program operation area is performed. If all the firmware upgrade data in the program operation area passes the overall verification, it is determined that the system upgrade of the energy storage device is successful. This method performs verification at any stage of the system upgrade. Specifically, each packet of firmware upgrade data is received only when the previous packet of firmware upgrade data passes the verification, and is stored in the temporary storage area only after each packet of firmware upgrade data passes the verification. Moreover, each packet of firmware upgrade data in the program operation area is also copied only when the previous copied packet of firmware upgrade data passes the verification. This greatly ensures the accuracy of each packet of firmware upgrade data received and copied, and avoids subsequent upgrade failures caused by receiving incorrect data. In addition, whether it is the completion stage of the firmware upgrade data reception or the completion stage of the firmware upgrade data copy, it is also necessary to perform an overall verification on all the firmware upgrade data stored in the temporary storage area and all the firmware upgrade data copied in the program operation area, further ensuring the security of the data during the upgrade process and reducing the instability of the overall system upgrade process due to partial data errors. That is to say, by combining the overall verification and the individual data verification, all stages of the upgrade process can be completely covered, ensuring the normal operation of the upgrade process, thereby ensuring the normal use of the energy storage device and avoiding misinstalling the firmware applicable to other models on the energy storage device due to failure to recognize the incorrect version.
[0086] For the process of sending upgraded firmware data, if the verification of any received packet of upgraded firmware data fails, there may be a problem during the sending process of this packet of upgraded firmware data. In response to this situation, the firmware supply server can also be requested to resend the upgraded firmware data. Then, in one embodiment, as Figure 4 , the method further includes:
[0087] S201, if the verification of any received packet of upgraded firmware data fails, then feedback a resend request to the firmware supply server.
[0088] Wherein, the resend request indicates that the firmware supply server needs to resend the upgraded firmware data to the processor in the energy storage device.
[0089] In the embodiments of the present application, during the process of the firmware supply server sending multiple packets of upgraded firmware data to the processor of the energy storage device, the processor in the energy storage device will immediately verify each received packet of upgraded firmware data. Then, for any received packet of upgraded firmware data, assuming that the verification result of this upgraded firmware data fails, then the processor will feedback a resend request to the firmware supply server. It should be noted that the resend request here is only for the resend request of this packet of upgraded firmware data, not a repeated request for all upgraded firmware data.
[0090] S202, receive the upgraded firmware data sent by the firmware supply server based on the resend request.
[0091] In the embodiments of the present application, after receiving the resend request, the firmware supply server will pause the sending of the next packet of upgraded firmware data and resend the upgraded firmware data that failed the verification. At this time, the processor in the energy storage device can receive the upgraded firmware data sent by the firmware supply server. At the same time, during the waiting period for the resend data, the processor will maintain the current state of the temporary storage area to ensure that the upgraded firmware data that has passed the verification is not disturbed or lost.
[0092] S203, in the case where the upgraded firmware data sent based on the resend request passes the verification, store the upgraded firmware data sent based on the resend request in the temporary storage area, and receive the next packet of upgraded firmware data sent by the firmware supply server.
[0093] In an embodiment of the present application, after receiving the upgraded firmware data sent by the firmware supply server based on the retransmission request, the processor in the energy storage device needs to continue to verify the upgraded firmware data sent based on the retransmission request. The verification here is the same as that of any received upgraded firmware data. If the upgraded firmware data sent based on the retransmission request passes the verification, the upgraded firmware data sent based on the retransmission request is stored in the temporary storage area. If the firmware supply server does not receive the retransmission request within the preset duration, it is determined that the sent upgraded firmware data passes the verification, and then the next packet of upgraded firmware data is sent to the processor of the energy storage device.
[0094] For the retransmitted upgraded firmware data, its verification process may pass or may not pass. Then, in one embodiment, in the case where the verification fails, the above method further includes:
[0095] S204, in the case where the upgraded firmware data sent based on the retransmission request fails to pass the verification, continue to execute the step of feedback the retransmission request to the firmware supply server.
[0096] After the received upgraded firmware data fails the verification, it needs to be resent. If it still fails the verification after multiple resends, it means that the upgraded firmware data itself cannot be adapted to the energy storage device. In this case, the processor of the energy storage device can set the number of resends with the firmware supply server. If the verification passes within the number of resends, the next packet of upgraded firmware data is sent; if the verification fails within the number of resends, an upgrade failure message is output.
[0097] Then, in the case where the upgraded firmware data sent based on the retransmission request fails to pass the verification, that is, the number of resends is one and the verification fails, at this time, the processor will feedback the retransmission request to the firmware supply server again. Among them, the number of transmissions carried in the first retransmission request and the second retransmission request is completely different.
[0098] S205, if the upgraded firmware data sent based on the retransmission request fails to pass the verification within the number of resends, output a first prompt message; the first prompt message is used to prompt that there is an abnormality in the verification during the process of the energy storage device receiving the upgraded firmware data.
[0099] After the processor of the energy storage device receives the upgraded firmware data sent based on the second retransmission request, it verifies the upgraded firmware data sent based on the second retransmission request. If the verification passes, the upgraded firmware data sent based on the second retransmission request is stored in the temporary storage area, and the next packet of upgraded firmware data sent by the firmware supply server is received.
[0100] If the verification fails and the number of resend requests has not reached the preset number of repeated transmissions, continue to feedback the resend request to the firmware supply server. If the number of resend requests has reached the preset number of repeated transmissions, a first prompt message can be output to both the firmware supply server and the user of the energy storage device, indicating that there is an anomaly in the verification during the process of receiving the upgraded firmware data by the energy storage device. For example, the processor can output the first prompt message to the user of the energy storage device in the form of text, voice, etc. At the same time, the first prompt message is sent to the firmware supply server by means of a transmission protocol, email, etc.
[0101] Exemplarily, assume that the preset number of repeated transmissions is 3 times. For any package of upgraded firmware data, if the upgraded firmware data sent by the firmware supply server, the upgraded firmware data resent for the first time, the upgraded firmware data resent for the second time, and the upgraded firmware data resent for the third time all fail the verification, it is determined that the upgrade fails and the first prompt message is output. If any one of the upgraded firmware data resent for the first time, the upgraded firmware data resent for the second time, and the upgraded firmware data resent for the third time passes the verification, the upgraded firmware data sent based on the resend request is stored in the temporary storage area, and the next package of upgraded firmware data sent by the firmware supply server is received.
[0102] In the above system upgrade method for the energy storage device, if the verification of any package of received upgraded firmware data fails, a resend request is fed back to the firmware supply server; the upgraded firmware data sent by the firmware supply server based on the resend request is received; when the upgraded firmware data sent based on the resend request passes the verification, the upgraded firmware data sent based on the resend request is stored in the temporary storage area, and the next package of upgraded firmware data sent by the firmware supply server is received; when the upgraded firmware data sent based on the resend request fails the verification, the step of feeding back the resend request to the firmware supply server is continued; if the verification of the upgraded firmware data sent based on the resend request fails within the number of repeated transmissions, the first prompt message is output; the first prompt message is used to indicate that there is an anomaly in the verification during the process of receiving the upgraded firmware data by the energy storage device. This method immediately feeds back the resend request when the received upgraded firmware data fails the verification, ensuring the acquisition of correct upgraded firmware data, avoiding the failure of the energy storage device upgrade or the occurrence of operation failures caused by incorrect data, and greatly improving the accuracy and reliability of data transmission. At the same time, by setting the number of repeated transmissions, not only can accidental data transmission failures be avoided, but from another perspective, the repeated execution of the resend process can also be avoided, improving the efficiency of system upgrade. In addition, by outputting a prompt message carrying the abnormal stage, the abnormal situation and abnormal stage of the upgrade process can be timely informed to the user, facilitating later troubleshooting and repair.
[0103] After the transmission process of the upgraded firmware data is completed, it is also necessary to perform an overall verification on all the upgraded firmware data in the temporary storage area. Next, a detailed introduction to the process of overall verification of all the upgraded firmware data in the temporary storage area will be given through an embodiment, as Figure 5 shown. The content includes the following steps:
[0104] S301, verify the integrity of all the upgraded firmware data in the temporary storage area.
[0105] When the firmware supply server has sent all the multi-pack upgraded firmware data and has not received a prompt message or a retransmission request feedback from the processor within a preset time period, it means that the individual verification processes of all the multi-pack upgraded firmware data have passed. In this case, the firmware supply server will send a data end transmission instruction to the processor. After receiving this data end transmission instruction, the processor starts to perform an overall verification on all the upgraded firmware data in the temporary storage area.
[0106] The overall verification process can include the integrity verification of the upgraded firmware data and the compatibility verification of the upgraded firmware data with the energy storage device. In the actual verification process, it is necessary to first perform the integrity verification, and after the integrity verification passes, then perform the compatibility verification.
[0107] Then, for the integrity verification of the upgraded firmware data, the processor can verify the multi-pack upgraded firmware data in the temporary storage area through an integrity verification method. Among them, the integrity verification method can be to determine whether the data volume of the multi-pack upgraded firmware data reaches the preset data volume, whether the number of the multi-pack upgraded firmware data is sufficient, etc. For example, the processor can use the CRC32 verification method for integrity verification.
[0108] S302, when the integrity verification of all the upgraded firmware data in the temporary storage area passes, verify the compatibility of the binary file messages in all the upgraded firmware data.
[0109] In the embodiment of the present application, when it is determined that the integrity verification of all the upgraded firmware data in the temporary storage area passes, the upgraded firmware data transmission process can be exited and the compatibility verification process can be entered.
[0110] In the process of compatibility verification, the processor can analyze all the upgraded firmware data in the temporary storage area, extract the binary file information of all the upgraded firmware data, determine whether the binary file information is correct, and verify whether the binary file is compatible with the energy storage device. If the binary file is correct and is compatible with the energy storage device, it is determined that the compatibility verification passes; if the binary file is incorrect and / or cannot be compatible with the energy storage device, it is determined that the compatibility verification fails.
[0111] S303. When the integrity check of all the upgraded firmware data in the temporary storage area fails, output a second prompt message; the second prompt message is used to prompt that the integrity check of all the upgraded firmware data in the temporary storage area of the energy storage device is abnormal.
[0112] When it is determined that the integrity check of all the upgraded firmware data in the temporary storage area passes, similarly, the processor of the energy storage device can simultaneously output a second prompt message to the firmware supply server and the user of the energy storage device, prompting that the integrity check of all the upgraded firmware data in the temporary storage area of the energy storage device is abnormal. For example, the processor can output the second prompt message to the user of the energy storage device in the form of text, voice, etc. At the same time, send the second prompt message to the firmware supply server through a transmission protocol, email, etc.
[0113] It should be emphasized that the difference between the second prompt message and the first prompt message is only the stage of abnormal prompt, and the prompt methods can be the same.
[0114] S304. If the adaptability check passes, it is determined that the overall check of all the upgraded firmware data in the temporary storage area passes.
[0115] In the embodiment of the present application, when it is determined that the adaptability check of all the upgraded firmware data in the temporary storage area passes, it means that all the upgraded firmware data in the temporary storage area not only adapts to the energy storage device, but also there is no abnormal situation during the data transmission process. Therefore, it can be directly determined that the overall check of all the upgraded firmware data in the temporary storage area passes.
[0116] S305. When the adaptability check fails, output a third prompt message; the third prompt message is used to prompt that the adaptability check of all the upgraded firmware data in the temporary storage area of the energy storage device is abnormal.
[0117] In the embodiment of the present application, when it is determined that the adaptability check of all the upgraded firmware data in the temporary storage area fails, it means that all the upgraded firmware data in the temporary storage area cannot adapt to the energy storage device. At this time, the processor needs to simultaneously output a third prompt message to the firmware supply server and the user of the energy storage device, prompting that the adaptability check of all the upgraded firmware data in the temporary storage area of the energy storage device is abnormal.
[0118] In the system upgrade method of the above energy storage device, the integrity of all the upgraded firmware data in the temporary storage area is verified; when the integrity verification of all the upgraded firmware data in the temporary storage area passes, the compatibility of the binary file messages in all the upgraded firmware data is verified; when the integrity verification of all the upgraded firmware data in the temporary storage area fails, a second prompt message is output; the second prompt message is used to prompt that the integrity verification of all the upgraded firmware data in the energy storage device in the temporary storage area is abnormal; if the compatibility verification passes, it is determined that the overall verification of all the upgraded firmware data in the temporary storage area passes; when the compatibility verification fails, a third prompt message is output; the third prompt message is used to prompt that the compatibility verification of all the upgraded firmware data in the energy storage device in the temporary storage area is abnormal. In the process of the overall verification, the integrity of all the upgraded firmware data in the temporary storage area is first verified to ensure that the data is not lost or damaged during transmission and storage. Only after the integrity verification passes, the next step of compatibility verification is carried out, with strict checks at each level to ensure that the finally used upgraded firmware data is complete and error-free, providing a solid data foundation for the system upgrade of the energy storage device. In addition, when the overall verification fails at different stages, different prompt messages can be used to distinguish the stage where the abnormality occurs, facilitating subsequent troubleshooting and repair.
[0119] After the overall verification of all the upgraded firmware data in the temporary storage area passes, the copy stage of the upgraded firmware data is entered next. In one embodiment, as Figure 6 shown, the specific content of the copy of the upgraded firmware data includes the following steps:
[0120] S401, if the verification of any package of the upgraded firmware data in the program running area fails, the upgraded firmware data is copied from the temporary storage area to the program running area again.
[0121] Similar to the transmission process of the upgraded firmware data, during the copy process of the upgraded firmware data, multiple packages of the upgraded firmware data are also copied from the temporary storage area to the program running area in sequence. For the copy process of any package of the upgraded firmware data, after the processor copies the upgraded firmware data in the temporary storage area to the program running area, it will read back and compare the copied upgraded firmware data in the program running area, and determine whether the upgraded firmware data passes the verification based on the comparison result.
[0122] If the comparison result shows that the upgraded firmware data passes the verification, the next package of the upgraded firmware data is continued to be copied from the temporary storage area to the program running area. If the comparison result shows that the upgraded firmware data fails the verification, the upgraded firmware data is copied again.
[0123] S402, if the verification of the upgraded firmware data in the program running area passes within the first repeated copy count, then copy the next packet of upgraded firmware data from the temporary storage area to the program running area.
[0124] To avoid the upgrade process staying at the copy process of a certain packet of upgraded firmware data all the time, the repeat copy count can be set. Within this first repeated copy count, if the verification of the copied upgraded firmware data passes, the copy of the next packet of upgraded firmware data can continue; if the verification of all the copied upgraded firmware data fails, it is determined that the copy process fails and a prompt message is output.
[0125] Based on this, within the first repeated copy count, if the verification of the upgraded firmware data in the program running area passes during any copy process, continue to copy the next packet of upgraded firmware data from the temporary storage area to the program running area. For example, the first repeated copy count can be 3 times, 5 times, etc.
[0126] S403, if the verification of all the upgraded firmware data in the program running area fails within the repeated send count, output a fourth prompt message; the fourth prompt message is used to prompt that the verification of the upgraded firmware data in the program running area of the energy storage device is abnormal.
[0127] In the embodiment of the present application, if the verification of the upgraded firmware data in the program running area fails during any copy process within the first repeated copy count, it indicates that an abnormal situation occurs during the system upgrade process. At this time, the processor needs to output a fourth prompt message to both the firmware supply server and the user of the energy storage device, indicating that the verification of the upgraded firmware data in the program running area of the energy storage device is abnormal.
[0128] In the above system upgrade method of the energy storage device, if the verification of any packet of upgraded firmware data in the program running area fails, copy the upgraded firmware data from the temporary storage area to the program running area again; if the verification of the upgraded firmware data in the program running area passes within the first repeated copy count, copy the next packet of upgraded firmware data from the temporary storage area to the program running area; if the verification of all the upgraded firmware data in the program running area fails within the first repeated copy count, output a fourth prompt message; the fourth prompt message is used to prompt that the verification of the upgraded firmware data in the program running area of the energy storage device is abnormal. When the verification of any packet of upgraded firmware data in the program running area fails, this method automatically copies the data from the temporary storage area again instead of interrupting the upgrade process. This enables the upgrade process to continue as much as possible, avoiding the failure of the entire upgrade task due to the verification problem of individual data packets, and greatly improving the probability of successful upgrade. In addition, if the verification fails within the first repeated copy count, the fourth prompt message can be used to distinguish the stage where the abnormality occurs, facilitating subsequent troubleshooting and repair.
[0129] The above embodiments introduce the details in the process of copying the upgraded firmware data. Then, after the copying is completed, it is also possible to perform an overall verification on all the upgraded firmware data copied in the program running area. In one embodiment, as Figure 7 shown, the overall verification process includes the following
[0130] S501, if the overall verification of all the upgraded firmware data in the program running area fails, then repeat the step of sequentially copying the multiple packets of upgraded firmware data in the temporary storage area to the program running area of the energy storage device.
[0131] In the embodiments of the present application, during the copying process, if each packet of upgraded firmware data in the program running area passes the individual verification, but when performing the overall verification on all the upgraded firmware data in the program running area, the verification result is unpassed. To avoid the failure of the entire upgrade task due to the verification problems of individual data packets, the above copying process can be repeated. Then, the processor can repeat the step of sequentially copying the multiple packets of upgraded firmware data in the temporary storage area to the program running area.
[0132] S502, if each packet of upgraded firmware data in the program running area passes the verification within the second repeated copying times, and the overall verification of all the upgraded firmware data in the program running area passes, then it is determined that the system upgrade of the energy storage device is successful.
[0133] During any copying process within the second repeated copying times, if each packet of upgraded firmware data in the program running area passes the individual verification and the overall verification of all the upgraded firmware data passes, then it can be determined that the system upgrade of the energy storage device is successful. At this time, the energy storage device can be restarted and the new system can be run.
[0134] Within the second repeated copying times, if each packet of upgraded firmware data in the program running area fails the individual verification, and / or the overall verification of all the upgraded firmware data fails, then it can be determined that the system upgrade of the energy storage device fails. At this time, a prompt message is output to the firmware supply server and the user again, and this prompt message is used to prompt that there is an abnormality in the process of copying the upgraded firmware data of the energy storage device.
[0135] It should be emphasized that the second repeated copying times refers to the number of repetitions of copying all the upgraded firmware data from the temporary storage area to the program running area, while the first repeated copying times is for one packet of upgraded firmware data. Their meanings are different. However, the set values of the first repeated copying times and the second repeated copying times can be the same or different. For example, the set values of the first repeated copying times and the second repeated copying times can both be 3 times, the first repeated copying times can also be 3 times, and the second repeated copying times can be 2 times.
[0136] In the system upgrade method of the above energy storage device, if the overall verification of all the upgrade firmware data in the program operation area fails, the step of sequentially copying multiple packets of upgrade firmware data in the temporary storage area to the program operation area of the energy storage device is repeatedly executed; within the second repeated copy count, if the verification of each packet of upgrade firmware data in the program operation area passes and the overall verification of all the upgrade firmware data in the program operation area passes, it is determined that the system upgrade of the energy storage device is successful. When the overall verification of all the upgrade firmware data in the program operation area fails, this method will repeatedly execute the copy step, giving multiple verification opportunities, which greatly improves the probability of successful upgrade.
[0137] The above embodiments all perform system upgrades on the basis of successful handshakes. Next, an embodiment is used to introduce the handshake process, as Figure 8 shown, and this handshake process includes the following steps:
[0138] S601, when the program legality verification in the program operation area passes after the energy storage device is powered on, receive the handshake command sent by the firmware supply server.
[0139] Regardless of whether the energy storage device needs to perform system updates, after the energy storage device is powered on, it is necessary to perform legality verification on the program in the program operation area to ensure the security of subsequent program operations or program upgrades. Then, after the energy storage device is powered on, the processor can perform legality verification on the program in the program operation area. When the verification is successful and the energy storage device needs to perform system updates, it receives the handshake command sent by the firmware supply server. The handshake command carries firmware identification information.
[0140] S602, verify the firmware identification information carried in the handshake command.
[0141] Among them, the firmware identification information may include information such as the upgrade firmware version, upgrade firmware type, and upgrade firmware size.
[0142] In the embodiment of the present application, when the handshake command is received, the processor can verify the firmware identification information carried in the handshake command to determine whether the firmware identification information is adapted to the energy storage device. If it is adapted to the energy storage device, it means that the verification of the firmware identification information passes; if it cannot be adapted to the energy storage device, it means that the verification of the firmware identification information fails.
[0143] S603, if the verification of the firmware identification information carried in the handshake command passes, it is determined that the handshake is successful; if the verification of the firmware identification information carried in the handshake command fails, output a fifth prompt message; the fifth prompt message is used to prompt that the handshake between the energy storage device and the firmware supply service fails.
[0144] In the embodiments of the present application, when the firmware identification information passes the verification, it indicates that the firmware identification information can be adapted to the energy storage device. At this time, it can be determined that the handshake between the energy storage device and the firmware supply server is successful. When the firmware identification information fails to pass the verification, it indicates that the firmware identification information cannot be adapted to the energy storage device. At this time, the handshake between the energy storage device and the firmware supply server fails, and a fifth prompt message can be output to prompt the users of the firmware supply server and the energy storage device that the energy storage device fails in the handshake stage.
[0145] In the above system upgrade method of the energy storage device, when the program legality verification in the program operation area is passed after the energy storage device is powered on, a handshake command sent by the firmware supply server is received; the firmware identification information carried in the handshake command is verified; if the firmware identification information carried in the handshake command passes the verification, it is determined that the handshake is successful; if the firmware identification information carried in the handshake command fails to pass the verification, a fifth prompt message is output; the fifth prompt message is used to prompt that the handshake between the energy storage device and the firmware supply service fails. Based on the legality verification, this method verifies the firmware identification information carried in the handshake command, and only determines that the handshake is successful when the verification passes. This can ensure that the upgraded firmware received by the energy storage device matches itself, and can also prevent the access of illegal devices or malicious commands, guaranteeing the security of the energy storage device during the upgrade process. In addition, after the handshake fails, it can be timely reminded through the fifth prompt message, which is convenient for subsequent troubleshooting and repair.
[0146] In a specific embodiment of the present application, as Figure 9 shown, the system upgrade method of the above energy storage device includes the following steps:
[0147] S701, when the program legality verification in the program operation area is passed after the energy storage device is powered on, receive the handshake command sent by the firmware supply server;
[0148] S702, verify the firmware identification information carried in the handshake command;
[0149] S703, if the firmware identification information carried in the handshake command passes the verification, determine that the handshake is successful, and receive multiple packets of upgrade firmware data sequentially sent by the firmware supply server;
[0150] S704, if the verification of any received packet of upgrade firmware data fails, feedback a retransmission request to the firmware supply server;
[0151] S705, receive the upgrade firmware data sent by the firmware supply server based on the retransmission request;
[0152] S706. When the upgrade firmware data sent based on the retransmission request passes the verification, store the upgrade firmware data sent based on the retransmission request in the temporary storage area, and receive the next packet of upgrade firmware data sent by the firmware supply server;
[0153] S707. When all the received upgrade firmware data passes the verification, perform an overall verification on all the upgrade firmware data in the temporary storage area;
[0154] S708. If all the upgrade firmware data in the temporary storage area passes the overall verification, copy the multiple packets of upgrade firmware data in the temporary storage area to the program running area of the energy storage device in sequence;
[0155] S709. If the verification of any packet of upgrade firmware data in the program running area fails, copy the upgrade firmware data from the temporary storage area to the program running area again;
[0156] S710. If the verification of the upgrade firmware data in the program running area passes within the first repeated copy count, copy the next packet of upgrade firmware data from the temporary storage area to the program running area;
[0157] S711. If the overall verification of all the upgrade firmware data copied in the program running area passes, perform an overall verification on all the upgrade firmware data in the program running area;
[0158] S712. If the overall verification of all the upgrade firmware data in the program running area passes, determine that the system upgrade of the energy storage device is successful.
[0159] Figure 10 It is a schematic diagram of the system upgrade method for the energy storage device. After the energy storage device is powered on, the processor runs in the BOOT area, and determines whether the program file in the program running area is legal. If it is not legal, copy the program files in the program emergency area of the energy storage device to the program running area in sequence. If it is legal, or after the program file copying is completed, jump to the program running area to run and wait for the handshake command. When the firmware supply server initiates the handshake command, on the premise of successful handshake, run the upgrade program, determine the upgrade is successful, and power on again. After the handshake fails or the upgrade fails, wait for the firmware supply server to initiate the handshake command again.
[0160] Figure 11Schematic diagram of a system upgrade method for an energy storage device. During the system upgrade process, first, it is determined whether the handshake command initiated by the firmware supply server is successful. If it fails, the handshake command is waited for continuously. If it is successful, the firmware transmission stage (i.e., the transmission of multi-pack upgrade firmware data) is entered. If the transmission is successful within 4 times (including 1 transmission and 3 retransmissions), the transmitted firmware processing stage (i.e., the overall verification of all upgrade firmware data in the temporary storage area) is entered. If the firmware is legal, the firmware copy stage is entered. If the copy is successful within 4 times (including 1 copy and 3 repeated copies), the copied firmware processing stage (i.e., the overall verification of all upgrade firmware data in the program running area) is entered. If the verification passes within 6 times (including 1 overall copy and 5 repeated overall copies), the upgrade is determined to be successful. If any stage in the upgrade process fails to pass the verification, the stage where the exception occurs is prompted.
[0161] After the legality verification of the program in the program running area, the verification result may also be failed. Based on this situation, the case where the verification fails is described through an embodiment, as Figure 12 shown, the method further includes:
[0162] S801, when the legality verification of the program in the program running area fails after the energy storage device is powered on, the program files in the program emergency area of the energy storage device are sequentially copied to the program running area.
[0163] In the embodiment of the present application, after the energy storage device is powered on and it is determined that the legality verification of the program in the program running area fails, it indicates that there is a problem with the program files in the program running area. Based on this, the program files stored in the program emergency area can be sequentially copied to the program running area. After each copy is completed, it can be determined whether the copy is completed by judging the memory size, order of the program files, etc. of the copied program files.
[0164] S802, if the copy is completed, the step of receiving the handshake command sent by the firmware supply server is executed.
[0165] In the embodiment of the present application, after all the program files in the program emergency area are copied to the program running area, the program files stored in the program running area are normal. In this case, the program files in the program running area can be directly run, or the program files in the program running area can be updated, that is, the handshake command sent by the firmware supply server is received.
[0166] In the system upgrade method of the above energy storage device, when the program legality check in the program operation area fails after the energy storage device is powered on, the program files in the program emergency area of the energy storage device are sequentially copied to the program operation area; if the copying is completed, the step of receiving the handshake command sent by the firmware supply server is executed. In the case where the legality check fails, this method sequentially copies the program files in the program emergency area to the program operation area, which can provide a backup executable program. In this way, even if there is a problem with the program file in the program operation area, the energy storage device still has the opportunity to restore its basic operating ability.
[0167] Figure 13 It is a schematic diagram of the system upgrade method of the energy storage device. After the energy storage device is powered on, it runs in the BOOT area and checks whether the files in the program operation area are legal. If it is determined that they are not legal, the program files in the program emergency area of the energy storage device are sequentially copied to the program operation area. After the copying is completed, it jumps to the program operation area to run, that is, runs the program files in the program operation area, or updates the program files in the program operation area.
[0168] It should be understood that although the steps in the flowcharts involved in the above embodiments are sequentially shown according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0169] Based on the same inventive concept, the embodiments of the present application also provide a system upgrade device for an energy storage device for implementing the system upgrade method of the energy storage device involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the system upgrade device for the energy storage device provided below can refer to the limitations on the system upgrade method of the energy storage device in the above text, and will not be repeated here.
[0170] In an exemplary embodiment, as Figure 14 shown, a system upgrade device for an energy storage device is provided, including: a first receiving module 11, a processing module 12, and a verification module 13, where:
[0171] The first receiving module 11 is configured to receive multiple packets of upgraded firmware data sequentially sent by the firmware supply server when the energy storage device successfully shakes hands with the firmware supply server; wherein, each packet of upgraded firmware data is received when the previous packet of upgraded firmware data passes the verification, and after each packet of upgraded firmware data passes the verification, it will be stored in the temporary storage area of the energy storage device;
[0172] The processing module 12 is configured to perform an overall verification on all the upgraded firmware data in the temporary storage area. If all the upgraded firmware data in the temporary storage area passes the overall verification, the multiple packets of upgraded firmware data in the temporary storage area will be sequentially copied to the program running area of the energy storage device; each packet of upgraded firmware data in the program running area is copied when the previously copied packet of upgraded firmware data passes the verification;
[0173] The verification module 13 is configured to perform an overall verification on all the upgraded firmware data in the program running area. If all the upgraded firmware data in the program running area passes the overall verification, it is determined that the system upgrade of the energy storage device is successful.
[0174] In an exemplary embodiment, the system upgrade device of the above energy storage device further includes: a feedback module, a repeated receiving module, and a storage module, wherein:
[0175] The feedback module is configured to, when the verification of any packet of upgraded firmware data received fails, feedback a retransmission request to the firmware supply server;
[0176] The repeated receiving module is configured to receive the upgraded firmware data sent by the firmware supply server based on the retransmission request;
[0177] The storage module is configured to, when the upgraded firmware data sent based on the retransmission request passes the verification, store the upgraded firmware data sent based on the retransmission request in the temporary storage area and receive the next packet of upgraded firmware data sent by the firmware supply server.
[0178] In an exemplary embodiment, the system upgrade device of the above energy storage device further includes: an execution module and a first output module, wherein:
[0179] The execution module is configured to, when the upgraded firmware data sent based on the retransmission request fails the verification, continue to execute the step of feedbacking a retransmission request to the firmware supply server;
[0180] The first output module is configured to, if the verification of the upgraded firmware data sent based on the retransmission request fails within the repeated transmission times, output a first prompt message; the first prompt message is used to prompt that there is an anomaly in the verification during the process of the energy storage device receiving the upgraded firmware data.
[0181] In an exemplary embodiment, the above processing module includes: an integrity verification unit, a compatibility verification unit, and a determination unit, where:
[0182] The integrity verification unit is configured to verify the integrity of all the upgrade firmware data in the temporary storage area;
[0183] The compatibility verification unit is configured to verify the compatibility of the binary file messages in all the upgrade firmware data when the integrity verification of all the upgrade firmware data in the temporary storage area passes;
[0184] The determination unit is configured to determine that the overall verification of all the upgrade firmware data in the temporary storage area passes when the compatibility verification passes.
[0185] In an exemplary embodiment, the above processing module further includes: a first output unit and a second output unit, where:
[0186] The first output unit is configured to output a second prompt message when the integrity verification of all the upgrade firmware data in the temporary storage area fails; the second prompt message is used to prompt that the integrity verification of all the upgrade firmware data in the temporary storage area of the energy storage device is abnormal;
[0187] The second output unit is configured to output a third prompt message when the compatibility verification fails; the third prompt message is used to prompt that the compatibility verification of all the upgrade firmware data in the temporary storage area of the energy storage device is abnormal.
[0188] In an exemplary embodiment, the system upgrade device of the above energy storage device further includes: a first copy module, a second copy module, and a second output module, where:
[0189] The first copy module is configured to re-copy the upgrade firmware data from the temporary storage area to the program running area when the verification of any package of upgrade firmware data in the program running area fails;
[0190] The second copy module is configured to copy the next package of upgrade firmware data from the temporary storage area to the program running area when the verification of the upgrade firmware data in the program running area passes within the first repeated copy times;
[0191] The second output module is configured to output a fourth prompt message when the verification of the upgrade firmware data in the program running area fails within the first repeated copy times; the fourth prompt message is used to prompt that the verification of the upgrade firmware data in the program running area of the energy storage device is abnormal.
[0192] In an exemplary embodiment, the system upgrade device of the above energy storage device further includes: a third copy module and a determination module, where:
[0193] A third copy module, configured to, when the overall verification of all the upgraded firmware data in the program running area fails, repeatedly execute the step of sequentially copying multiple packets of upgraded firmware data in the temporary storage area to the program running area of the energy storage device;
[0194] A determination module, configured to determine that the system upgrade of the energy storage device is successful when the verification of each packet of upgraded firmware data in the program running area passes within the second repeated copy count and the overall verification of all the upgraded firmware data in the program running area passes.
[0195] In an exemplary embodiment, the system upgrade device of the energy storage device further includes: a handshake command receiving module, an information verification module, and a third output module, where:
[0196] The handshake command receiving module is configured to receive a handshake command sent by the firmware supply server when the program legitimacy verification in the program running area passes after the energy storage device is powered on;
[0197] The information verification module is configured to verify the firmware identification information carried in the handshake command;
[0198] The third output module is configured to determine that the handshake is successful when the firmware identification information carried in the handshake command passes the verification; if the firmware identification information carried in the handshake command fails to pass the verification, output a fifth prompt message; the fifth prompt message is used to prompt that the handshake between the energy storage device and the firmware supply service fails.
[0199] Each module in the system upgrade device of the energy storage device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0200] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.
[0201] The above embodiments only represent several implementation manners of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the patent scope of this application. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several deformations and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of this application should be subject to the appended claims.
Claims
1. A system upgrade method for energy storage equipment, characterized in that: The method comprises: When the energy storage device and the firmware supply server have successfully handshaked, multiple packages of upgrade firmware data sent in sequence by the firmware supply server are received; wherein each package of upgrade firmware data is received when the previous package of upgrade firmware data has been verified, and each package of upgrade firmware data will be stored in the temporary storage area of the energy storage device after being verified; Performing an overall verification on all the upgraded firmware data in the temporary storage area, if all the upgraded firmware data in the temporary storage area pass the overall verification, then copying multiple packages of upgraded firmware data in the temporary storage area to the program running area of the energy storage device in sequence; each package of upgraded firmware data in the program running area is copied when the previously copied package of upgraded firmware data passes the verification; All upgraded firmware data in the program running area are checked as a whole. If all upgraded firmware data in the program running area pass the overall check, it is determined that the system upgrade of the energy storage device passes.
2. The method according to claim 1, characterized in that The method further comprises: If the verification of any received package of upgrade firmware data fails, a resend request is fed back to the firmware supply server; receiving the upgraded firmware data sent by the firmware provision server based on the resending request; When the upgrade firmware data sent based on the resending request passes the verification, the upgrade firmware data sent based on the resending request is stored in the temporary storage area, and the next package of upgrade firmware data sent by the firmware provisioning server is received.
3. The method according to claim 2, characterized in that The method further comprises: If the upgrade firmware data sent based on the resending request fails to pass the verification, continue to perform the step of feeding back the resending request to the firmware provisioning server; If the upgrade firmware data sent based on the retransmission request fails to pass the verification within the number of repeated transmissions, a first prompt message is output; the first prompt message is used to prompt the energy storage device that a verification abnormality occurs during the process of receiving the upgrade firmware data.
4. The method according to any one of claims 1 to 3, characterized in that: The overall verification of all the upgraded firmware data in the temporary storage area includes: Verifying the integrity of all upgraded firmware data in the temporary storage area; In the case where the integrity check of all the upgraded firmware data in the temporary storage area passes, verifying the adaptability of the binary file messages in all the upgraded firmware data; If the compatibility check passes, it is determined that all the upgrade firmware data in the temporary storage area have passed the overall check.
5. The method according to claim 4, characterized in that The method further comprises: If the integrity check of all the upgraded firmware data in the temporary storage area fails, a second prompt message is output; the second prompt message is used to prompt the energy storage device that the integrity check of all the upgraded firmware data in the temporary storage area is abnormal; In the case where the adaptability check fails, a third prompt message is output; the third prompt message is used to prompt the energy storage device that the adaptability check of all the upgraded firmware data in the temporary storage area is abnormal.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If any package of the upgrade firmware data in the program running area fails to pass the verification, the upgrade firmware data is copied from the temporary storage area to the program running area again; If the verification of the upgrade firmware data in the program running area is passed within the first number of repeated copies, the next package of upgrade firmware data is copied from the temporary storage area to the program running area; If the verification of the upgraded firmware data in the program running area fails within the first number of repeated copies, a fourth prompt message is output; the fourth prompt message is used to prompt that the verification of the upgraded firmware data in the program running area by the energy storage device is abnormal.
7. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the overall verification of all the upgraded firmware data in the program running area fails, repeating the step of sequentially copying the multiple packages of upgraded firmware data in the temporary storage area to the program running area of the energy storage device; If each package of upgraded firmware data in the program running area passes verification within the second number of repeated copies, and all upgraded firmware data in the program running area pass overall verification, it is determined that the system upgrade of the energy storage device passes.
8. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the program legality check in the program running area passes after the energy storage device is powered on, receiving a handshake instruction sent by the firmware supply server; Verifying the firmware identification information carried in the handshake instruction; If the firmware identification information carried in the handshake instruction passes the verification, the handshake is determined to be successful; if the firmware identification information carried in the handshake instruction fails the verification, a fifth prompt message is output; the fifth prompt message is used to prompt that the handshake between the energy storage device and the firmware supply service fails.
9. The method according to claim 8, characterized in that The method further comprises: When the program legality check in the program running area fails after the energy storage device is powered on, the program files in the program emergency area of the energy storage device are copied to the program running area in sequence; If the copying is completed, the step of receiving a handshake instruction sent by the firmware provisioning server is performed.
10. A system upgrade device for energy storage equipment, characterized in that: The device comprises: A first receiving module is used to receive multiple packages of upgrade firmware data sent in sequence by the firmware supply server when the energy storage device successfully shakes hands with the firmware supply server; wherein each package of upgrade firmware data is received when the previous package of upgrade firmware data is verified, and each package of upgrade firmware data is stored in the temporary storage area of the energy storage device after being verified; A processing module, configured to perform an overall verification on all the upgraded firmware data in the temporary storage area, and if all the upgraded firmware data in the temporary storage area pass the overall verification, copy multiple packages of upgraded firmware data in the temporary storage area to the program running area of the energy storage device in sequence; each package of upgraded firmware data in the program running area is copied when the previously copied package of upgraded firmware data passes the verification; The verification module is used to perform an overall verification on all the upgraded firmware data in the program running area. If all the upgraded firmware data in the program running area pass the overall verification, it is determined that the system upgrade of the energy storage device passes.