A Backup Upgrade Method and System for Energy Storage Inverters

By performing partitioned dual backup of the Flash of the energy storage converter and using CRC calculations, the remote upgrade of the energy storage converter is achieved, solving the problems of inconvenience and high cost of upgrading traditional energy storage converters, improving the reliability of the upgrade and reducing the need for hardware replacement.

CN114816472BActive Publication Date: 2025-07-22FUJIAN NEBULA ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210358914.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-07
Publication Date
2025-07-22
Estimated Expiration
2042-04-07

AI Technical Summary

Technical Problem

Traditional energy storage converters do not have remote upgrade functions, and require manual on-site operation, increasing labor and economic costs, and do not have dual backup functions, resulting in damage to the program Flash sector, affecting reliability and hardware costs.

Method used

The Flash partition of the energy storage converter is divided into a boot area, a first storage area, a first flag area, a second storage area and a second flag area. The program is double backup and upgraded, and the program is ensured through CRC calculation and power-on self-check, and the remote upgrade is achieved using the communication module.

Benefits of technology

It improves the convenience and reliability of energy storage converter upgrades, reduces upgrade costs, extends the service life of the chip, and avoids hardware replacement caused by program damage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114816472B_ABST
    Figure CN114816472B_ABST
Patent Text Reader

Abstract

The present invention provides a backup and upgrade method and system for an energy storage converter in the technical field of energy storage converters. The method includes the following steps: Step S10, partition the Flash of each chip in the energy storage converter, and the host computer double-backup the upgrade program to the corresponding Flash and write the boot code into the corresponding Flash; Step S20, the energy storage converter performs a power-on self-check based on the boot code; Step S30, the energy storage converter verifies the double-backup upgrade program; Step S40, the energy storage converter performs an upgrade operation based on the verified upgrade program. The advantages of the present invention are: greatly improving the convenience and reliability of the upgrade of the energy storage converter, and greatly reducing the upgrade cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy storage inverters, and particularly to a backup and upgrade method and system for energy storage inverters. Background Art

[0002] Under the development background of carbon peak and carbon neutrality, new energy storage has been pushed to an unprecedented height, and the market share of energy storage inverters has gradually climbed. During the operation of the energy storage inverter, abnormalities may occur, or users need to add new functions. At this time, the program of the energy storage inverter needs to be updated.

[0003] However, traditional energy storage inverters do not have the function of remote upgrade. After-sales personnel need to carry a simulator to the site for program update. Since there are many chips inside the energy storage inverter and the simulators corresponding to chips from different manufacturers are different, it is necessary to perform upgrade operations on each chip separately, which undoubtedly increases the labor cost and economic cost, and is not convenient for adding function modules later; traditional energy storage inverters do not have a dual backup function. With the long-term operation of the energy storage inverter, continuous reading, writing, and erasing of the Flash inside the chip damage part of the Flash sectors storing the program, and the program cannot be executed normally. Only the chip or motherboard can be replaced, which not only increases the hardware cost but also has certain risks.

[0004] Therefore, how to provide a backup and upgrade method and system for energy storage inverters to improve the convenience and reliability of energy storage inverter upgrade and reduce the upgrade cost has become an urgent technical problem to be solved. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a backup and upgrade method and system for energy storage inverters to improve the convenience and reliability of energy storage inverter upgrade and reduce the upgrade cost.

[0006] In a first aspect, the present invention provides a backup and upgrade method for an energy storage inverter, including the following steps:

[0007] Step S10: Partition the Flash of each chip in the energy storage inverter, and the host computer double-backup the upgrade program to the corresponding Flash and write the boot code into the corresponding Flash;

[0008] Step S20: The energy storage inverter performs a power-on self-check based on the boot code;

[0009] Step S30: The energy storage inverter verifies the double-backup upgrade program;

[0010] Step S40: The energy storage inverter performs an upgrade operation based on the verified upgrade program.

[0011] Further, step S10 specifically includes:

[0012] Step S11: Divide the Flash of each chip in the energy storage converter into a boot area, a first storage area, a first flag area, a second storage area, and a second flag area;

