BOOT upgrading method and device and storage medium

By downloading and copying the new version of the BOOT program to the device's application partition, the problem of insufficient storage space is solved, enabling efficient BOOT upgrades. This is applicable to devices with various storage capacities and reduces the risk of device upgrade failures.

CN122018944APending Publication Date: 2026-05-12SHANGHAI MOOREWATT ENERGY TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI MOOREWATT ENERGY TECHNOLOGY CO LTD
Filing Date
2026-04-13
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

The current reverse upgrade BOOT method requires a large amount of device storage space and is difficult to be compatible with device scenarios with limited storage space.

Method used

The upgrade process involves downloading the BOOT upgrade package to the device's application partition, then using the program in the upgrade helper file to copy the new version of the BOOT program to the BOOT partition, overwriting the old version of the BOOT program, thus completing the upgrade. An additional download path is provided if the upgrade cannot be completed to improve security and success rate.

Benefits of technology

It effectively reduces the storage space required for BOOT upgrades, improves compatibility and upgrade efficiency in scenarios with limited device storage space, and reduces the probability of devices becoming bricked due to upgrade failures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018944A_ABST
    Figure CN122018944A_ABST
Patent Text Reader

Abstract

The invention provides a BOOT upgrading method and device and a storage medium, and belongs to the technical field of computers.The BOOT upgrading method comprises the steps that a first BOOT program of a BOOT partition in a device storage is called, and an upgrading file package is downloaded to an application program partition in the device storage; wherein the upgrading file package comprises a second BOOT program and an upgrading auxiliary file; calling a first program in the upgrading auxiliary file, copying a second BOOT program stored in the application program partition to the BOOT partition to cover the first BOOT program, and completing BOOT upgrading. According to the application, the storage space of the application program partition is directly used for temporarily storing related programs and files required by BOOT upgrading, other storage spaces do not need to be additionally arranged for storing the programs and the files, and the application can be effectively suitable for BOOT upgrading under the scene that storage spaces of household storage devices, micro inverters, relays, standby power boxes and other devices are small.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a BOOT upgrade method, device and storage medium. Background Technology

[0002] The BOOT bootloader is the first program executed after the microcontroller unit (MCU) is powered on. Although engineers design as many necessary functions as possible during the initial development of the BOOT to avoid future upgrades, it is difficult to truly avoid upgrading the BOOT forever due to the accelerating update cycle of embedded devices. Therefore, there is an urgent need to design a method for upgrading the BOOT.

[0003] Currently, a reverse upgrade method for BOOT has been proposed, which involves upgrading the BOOT bootloader through an application (APP).

[0004] However, the current method of reverse boot upgrade has high requirements for device memory storage space, requiring a large amount of storage space, which makes it difficult to be compatible with scenarios where devices have limited storage space, such as home storage devices. Summary of the Invention

[0005] This application provides a BOOT upgrade method, device, and storage medium to solve the problem of incompatibility with small storage space scenarios in existing technologies, such as home storage devices.

[0006] Firstly, this application provides a BOOT upgrade method, comprising: The first BOOT program in the BOOT partition of the device memory is invoked to download the upgrade file package to the application partition of the device memory; wherein, the upgrade file package includes a second BOOT program and upgrade auxiliary files; The first program in the upgrade auxiliary file is invoked to copy the second BOOT program stored in the application partition to the BOOT partition, thereby overwriting the first BOOT program and completing the BOOT upgrade.

[0007] In some embodiments, the method further includes: If the first condition is met, the second program in the upgrade auxiliary file is invoked to download the third BOOT program to the device memory, so that the third BOOT program can overwrite the first BOOT program and complete the BOOT upgrade. The first condition being met indicates that the BOOT upgrade cannot be completed using the second BOOT program.

[0008] In some embodiments, the step of calling the second program in the upgrade auxiliary file to download the third BOOT program to the device memory, so as to overwrite the first BOOT program with the third BOOT program and complete the BOOT upgrade, includes: The second program in the upgrade auxiliary file is invoked to download the third BOOT program to the BOOT partition, overwriting the first BOOT program and completing the BOOT upgrade.

[0009] In some embodiments, the step of calling the second program in the upgrade auxiliary file to download the third BOOT program to the device memory, so as to overwrite the first BOOT program with the third BOOT program and complete the BOOT upgrade, includes: The second program in the upgrade auxiliary file is invoked to download the third BOOT program to the partition in the application partition used to store the second BOOT program, thereby overwriting the second BOOT program; The first program in the upgrade auxiliary file is invoked to copy the third BOOT program to the BOOT partition, overwriting the first BOOT program, thus completing the BOOT upgrade.

[0010] In some embodiments, the method further includes: If the verification information included in the upgrade file package does not carry an upgrade flag, it is determined that the second BOOT program cannot complete the BOOT upgrade, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade; the verification information is used to verify the second BOOT program. And / or, If the second BOOT program in the application partition fails the verification and the number of attempts exceeds the first preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade. And / or, After copying the second BOOT program from the upgrade file package to the BOOT partition, if the second BOOT program in the BOOT partition fails the verification and the number of attempts exceeds the second preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade.

[0011] In some embodiments, the step of calling the first program in the upgrade helper file and copying the second BOOT program stored in the application partition to the BOOT partition includes: The first program in the upgrade auxiliary file is invoked to perform the following steps: The verification information further included in the upgrade file package is read, and the verification information is used to verify the second BOOT program; If the verification information is found to carry an upgrade flag, the second BOOT program in the upgrade file package is verified using the verification information. If the second BOOT program in the upgrade package passes verification, the second BOOT program stored in the application partition will be copied to the BOOT partition.

[0012] In some embodiments, after copying the second BOOT program stored in the application partition to the BOOT partition, the method further includes: The second BOOT program in the BOOT partition is verified using the verification information also included in the upgrade file package. If the verification of the second boot program in the boot partition is successful, the verification information is cleared in the application partition. Alternatively, the preset flag in the verification information can be set to a first value, which indicates that the BOOT has completed the upgrade.

