Software update method for master-slave devices of low-voltage stacked energy storage system
By inserting data X at the beginning of the firmware file and automatically determining the firmware type based on the identifier, the cumbersome operation and device crashes of master-slave software upgrades in lithium battery energy storage systems are solved, achieving an efficient and reliable software upgrade process.
Patent Information
- Application Number
- PCT/CN2024/115890
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-19
- Filing Date
- 2024-08-30
- Publication Date
- 2026-01-22
AI Technical Summary
In existing lithium battery energy storage systems, master-slave software upgrades require multiple connections to the communication harness, and the device may crash if the input upgrade command does not match the sent firmware.
Insert a data segment X at the beginning of the firmware file, connect to the host via serial port and enter the upgrade command. The host receives and stores the firmware data, determines the firmware type based on the identifier, and automatically completes the software upgrade between the master and slave, avoiding multiple connections and incorrect upgrades.
This eliminates the need for multiple connections to the communication harness, preventing device crashes and improving upgrade efficiency and reliability.
Smart Images

Figure CN2024115890_22012026_PF_FP_ABST
Abstract
Description
A method for upgrading master-slave software in a low-voltage energy storage stacked system Technical Field
[0001] This invention relates to the field of software upgrade technology, specifically a master-slave software upgrade method for a low-voltage energy storage stacked system. Background Technology
[0002] In lithium battery energy storage applications, there exists a stacked energy storage system with one master and multiple slave devices connected in parallel, where the master and slave devices run their own software programs. When software upgrades are required for the master and slave devices, there are typically two approaches: 1. Upgrading the master: The host computer connects to the master and sends a new firmware update via serial port after inputting the upgrade command. Similarly, when upgrading the slave, the host computer connects to the slave and sends a new firmware update via serial port after inputting the upgrade command. 2. The host computer connects to the master and sends a new firmware update via different upgrade commands to complete the master-slave upgrade. For example, when upgrading the master, inputting "update master" sends the new master firmware update; when upgrading the slave, inputting "update slave" sends the new slave firmware update. The master receives the new slave firmware and forwards it to upgrade the slave.
[0003] Upgrading using Method 1 requires reconnecting the communication cable and re-entering the upgrade command to resend the new firmware for each host or slave device upgrade. This method is inefficient from the perspectives of product development, production, and maintenance.
[0004] To upgrade using method 2, simply connect the communication cable to the host and enter the upgrade command twice. If the entered upgrade command does not match the sent firmware, the device being upgraded will crash due to the incorrect software program being flashed.
[0005] Summary of the Invention
[0006] To overcome the shortcomings of the prior art, this invention provides a master-slave software upgrade method for a low-voltage energy storage stacking system. This method avoids the tedious operation of repeatedly connecting communication harnesses and also avoids the situation where the input upgrade command does not match the sent firmware, which could lead to device crashes.
[0007] To achieve the above objectives, a master-slave software upgrade method for a low-voltage energy storage stacking system is designed, characterized by the following specific process:
[0008] S1. Before the host computer inputs the upgrade command, it needs to insert a piece of data X at the beginning of the firmware file of the host or slave device.
[0009] S2, the host computer connects to the host and enters the upgrade command "update". After the host computer displays the prompt to receive firmware, it sends the new firmware to the host or slave.
[0010] S3, the host computer stores the firmware data into the specific area of the external FLASH chip after receiving the data X transmitted by the host computer each time;
[0011] S4, when the host computer finishes transmitting the firmware and the host computer finishes receiving the firmware, the area of the external FLASH chip of the host computer storing the firmware includes the data X and the firmware data, that is, the content of the first x bytes of the area is the firmware not used for upgrading, and the content greater than the x bytes is the firmware used for upgrading;
[0012] S5, the host computer reads the content of the first x bytes from the area of the external FLASH chip storing the firmware and judges whether the content of the first x bytes has the master-slave identification;
[0013] S6, when the host computer detects that the identification is the master identification, it is determined that the received firmware is the upgrading firmware of the host computer itself, the upgrading flag is updated, and the process jumps to the Boot, and in the Boot, the valid content greater than the x bytes in the area of the external FLASH chip storing the firmware is written into the FLASH of the MCU to complete the upgrading;
[0014] S7, when the host computer detects that the identification is the slave identification, it is determined that the received firmware is the upgrading firmware of the slave, the slave firmware transmission flag is updated, and the slave is transmitted in turn through the CAN communication, and the firmware sent by the host computer to the slave includes all the valid content in the area of the external FLASH chip storing the firmware, that is, all the content received from the host computer;
[0015] S8, when the host computer sends the upgrading firmware of the slave to each slave, the host computer informs the slave to shut down and restart, in the process of starting up, the host computer wakes up each slave in turn, and the slave identifies the upgrading flag in the process of starting up, and then writes the valid content greater than the x bytes in the area of the external FLASH chip storing the firmware into the FLASH of the MCU of the slave to complete the upgrading; when the host computer wakes up all the slaves and completes the power-on, all the slaves complete the upgrading;
[0016] S9, when the host computer detects that the identification is neither the master identification nor the slave identification, it is considered that the received firmware is invalid, and the upgrading is exited.
[0017] In the step S1, the data length of the data X is 128, and the data X includes the master identification or the slave identification and the upgrading date and time.
[0018] In the step S1, the data inserted into the firmware of the host computer and the data inserted into the firmware of the slave have the same length, the same format and different content, the data inserted into the firmware of the host computer includes the master identification, and the data inserted into the firmware of the slave includes the slave identification.
[0019] The specific region of the external FLASH chip in the step S3 is fixed in position, and the memory of the region is larger than the memory size of the master and slave firmware.
[0020] In the step S6, the data X has 128 bytes of data, and if the data content of 17-32 bytes is E-BOX-48100S-M, it is the master identification.
[0021] In the step S7, the data X has 128 bytes of data, and if the data content of 17-32 bytes is E-BOX-48100S-S, it is the slave identification.
[0022] In the step S7, after each slave receives the data sent by the master, the data is stored in the storage firmware region of the external FLASH chip in the system of the slave, and after the reception is completed, the identification content of the first x bytes in the received content is first judged, and if it satisfies the slave identification, the upgrade flag is updated.
[0023] In the step S9, the data X has 128 bytes of data, and if the data content of 17-32 bytes is not matched with E-BOX-48100S-S and E-BOX-48100S-S, it is considered that the received firmware is invalid.
[0024] Compared with the prior art, the application provides a master-slave software upgrade method for an energy storage low-voltage stack system, which can avoid the cumbersome operation of connecting the communication harness multiple times, and avoid the situation that the input upgrade command does not correspond to the sent firmware, causing the device to crash.
[0025] The scheme of the application only needs to connect the upper computer to the master through the serial port, and only needs to input the upgrade command "update" and send the new firmware of the master or slave, that is, only needs to input the upgrade command once. When the new firmware does not correspond to the input upgrade command, the master directly exits the upgrade process after receiving the firmware, without upgrading the master or the slave. DETAILED DESCRIPTION
[0026] A master-slave software upgrade method for an energy storage low-voltage stack system, and the specific process is as follows:
[0027] S1, before the upper computer inputs the upgrade command, a data X is inserted at the beginning of the firmware file of the master or slave;
[0028] S2, the upper computer connects the master and inputs the upgrade command "update", and after the upper computer displays the prompt of the firmware to be received, the new firmware of the master or slave is sent;
[0029] S3, when the host receives the data X, the host stores the firmware data into the specific area of the external FLASH chip;
[0030] S4, when the host receives the firmware, the area of the external FLASH chip storing the firmware includes the data X and the firmware data, that is, the first x bytes of the area contain the non-upgrade firmware, and the content greater than x bytes contains the upgrade firmware.
[0031] S5, the host reads the content of the first x bytes of the area of the external FLASH chip storing the firmware, and judges whether the content of the first x bytes contains the master-slave identification.
[0032] S6, when the host detects that the identification is the master identification, it is determined that the received firmware is the upgrade firmware of the host itself, the upgrade flag is updated, and the process jumps to the Boot, in which the valid content greater than x bytes of the area of the external FLASH chip storing the firmware is written into the FLASH of the MCU to complete the upgrade.
[0033] S7, when the host detects that the identification is the slave identification, it is determined that the received firmware is the upgrade firmware of the slave, the slave firmware transmission flag is updated, and the slave is transmitted to the slave through the CAN communication in turn, the firmware sent by the host to the slave contains all the valid content of the area of the external FLASH chip storing the firmware, that is, all the content received from the host.
[0034] S8, when the host sends the slave upgrade firmware to each slave, the host notifies the slave to restart itself, in the process of starting up the host, each slave is woken up in turn, and the slave writes the valid content greater than x bytes of the area of the external FLASH chip storing the firmware into the FLASH of the MCU to complete the upgrade in the process of starting up.
[0035] S9, when the host detects that the identification is neither the master identification nor the slave identification, it is determined that the received firmware is invalid, and the upgrade is exited.
[0036] In step S1, the data length of the data X is 128, which includes the master identification or the slave identification, and the upgrade date and time.
[0037] In step S1, the data inserted into the host firmware and the data inserted into the slave firmware have the same length, the same format, and different content, the data inserted into the host firmware contains the master identification, and the data inserted into the slave firmware contains the slave identification.
[0038] In step S3, the external FLASH chip specific region has a fixed position and a memory size greater than the memory size of the master and slave firmware.
[0039] In step S6, the data X has 128 bytes of data, and if the data content of 17-32 bytes is E-BOX-48100S-M, it is the master identification.
[0040] In step S7, the data X has 128 bytes of data, and if the data content of 17-32 bytes is E-BOX-48100S-S, it is the slave identification.
[0041] In step S7, after each slave receives the data sent by the master, the data is stored in the storage firmware region of the external FLASH chip in the system of the slave. After receiving, the first judgment is made on the identification content of the first x bytes of the received content. If it meets the slave identification, the upgrade flag is updated.
[0042] In step S9, the data X has 128 bytes of data, and if the data content of 17-32 bytes does not match E-BOX-48100S-S and E-BOX-48100S-S, it is considered that the received firmware is invalid.
[0043] Case:
[0044] I. Master upgrade process:
[0045] 1. The host computer connects the master, and before upgrading, a data X is inserted at the beginning of the master firmware file. The data length is 128 bytes. Before data insertion, as shown in FIG. 1.
[0046] 2. After data insertion: “E-BOX-48100S-M” is the master identification, as shown in FIG. 2.
[0047] 3. The master firmware version before upgrading, as shown in FIG. 3.
[0048] 4. The host computer inputs the upgrade command “updata”, as shown in FIG. 4.
[0049] 5. Send the master new firmware, and during firmware transmission, as shown in FIG. 5.
[0050] 6. After receiving, the master identifies that the identification matches itself, and then restarts for firmware upgrade, as shown in FIG. 6.
[0051] 7. The master updates the firmware, and after updating is completed, it restarts, as shown in FIG. 7.
[0052] 8. After restarting after updating is completed, the software version number is checked, and the version number is changed after upgrading is completed, as shown in FIG. 8.
[0053] II. Slave upgrade process:
[0054] 1. The host computer connects to the master, and before upgrading, inserts a piece of data X at the beginning of the slave firmware file, with a data length of 128 bytes. Before data insertion, as shown in FIG. 9.
[0055] 2. After data insertion: E-BOX-48100S-S” is the master identification, as shown in FIG. 10.
[0056] 3. The slave firmware version before upgrading, as shown in FIG. 11.
[0057] 4. The host computer inputs the upgrade command “updata”, as shown in FIG. 12.
[0058] 5. Send the new firmware of the slave, and during firmware transmission, as shown in FIG. 13.
[0059] 6. After receiving, the master identifies that the identification matches the slave, and then sends the firmware to the slave in turn, as shown in FIG. 14.
[0060] 7. After the master sends the slave, it broadcasts the slave to shut down and restart itself, as shown in FIG. 15.
[0061] 8. After the master restarts, it wakes up the slave in turn, as shown in FIG. 16.
[0062] 9. After the slave is woken up, it upgrades the new firmware, as shown in FIG. 17.
[0063] 10. After the last slave is woken up and the upgrade is completed, the slave upgrade is completed, as shown in FIG. 18.
[0064] 11. Check the software version number of each slave, and the version number is changed after upgrading, as shown in FIG. 19.
[0065] III. Error upgrade process:
[0066] 1. The host computer connects to the master, and the host computer inputs the upgrade command “updata”, as shown in FIG. 20.
[0067] 2. When sending the wrong firmware, during firmware transmission, as shown in FIG. 21.
[0068] 3. After sending, the master detects that the identification does not match the master and slave, and exits the upgrade, as shown in FIG. 22.
[0069] 4. The host software is not updated, the version number does not change, and it returns to normal operation, as shown in FIG. 23.
Claims
1. A method for upgrading master-slave software in a low-voltage energy storage stacked system, characterized in that: The specific process is as follows: S1, before the host computer inputs the upgrade command, a piece of data X needs to be inserted at the beginning of the firmware file of the host computer or the slave computer; S2, the host computer connects the host computer and inputs the upgrade command of "update", and sends the new firmware of the host computer or the slave computer to the host computer after the host computer displays the prompt of the firmware to be received; S3, when the host computer receives the data X transmitted by the host computer each time, the firmware data is stored in a specific area of the external FLASH chip; S4, when the host computer transmits the firmware and the host computer receives the firmware, the area of the external FLASH chip for storing the firmware includes the data X and the firmware data, that is, the content of the first x bytes of the area is the firmware not used for upgrading, and the content greater than x bytes is the firmware used for upgrading; S5, the host computer reads the content of the first x bytes in the area of the external FLASH chip for storing the firmware, and judges whether the content of the first x bytes includes the host computer identifier or the slave computer identifier; S6, when the host computer detects that the identifier is the host computer identifier, it is determined that the received firmware is the upgrade firmware of the host computer, the upgrade flag is updated, and the boot is jumped to, and the valid content greater than x bytes in the area of the external FLASH chip for storing the firmware is written into the FLASH of the MCU to complete the upgrade; S7, when the host computer detects that the identifier is the slave computer identifier, it is determined that the received firmware is the upgrade firmware of the slave computer, the slave computer firmware transmission flag is updated, and the slave computer is transmitted in turn through CAN communication, and the firmware sent by the host computer to the slave computer includes all the valid content in the area of the external FLASH chip for storing the firmware, that is, all the content received from the host computer; S8, after the host computer sends the slave computer upgrade firmware to each slave computer, the slave computer is informed to shut down and restart, and in the process of starting up, each slave computer is woken up in turn, and the slave computer identifies the upgrade flag in the process of starting up, and then the valid content greater than x bytes in the area of the external FLASH chip for storing the firmware is written into the FLASH of the MCU to complete the upgrade; after the host computer wakes up all the slave computers and completes the power-on, all the slave computers complete the upgrade; S9, when the host computer detects that the identifier is neither the host computer identifier nor the slave computer identifier, it is considered that the received firmware is invalid, and the upgrade is exited.
2. The method of claim 1, wherein the method further comprises: In the step S1, the data length of the piece of data X is 128, and the host computer identifier or the slave computer identifier, the upgrade date and time are included.
3. The method of claim 1, wherein the method further comprises: In the step S1, the data inserted into the host computer firmware and the data inserted into the slave computer firmware have the same length, the same format and different contents, the data inserted into the host computer firmware includes the host computer identifier, and the data inserted into the slave computer firmware includes the slave computer identifier.
4. The method of claim 1, wherein the method further comprises: In the step S3, the specific area of the external FLASH chip is fixed in position, and the memory of the area is greater than the memory size of the host computer firmware and the slave computer firmware.
5. The method of claim 1, wherein the method further comprises: In the step S6, the data X has 128 bytes of data, and if the data content of 17-32 bytes is E-BOX-48100S-M, it is the host computer identifier.
6. The method of claim 1, wherein: The data X has 128 bytes of data in the step S7, and if the data content of 17-32 bytes is E-BOX-48100S-S, it is the slave identification.
7. The method of claim 1, wherein the method further comprises: In the step S7, each slave receives the data sent by the host, and stores the data in the storage firmware area of the external FLASH chip in the system, and after the reception is completed, firstly judges the identification content of the first x bytes of the received content, and if it satisfies the slave identification, the upgrade flag is updated.
8. The method of claim 1, wherein the method further comprises: In the step S9, the data X has 128 bytes of data, and if the data content of 17-32 bytes is not matched with E-BOX-48100S-S and E-BOX-48100S-S, it is considered that the received firmware is invalid.
Citation Information
Patent Citations
Electronic module and software wireless upgrading method thereof
CN110633091A
Distributed embedded system upgrading method and device
CN110780909A
Batch firmware upgrading method and system
CN114844780A
Automatic firmware upgrading method and device, electronic equipment and readable storage medium
CN115344292A
Method for upgrading firmware of energy storage system
CN115904456A