[0013] Step S12: The host computer backs up the upgrade program to the first storage area and the second storage area of the corresponding chip through the communication module, and writes the boot code to the boot area of the corresponding chip;

[0014] Step S13: Calculate the CRC value of the upgrade program stored in the first storage area to obtain the first CRC value, calculate the length to obtain the first file length, store the first CRC value and the first file length in the first flag area, and set the flag position in the first flag area to valid;

[0015] Calculate the CRC value of the upgrade program stored in the second storage area to obtain the second CRC value, calculate the length to obtain the second file length, store the second CRC value and the second file length in the second flag area, and set the flag position in the second flag area to valid.

[0016] Further, step S20 is specifically as follows:

[0017] After the energy storage converter is powered on, it automatically runs the boot code stored in the boot area, and automatically detects whether the DIP switch is triggered within a preset duration. If so, it means that an upgrade operation needs to be performed, and it enters step S30; if not, it means that an upgrade operation does not need to be performed, and the process ends.

[0018] Further, step S30 specifically includes:

[0019] Step S31: The energy storage converter verifies the upgrade program stored in the first storage area based on the first CRC value. If the verification is successful, it enters step S32; if the verification fails, it sets the flag position in the first flag area to invalid and enters step S34;

[0020] Step S32: The energy storage converter verifies the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, it enters step S33; if the verification fails, it sets the flag position in the second flag area to invalid, stores the upgrade program stored in the first storage area in the second storage area, recalculates the second CRC value, and then sets the flag position in the second flag area to valid and enters step S33;

[0021] Step S33: Determine whether the first CRC value is equal to the second CRC value. If so, the program upgrade passes the verification and proceed to step S40; if not, store the upgrade program stored in the first storage area into the second storage area, recalculate the second CRC value, and then proceed to step S40;

[0022] Step S34: The energy storage converter verifies the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, store the upgrade program stored in the second storage area into the first storage area, recalculate the first CRC value, and set the flag in the first flag area to valid, then proceed to step S40; if the verification fails, proceed to step S10.

[0023] Further, step S40 is specifically:

[0024] The energy storage converter performs an upgrade operation based on the verified upgrade program stored in the first storage area and performs a restart operation after the upgrade is completed.

[0025] In a second aspect, the present invention provides an energy storage converter backup upgrade system, including the following modules:

[0026] Flash partition module, used to partition the Flash of each chip in the energy storage converter. The host computer double-backups the upgrade program to the corresponding Flash and writes the boot code to the corresponding Flash;

[0027] Power-on self-check module, used for the energy storage converter to perform a power-on self-check based on the boot code;

[0028] Upgrade program verification module, used for the energy storage converter to verify the double-backed-up upgrade program;

[0029] Upgrade module, used for the energy storage converter to perform an upgrade operation based on the verified upgrade program.

[0030] Further, the Flash partition module specifically includes:

[0031] Partition unit, used to divide the Flash of each chip in the energy storage converter into a boot area, a first storage area, a first flag area, a second storage area, and a second flag area;

[0032] Data import unit, used for the host computer to backup the upgrade program to the first storage area and the second storage area of the corresponding chip through the communication module and write the boot code to the boot area of the corresponding chip;

[0033] The CRC and length calculation unit is used to perform CRC calculation on the upgrade program stored in the first storage area to obtain the first CRC value, perform length calculation to obtain the first file length, store the first CRC value and the first file length in the first flag area, and set the flag in the first flag area to valid;

[0034] Perform CRC calculation on the upgrade program stored in the second storage area to obtain the second CRC value, perform length calculation to obtain the second file length, store the second CRC value and the second file length in the second flag area, and set the flag in the second flag area to valid.

[0035] Further, the power-on self-check module is specifically:

[0036] After the energy storage converter is powered on, it automatically runs the boot code stored in the boot area, and automatically detects whether the DIP switch is triggered within a preset duration through the boot code. If so, it means that an upgrade operation needs to be performed, and it enters the upgrade program verification module; if not, it means that an upgrade operation does not need to be performed, and the process ends.