[0013] In some embodiments, the method further includes: Upon completion of the BOOT upgrade, the device is reset and restarted, and the second BOOT program in the BOOT partition is invoked to upgrade the device's applications in order to reset the application partition.

[0014] Secondly, this application also provides a BOOT upgrade device, comprising: The download module is used to call the first BOOT program in the BOOT partition of the device memory and download the upgrade file package to the application partition of the device memory; wherein, the upgrade file package includes a second BOOT program and upgrade auxiliary files; The processing module is used to call the first program in the upgrade auxiliary file, copy the second BOOT program stored in the application partition to the BOOT partition to overwrite the first BOOT program and complete the BOOT upgrade.

[0015] In some embodiments, the download module is further configured to: If the first condition is met, the second program in the upgrade auxiliary file is invoked to download the third BOOT program to the device memory, so that the third BOOT program can overwrite the first BOOT program and complete the BOOT upgrade. The first condition being met indicates that the BOOT upgrade cannot be completed using the second BOOT program.

[0016] In some embodiments, the download module is further specifically used for: The second program in the upgrade auxiliary file is invoked to download the third BOOT program to the BOOT partition, overwriting the first BOOT program and completing the BOOT upgrade.

[0017] In some embodiments, the download module is further specifically used for: The second program in the upgrade auxiliary file is invoked to download the third BOOT program to the partition in the application partition used to store the second BOOT program, thereby overwriting the second BOOT program; The first program in the upgrade auxiliary file is invoked to copy the third BOOT program to the BOOT partition, overwriting the first BOOT program, thus completing the BOOT upgrade.

[0018] In some embodiments, the processing module is further configured to: If the verification information included in the upgrade file package does not carry an upgrade flag, it is determined that the second BOOT program cannot complete the BOOT upgrade, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade; the verification information is used to verify the second BOOT program. And / or, If the second BOOT program in the application partition fails the verification and the number of attempts exceeds the first preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade. And / or, After copying the second BOOT program from the upgrade file package to the BOOT partition, if the second BOOT program in the BOOT partition fails the verification and the number of attempts exceeds the second preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade.

[0019] In some embodiments, the processing module is specifically used for: The first program in the upgrade auxiliary file is invoked to perform the following steps: The verification information further included in the upgrade file package is read, and the verification information is used to verify the second BOOT program; If the verification information is found to carry an upgrade flag, the second BOOT program in the upgrade file package is verified using the verification information. If the second BOOT program in the upgrade package passes verification, the second BOOT program stored in the application partition will be copied to the BOOT partition.

[0020] In some embodiments, the processing module is further configured to: The second BOOT program in the BOOT partition is verified using the verification information also included in the upgrade file package. If the verification of the second boot program in the boot partition is successful, the verification information is cleared in the application partition. Alternatively, the preset flag in the verification information can be set to a first value, which indicates that the BOOT has completed the upgrade.

[0021] In some embodiments, the processing module is further configured to: reset and restart the device upon completion of a BOOT upgrade, and invoke a second BOOT program in the BOOT partition to upgrade the device's applications in order to reset the application partition.

[0022] Thirdly, this application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement a BOOT upgrade method as described in the first aspect above.

[0023] Fourthly, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a BOOT upgrade method as described in the first aspect above.

[0024] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements a BOOT upgrade method as described in the first aspect above.

[0025] Compared with existing technologies, the BOOT upgrade method, device, and storage medium provided in this application first call the currently usable first BOOT program stored in the device's BOOT partition, and then package and download the new version of the second BOOT program and upgrade auxiliary files required for the BOOT upgrade to the device's application partition. Subsequently, the first program in the upgrade auxiliary files can be called to copy the new version of the second BOOT program to the BOOT partition, so that the new version of the second BOOT program can overwrite the old version of the first BOOT program in the BOOT partition, thus completing the BOOT upgrade. This application directly utilizes the storage space of the application partition to temporarily store the relevant programs and files required for the BOOT upgrade, without the need for additional settings. The additional storage space stores these programs and files, effectively reducing the storage space required for BOOT upgrades. This method is not only effective for BOOT upgrades in scenarios with large storage space, such as industrial and commercial storage devices, but also for BOOT upgrades in scenarios with smaller storage space, such as residential storage devices, micro inverters, relays, and backup power boxes. Compared with existing BOOT upgrade methods, the BOOT upgrade method provided in this application has better compatibility and a wider range of applications. In addition, the downloaded upgrade file package includes both the new version of the second BOOT program and upgrade auxiliary files for BOOT upgrades. With a single download, the upgrade auxiliary files can be used to complete the BOOT upgrade, resulting in high efficiency.

[0026] Details of one or more embodiments provided in this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0027] The accompanying drawings, which are included to provide a further understanding of this application, form part of this application. Those skilled in the art will be able to obtain other drawings based on these drawings without any inventive effort. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is one of the flowcharts illustrating the BOOT upgrade method provided in this application.

[0028] Figure 2 This is one of the partition diagrams of the device memory in the BOOT upgrade method provided in this application.

[0029] Figure 3 This is the second schematic diagram of the partitioning of the device memory in the BOOT upgrade method provided in this application.

[0030] Figure 4 This is the second flowchart of the BOOT upgrade method provided in this application.

[0031] Figure 5 This is the third flowchart of the BOOT upgrade method provided in this application.

[0032] Figure 6 This is a schematic diagram of the BOOT upgrade device provided in this application.

[0033] Figure 7 This is a schematic diagram of the physical structure of the electronic device provided in this application. Detailed Implementation

[0034] To better understand the purpose, technical solutions, and advantages of this application, the technical solutions in this application will be clearly and completely described and explained below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0035] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by a person skilled in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these” used in this application do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled” used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, or B alone. Normally, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," "third," etc., used in this application are only used to distinguish similar objects and do not represent a specific order of objects.

