Search

CN-122019254-A - Dual-backup upgrading method and medium of intelligent terminal

CN122019254ACN 122019254 ACN122019254 ACN 122019254ACN-122019254-A

Abstract

The application relates to the technical field of application program upgrading, in particular to a dual-backup upgrading method and medium of an intelligent terminal, and aims to solve the technical problem that a system cannot be started or restarted repeatedly due to upgrading of existing equipment. The dual-backup upgrading method of the intelligent terminal comprises the steps of responding to an upgrading instruction, storing an application program to be upgraded and first verification information into a first storage area and obtaining upgrading zone bits, after the intelligent terminal is restarted, verifying the validity of the application program to be upgraded according to the upgrading zone bits and the first verification information, writing the application program to be upgraded into a second storage area and jumping to the application program to be upgraded to start after verification is passed, judging whether the application program to be upgraded is normally started or not by the guiding loading program based on the starting zone bits, and if not, replacing the backup application program to the second storage area by the guiding loading program, so that the reliability and the running stability of firmware upgrading are remarkably improved.

Inventors

  • SUN YAXIN
  • WANG WENGANG
  • YANG ZHIMENG
  • GAO JUNJIE

Assignees

  • 青岛乾程科技股份有限公司

Dates

Publication Date
20260512
Application Date
20260104

Claims (10)

  1. 1. The double-backup upgrading method for the intelligent terminal is characterized in that the intelligent terminal comprises a boot loader and an application program, wherein the application program at least comprises an application program to be upgraded and a backup application program, and the method comprises the following steps: responding to an upgrade instruction, storing an application program to be upgraded and first check information into a first storage area and acquiring an upgrade flag bit; After the intelligent terminal is restarted, the boot loader verifies the validity of the application program to be upgraded according to the upgrade flag bit and the first verification information; After the verification is passed, writing the application program to be upgraded into a second storage area and jumping to the application program to be upgraded for starting; the boot loader judges whether the application program to be upgraded is started normally or not based on the starting flag bit; if not, the boot loader replaces the backup application program to the second storage area.
  2. 2. The dual backup upgrade method of an intelligent terminal according to claim 1, wherein the first storage area is an external flash memory of the intelligent terminal, and the second storage area is a storage area of an embedded flash memory of the intelligent terminal.
  3. 3. The dual backup upgrade method of an intelligent terminal according to claim 1, wherein the first check information is a CRC check value of an application program to be upgraded, and the CRC check value is stored in the first storage area after being extracted from the upgrade instruction by the intelligent terminal.
  4. 4. The dual-backup upgrade method of an intelligent terminal according to claim 1, wherein the obtaining the upgrade flag bit includes storing the application program to be upgraded and the verification information in the first storage area, and then obtaining the upgrade flag bit with the upgrade flag bit being 1.
  5. 5. The dual backup upgrade method of an intelligent terminal according to claim 1, wherein the boot loader verifies the validity of the application program to be upgraded according to the upgrade flag bit and the first verification information, comprising: the boot loader determines whether the upgrade flag bit is consistent with a preset flag bit; If yes, the boot loader determines second check information based on the application program to be upgraded; And comparing the second check information with the first check information, if the comparison is consistent, judging that the check is passed, otherwise, judging that the check is not passed.
  6. 6. The dual backup upgrade method of an intelligent terminal according to claim 2, wherein the bootloader judges whether the application program to be upgraded is normally started based on a start flag bit, comprising: Each time the boot loader is started, accumulating the value of the starting zone bit by a preset value; if the application program to be upgraded is started normally and runs for a preset time, the application program to be upgraded is determined to be started normally; If the application program to be upgraded is started abnormally, continuously accumulating the starting zone bit; And when the starting zone bit is larger than a preset threshold value, determining that the application program to be upgraded is finally started abnormally.
  7. 7. The dual backup upgrade method of an intelligent terminal according to claim 6, wherein the backup application program is pre-stored in a third storage area, and the backup application program is an application program that normally operates before the upgrade of the intelligent terminal, and the third storage area is another storage area independent of the second storage area in the embedded flash memory.
  8. 8. The method for upgrading dual backup of intelligent terminal according to claim 7, wherein the method further comprises storing the upgrading application program to the third storage area for backup after the application program to be upgraded starts normally.
  9. 9. The dual backup upgrade method of an intelligent terminal according to claim 1, wherein the intelligent terminal is an intelligent measurement switch.
  10. 10. A computer readable storage medium having stored therein a plurality of program codes, wherein the program codes are adapted to be loaded and executed by a processor to perform the dual backup upgrade method of the intelligent terminal of any one of claims 1 to 9.