[0037] Further, the upgrade program verification module specifically includes:

[0038] The first storage area verification unit is used for the energy storage converter to verify the upgrade program stored in the first storage area based on the first CRC value. If the verification is successful, it enters the second storage area verification unit; if the verification fails, it sets the flag in the first flag area to invalid and enters the data rewriting unit;

[0039] The second storage area verification unit is used for the energy storage converter to verify the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, it enters the CRC value comparison unit; if the verification fails, it sets the flag in the second flag area to invalid, stores the upgrade program stored in the first storage area in the second storage area, recalculates the second CRC value, and then sets the flag in the second flag area to valid and enters the CRC value comparison unit;

[0040] The CRC value comparison unit is used to determine whether the first CRC value is equal to the second CRC value. If so, the upgrade program verification passes and it enters the upgrade module; if not, it stores the upgrade program stored in the first storage area in the second storage area, recalculates the second CRC value, and then enters the upgrade module;

[0041] A data rewrite unit is used for the energy storage converter to verify the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, the upgrade program stored in the second storage area is stored in the first storage area. After recalculating the first CRC value, the flag in the first flag area is set to valid, and the upgrade module is entered. If the verification fails, the Flash partition module is entered.

[0042] Further, the upgrade module is specifically:

[0043] The energy storage converter performs an upgrade operation based on the verified upgrade program stored in the first storage area and performs a restart operation after the upgrade is completed.

[0044] The advantages of the present invention are as follows:

[0045] 1. By connecting the host computer and the energy storage converter through the communication module, the host computer transmits the upgrade program to the first chip, or the first chip transparently transmits it to the remaining chips hanging below. The energy storage converter only needs to provide a communication interface to upgrade the upgrade programs of all chips, without the need to match different emulators for different chips as in the traditional way; by dividing the Flash of the chip into a boot area, a first storage area, a first flag area, a second storage area, and a second flag area, the upgrade program is backed up to both the first storage area and the second storage area at the same time. When the upgrade program in one storage area is damaged, the upgrade program in the other storage area can be used to perform the upgrade, extending the service life of the chip, without the need to directly replace the chip or the motherboard as in the traditional way, ultimately greatly improving the convenience and reliability of the energy storage converter upgrade and greatly reducing the upgrade cost.

[0046] 2. By performing CRC calculation on the upgrade program and storing the CRC value in the flag area, before performing the upgrade operation, the upgrade programs stored in the first storage area and the second storage area are verified using the CRC value respectively. If one of the verifications fails, the successfully verified upgrade program is copied to the corresponding storage area. If both verifications fail, the upgrade program is downloaded again from the host computer, and after the upgrade programs in both storage areas are successfully verified, the CRC values of the two storage areas are compared again to determine whether the upgrade programs stored in the two storage areas are the same, avoiding performing the upgrade operation based on an incorrect upgrade program and further improving the reliability of the energy storage converter upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The present invention will be further described below with reference to the accompanying drawings in conjunction with embodiments.

[0048] Figure 1 It is a flowchart of a method for backup upgrade of an energy storage converter according to the present invention.

[0049] Figure 2It is a schematic structural diagram of a backup and upgrade system for an energy storage converter according to the present invention.

[0050] Figure 3 It is a hardware architecture diagram of the present invention. Specific implementation manners

[0051] The overall idea of the technical solution in the embodiment of this application is as follows: By using a communication interface of the energy storage converter, the host computer transmits the upgrade program to the first chip, or the first chip transparently transmits it to the remaining chips hung below, and then performs the upgrade operation, without the need to match different emulators for different chips as in the traditional way; The upgrade program is simultaneously backed up to the first storage area and the second storage area. When the upgrade program in one storage area is damaged, the upgrade program in the other storage area can be used to perform the upgrade, extending the service life of the chip, so as to improve the convenience and reliability of the energy storage converter upgrade and reduce the upgrade cost.

[0052] Please refer to Figures 1 to 3 As shown, a preferred embodiment of a backup and upgrade method for an energy storage converter according to the present invention includes the following steps:

[0053] Step S10: Partition the Flash of each chip in the energy storage converter, and the host computer double-backup the upgrade program to the corresponding Flash and write the boot code into the corresponding Flash; the host computer is a computer or a server; the chip is a DSP, STM32, FPGA or CPLD;

[0054] Step S20: The energy storage converter performs a power-on self-check based on the boot code;

[0055] Step S30: The energy storage converter verifies the double-backed-up upgrade program;

[0056] Step S40: The energy storage converter performs an upgrade operation based on the verified upgrade program.

[0057] The specific content of step S10 includes:

[0058] Step S11: Divide the Flash of each chip in the energy storage converter into a boot area (boot), a first storage area (app0), a first flag area (flag0), a second storage area (app1) and a second flag area (flag1);

[0059] The boot area is used to store the boot code, which is used for reset initialization and stack initialization, receives the upgrade program sent by the host computer and writes it into the first storage area and the second storage area, and modifies the flag bits in the first flag area and the second flag area; the first storage area and the second storage area are used to store the upgrade program; the first annotation area and the second flag area are used to store the CRC value, file length and flag bits; the flag bit is valid (1) or invalid (0).

[0060] Step S12: The host computer backs up the upgrade program to the first storage area and the second storage area of the corresponding chip through the communication module, and writes the boot code (bootloader) into the boot area of the corresponding chip; the energy storage converter feeds back the corresponding response to the host computer after receiving the upgrade program; when the upgrade program is not sent to chip 1, chip 1 transparently transmits the upgrade program to the other chips, that is, chip 1 acts as a gateway;

[0061] Step S13: Perform CRC calculation (redundant cyclic check) on the upgrade program stored in the first storage area to obtain the first CRC value, perform length calculation to obtain the first file length, store the first CRC value and the first file length in the first flag area, and set the flag bit in the first flag area to valid; the CRC calculation is preferably CRC16;

[0062] Perform CRC calculation on the upgrade program stored in the second storage area to obtain the second CRC value, perform length calculation to obtain the second file length, store the second CRC value and the second file length in the second flag area, and set the flag bit in the second flag area to valid.

[0063] The specific content of step S20 is as follows:

[0064] After the energy storage converter is powered on, it automatically runs the boot code stored in the boot area, and automatically detects whether the DIP switch is triggered within a preset time period through the boot code. If so, it means that the upgrade operation needs to be performed, and it enters step S30; if not, it means that the upgrade operation does not need to be performed, and the process ends.

[0065] The specific content of step S30 includes:

[0066] Step S31: The energy storage converter verifies the upgrade program stored in the first storage area based on the first CRC value. If the verification is successful, it enters step S32; if the verification fails, it sets the flag bit in the first flag area to invalid and enters step S34; that is, perform CRC calculation again, and compare the calculation result with the first CRC value. If the comparison is consistent, the verification passes. If the verification fails, it means that the upgrade program has been damaged;

[0067] Step S32: The energy storage converter verifies the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, proceed to step S33; if the verification fails, set the flag in the second flag area to invalid, store the upgrade program stored in the first storage area to the second storage area, recalculate the second CRC value, then set the flag in the second flag area to valid, and proceed to step S33;

[0068] Step S33: Determine whether the first CRC value is equal to the second CRC value. If so, the upgrade program verification passes, and proceed to step S40; if not, store the upgrade program stored in the first storage area to the second storage area, recalculate the second CRC value, and then proceed to step S40; that is, determine whether the upgrade programs in the first storage area and the second storage area are consistent. By comparing the first CRC value and the second CRC value instead of the upgrade programs, the comparison efficiency is greatly improved because if the first CRC value is equal to the second CRC value, the upgrade programs must be consistent, and the data volume of the first CRC value and the second CRC value is much smaller than that of the upgrade programs;

[0069] Step S34: The energy storage converter verifies the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, store the upgrade program stored in the second storage area to the first storage area, recalculate the first CRC value, set the flag in the first flag area to valid, and proceed to step S40; if the verification fails, proceed to step S10. After the upgrade programs are rewritten to the first storage area and the second storage area, both are reset and restarted.