[0036] The BOOT upgrade method, device, and storage medium of this application are described below with reference to the accompanying drawings.

[0037] Figure 1 This is one of the flowcharts illustrating the BOOT upgrade method provided in this application, such as... Figure 1 As shown, the BOOT upgrade method includes the following steps: Step 101: Call the first BOOT program in the BOOT partition of the device memory to download the upgrade file package to the application partition of the device memory; The upgrade package includes a second BOOT program and upgrade auxiliary files.

[0038] It should be noted that the first and second BOOT programs mentioned above are both BOOT programs, which are the first programs after the MCU is powered on and started.

[0039] It should also be noted that the first BOOT program mentioned above is the first BOOT program that is already stored in the device's BOOT partition and is currently usable. The second BOOT program is a new version of the BOOT program, and the upgrade auxiliary file is used to assist the device in completing the BOOT upgrade.

[0040] Optionally, the first BOOT program can be the BOOT program used by the device before the BOOT upgrade, and the second BOOT program is the BOOT program that needs to be updated now. This application embodiment does not limit the relationship between the versions of the first BOOT program and the second BOOT program.

[0041] It should also be noted that, for device memory, Figure 2 This is one of the partition diagrams of the device memory in the BOOT upgrade method provided in this application, such as... Figure 2 As shown in the figure, the device memory is partitioned. It can be seen that the device memory has a total of 256KB of storage space, which is divided into a BOOT partition and an application partition (i.e., APP partition). The BOOT partition is set to 0x00000000~0x00010000, with a total of 64KB of storage space, and the application partition is set to 0x00010000~0x00040000, with a total of 192KB of storage space.

[0042] For example, Figure 3 This is the second schematic diagram of the device memory partitioning in the BOOT upgrade method provided in this application, as shown below. Figure 3 As shown in the figure, the example illustrates how the upgrade file package is downloaded to the application partition of the device storage by calling the first BOOT program. It can be seen that the upgrade file package (e.g., update_boot.bin) can be stored in the application partition 0x00010000~0x00030000, occupying a total of 128KB of storage space in the application partition. Therefore, the application partition 0x00030000~0x00040000 (64KB in total) is free and unused.

[0043] Optionally, the upgrade package may also include verification information for verifying the second BOOT program (e.g., boot_new.bin), such as cyclic redundancy check (CRC) information.

[0044] For example, Figure 3 The example provided illustrates an upgrade file package that includes a second BOOT program, upgrade auxiliary files, and CRC information. The upgrade auxiliary files are stored, for example, in the application partition at locations 0x00010000~0x00020000, the CRC information is stored, for example, in the application partition at locations 0x00020000~0x00021000, and the second BOOT program is stored, for example, in the application partition at locations 0x00021000~0x00030000.

[0045] Step 102: Invoke the first program in the upgrade auxiliary file, copy the second BOOT program stored in the application partition to the BOOT partition to overwrite the first BOOT program, and complete the BOOT upgrade.

[0046] It should be noted that the first program in the aforementioned upgrade auxiliary file can be used for reverse boot upgrade. Specifically, by calling the first program, the second boot program stored in the application partition is copied to the boot partition, overwriting the old version of the first boot program originally stored in the boot partition, thus achieving a boot upgrade. The first program in the upgrade auxiliary file refers to an APP program with reverse boot upgrade functionality.

[0047] For example, such as Figure 3 As shown, after the upgrade file package is downloaded to the application partition by calling the first BOOT program, the device can call the first program stored in the upgrade auxiliary file in the application partition to copy the second BOOT program stored in the application partition to the BOOT partition, so as to overwrite the old version of the first BOOT program stored in the BOOT partition. Then, the newly stored second BOOT program in the BOOT partition can be called in the future, thus realizing the BOOT upgrade.

[0048] The BOOT upgrade method provided in this application first calls the currently usable first BOOT program stored in the device's BOOT partition. Then, it packages and downloads the new version of the second BOOT program and upgrade auxiliary files required for the BOOT upgrade to the device's application partition. Subsequently, it can call the first program in the upgrade auxiliary files to copy the new version of the second BOOT program to the BOOT partition, thereby overwriting the old version of the first BOOT program in the BOOT partition and completing the BOOT upgrade. This application directly utilizes the storage space of the application partition to temporarily store the relevant programs and files required for the BOOT upgrade, without needing to set up additional storage space for this... The storage of these programs and files effectively reduces the storage space required for BOOT upgrades. This method is not only applicable to BOOT upgrades in scenarios with large storage space, such as industrial and commercial storage devices, but also to BOOT upgrades in scenarios with smaller storage space, such as residential storage devices, micro inverters, relays, and backup power boxes. Compared with existing BOOT upgrade methods, the BOOT upgrade method provided in this application has better compatibility and a wider range of applications. In addition, the downloaded upgrade file package includes both the new version of the second BOOT program and upgrade auxiliary files for BOOT upgrades. With a single download, the upgrade auxiliary files can be used to complete the BOOT upgrade, resulting in high efficiency.

[0049] In some of these embodiments, a specific implementation of a BOOT upgrade is provided when a second BOOT program cannot complete the BOOT upgrade.

[0050] Figure 4 This is the second flowchart illustrating the BOOT upgrade method provided in this application, as shown below. Figure 4 As shown above, in the above Figure 1 Based on this, the above method may further include the following steps: Step 103: If the first condition is met, call the second program in the upgrade auxiliary file to download the third BOOT program to the device memory, so as to use the third BOOT program to overwrite the first BOOT program and complete the BOOT upgrade. Among them, meeting the first condition indicates that the BOOT upgrade cannot be completed using the second BOOT program.