Description

Dual-backup upgrading method and medium of intelligent terminal Technical Field The invention relates to the technical field of application program upgrading, and particularly provides a dual-backup upgrading method and medium of an intelligent terminal. Background In products such as intelligent terminals developed based on a singlechip platform, firmware upgrading is an important means for realizing functional iteration and bug repair. The product adopts a dual-firmware architecture of a boot loader and an application program, and the upgrading process is usually triggered by an external instruction, and the starting switching is completed after the new version application program is written into a storage area. However, the existing upgrading scheme generally lacks a reliable fault-tolerant backup mechanism, and the repeated restarting and incapability of starting of the product are easy to occur after upgrading, so that the use reliability and the user experience of the product are seriously affected. Specifically, the prior art has the following problems that the newly upgraded application program version may have defects of code loopholes, logic errors and the like, so that the product cannot be initialized normally after being upgraded, and falls into the dead loop of repeated restarting or direct starting failure; the method has the advantages that the parameter adaptation difference exists between the new application program version and the old application program version, the hardware configuration parameters, the data storage format and other processing logics are incompatible, the system starting abnormality or repeated restarting is further caused, the problems of upgrading instruction errors, data transmission packet loss and the like easily occur in the process of upgrading the new version program, the software is not matched with a single chip microcomputer hardware platform, finally, the product cannot be started after being upgraded, and even the product needs to be manually disassembled for maintenance. Aiming at the problems, once the upgrade fails, the normal running state before the upgrade cannot be recovered, so that the product is stopped and the operation and maintenance cost is increased. Disclosure of Invention The present application has been made to overcome the above-mentioned drawbacks, and provides a solution or at least partially solves the technical problem that the system of the existing device cannot be started or restarted repeatedly due to upgrade. The application provides a dual-backup upgrading method and medium of an intelligent terminal. In a first aspect, the present application provides a dual backup upgrade method for an intelligent terminal, where the intelligent terminal includes a boot loader and an application program, the application program includes at least an application program to be upgraded and a backup application program, and the method includes: responding to an upgrade instruction, storing an application program to be upgraded and first check information into a first storage area and acquiring an upgrade flag bit; After the intelligent terminal is restarted, the boot loader verifies the validity of the application program to be upgraded according to the upgrade flag bit and the first verification information; After the verification is passed, writing the application program to be upgraded into a second storage area and jumping to the application program to be upgraded for starting; the boot loader judges whether the application program to be upgraded is started normally or not based on the starting flag bit; if not, the boot loader replaces the backup application program to the second storage area. In one embodiment of the dual backup upgrade method of the intelligent terminal, the first storage area is an external flash memory of the intelligent terminal, and the second storage area is a storage area of an embedded flash memory of the intelligent terminal. In one embodiment of the dual backup upgrade method of the intelligent terminal, the first check information is a CRC check value of the application to be upgraded, and the CRC check value is stored in the first storage area after being extracted from the upgrade instruction by the intelligent terminal. In one embodiment of the dual-backup upgrade method of the intelligent terminal, the step of obtaining the upgrade flag bit includes storing the application program to be upgraded and the verification information in the first storage area, and then obtaining the upgrade flag bit with the upgrade flag position of 1. In one embodiment of the dual backup upgrade method of an intelligent terminal of the present application, the boot loader checks the validity of the application to be upgraded according to the upgrade flag bit and the first check information, including: the boot loader determines whether the upgrade flag bit is consistent with a preset flag bit; If yes, the boot loader determines sec