[0070] The specific content of step S40 is as follows:

[0071] The energy storage converter performs an upgrade operation based on the verified upgrade program stored in the first storage area and performs a restart operation after the upgrade is completed.

[0072] A preferred embodiment of an energy storage converter backup upgrade system of the present invention includes the following modules:

[0073] Flash partitioning module, used to partition the Flash of each chip in the energy storage converter. The host computer double-backups the upgrade program to the corresponding Flash and writes the boot code to the corresponding Flash; the host computer is a computer or a server; the chip is a DSP, STM32, FPGA or CPLD;

[0074] Power-on self-check module, used for the energy storage converter to perform a power-on self-check based on the boot code;

[0075] Upgrade program verification module, used for the energy storage converter to verify the double-backup upgrade program;

[0076] An upgrade module for the energy storage converter to perform an upgrade operation based on the verified upgrade program.

[0077] The Flash partition module specifically includes:

[0078] A partitioning unit for partitioning the Flash of each chip in the energy storage converter into a boot area, a first storage area (app0), a first flag area (flag0), a second storage area (app1), and a second flag area (flag1);

[0079] The boot area is used to store boot code, perform reset initialization and stack initialization using the boot code, receive the upgrade program sent by the host computer and write it into the first storage area and the second storage area, and modify the flag bits in the first flag area and the second flag area; the first storage area and the second storage area are used to store the upgrade program; the first annotation area and the second flag area are used to store CRC values, file lengths, and flag bits; the flag bit is valid (1) or invalid (0).

[0080] A data import unit for the host computer to back up the upgrade program to the first storage area and the second storage area of the corresponding chip through the communication module, and write the boot code (bootloader) into the boot area of the corresponding chip; the energy storage converter feeds back a corresponding response to the host computer after receiving the upgrade program; when the upgrade program is not sent to chip 1, chip 1 transparently transmits the upgrade program to the remaining chips, that is, chip 1 acts as a gateway.

[0081] A CRC and length calculation unit for performing CRC calculation (redundant cyclic check) on the upgrade program stored in the first storage area to obtain a first CRC value, performing length calculation to obtain a first file length, storing the first CRC value and the first file length in the first flag area, and setting the flag bit in the first flag area to valid; the CRC calculation is preferably CRC16.

[0082] Perform CRC calculation on the upgrade program stored in the second storage area to obtain a second CRC value, perform length calculation to obtain a second file length, store the second CRC value and the second file length in the second flag area, and set the flag bit in the second flag area to valid.

[0083] The power-on self-check module is specifically:

[0084] After the energy storage converter is powered on, it automatically runs the boot code stored in the boot area, and automatically detects whether the DIP switch is triggered within a preset duration through the boot code. If so, it means that an upgrade operation needs to be performed, and it enters the upgrade program verification module; if not, it means that an upgrade operation does not need to be performed, and the process ends.

[0085] The upgrade program verification module specifically includes:

[0086] The first storage area verification unit is used for the energy storage converter to verify the upgrade program stored in the first storage area based on the first CRC value. If the verification is successful, it enters the second storage area verification unit; if the verification fails, it invalidates the flag in the first flag area and enters the data rewriting unit; that is, it calculates the CRC again and compares the calculation result with the first CRC value. If the comparison is consistent, the verification passes. If the verification fails, it indicates that the upgrade program has been damaged;

[0087] The second storage area verification unit is used for the energy storage converter to verify the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, it enters the CRC value comparison unit; if the verification fails, it invalidates the flag in the second flag area, stores the upgrade program stored in the first storage area to the second storage area, recalculates the second CRC value, and then sets the flag in the second flag area to valid and enters the CRC value comparison unit;