[0051] It should be noted that the above Figure 4The example shown is that step 103 is executed after step 102. That is, after calling the first program in the upgrade auxiliary file to perform the BOOT upgrade, if it is detected that the BOOT upgrade cannot be completed, step 103 can be executed to download the third BOOT program for the BOOT upgrade to the device memory through the second program in the upgrade auxiliary file. The third BOOT program is used to overwrite the first BOOT program to complete the BOOT upgrade, which can effectively reduce the probability of the device becoming bricked due to the inability to upgrade.

[0052] For example, step 103 can also be performed before step 102. If it is determined that the BOOT upgrade cannot be completed before calling the first program in the upgrade auxiliary file to perform the BOOT upgrade, for example, if the second BOOT program downloaded to the application partition is found to have an abnormality such as failing verification, it is foreseeable that even if such an abnormal second BOOT program is copied to the BOOT partition, it will be difficult to complete the BOOT upgrade. In this case, step 103 can also be performed. By calling the second program in the upgrade auxiliary file, the third BOOT program used for the BOOT upgrade is downloaded to the device memory, so as to use the third BOOT program to overwrite the first BOOT program and complete the BOOT upgrade. This can effectively reduce the probability of the device becoming bricked due to the inability to upgrade.

[0053] It should also be noted that the second program in the aforementioned upgrade support file can be used to download a new BOOT program, for example, to the device's BOOT partition or application partition. The second program in the upgrade support file is an app program with BOOT download functionality.

[0054] Optionally, the newly downloaded third BOOT program can be the same as or different from the second BOOT program, and can be a new version of the BOOT program used for BOOT upgrades.

[0055] Optionally, satisfying the first condition includes, for example, at least one of the following: 1) The upgrade package was found to contain an upgrade flag in its verification information. 2) The second BOOT program in the application partition failed verification; 3) After copying the second BOOT program to the BOOT partition, the second BOOT program in the BOOT partition was detected as failing the verification.

[0056] It should be noted that the upgrade flag mentioned above is used to indicate whether the second BOOT program has changed after performing operations such as packaging and downloading. If the verification information does not carry the upgrade flag, it can be assumed that the second BOOT program has changed after performing operations such as packaging and downloading, and the BOOT upgrade cannot be completed using such a changed BOOT program.

[0057] It should also be noted that the verification information (such as CRC information) in the upgrade file package can be used to verify the second BOOT program in the application partition, as well as the second BOOT program in the BOOT partition.

[0058] In related technologies, a power outage during the BOOT upgrade process may brick the device, rendering it permanently unusable. Once bricked, the device typically needs to be returned to the factory for repair. It can be reprogrammed using debugging interfaces such as the Joint Test Action Group (JTAG) and Serial Wire Debug (SWD), but these methods are time-consuming and labor-intensive, and may damage the original casing, leading to permanent damage.

[0059] To address the aforementioned issues, this application embodiment, under the first condition (i.e., when it is determined that the second BOOT program stored in the application partition cannot complete the BOOT upgrade), can also download a new version of the third BOOT program for BOOT upgrade to the device memory by calling the second program in the upgrade auxiliary file, so that the BOOT upgrade can be completed using the newly downloaded third BOOT program. In this application, even if the device cannot complete the BOOT upgrade, the second program in the upgrade auxiliary file can continue the file download and copying process, thus providing an escape route after determining that the BOOT upgrade cannot be completed, reducing the probability of the device becoming bricked due to the inability to complete the BOOT upgrade, and improving the security and success rate of the BOOT upgrade.

[0060] In some embodiments, a specific implementation of BOOT upgrade using a second program in the upgrade support file is provided. Specifically, step 103 above may include the following sub-steps: Step 103-1: Call the second program in the upgrade auxiliary file to download the third BOOT program to the BOOT partition to overwrite the first BOOT program and complete the BOOT upgrade.

[0061] Specifically, the device can download the new version of the third BOOT program directly to the BOOT partition by calling the second program in the upgrade auxiliary file, so that the third BOOT program overwrites the old version of the first BOOT program in the BOOT partition, thus completing the BOOT upgrade.

[0062] In this embodiment, if it is determined that the BOOT upgrade cannot be completed, the device can directly download the third BOOT program to the BOOT partition by calling the second program in the upgrade auxiliary file to perform the BOOT upgrade. Using the second program in the upgrade auxiliary file, the device can also continue the file download and copy process. That is, it provides an escape route after it is determined that the BOOT upgrade cannot be completed, reducing the probability of the device becoming bricked due to the inability to complete the BOOT upgrade, and improving the security and success rate of the BOOT upgrade.

[0063] In some embodiments, another specific implementation of BOOT upgrade using a second program in the upgrade support file is provided. Specifically, step 103 above may include the following sub-steps: Steps 103-21: Invoke the second program in the upgrade auxiliary file to download the third BOOT program to the partition in the application partition used to store the second BOOT program, so as to overwrite the second BOOT program; Steps 103-22: Invoke the first program in the upgrade auxiliary file, copy the third BOOT program to the BOOT partition to overwrite the first BOOT program, and complete the BOOT upgrade.

[0064] Specifically, the device can first download the new version of the third boot program to the partition in the application partition used to store the second boot program by calling the second program in the upgrade auxiliary file. Figure 3 The numbers 0x00021000~0x00030000 are used to overwrite the previously downloaded second BOOT program, thus allowing the first program in the upgrade auxiliary file to be called. Figure 3 The third BOOT program stored in partitions 0x00021000~0x00030000 is copied to the BOOT partition to overwrite the old version of the first BOOT program stored in the BOOT partition, thus completing the BOOT upgrade.

[0065] Alternatively, the device can also download the new version of the third BOOT program to an empty location in the application partition by calling the second program in the upgrade auxiliary file, and then use the first program in the upgrade auxiliary file to copy the newly downloaded third BOOT program to the BOOT partition to achieve BOOT upgrade.

