Software updating method and device, chip, energy storage system and storage medium
By using the first startup program in the chip to detect and copy the second startup program for software update, the problem of abnormal software upgrade in the power generation system is solved, the system's safety and flexibility are improved, and the update failure of the energy storage system is reduced Risk and maintenance costs.
Patent Information
- Application Number
- CN202411098130.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-31
AI Technical Summary
In power generation systems, there are abnormal risks that cannot be ignored during the software upgrade process, which affects the reliability and safety of the system. Especially during the software update process of the energy storage system, the failure of the update may cause the system to crash, which is high in cost and reduces safety.
By introducing the first startup program and the second startup program in the chip, the first startup program detects whether there is update data in the external flash memory area, and copies the second startup program to the random storage area, and uses the second startup program to perform software updates to ensure that The internal flash memory area does not contain programs that perform write operations, which improves security and improves update flexibility.
It improves the security and flexibility of software updates of chips and energy storage systems, reduces the risk of update failure, reduces maintenance costs, and enhances the reliability and applicability of the system.
Smart Images

Figure CN119225775A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and more specifically, to a software updating method, device, chip, energy storage system and storage medium. Background Art
[0002] As global fossil energy is becoming increasingly depleted, in order to meet humanity's demand for energy, major countries are vigorously developing new forms of energy acquisition based on solar energy + energy storage, such as balcony photovoltaics, home energy storage systems, industrial and commercial integrated photovoltaic storage and charging systems, large-scale photovoltaic + energy storage power stations and other product forms.
[0003] At the same time, with the rapid development of electronic technology in recent years, the number of microprocessors used in the control and management systems in power generation systems has also increased. Generally speaking, the control and management system can be used to manage the start and stop, speed regulation and load distribution of the generator set, and is responsible for the monitoring and adjustment of various electrical parameters including voltage, current and power factor, as well as fault detection, remote communication and other aspects. In order to ensure that the power generation system can meet the needs of various application scenarios, it is inevitable that the number of software upgrades in the system will increase sharply. If an abnormality occurs during the software upgrade process, it will have a significant impact on the entire power generation system.
[0004] Therefore, it is crucial to improve the reliability and safety of software upgrades in power systems. Summary of the invention
[0005] The present application proposes a software update method, device, chip, energy storage system and storage medium to improve the above-mentioned defects.
[0006] In a first aspect, an embodiment of the present application provides a software update method, which is applied to a chip, and the method includes: detecting through a first startup program whether there is update data in an external flash memory area connected to the chip, the update data including a second startup program and software update data corresponding to specified software, and the first startup program and the specified software are both stored in an internal flash memory area of the chip; if there is update data in the external flash memory area, reading the second startup program through the first startup program, and copying the second startup program to a random storage area of the chip; based on the software update data in the external flash memory area, updating the specified software through the second startup program.
[0007] In a second aspect, an embodiment of the present application further provides a software updating device, which is applied to a chip, and the device comprises: a detection module, which is used to detect whether there is update data in an external flash memory area connected to the chip through the first startup program, and the update data comprises a second startup program and software update data corresponding to the specified software, and the first startup program and the specified software are both stored in the internal flash memory area of the chip; a copy module, which is used to read the second startup program through the first startup program if there is update data in the external flash memory area, and copy the second startup program to the random storage area of the chip; and an update module, which updates the specified software through the second startup program based on the software update data in the external flash memory area.
[0008] In the third aspect, an embodiment of the present application also provides a chip, comprising an internal flash memory area and a random storage area, wherein the internal flash memory area is used to store a first startup program and designated software, and the random storage area is used to store a second startup program; wherein the first startup program is used to detect whether there is update data in an external flash memory area connected to the chip, and the update data includes a second startup program and software update data corresponding to the designated software; the first startup program is also used to copy the second startup program to the random storage area of the chip if there is software update data in the external flash memory area, wherein the second startup program is used to update the designated software based on the software update data in the external flash memory area.
[0009] In a fourth aspect, an embodiment of the present application further provides an energy storage system, which is used to execute the software update method described in any one of claims 1 to 6 to perform online software update.
[0010] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.
[0011] Therefore, the present application provides a software update method, device, chip, energy storage system and storage medium, and the method is applied to a chip. The method includes: detecting whether there is update data in an external flash memory area connected to the chip through the first startup program, and the update data includes a second startup program and software update data corresponding to the specified software, and the first startup program and the specified software are both stored in the internal flash memory area of the chip; if there is update data in the external flash memory area, copying the second startup program to the random storage area of the chip through the first startup program; based on the software update data in the external flash memory area, updating the specified software through the second startup program. The present application detects whether there is updated data in the external flash memory area through the first startup program. If the updated data exists, the second startup program is copied to the random storage area of the chip, so that the software update data is written into the internal flash memory area of the chip through the second startup program. Therefore, the internal flash memory area of the chip does not contain the program for performing write operations, thereby improving the security of the chip. In addition, since the second startup program is copied into the random storage area during the software update process, any storage partition in the internal flash memory area of the chip can be upgraded and updated by the second startup program, thereby improving the flexibility and applicability of the software update operation.
[0012] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1 A flowchart of a software updating method proposed in an embodiment of the present application is shown.
[0015] Figure 2 A flowchart of another software updating method proposed in an embodiment of the present application is shown.
[0016] Figure 3 A flowchart of another software updating method proposed in an embodiment of the present application is shown.
[0017] Figure 4 A structural block diagram of a chip proposed in an embodiment of the present application is shown.
[0018] Figure 5 A structural block diagram of a software updating device proposed in an embodiment of the present application is shown.
[0019] Figure 6 A structural block diagram of a computer-readable storage medium proposed in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0020] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0021] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0022] For energy storage systems, they generally include multiple energy storage devices. If an update fails during the software update process of a certain energy storage device, the entire energy storage system may freeze and fail to perform normal charging and discharging work. The staff needs to go to the site for repair and re-upgrade, which makes the cost of software upgrade extremely high. In the prior art, the process of upgrading and updating the software of the energy storage device is generally: based on the boot loader stored in the flash area inside the chip used by the energy storage system, it detects whether there is update data in the external device. If so, the boot loader is used to copy the update data to the area in the chip used to store software, thereby realizing the software upgrade. Due to the method used in the prior art, a program for writing data needs to be stored in the chip, which easily causes the chip and even the application chip system to be tampered with, resulting in a decrease in system security.
[0023] See also Figure 1 , Figure 1 A flowchart of a software update method proposed in an embodiment of the present application is shown. The method is applied to Figure 4The chip shown, for example, may be a microcontroller unit (MCU) or a system on chip (SOC), and the chip may be used as a hardware device in an embedded system. In this application, the embedded system may specifically refer to a control management system in a power system, such as an energy storage system. Specifically, the above method may include the following steps:
[0024] S110: Detecting whether there is update data in the external flash memory area connected to the chip through the first startup program, the update data including the second startup program and software update data corresponding to the specified software, and the first startup program and the specified software are both stored in the internal flash memory area of the chip.
[0025] Specifically, a first boot program is stored in the chip, and the first boot program is stored in the internal flash memory area of the chip. Exemplarily, the first boot program can be a boot loader, such as a bootloader, and in this embodiment, the first boot program is used to detect whether there is update data in the external flash memory area connected to the chip, wherein the update data includes the second boot program and software update data corresponding to the specified software, wherein the specified software is stored in the internal flash memory area of the chip.
[0026] As an implementation method, an internal flash memory area and a random access memory (Random Access Memory, RAM) are provided in the chip, wherein the internal flash memory area refers to the internal flash area, which is often used to store data that needs to be frequently updated due to its non-volatility and rewritability; and the random access memory RAM is often used as a temporary storage space to store data and instructions that may be changed at any time due to its volatility and high-speed access characteristics. It can be understood that for a large embedded system, the number of chips it contains is huge. For ease of understanding, this application only takes any chip in the system as the target chip, and takes the update process of the software stored in the target chip as an example for explanation.
[0027] As an implementation method, the designated software can be any one of the multiple application software included in the embedded system. Taking the embedded system as an energy storage system as an example, the designated software can be software in the Supervisory Control And Data Acquisition (SCADA) system that is responsible for implementing a specific function such as data acquisition, data processing (such as range conversion, filtering, alarm checking, calculation, event recording, historical storage, and execution of user scripts); it can also be software in the Automatic Generation Control (AGC) system that is responsible for implementing a specific function such as load frequency control, economic dispatch control, spare capacity monitoring, performance monitoring, etc. It can also be economic dispatch software, load forecasting software, safety analysis software, etc. Furthermore, as an implementation method, the internal flash memory area may include multiple storage partitions, such as a boot program storage area and an application software storage area. In the present embodiment, a first boot program and one or more application software are stored in the internal flash memory area of the chip. Accordingly, the first boot program may be stored in the boot program storage area in the internal flash memory area, and one or more application software may be stored in the application software storage area in the internal flash memory area. That is to say, the designated software and the first boot program are located in different storage partitions in the internal flash memory area, which can effectively improve access efficiency and increase the flexibility and scalability of the chip.
[0028] As an implementation method, the external flash memory area refers to an external flash area. Different from the internal flash memory area that is integrated inside the chip and can be directly accessed by the chip, the external flash memory area is often located outside the chip. The chip needs to communicate with the external flash memory area based on an interface, and the storage capacity of the external flash memory area is larger. Therefore, the external flash memory area is often used to expand the storage space of the chip and store less important data information. Furthermore, if there is a demand for a specified software update, the corresponding software update data will be downloaded from the manufacturer and stored in the external flash memory area. As an embodiment, the second startup program is also stored in the external flash memory area, and the software update data and the second startup program are stored in different storage partitions in the external flash memory area. Further, the second startup program can be downloaded from the manufacturer together with the software update data and stored in the external flash memory area, or it can be pre-stored in the external flash memory area. Exemplarily, the second startup program can be a boot loader, such as a bootloader, and the second startup program is used to update the specified software based on the software update data. Therefore, the second startup program can be pre-written and stored in the external flash memory area. Further, it can be understood that since the second startup program is stored in the external flash memory area instead of inside the chip, it is easier to modify or update the second startup program according to different software and actual needs.
[0029] Further, the target chip and the external flash memory area can be connected based on the interface protocols that match each other, and a suitable interface can be selected for connection. For example, if both support the SPI protocol, they can be connected through the SPI interface. As an implementation method, the method for the target chip to detect whether there is updated data in the external flash memory area through the first boot program can be: establish communication with the external flash memory area through the first boot program, and when the external flash memory area is successfully detected and identified, read the information of a specific area (such as a boot sector, a file system table, etc.) related to the updated data in the external flash memory area, and then read the updated data and verify the validity of the data. When the data validity verification is passed, it is confirmed that there is updated data in the external flash memory area. Therefore, when the chip connected to the external flash memory area detects that there is updated data in the external flash memory area through the first boot program, it means that the specified software stored in the chip needs to be updated.
[0030] As an implementation method, before the first startup program detects whether there is updated data in the external flash memory area connected to the target chip, it also includes powering on and initializing the target chip, and checking the correctness of the target chip. After the chip correctness is verified, the first startup program is started and subsequent steps are executed.
[0031] S120: If there is updated data in the external flash memory area, copy the second boot program to the random access memory area of the chip through the first boot program.
[0032] In this embodiment, according to the above analysis, when the existence of updated data in the external flash memory area is detected through the first startup program, it means that the specified software stored in the chip needs to be updated, and the first startup program is also used to copy the second startup program in the external flash memory area to the random storage area of the chip. Specifically, after confirming that there is updated data in the external flash memory area, the data of the second startup program can be read from the external flash memory area through the first startup program, thereby copying the read data from the external flash memory area to the random storage area inside the target chip.
[0033] S130: Based on the software update data in the external flash memory area, the designated software is updated through the second startup program.
[0034] As an implementation method, after the second boot program is copied and stored in the random storage area of the target chip, the software update data in the external flash memory area is written into the chip by running the second boot program to update the specified software. Specifically, the second boot program can write the software update data in the external flash memory area into the internal flash memory area in the target chip, and in particular, write it into the application software storage area in the internal flash memory area, so as to implement the software update. Exemplarily, the second boot program can first write the software update data into the random storage area, and after erasing the specified software data originally stored in the application software storage area, write the software update data in the random storage area into the application software storage area in the internal flash memory area.
[0035] Therefore, the present application provides a software update method, which is applied to a chip, and the method includes: detecting whether there is update data in an external flash memory area connected to the chip through a first boot program, the update data includes a second boot program and software update data corresponding to a specified software, and the first boot program and the specified software are both stored in the internal flash memory area of the chip; if there is update data in the external flash memory area, copying the second boot program to the random storage area of the chip through the first boot program; based on the software update data in the external flash memory area, updating the specified software through the second boot program. The present application detects whether there is update data in the external flash memory area through the first boot program, and if there is update data, copies the second boot program to the random storage area of the chip, so that the software update data is written into the internal flash memory area of the chip through the second boot program, so that the internal flash memory area of the chip does not contain a program for performing a write operation, thereby improving the security of the chip, and because the second boot program is copied into the random storage area during the software update process, any storage partition in the internal flash memory area of the chip can be upgraded and updated by the second boot program, thereby improving the flexibility and applicability of the software update operation.
[0036] See also Figure 2 , Figure 2 A flowchart of another software updating method proposed in an embodiment of the present application is shown, and the method is applied to Figure 4 The chip shown, for example, may be an MCU or a SOC, etc., and the chip may be used as a hardware device in an embedded system. In this application, the embedded system may specifically refer to a control management system in a power system, such as an energy storage system EMS, etc. Specifically, the above method may include the following steps:
[0037] S210: Detecting whether there is update data in the external flash memory area connected to the chip through the first startup program, the update data including the second startup program and software update data corresponding to the specified software, and the first startup program and the specified software are both stored in the internal flash memory area of the chip.
[0038] S221: If there is update data in the external flash memory area, copy the second startup program to the random storage area of the chip through the first startup program; based on the software update data in the external flash memory area, update the designated software through the second startup program.
[0039] Specifically, the specific implementation of steps S210-S221 can refer to the specific implementation of steps S110-S130 in the above embodiment, which will not be repeated here.
[0040] S222: If there is no software update data in the external flash memory area, determine the validity of the specified software stored in the chip through the first boot program.
[0041] In this embodiment, if the software update data does not exist in the external flash memory area, the first boot program is further used to determine whether the designated software stored in the chip is valid, that is, to determine the validity of the designated software. Exemplarily, the method for determining the validity of the designated software may be: performing a cyclic redundancy check and other tests at the hardware level to verify whether the designated software data and the chip storage area are damaged, and performing a functional test and security verification on the designated software at the software level to verify whether the designated software can run normally. If the chip storage area and the designated software data are not damaged and the designated software can run normally, the designated software is determined to be valid. Otherwise, if the chip storage area or the designated software data is damaged, or the designated software cannot run normally, the designated software is determined to be invalid.
[0042] S231: If the designated software is valid, run the designated software.
[0043] In this embodiment, if it is detected through the first boot program that the designated software stored in the chip is valid, then the designated software can be directly run to implement functions related to the designated software.
[0044] S232: If the designated software is invalid, determine whether the chip is connected to a host computer through the first startup program.
[0045] In this embodiment, if it is detected through the first startup program that the specified software stored in the chip is invalid, that is, if the specified software is still running, it may cause damage to the chip at best, and may even affect the entire embedded system using the chip. Therefore, at this time, the first startup program is used to determine whether the chip is connected to the host computer.
[0046] Specifically, the host computer (Supervisory Control and Data Acquisition System, SCADA) refers to a computer software system that establishes a connection with the lower computer (the chip in this application) through a transmission medium (such as Ethernet, serial communication and other communication methods), and is responsible for data acquisition, processing, display and sending of control instructions. Further, judging whether the chip is connected to the host computer can be by checking serial port parameters, checking communication protocols, checking data streams, etc. to determine whether the communication connection between the chip and the host computer is normal.
[0047] S240: If the chip is connected to a host computer, the software update data stored in the host computer is obtained, and the software update data is stored in the external flash memory area.
[0048] Generally, when a software manufacturer upgrades or updates the software, the updated software data will first be sent to the user system, that is, to the host computer of the user system. Therefore, even if the system administrator fails to download and store the software update data in the external flash memory area in time, if there is a software update, the software update data can still be downloaded through the host computer. Therefore, in this embodiment, if it is detected that the chip is connected to the host computer, the software update data stored in the host computer is obtained, and the software update data is stored in the external flash memory area.
[0049] As an implementation method, if the chip is connected to the host computer but the software update data is not found in the host computer, then the host computer connection state can be maintained and the operation of reading the software update data from the host computer can be continuously performed, so that when the host computer receives the software update data, the chip can respond to the software update demand in a timely manner and download the data and perform subsequent updates in a timely manner. Furthermore, if the duration of reading the software update data from the host computer exceeds a preset time threshold but the software update data is still not read, the chip can be turned off to reduce energy consumption. Exemplarily, the preset time threshold can be thirty minutes.
[0050] S250: Restart the chip and return to the step of detecting whether there is update data in the external flash memory area connected to the chip through the first boot program and subsequent steps until the software update operation is completed.
[0051] In this embodiment, after the software update data is downloaded from the host computer to the external flash memory area, the chip is restarted to re-execute step S210 and subsequent steps until the software update operation is completed. It can be understood that after the software update data is downloaded based on the host computer, there is still a possibility of data corruption or chip damage. Therefore, the chip is restarted to re-execute the entire software update process, thereby verifying the correctness of the chip based on multiple security verification operations in the complete process, thereby ensuring the integrity and security of the software update process.
[0052] Therefore, the software update method provided in this embodiment ensures the integrity and security of the software update process by downloading the software update data through the host computer and then re-executing the software update process when the software update data does not exist in the external flash memory area.
[0053] See also Figure 3 , Figure 3 A flowchart of another software update method proposed in an embodiment of the present application is shown, and the method is applied to Figure 4 The chip shown, exemplarily, may be an MCU or a SOC, etc., and the chip may be used as a hardware device in an embedded system. In this application, the embedded system may specifically refer to a control management system in a power system, such as an energy storage system EMS, etc. Specifically, the above method may include the following steps:
[0054] S310: Detecting, through the first boot program, whether there is update data in the external flash memory area connected to the chip, the update data including the second boot program and software update data corresponding to the specified software, and the specified software is stored in the internal flash memory area of the chip.
[0055] S321: If there is update data in the external flash memory area, read the second startup program through the first startup program, and copy the second startup program to the random storage area of the chip; based on the software update data in the external flash memory area, update the specified software through the second startup program.
[0056] S322: If there is no software update data in the external flash memory area, determine the validity of the specified software stored in the chip through the first boot program.
[0057] S331: If the designated software is valid, run the designated software.
[0058] S332: If the designated software is invalid, determine whether the chip is connected to a host computer through the first startup program.
[0059] Specifically, the specific implementation of steps S310-S332 can refer to the specific implementation of steps S210-S232 in the above embodiment, which will not be repeated here.
[0060] S341: If the chip is connected to a host computer, the software update data stored in the host computer is obtained, and the software update data is stored in the external flash memory area.
[0061] S342: Restart the chip and return to the step of detecting whether there is update data in the external flash memory area connected to the chip through the first boot program and its subsequent steps until the software update operation is completed.
[0062] Specifically, the specific implementation of steps S341-S342 can refer to the specific implementation of steps S240-S250 in the above embodiment, which will not be repeated here.
[0063] S343: If the chip is not connected to the host computer, continue to detect whether the chip has access to the host computer.
[0064] In this embodiment, if the host computer connected to the chip cannot be detected, the chip can continue to be detected whether there is a host computer connected to the chip, so that the software update demand can be responded to in time and the software update operation can be performed.
[0065] S351: When the chip remains without access to the host computer for more than a preset time threshold, the chip is turned off.
[0066] As an implementation mode, the preset time threshold may be thirty minutes. Specifically, when the chip remains in a state without access to the host computer for more than the preset time threshold, the chip is shut down in time to reduce system energy consumption.
[0067] S352: If it is detected within the preset time threshold that the chip has access to a host computer, return to execute the steps of obtaining the software update data stored in the host computer and storing the software update data in the external flash memory area if the chip is connected to the host computer and its subsequent steps until the software update operation is completed.
[0068] In this embodiment, when it is detected that the chip has access to the host computer within the preset time threshold, the chip is restarted to re-execute step S341 and subsequent steps until the software update operation is completed. It can be understood that after connecting to the host computer and downloading the software update data based on the host computer, there is still a possibility of data corruption or chip damage. Therefore, the relevant steps of the software update are re-executed to verify the correctness of the chip based on multiple security verification operations in the complete process, thereby ensuring the integrity and security of the software update process.
[0069] Therefore, a software update method provided in this embodiment continuously detects whether the chip is connected to the host computer when there is no software update data in the external flash memory area and the chip is not connected to the host computer. If the host computer connection is detected within a preset time threshold, the software update data is downloaded from the host computer and the software update process is re-executed, thereby ensuring the integrity and security of the software update process. If the host computer connection is not detected within the preset time threshold, the chip is shut down to reduce system energy consumption.
[0070] See also Figure 4 , Figure 4 A structural block diagram of a chip 400 proposed in an embodiment of the present application is shown. Specifically, the chip 400 includes an internal flash memory area 401 and a random storage area 402. The internal flash memory area 401 is used to store a first startup program and specified software, and the random storage area 402 is used to store a second startup program, wherein the first startup program is used to detect whether there is update data in an external flash memory area connected to the chip, and the update data includes a second startup program and software update data corresponding to the specified software; the first startup program is also used to copy the second startup program to the random storage area of the chip if there is software update data in the external flash memory area, wherein the second startup program is used to update the specified software based on the software update data in the external flash memory area. Furthermore, the internal flash memory area 401 may include a boot program storage area and an application software storage area, the first boot program is stored in the boot program storage area of the internal flash memory area 401, and the designated software is stored in the application software storage area of the internal flash memory area 401; the random storage area 402 may also include a boot program storage area and an update data storage area, the second boot program is stored in the boot program storage area of the random storage area 402, and when the second boot program updates the designated software based on the software update data in the external flash memory area, the software update data in the external flash memory area may be temporarily stored in the update data area of the random storage area 402.
[0071] See also Figure 5 , Figure 5 The structure block diagram of a software updating device 500 proposed in an embodiment of the present application is shown, including:
[0072] A detection module 501 is used to detect whether there is update data in the external flash memory area connected to the chip through a first boot program, wherein the update data includes a second boot program and software update data corresponding to the specified software, and the first boot program and the specified software are both stored in the internal flash memory area of the chip;
[0073] A copy module 502, configured to copy the second boot program to the random access memory area of the chip through the first boot program if there is updated data in the external flash memory area;
[0074] An updating module 503, based on the software update data in the external flash memory area, updates the specified software through the second startup program;
[0075] Optionally, the update module 503 is further configured to write the software update data in the external flash memory area into the application software storage area of the chip through the second boot program, and the application software storage area is located in the internal flash memory area of the chip;
[0076] Optionally, the detection module 501 is further used to determine the validity of the specified software stored in the chip through the first startup program if there is no software update data in the external flash memory area; if the specified software is valid, run the specified software.
[0077] Optionally, the detection module 501 is also used to determine whether the chip is connected to a host computer through the first startup program if the specified software is invalid; if the chip is connected to the host computer, obtain the software update data stored in the host computer, and store the software update data in the external flash memory area; restart the chip, return to execute the step of detecting whether there is update data in the external flash memory area connected to the chip through the first startup program and its subsequent steps until the software update operation is completed.
[0078] Optionally, the detection module 501 is also used to continuously detect whether the chip has access to the host computer if the chip is not connected to the host computer; when the chip remains in a state of no access to the host computer for more than a preset time threshold, the chip is turned off.
[0079] Optionally, the detection module 501 is also used to return to execute the steps of obtaining the software update data stored in the host computer if the chip is connected to the host computer, and storing the software update data in the external flash memory area and its subsequent steps if it is detected that the chip has access to the host computer within the preset time threshold, until the software update operation is completed.
[0080] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0081] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0082] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0083] See also Figure 6 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 600 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0084] The computer readable storage medium 600 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 600 includes a non-transitory computer-readable storage medium. The computer readable storage medium 600 has storage space for program code 610 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 610 can be compressed, for example, in an appropriate form.
[0085] As an implementation mode, the embodiment of the present application also provides an energy storage system, which is used to execute the software update method described in the above embodiment to perform online software update. Since this method makes the internal flash memory area of the chip not contain the program for performing write operations, the security of the chip is improved, thereby improving the success rate of the energy storage system software update.
[0086] As an implementation mode, the present application also provides a computer program product. The computer program product includes a computer program / instruction, and the computer program / instruction implements the steps of the above method when executed by a processor.
[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A software updating method, characterized in that: Applied to a chip, the method comprises: Detecting, by a first boot program, whether there is update data in an external flash memory area connected to the chip, wherein the update data includes a second boot program and software update data corresponding to designated software, wherein the first boot program and the designated software are both stored in an internal flash memory area of the chip; If the update data exists in the external flash memory area, copying the second boot program from the external flash memory area to the random access memory area of the chip through the first boot program; The designated software is updated through the second boot program based on the software update data in the external flash memory area.
2. The method according to claim 1, characterized in that The updating of the designated software by the second startup program based on the software update data in the external flash memory area includes: The software update data in the external flash memory area is written into the application software storage area of the chip through the second boot program. The application software storage area is located in the internal flash memory area of the chip.
3. The method according to claim 1, characterized in that After detecting whether there is update data in the external flash memory area connected to the chip through the first boot program, the method further includes: If the software update data does not exist in the external flash memory area, determining the validity of the designated software stored in the chip through the first boot program; If the specified software is valid, run the specified software.
4. The method according to claim 3, characterized in that After determining the validity of the designated software stored in the chip by the first boot program if there is no software update data in the external flash memory area, the method further includes: If the specified software is invalid, determining whether the chip is connected to a host computer through the first startup program; If the chip is connected to a host computer, the software update data stored in the host computer is obtained, and the software update data is stored in the external flash memory area; Restart the chip, and return to the step of detecting whether there is update data in the external flash memory area connected to the chip through the first boot program and its subsequent steps until the software update operation is completed.
5. The method according to claim 4, characterized in that After determining whether the chip is connected to a host computer through the first startup program if the designated software is invalid, the method further includes: If the chip is not connected to the host computer, continue to detect whether the chip has access to the host computer; When the chip remains without access to the host computer for more than a preset time threshold, the chip is turned off.
6. The method according to claim 5, characterized in that After the step of continuously detecting whether the chip has access to the host computer if the chip is not connected to the host computer, the method further includes: If it is detected within the preset time threshold that the chip has access to a host computer, the process returns to execute the steps of, if the chip is connected to a host computer, obtaining the software update data stored in the host computer, and storing the software update data in the external flash memory area, and its subsequent steps, until the software update operation is completed.
7. A software updating device, characterized in that: Applied to a chip, the device comprises: a detection module, configured to detect whether there is update data in an external flash memory area connected to the chip through a first startup program, wherein the update data includes a second startup program and software update data corresponding to designated software, and the first startup program and designated software are both stored in an internal flash memory area of the chip; a copy module, configured to copy the second boot program to the random access storage area of the chip through the first boot program if there is update data in the external flash memory area; An update module updates the designated software through the second startup program based on the software update data in the external flash memory area.
8. A chip, characterized in that: It includes an internal flash memory area and a random access memory area, wherein the internal flash memory area is used to store a first startup program and designated software, and the random access memory area is used to store a second startup program; Wherein, the first boot program is used to detect whether there is update data in the external flash memory area connected to the chip, and the update data includes the second boot program and software update data corresponding to the specified software; The first boot program is also used to copy the second boot program to the random storage area of the chip if there is software update data in the external flash memory area, wherein the second boot program is used to update the specified software based on the software update data in the external flash memory area.
9. An energy storage system, characterized in that: The energy storage system is used to execute the software update method described in any one of claims 1 to 6 to perform online software update.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program executable by a processor, and when the program is executed by the processor, the processor executes the method according to any one of claims 1 to 6.