[0088] The CRC value comparison unit is used to determine whether the first CRC value is equal to the second CRC value. If so, the upgrade program verification passes and it enters the upgrade module; if not, it stores the upgrade program stored in the first storage area to the second storage area, recalculates the second CRC value, and then enters the upgrade module; that is, it determines whether the upgrade programs in the first storage area and the second storage area are consistent. By comparing the first CRC value and the second CRC value instead of the upgrade program, the comparison efficiency is greatly improved because if the first CRC value is equal to the second CRC value, the upgrade programs must be consistent, and the data volume of the first CRC value and the second CRC value is much smaller than that of the upgrade program;

[0089] The data rewriting unit is used for the energy storage converter to verify the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, it stores the upgrade program stored in the second storage area to the first storage area, recalculates the first CRC value, sets the flag in the first flag area to valid, and enters the upgrade module; if the verification fails, it enters the Flash partition module. After the upgrade program is rewritten in the first storage area and the second storage area, both are reset and restarted.

[0090] The upgrade module is specifically:

[0091] The energy storage converter performs an upgrade operation based on the verified upgrade program stored in the first storage area and performs a restart operation after the upgrade is completed.

[0092] In summary, the advantages of the present invention are:

[0093] 1. Connect the host computer and the energy storage converter through the communication module. The host computer transmits the upgrade program to the first chip, or the first chip forwards it to the remaining chips connected below. The energy storage converter only needs to provide a communication interface to upgrade the upgrade programs of all chips, without the need to match different emulators for different chips as in the traditional way. By dividing the Flash of the chip into a boot area, a first storage area, a first flag area, a second storage area, and a second flag area, the upgrade program is backed up to both the first storage area and the second storage area at the same time. When the upgrade program in one storage area is damaged, the upgrade program in the other storage area can be used to perform the upgrade, extending the service life of the chip. There is no need to directly replace the chip or the motherboard as in the traditional way, ultimately greatly improving the convenience and reliability of the energy storage converter upgrade and significantly reducing the upgrade cost.

[0094] 2. Calculate the CRC of the upgrade program and store the CRC value in the flag area. Before performing the upgrade operation, first use the CRC value to verify the upgrade programs stored in the first storage area and the second storage area respectively. If one of the verifications fails, copy the successfully verified upgrade program to the corresponding storage area. If both verifications fail, download the upgrade program again from the host computer. After the upgrade programs in both storage areas are successfully verified, compare whether the CRC values of the two storage areas are the same, that is, determine whether the upgrade programs stored in the two storage areas are the same, to avoid performing the upgrade operation based on an incorrect upgrade program, further improving the reliability of the energy storage converter upgrade.

[0095] Although the specific implementation manners of the present invention have been described above, those skilled in the art of this technology should understand that the specific embodiments we described are illustrative rather than used to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered by the scope protected by the claims of the present invention.

Claims

1. A method for backup and upgrade of an energy storage converter, characterized in that: It includes the following steps: Step S10: Partition the Flash of each chip in the energy storage converter. The host computer double-backups the upgrade program to the corresponding Flash and writes the boot code to the corresponding Flash. The specific steps of step S10 include: Step S11: Divide the Flash of each chip in the energy storage converter into a boot area, a first storage area, a first flag area, a second storage area, and a second flag area. Step S12: The host computer backs up the upgrade program to the first storage area and the second storage area of the corresponding chip through the communication module, and writes the boot code to the boot area of the corresponding chip. Step S13: Calculate the CRC of the upgrade program stored in the first storage area to obtain the first CRC value, calculate the length to obtain the first file length, store the first CRC value and the first file length in the first flag area, and set the flag in the first flag area to valid. Calculate the CRC of the upgrade program stored in the second storage area to obtain the second CRC value, calculate the length to obtain the second file length, store the second CRC value and the second file length in the second flag area, and set the flag in the second flag area to valid. Step S20: After the energy storage converter is powered on, it automatically runs the boot code stored in the boot area, and automatically detects whether the DIP switch is triggered within a preset time. If so, it means that an upgrade operation needs to be performed, and it enters step S30; if not, it means that an upgrade operation does not need to be performed, and the process ends. Step S30: The energy storage converter verifies the double-backed upgrade program. The specific steps of step S30 include: Step S31: The energy storage converter verifies the upgrade program stored in the first storage area based on the first CRC value. If the verification is successful, it enters step S32; if the verification fails, it sets the flag in the first flag area to invalid and enters step S34. Step S32: The energy storage converter verifies the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, it enters step S33; if the verification fails, it sets the flag in the second flag area to invalid, stores the upgrade program stored in the first storage area in the second storage area, recalculates the second CRC value, and then sets the flag in the second flag area to valid and enters step S33. Step S33: Determine whether the first CRC value is equal to the second CRC value. If so, the upgrade program verification passes, and it enters step S40; if not, it stores the upgrade program stored in the first storage area in the second storage area, recalculates the second CRC value, and then enters step S40. Step S34: The energy storage converter verifies the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, it stores the upgrade program stored in the second storage area in the first storage area, recalculates the first CRC value, and sets the flag in the first flag area to valid and enters step S40; if the verification fails, it enters step S10. Step S40: The energy storage converter performs an upgrade operation based on the verified upgrade program stored in the first storage area, and performs a restart operation after the upgrade is completed.