[0066] In this embodiment, if it is determined that a BOOT upgrade cannot be completed, the device can call the second program in the upgrade auxiliary file to download the third BOOT program to the partition in the application partition used to store the second BOOT program. After the third BOOT program is fully downloaded, the device can then call the first program in the upgrade auxiliary file to copy the newly downloaded third BOOT program to the BOOT partition for BOOT upgrade. Using the second program in the upgrade auxiliary file, the device can continue the file download and copying process, thus providing an escape route after determining that a BOOT upgrade cannot be completed. This reduces the probability of the device becoming unusable due to the inability to complete the BOOT upgrade and improves the BOOT upgrade efficiency. The security and success rate of OT upgrades are improved. Furthermore, during the download of the third BOOT program to the partition in the application partition used to store the second BOOT program, the first BOOT program in the BOOT partition can still be called normally. Even if the device loses power during the download process, as long as the BOOT program in the BOOT partition has not been erased, the device will not become unusable. Only a power outage during program copying could lead to device unusability. The time required for program copying is usually very short, and the reliability of copying via memory within the device is higher. The probability of BOOT upgrade failure during the copying process is very low. Therefore, the embodiments of this application can further improve the security and success rate of BOOT upgrades.

[0067] In some embodiments, several specific implementations of BOOT upgrades are provided. The above BOOT upgrade method includes the following steps: If the upgrade flag is not included in the verification information in the upgrade file package, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade; the verification information is used to verify the second BOOT program. And / or, If the second BOOT program in the application partition fails the verification and the number of attempts exceeds the first preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade. And / or, After copying the second BOOT program from the upgrade package to the BOOT partition, if the second BOOT program in the BOOT partition fails the verification and the number of attempts exceeds the second preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade.

[0068] Specifically, BOOT upgrades can be divided into the following categories: 1) If the device detects that the verification information included in the upgrade file package does not carry the upgrade flag, it can be assumed that the second BOOT program has changed after performing operations such as packaging and downloading. In this case, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the device can wait for the user to call the second program in the upgrade auxiliary file to perform the BOOT upgrade.

[0069] This embodiment provides an escape route after determining that a BOOT upgrade cannot be completed, reducing the probability of the device becoming unusable due to the inability to complete the BOOT upgrade, and improving the safety and success rate of the BOOT upgrade.

[0070] 2) After the device detects that the second BOOT program in the application partition has failed verification, it can try to re-verify until the number of attempts exceeds the first preset threshold and still fails verification. Then it can be considered that the second BOOT program cannot complete the BOOT upgrade and needs to wait for the second program in the upgrade auxiliary file to be called to perform the BOOT upgrade.

[0071] It should be noted that the first preset threshold can be set according to the actual situation, for example, it can be set to an integer greater than 0.

[0072] This embodiment provides an escape route after determining that the BOOT upgrade cannot be completed, reducing the probability of the device becoming bricked due to the inability to complete the BOOT upgrade, and improving the security and success rate of the BOOT upgrade. In addition, by setting the condition that the number of verification attempts is greater than a first preset threshold, the situation of verification misjudgment is effectively reduced, which can further improve the efficiency and success rate of the BOOT upgrade.

[0073] 3) After the device copies the second BOOT program from the upgrade file package to the BOOT partition, if it detects that the second BOOT program in the BOOT partition has failed verification and the number of attempts is greater than the second preset threshold, it will determine that the BOOT upgrade cannot be completed using the second BOOT program and wait to call the second program in the upgrade auxiliary file to perform the upgrade.

[0074] It should be noted that the second preset threshold can be set according to the actual situation, for example, it can be set to an integer greater than 0.

[0075] This embodiment provides an escape route after determining that the BOOT upgrade cannot be completed, reducing the probability of the device becoming bricked due to the inability to complete the BOOT upgrade, and improving the security and success rate of the BOOT upgrade. In addition, by setting the condition that the number of verification attempts is greater than a second preset threshold, the situation of verification misjudgment is effectively reduced, which can further improve the efficiency and success rate of the BOOT upgrade.

[0076] In some embodiments, a specific implementation is provided that calls the first program in the upgrade auxiliary file to perform a BOOT upgrade. Step 102 above may include the following steps: The first program in the upgrade help file is invoked to perform the following steps: S1-1, Read the verification information also included in the upgrade file package. The verification information is used to verify the second BOOT program. S1-2, If the verification information contains an upgrade flag, the second BOOT program in the upgrade file package is verified using the verification information. S1-3, if the second BOOT program in the upgrade package passes verification, copy the second BOOT program stored in the application partition to the BOOT partition.

[0077] Specifically, the device can call the first program in the upgrade auxiliary file to first read the verification information included in the upgrade file package, such as CRC information, and then check whether the verification information carries an upgrade flag. If it does not carry an upgrade flag, it waits to call the second program in the upgrade auxiliary file to perform the upgrade. If it carries an upgrade flag, it further uses the verification information to verify the second BOOT program in the upgrade file package. If the second BOOT program in the upgrade file package fails the verification, it waits to call the second program in the upgrade auxiliary file to perform the upgrade. If the second BOOT program in the upgrade file package passes the verification, it is considered that the new version of the second BOOT program has no abnormalities and can be used for BOOT upgrade. At this time, the first program in the upgrade auxiliary file can be called to copy the second BOOT program to the BOOT partition for BOOT upgrade.

[0078] In this embodiment, after the device performs a BOOT upgrade using the second BOOT program, it can first read the verification information in the upgrade file package to verify whether the second BOOT program stored in the application partition is abnormal. If no abnormality is found, the device can then use the second BOOT program to perform the BOOT upgrade. Otherwise, it can directly wait to call the second program in the upgrade auxiliary file to perform the upgrade. This improves the success rate of the BOOT upgrade and avoids the need to use the abnormal second BOOT program for the BOOT upgrade.