2. A backup and upgrade system for an energy storage converter, characterized in that: It includes the following modules: Flash Partition Module, used to partition the Flash of each chip in the energy storage converter. The host computer double-backups the upgrade program to the corresponding Flash and writes the boot code to the corresponding Flash; The Flash Partition Module specifically includes: Partition Unit, used to divide the Flash of each chip in the energy storage converter into a boot area, a first storage area, a first flag area, a second storage area, and a second flag area; Data Import Unit, used for the host computer to backup the upgrade program to the first storage area and the second storage area of the corresponding chip through the communication module, and write the boot code to the boot area of the corresponding chip; CRC and Length Calculation Unit, used to perform CRC calculation on the upgrade program stored in the first storage area to obtain the first CRC value, perform length calculation to obtain the first file length, store the first CRC value and the first file length in the first flag area, and set the flag in the first flag area to valid; Perform CRC calculation on the upgrade program stored in the second storage area to obtain the second CRC value, perform length calculation to obtain the second file length, store the second CRC value and the second file length in the second flag area, and set the flag in the second flag area to valid; Power-on Self-check Module, used for the energy storage converter to automatically run the boot code stored in the boot area after power-on, and automatically detect whether the DIP switch is triggered within a preset duration through the boot code. If so, it means that an upgrade operation needs to be performed, and enter the upgrade program verification module; if not, it means that an upgrade operation does not need to be performed, and end the process; Upgrade Program Verification Module, used for the energy storage converter to verify the double-backed upgrade program; The Upgrade Program Verification Module specifically includes: First Storage Area Verification Unit, used for the energy storage converter to verify the upgrade program stored in the first storage area based on the first CRC value. If the verification is successful, enter the second storage area verification unit; if the verification fails, set the flag in the first flag area to invalid and enter the data rewrite unit; Second Storage Area Verification Unit, used for the energy storage converter to verify the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, enter the CRC value comparison unit; if the verification fails, set the flag in the second flag area to invalid, store the upgrade program stored in the first storage area in the second storage area, recalculate the second CRC value, and then set the flag in the second flag area to valid and enter the CRC value comparison unit; CRC Value Comparison Unit, used to determine whether the first CRC value is equal to the second CRC value. If so, the upgrade program verification passes and enter the upgrade module; if not, store the upgrade program stored in the first storage area in the second storage area, recalculate the second CRC value, and then enter the upgrade module; The data rewriting unit is used for the energy storage converter to verify the upgrade program stored in the second storage area based on the second CRC value. If the verification is successful, the upgrade program stored in the second storage area is stored in the first storage area. After recalculating the first CRC value, the flag in the first flag area is set to valid, and the upgrade module is entered. If the verification fails, the Flash partition module is entered. The upgrade module is used for the energy storage converter to perform an upgrade operation based on the verified upgrade program stored in the first storage area and perform a restart operation after the upgrade is completed.

Citation Information

Patent Citations

  • Automobile embedded software upgrading method and device and storage medium

    CN112486549A

  • Software online upgrading method for SOC processor

    CN113867750A