[0079] In some embodiments, a specific implementation method is provided for processing verification information after completing the BOOT upgrade. Following step 102 above, the following steps may also be included: Step 104: Use the verification information included in the upgrade package to verify the second BOOT program in the BOOT partition; Step 105: If the verification of the second BOOT program in the BOOT partition is successful, clear the verification information in the application partition, or set the preset flag in the verification information to the first value. The first value is used to indicate that the BOOT has been upgraded.

[0080] Specifically, after the device uses the first program in the upgrade auxiliary file to copy the second BOOT program stored in the application partition to the BOOT partition to overwrite the first BOOT program, it can use the verification information in the upgrade file package to verify the newly stored second BOOT program in the BOOT partition. If the verification fails, the BOOT upgrade is considered to have failed, and the device waits to call the second program in the upgrade auxiliary file to perform the upgrade. If the verification passes, the BOOT upgrade is considered to have succeeded, and the newly stored second BOOT program in the BOOT partition can be called normally in the future.

[0081] It should be noted that after a successful BOOT upgrade, the device needs to be reset and restarted. If the original upgrade file package is still retained in the application partition, the device will think that it needs to use the upgrade file package to perform another BOOT upgrade, thus causing the device to perform BOOT upgrades in a loop.

[0082] To avoid the above situation, this application embodiment sets that after the second BOOT program verification in the BOOT partition is passed, that is, after the BOOT upgrade is determined to be successful, the verification information in the application partition can be cleared to indicate that the BOOT upgrade has been completed. In this way, after resetting and restarting the device, since the device does not read the above verification information in the application partition, it is determined that the BOOT upgrade has been completed, and the device will no longer call the first program in the upgrade auxiliary file to perform the BOOT upgrade, thus avoiding the device from repeatedly performing the BOOT upgrade, so that the device can be used normally after the BOOT upgrade.

[0083] Alternatively, in this embodiment of the application, after the second BOOT program in the BOOT partition is verified to be successful, that is, after the BOOT upgrade is confirmed to be successful, the preset flag bit in the verification information is set to the first value to indicate that the BOOT upgrade has been completed. In this way, after the device is reset and restarted, the device recognizes that the preset flag bit in the verification information is the first value, and can determine that the BOOT upgrade has been completed. It will no longer call the first program in the upgrade auxiliary file to perform the BOOT upgrade, thus avoiding the device from performing the BOOT upgrade repeatedly, so that the device after the BOOT upgrade can be used normally in the future.

[0084] In some embodiments, a specific implementation is provided for resetting the application partition after a BOOT upgrade. The method may also include: Step 106: After completing the BOOT upgrade, reset and restart the device, and call the second BOOT program in the BOOT partition to upgrade the device's applications in order to reset the application partition.

[0085] It should be noted that step 106 can be executed after the BOOT upgrade is completed in step 102, or after the BOOT upgrade is completed and the verification information is processed in step 105. The execution order can be set according to the actual situation, and this application does not restrict it.

[0086] Specifically, after the device completes the BOOT upgrade, it can be reset and restarted. The device's applications can be upgraded by calling the second BOOT program in the BOOT partition. In this way, the application partition can be reset and the upgrade file package previously stored in the application partition can be released. The application can also be upgraded by using the second BOOT program newly stored in the BOOT partition. This allows for timely verification of whether the full functionality of the BOOT can be operated normally after the upgrade. If there are any abnormalities, it is convenient for technicians to handle them in a timely manner.

[0087] The following example illustrates the BOOT upgrade method provided in this application. The overall technical concept of the BOOT upgrade method in this application is as follows: Package the APP file with reverse upgrade BOOT (i.e., the upgrade auxiliary file mentioned above) and the new version of BOOT program (i.e., the second BOOT program mentioned above) together, ensuring that the size of the packaged upgrade file does not exceed the application partition. Then, call the old version of BOOT program (i.e., the first BOOT program mentioned above) to download the packaged upgrade file to the application partition. After the upgrade file runs in the application, the upgrade auxiliary file can be used to copy the new version of BOOT program to the BOOT partition where the old version of BOOT program is located.

[0088] If the copy is successful, the new version of the BOOT program can be called subsequently; if the copy fails, the download function of the upgrade auxiliary file can be used to wait for the file download instruction, which can download the new version of the BOOT program (here it is considered to be the third BOOT program mentioned above) to the BOOT partition where the old version of the BOOT program is located, or to the location where the new version of the BOOT program is stored in the application partition.

[0089] If the download is to the BOOT partition where the old version of the BOOT program is located, the BOOT upgrade is complete once the download is finished; if the download is to the location where the new version of the BOOT program is stored in the application partition, then another copy operation is required to complete the BOOT upgrade.

[0090] After a successful BOOT upgrade, the application can be upgraded immediately to ensure that the business applications can continue to run.

[0091] like Figure 2 and Figure 3 The images shown are schematic diagrams of the device's memory before and after the BOOT upgrade. Figure 3 In the process, the new version's second BOOT program is named, for example, boot_new.bin, and the CRC information is the CRC information of boot_new.bin. The upgrade auxiliary file is named, for example, boot_app.bin, which is an APP file with reverse upgrade BOOT function and download BOOT function. The packaged upgrade file package is named, for example, update_boot.bin, which can be understood as an APP firmware composed of boot_app.bin, CRC information, and boot_new.bin.

[0092] After the reverse boot upgrade is complete, upgrading the app with the new boot version will restore the device's storage partitions to their original state. Figure 2 The format shown.

[0093] The following is a specific implementation of the BOOT upgrade method. Figure 5 This is the third flowchart of the BOOT upgrade method provided in this application, as shown below. Figure 5 As shown, the BOOT upgrade method includes the following steps: Step 501: Power on the device and run the upgrade package in the application partition.

[0094] Step 502: Read the CRC information from the upgrade file package.

[0095] Step 503: Determine if there is an upgrade flag in the CRC information. If yes, proceed to step 504; otherwise, proceed to step 508.

[0096] Step 504: Determine whether the second BOOT program in the upgrade file package has passed the verification. If yes, proceed to step 505; otherwise, proceed to step 508.

[0097] Specifically, the device can use CRC information to determine whether the second BOOT program in the upgrade file package has passed verification.

[0098] Step 505: Copy the second BOOT program from the upgrade package to the BOOT partition.

[0099] Step 506: Determine whether the second BOOT program in the BOOT partition has passed the verification. If yes, proceed to step 507; otherwise, proceed to step 508.

[0100] Specifically, the device can use CRC information to determine whether the second BOOT program in the BOOT partition has passed verification.

[0101] Step 507: Clear the CRC information in the application partition.

[0102] Step 508: Wait for the upgrade auxiliary file in the upgrade file package to be called and execute the BOOT upgrade process.

[0103] Specifically, the above BOOT upgrade process can be implemented in the following two ways: 1) Directly upgrade the BOOT partition, which means directly downloading the new version of the third-party BOOT program to the BOOT partition. This method has a higher probability of bricking the device because the download process is relatively long, and if the power is interrupted during the download, it may cause the device to become bricked.

[0104] 2) First, upgrade the location of the second BOOT program stored in the application partition. After the third BOOT program is downloaded, trigger the copying process for the third BOOT program. This method has a much lower probability of bricking the device. Even if the power is interrupted during the download process, as long as the BOOT partition is not erased, the device will not be bricked. The reverse BOOT upgrade process can be executed again on the next restart. Only a power outage during the copying process can cause the device to brick. The copying process is very short, and the onboard memory copying is more reliable. The probability of failure during the copying process is very low. Therefore, this embodiment is a safer remedial measure after a reverse BOOT upgrade fails.

[0105] Step 509: Determine if the BOOT upgrade is complete. If yes, proceed to step 510; otherwise, return to step 508.

[0106] Step 510: Reset and restart the device, and execute the second BOOT program in the BOOT partition.

[0107] Step 511: Upgrade the business app.

[0108] Step 512: Determine whether the business APP has been upgraded. If yes, proceed to step 513; otherwise, return to step 511.

[0109] Step 513: Execute the upgraded business APP (upgrade complete).

[0110] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0111] In the embodiments of this application, at least the following beneficial effects exist: 1) Safer: After a failed BOOT upgrade, the upgrade auxiliary file can be used to continue the file download and copying process, providing an escape route after a copying failure and reducing the probability of the device becoming bricked due to power failure.

[0112] 2) Smaller storage space: BOOT upgrades require less storage space. BOOT upgrades can be performed directly using the application partition without the need for additional storage space. This is not only effective for BOOT upgrades in scenarios with large storage space, such as industrial and commercial storage devices, but also compatible with BOOT upgrades in scenarios with smaller storage space, such as residential storage devices, micro inverters, relays, and backup power boxes.

[0113] 3) More reasonable process: The BOOT upgrade process is more reasonable. After the BOOT upgrade is completed, the APP needs to be upgraded in time. This allows for timely verification of whether the upgraded BOOT functions properly. In case of any abnormalities, they can be dealt with in a timely manner.

[0114] This application also provides a BOOT upgrade device for implementing the above embodiments and preferred embodiments, which will not be repeated hereafter. The terms "module," "unit," "subunit," etc., used below refer to combinations of software and / or hardware that implement a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated. The BOOT upgrade device provided in this application is described below, and the BOOT upgrade device described below corresponds to the BOOT upgrade method described above.

[0115] Figure 6 This is a structural diagram of the BOOT upgrade device provided in this application, as shown below. Figure 6 As shown, the BOOT upgrade device 600 includes: The download module 601 is used to call the first BOOT program in the BOOT partition of the device memory to download the upgrade file package to the application partition of the device memory; wherein, the upgrade file package includes a second BOOT program and upgrade auxiliary files; The processing module 602 is used to call the first program in the upgrade auxiliary file, copy the second BOOT program stored in the application partition to the BOOT partition to overwrite the first BOOT program and complete the BOOT upgrade.

[0116] In some embodiments, the download module 601 is further configured to: If the first condition is met, the second program in the upgrade auxiliary file is invoked to download the third BOOT program to the device memory, so as to overwrite the first BOOT program with the third BOOT program and complete the BOOT upgrade. Among them, meeting the first condition indicates that the BOOT upgrade cannot be completed using the second BOOT program.

[0117] In some embodiments, the download module 601 is further specifically used for: The second program in the upgrade auxiliary file is invoked to download the third BOOT program to the BOOT partition, overwriting the first BOOT program and completing the BOOT upgrade.

[0118] In some embodiments, the download module 601 is further specifically used for: The second program in the upgrade auxiliary file is invoked to download the third BOOT program to the partition in the application partition used to store the second BOOT program, thereby overwriting the second BOOT program; The first program in the upgrade auxiliary file is invoked, and the third BOOT program is copied to the BOOT partition to overwrite the first BOOT program, thus completing the BOOT upgrade.

[0119] In some embodiments, the processing module 602 is further configured to: If the upgrade flag is not included in the verification information in the upgrade file package, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade; the verification information is used to verify the second BOOT program. And / or, If the second BOOT program in the application partition fails the verification and the number of attempts exceeds the first preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade. And / or, After copying the second BOOT program from the upgrade package to the BOOT partition, if the second BOOT program in the BOOT partition fails the verification and the number of attempts exceeds the second preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade.

[0120] In some embodiments, the processing module 602 is specifically used for: The first program in the upgrade help file is invoked to perform the following steps: The upgrade file package also includes verification information, which is used to verify the second BOOT program. If an upgrade flag is detected in the verification information, the second BOOT program in the upgrade file package is verified using the verification information. If the second boot program in the upgrade package passes verification, copy the second boot program stored in the application partition to the boot partition.

[0121] In some embodiments, the processing module 602 is further configured to: The second boot program in the boot partition is verified using the verification information included in the upgrade package. If the verification of the second boot program in the boot partition is successful, clear the verification information in the application partition. Alternatively, the preset flag in the verification information can be set to the first value, which indicates that the BOOT has completed the upgrade.

[0122] In some embodiments, the processing module 602 is further configured to: reset and restart the device upon completion of the BOOT upgrade, and call the second BOOT program in the BOOT partition to upgrade the device's applications in order to reset the application partition.

[0123] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0124] Figure 7 This is a schematic diagram of the physical structure of the electronic device provided in this application, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a BOOT upgrade method, which includes: The first boot program in the BOOT partition of the device memory is invoked to download the upgrade file package to the application partition of the device memory; the upgrade file package includes a second boot program and upgrade auxiliary files; The first program in the upgrade auxiliary file is invoked, and the second BOOT program stored in the application partition is copied to the BOOT partition to overwrite the first BOOT program, thus completing the BOOT upgrade.

[0125] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0126] This application also provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0127] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0128] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program: Step 1: Invoke the first BOOT program in the BOOT partition of the device memory to download the upgrade file package to the application partition of the device memory; wherein, the upgrade file package includes the second BOOT program and upgrade auxiliary files.

[0129] Step 2: Call the first program in the upgrade auxiliary file to copy the second BOOT program stored in the application partition to the BOOT partition to overwrite the first BOOT program and complete the BOOT upgrade.

[0130] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0131] On the other hand, in conjunction with the BOOT upgrade method provided in the above embodiments, this application also provides a non-transitory computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above BOOT upgrade method embodiments.

[0132] In another aspect, in conjunction with the BOOT upgrade method provided in the above embodiments, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0133] The apparatus and equipment embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions 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 this application.

Claims

1. A BOOT upgrade method, characterized in that, include: The first BOOT program in the BOOT partition of the device memory is invoked to download the upgrade file package to the application partition of the device memory; wherein, the upgrade file package includes a second BOOT program and upgrade auxiliary files; The first program in the upgrade auxiliary file is invoked to copy the second BOOT program stored in the application partition to the BOOT partition, thereby overwriting the first BOOT program and completing the BOOT upgrade.

2. The BOOT upgrade method according to claim 1, characterized in that, The method further includes: If the first condition is met, the second program in the upgrade auxiliary file is invoked to download the third BOOT program to the device memory, so that the third BOOT program can overwrite the first BOOT program and complete the BOOT upgrade. The first condition being met indicates that the BOOT upgrade cannot be completed using the second BOOT program.

3. The BOOT upgrade method according to claim 2, characterized in that, The step of calling the second program in the upgrade auxiliary file to download the third BOOT program to the device memory, so as to use the third BOOT program to overwrite the first BOOT program and complete the BOOT upgrade, includes: The second program in the upgrade auxiliary file is invoked to download the third BOOT program to the BOOT partition, overwriting the first BOOT program and completing the BOOT upgrade.

4. The BOOT upgrade method according to claim 2, characterized in that, The step of calling the second program in the upgrade auxiliary file to download the third BOOT program to the device memory, so as to use the third BOOT program to overwrite the first BOOT program and complete the BOOT upgrade, includes: The second program in the upgrade auxiliary file is invoked to download the third BOOT program to the partition in the application partition used to store the second BOOT program, thereby overwriting the second BOOT program; The first program in the upgrade auxiliary file is invoked to copy the third BOOT program to the BOOT partition, overwriting the first BOOT program, thus completing the BOOT upgrade.

5. The BOOT upgrade method according to any one of claims 1-4, characterized in that, The method further includes: If the verification information included in the upgrade file package does not carry an upgrade flag, it is determined that the second BOOT program cannot complete the BOOT upgrade, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade; the verification information is used to verify the second BOOT program. And / or, If the second BOOT program in the application partition fails the verification and the number of attempts exceeds the first preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade. And / or, After copying the second BOOT program from the upgrade file package to the BOOT partition, if the second BOOT program in the BOOT partition fails the verification and the number of attempts exceeds the second preset threshold, it is determined that the BOOT upgrade cannot be completed using the second BOOT program, and the system waits to call the second program in the upgrade auxiliary file to perform the upgrade.

6. The BOOT upgrade method according to claim 1, characterized in that, The step of calling the first program in the upgrade auxiliary file and copying the second BOOT program stored in the application partition to the BOOT partition includes: The first program in the upgrade auxiliary file is invoked to perform the following steps: The verification information further included in the upgrade file package is read, and the verification information is used to verify the second BOOT program; If the verification information is found to carry an upgrade flag, the second BOOT program in the upgrade file package is verified using the verification information. If the second BOOT program in the upgrade package passes verification, the second BOOT program stored in the application partition will be copied to the BOOT partition.

7. The BOOT upgrade method according to claim 1 or 6, characterized in that, After copying the second BOOT program stored in the application partition to the BOOT partition, the method further includes: The second BOOT program in the BOOT partition is verified using the verification information also included in the upgrade file package. If the verification of the second boot program in the boot partition is successful, the verification information is cleared in the application partition. Alternatively, the preset flag in the verification information can be set to a first value, which indicates that the BOOT has completed the upgrade.

8. The BOOT upgrade method according to claim 1, characterized in that, The method further includes: Upon completion of the BOOT upgrade, the device is reset and restarted, and the second BOOT program in the BOOT partition is invoked to upgrade the device's applications in order to reset the application partition.

9. A BOOT upgrade device, characterized in that, include: The download module is used to call the first BOOT program in the BOOT partition of the device memory and download the upgrade file package to the application partition of the device memory; wherein, the upgrade file package includes a second BOOT program and upgrade auxiliary files; The processing module is used to call the first program in the upgrade auxiliary file, copy the second BOOT program stored in the application partition to the BOOT partition to overwrite the first BOOT program and complete the BOOT upgrade.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the BOOT upgrade method as described in any one of claims 1 to 8.