CN114995854A - Application program online upgrading method and device, terminal and operation machine - Google Patents

Application program online upgrading method and device, terminal and operation machine Download PDF

Info

Publication number
CN114995854A
CN114995854A CN202210613696.XA CN202210613696A CN114995854A CN 114995854 A CN114995854 A CN 114995854A CN 202210613696 A CN202210613696 A CN 202210613696A CN 114995854 A CN114995854 A CN 114995854A
Authority
CN
China
Prior art keywords
file
mark
program
upgrading
current value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210613696.XA
Other languages
Chinese (zh)
Inventor
童晓斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Sany Intelligent Control Equipment Co Ltd
Original Assignee
Hunan Sany Intelligent Control Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Sany Intelligent Control Equipment Co Ltd filed Critical Hunan Sany Intelligent Control Equipment Co Ltd
Priority to CN202210613696.XA priority Critical patent/CN114995854A/en
Publication of CN114995854A publication Critical patent/CN114995854A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of equipment upgrading, and provides an application program online upgrading method, an application program online upgrading device, an application program online upgrading terminal and an operation machine, wherein the method comprises the following steps: reading the current value of each mark in the mark storage area when starting the bootstrap program, wherein the marks comprise an upgrading mark, a sending completion mark and a storage area mark; when the preset condition is met, acquiring a file to be executed from a corresponding program backup area based on the current value of the upgrading mark and the current value of the sending completion mark, sending the file to be executed to a program operation area of the equipment to be upgraded, and updating the current value of the mark and the file to be executed in the program operation area; the file to be executed is an upgrade file or a current operation file; and if the file to be executed runs abnormally, starting the bootstrap program. The invention can still ensure the normal operation of the equipment to be upgraded when the self problem of the program or the power failure abnormality occurs in the upgrading process.

Description

Application program online upgrading method and device, terminal and operation machine
Technical Field
The invention relates to the technical field of equipment upgrading, in particular to an application program online upgrading method, an application program online upgrading device, a terminal and an operation machine.
Background
The device terminal in the working machine usually adopts a processor such as an MCU as a main controller or a coprocessor, and the application program of the processor such as the MCU can be upgraded according to the defects of the application software or the upgrading requirement of the application function, and the method is a quick and convenient method through remote or local online upgrading.
The traditional online upgrading method lacks a mechanism for judging the validity of an upgrading file, and if the program has self-problems or power failure and other abnormalities in the upgrading process, the program of a processor cannot normally run easily, and the use of an equipment terminal is influenced.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides an application program online upgrading method, an application program online upgrading device, a terminal and an operation machine.
The invention provides an online application program upgrading method, which comprises the following steps:
reading the current value of each mark in the mark storage area when a bootstrap program is started, wherein the marks comprise an upgrading mark, a sending completion mark and a storage area mark; the upgrading mark is used for representing whether an upgrading file exists or not, and the sending completion mark is used for representing whether the upgrading file is sent completely or not; the storage area mark is used for representing a program backup area corresponding to the upgrade file or a program backup area corresponding to the current operating file; the upgrading file and the current operating file are respectively stored in different program backup areas;
when the current value of the upgrading mark and the current value of the sending completion mark are determined to meet preset conditions, acquiring files to be executed from the corresponding program backup area based on the current value of the storage area mark, sending the files to be executed to a program operation area of equipment to be upgraded, and updating the current values of the mark and operating the files to be executed in the program operation area; the file to be executed is the upgrade file or the current operation file;
and if the file to be executed runs abnormally, starting the bootstrap program.
According to the online upgrading method for the application program provided by the invention, when the determination meets the preset condition, the file to be executed is acquired from the corresponding program backup area based on the current value of the storage area mark, the file to be executed is sent to the program operation area of the equipment to be upgraded, and the current value of the mark is updated, and the method comprises the following steps:
when the condition of normal upgrading is determined to be met, acquiring the upgrading file from the program backup area corresponding to the upgrading file based on the current value of the storage area mark, and sending the upgrading file serving as the file to be executed to the program operation area of the equipment to be upgraded;
and updating the current value of the upgrading mark and the current value of the transmission completion mark when the transmission of the file to be executed is determined to be completed.
According to the online upgrading method for the application program provided by the invention, when the determination meets the preset condition, the file to be executed is acquired from the corresponding program backup area based on the current value of the storage area mark, the file to be executed is sent to the program operation area of the equipment to be upgraded, and the current value of the mark is updated, and the method comprises the following steps:
when the condition of upgrading failure is determined to be met, acquiring the current operating file from the program backup area corresponding to the current operating file based on the current value of the storage area mark, and sending the current operating file serving as the file to be executed to the program operating area of the equipment to be upgraded;
and updating the current value of the storage area mark to the program backup area corresponding to the current operating file.
According to the application program online upgrading method provided by the invention, when the boot program is started, the current value of each mark in the mark storage area is read, and before the mark comprises an upgrading mark, a sending completion mark and a storage area mark, the method further comprises the following steps:
starting the current running file in the program running area;
when a program upgrading instruction is received, storing the upgrading file to the program backup area corresponding to the upgrading file;
and updating the upgrading mark to be used as an initial value of the upgrading mark when the upgrading file is determined to be stored completely.
According to the online upgrading method for the application program provided by the invention, the step of storing the upgrading file to the program backup area corresponding to the upgrading file comprises the following steps:
reading the current value of the storage area mark;
determining the program backup area for storing the upgrade file based on the current value of the storage area flag, and updating the current value of the storage area flag to the program backup area for storing the upgrade file;
and storing the upgrade file to the program backup area corresponding to the current value of the storage area mark.
According to the online upgrading method of the application program provided by the present invention, after the file to be executed in the program running area is run, the method further includes:
and if the file to be executed is successfully operated, updating the current value of the sending completion mark based on the current value of the sending completion mark.
According to the online upgrading method for the application program provided by the invention, the updating of the current value of the sending completion flag based on the current value of the sending completion flag comprises the following steps:
and if the current value of the transmission completion flag represents that the transmission of the upgrade file is completed, updating the current value of the transmission completion flag.
The invention also provides an online application program upgrading device, which comprises:
the mark reading module is used for reading the current values of all marks in the mark storage area when the bootstrap program is started, wherein the marks comprise an upgrading mark, a sending completion mark and a storage area mark; the upgrading mark is used for representing whether an upgrading file exists or not, and the sending completion mark is used for representing whether the upgrading file is sent completely or not; the storage area mark is used for representing a program backup area corresponding to the upgrade file or a program backup area corresponding to the current operating file; the upgrade file and the current operation file are respectively stored in different program backup areas;
the upgrading execution module is used for acquiring files to be executed from the corresponding program backup area based on the current value of the storage area mark when the preset condition is determined to be met based on the current value of the upgrading mark and the current value of the sending completion mark, sending the files to be executed to a program operation area of the equipment to be upgraded, and updating the current value of the mark and operating the files to be executed in the program operation area; the file to be executed is the upgrade file or the current operation file;
and the restarting control module is used for starting the bootstrap program if the file to be executed runs abnormally.
The present invention also provides a terminal, comprising: the device for upgrading the application program online is described above.
The present invention also provides a work machine comprising: one or more terminals as described above.
The invention provides an on-line upgrading method, a device, a terminal and an operating machine of an application program, which are characterized in that when a bootstrap program is started, an upgrading mark, a sending completion mark and the current value of a storage area mark in an identification storage area are read, whether a preset condition is met is determined based on the current value of the upgrading mark and the current value of the sending completion mark, an upgrading file or a current operating file is obtained from a corresponding program backup area according to the current value of the storage area mark when the preset condition is met, the upgrading file or the current operating file is sent to a program operating area of equipment to be upgraded, the current value of each mark is updated, a file to be executed in the program operating area is operated, and the bootstrap program is started when the file to be executed abnormally operates, so that the normal operation of the equipment to be upgraded can still be ensured when the program has self-problems or power failure is abnormal in the upgrading process.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of an online application program upgrading method provided by the present invention;
FIG. 2 is a schematic flow chart of an online receiving method for an upgrade file according to the present invention;
FIG. 3 is a second schematic flowchart of the online upgrade method for application programs provided by the present invention;
FIG. 4 is a schematic structural diagram of an application online upgrade apparatus provided by the present invention;
FIG. 5 is a schematic structural diagram of a storage medium provided by the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The application online upgrade method of the present invention is described below with reference to fig. 1 to 3. The online upgrading method of the application program is executed by a processor or software and/or hardware in the processor. As shown in fig. 1, the method for upgrading an application program online of the present invention includes:
s101, reading the current values of all marks in an identification storage area when a bootstrap program is started, wherein the marks comprise an upgrading mark, a sending completion mark and a storage area mark; the upgrading mark is used for representing whether an upgrading file exists or not, and the sending completion mark is used for representing whether the upgrading file is sent completely or not; the storage area mark is used for representing a program backup area corresponding to the upgrade file or a program backup area corresponding to the current operating file; the upgrade file and the current operation file are respectively stored in different program backup areas.
Specifically, the current values of the upgrade flag, the transmission completion flag, and the storage area flag are stored in the identification storage area. The upgrade flag is used to represent whether an upgrade file exists, for example, if the upgrade flag is 0, it indicates that the upgrade file does not exist, and if the upgrade flag is 1, it indicates that the upgrade file exists. The sending completion flag is used for representing whether the sending of the upgrade file is completed or not, and the upgrade file is completely sent to a program operation area of the device to be upgraded, namely, the sending is completed, otherwise, the sending is not completed, for example, the sending completion flag is 0 to indicate that the sending is not completed, and the sending completion flag is 1 to indicate that the sending is completed. Among them, electronic devices such as controllers, computers, and the like, are devices to be upgraded. The storage area mark is used for representing a program backup area corresponding to the upgrade file or a program backup area corresponding to the current operating file. The upgrade file is a file used for upgrading the equipment to be upgraded, and the current operation file is a file which normally operates in the equipment to be upgraded before the equipment to be upgraded is upgraded through the upgrade file. The upgrade file and the current operation file are respectively stored in different program backup areas, the number of the program backup areas can be two, one is used for storing the current operation file, the other is used for storing the upgrade file, the two program backup areas can alternately store the upgrade file, for example, the current operation file is stored in the first program backup area, the upgrade file is stored in the second program backup area, if the equipment to be upgraded is successfully upgraded, the upgrade file is stored in the first program backup area when being received, otherwise, the upgrade file is still stored in the second program backup area when being received.
In addition, when the bootstrap program of the equipment to be upgraded is started, the equipment to be upgraded is upgraded, so that the normal work of the equipment to be upgraded is not influenced in the upgrading process, and the usability is high.
S102, when it is determined that preset conditions are met based on the current value of the upgrading mark and the current value of the sending completion mark, obtaining a file to be executed from the corresponding program backup area based on the current value of the storage area mark, sending the file to be executed to a program operation area of equipment to be upgraded, and updating the current value of the mark and operating the file to be executed in the program operation area; the file to be executed is the upgrade file or the current operation file.
Specifically, the preset condition may be set according to an actual requirement, for example, an upgrade task may exist. The upgrade task may be that an upgrade file exists and the upgrade file is not completely sent to the program operating area of the device to be upgraded, or that the upgrade file is completely sent to the program operating area of the device to be upgraded but the upgrade file fails to operate. For example, the upgrade flag is 1 and the transmission completion flag is 0, which indicates that the upgrade file exists and is not completely transmitted to the program running area of the device to be upgraded, if the upgrade file is downloaded and finishes waiting for upgrading, or the power is cut off when the upgrade file is not transmitted to the program running area of the device to be upgraded, or the power is cut off when the upgrade file is transmitted to the program running area of the device to be upgraded; the upgrade flag is 0 and the transmission completion flag is 1, which indicates that the upgrade file has been completely transmitted to the program operation area of the device to be upgraded but the upgrade file has failed to operate, i.e., the upgrade file itself has a problem and cannot operate.
When the preset condition is determined not to be met, the upgrading task does not exist, for example, the upgrading flag and the sending completion flag are both 0, and the current running file in the program running area can be directly guided to run.
And when the preset condition is met, acquiring the file to be executed from the corresponding program backup area based on the current value of the storage area mark, and copying the file to be executed to the program operation area to realize the operation of the file to be executed. When the upgrading is not executed, the current operating file is stored in the program operating area, and in the upgrading process, the upgrading file is sent to the program operating area so as to replace the current operating file in the program operating area through the upgrading file and complete the upgrading of the equipment to be upgraded.
When the upgrade file exists and is not completely transmitted to the program operating area of the equipment to be upgraded, the upgrade file can be copied to the program operating area from the program backup area corresponding to the upgrade file so as to upgrade the equipment to be upgraded, namely, when the equipment to be upgraded is powered on after power failure in the upgrading process, normal upgrading can still be carried out; when the upgrade file is completely sent to the program operation area of the equipment to be upgraded but the upgrade file fails to operate, the current operation file can be copied to the program operation area from the program backup area corresponding to the current operation file, so that when the upgrade file has a problem and the upgrade fails, the program can still be backed off, and the normal operation of the equipment to be upgraded is ensured.
After the file to be executed is sent to the program operation area of the device to be upgraded, the file to be executed in the program operation area is operated so as to detect whether the device to be upgraded can normally operate after the file in the program operation area is updated.
S103, if the file to be executed runs abnormally, the bootstrap program is started.
Specifically, if the to-be-executed file sent to the program running area of the to-be-upgraded device runs abnormally, it indicates that the upgrade fails, and the boot program is continuously started to execute step S101, and the to-be-executed file capable of running normally is reselected to ensure the normal running of the to-be-upgraded device. If the file to be executed sent to the program operation area of the equipment to be upgraded runs successfully, the equipment to be upgraded is restored to the state before upgrading after upgrading success or upgrading failure is indicated, and the equipment to be upgraded normally runs the file to be executed in the program operation area.
Therefore, when the boot program is started, the upgrading mark, the sending completion mark and the current value of the storage region mark in the identification storage region are read, whether the preset condition is met is determined based on the current value of the upgrading mark and the current value of the sending completion mark, the upgrading file or the current operating file is obtained from the corresponding program backup region according to the current value of the storage region mark when the preset condition is met and is sent to the program operating region of the equipment to be upgraded, the current values of all marks are updated, the file to be executed in the program operating region is operated, and the boot program is started when the file to be executed abnormally operates, so that the normal operation of the equipment to be upgraded can still be ensured when the self problem of the program or power failure abnormality occurs in the upgrading process.
Based on the above embodiment, when it is determined that the preset condition is satisfied, acquiring a file to be executed from the corresponding program backup area based on the current value of the storage area flag, sending the file to be executed to the program running area of the device to be upgraded, and updating the current value of the flag includes:
when the condition of normal upgrading is determined to be met, acquiring the upgrading file from the program backup area corresponding to the upgrading file based on the current value of the storage area mark, and sending the upgrading file serving as the file to be executed to the program operation area of the equipment to be upgraded;
and updating the current value of the upgrading mark and the current value of the transmission completion mark when the transmission of the file to be executed is determined to be completed.
Specifically, it is determined that a normal upgrade condition is met, that is, an upgrade file exists and is not completely transmitted to a program operation area of the device to be upgraded, if the upgrade file is downloaded and is waiting for upgrading, or the upgrade file is not transmitted to the program operation area of the device to be upgraded, and the power is cut off or the upgrade file is transmitted to the program operation area of the device to be upgraded; it may be determined that the normal upgrade condition is satisfied when the upgrade flag is 1 and the transmission completion flag is 0.
And when the normal upgrading condition is met, acquiring an upgrading file from a program backup area corresponding to the upgrading file based on the current value of the storage area mark, and sending the upgrading file serving as a file to be executed to a program operation area so as to upgrade the equipment to be upgraded. When the current value of the storage area mark is the program backup area corresponding to the upgrade file, the upgrade file can be directly obtained according to the current value of the storage area mark.
When the file to be executed is completely sent to the program running area of the equipment to be upgraded, updating the current value of the upgrade flag and the current value of the transmission completion flag, namely, the current value of the upgrade flag is updated to 0, and the transmission completion flag is updated to 1, which indicates that the current upgrade file is completely sent to the program running area of the equipment to be upgraded, and no new upgrade file exists.
Based on any of the above embodiments, when it is determined that the preset condition is satisfied, acquiring a file to be executed from the corresponding program backup area based on the current value of the storage area flag, sending the file to be executed to the program running area of the device to be upgraded, and updating the current value of the flag includes:
when the condition of upgrading failure is determined to be met, acquiring the current operating file from the program backup area corresponding to the current operating file based on the current value of the storage area mark, and sending the current operating file serving as the file to be executed to the program operating area of the equipment to be upgraded;
and updating the current value of the storage area mark to the program backup area corresponding to the current operating file.
Specifically, it is determined that an upgrade failure condition is met, that is, the upgrade file is completely sent to the program operation area of the device to be upgraded but the upgrade file fails to operate, if the upgrade file has a problem and cannot operate; it may be determined that the upgrade failure condition is satisfied when the upgrade flag is 0 and the transmission completion flag is 1.
When the upgrade failure condition is met, the current operating file is obtained from the program backup area corresponding to the current operating file based on the current value of the storage area mark, and the current operating file is sent to the program operating area as the file to be executed, so that when the upgrade failure occurs due to the problem of the upgrade file, the program can still be returned, and the normal operation of the equipment to be upgraded is ensured. When the current value of the storage area mark is the program backup area corresponding to the upgrade file, the program backup area of the upgrade file can be determined according to the current value of the storage area mark, and the current operating file is acquired through the other program backup area of the two program backup areas.
After the current operating file is sent to the program operating area, the current value of the storage area mark is updated to the program backup area corresponding to the current operating file, so that when the upgrade file is received next time, the program backup area for storing the upgrade file can be determined according to the current value of the storage area mark, and the current operating file and the upgrade file are ensured to be stored in different program backup areas.
Based on any of the above embodiments, when the boot program is started, reading current values of flags in the identifier storage area, where the flags include an upgrade flag, a transmission completion flag, and a storage area flag, and before the reading, the method further includes:
starting the current running file in the program running area;
when a program upgrading instruction is received, storing the upgrading file to the program backup area corresponding to the upgrading file;
and updating the upgrading mark to be used as an initial value of the upgrading mark when the upgrading file is determined to be stored completely.
Specifically, before upgrading the device to be upgraded, receiving an upgrade file. In the process of receiving the upgrade file, the current operation file in the program operation area is started, namely, the upgrade file is received online in the process of operating the current operation file so as to realize online upgrade, remote upgrade or local upgrade can be realized through online upgrade, the upgrade convenience is improved, and in the process of receiving the upgrade file, the normal operation of the equipment to be upgraded is not influenced.
In the process of operating the current running file, if a program upgrading instruction is received, the upgrading file is stored in the program backup area corresponding to the upgrading file, and when the upgrading file is completely stored in the program backup area corresponding to the upgrading file, the upgrading mark is updated, for example, the upgrading mark is updated from 0 to 1, so that when the bootstrap program is started, the existence of the upgrading file to be upgraded can be quickly and accurately determined according to the updated upgrading mark, and the timeliness and the effectiveness of the upgrading process are ensured.
Before updating the upgrade flag, the method further includes: the upgrade flag and the transmission completion flag are reset, for example, both the upgrade flag and the transmission completion flag are reset to 0, that is, it indicates that there is no upgrade task for the files in the program backup area, so that the upgrade flag of the newly received upgrade file can be updated to 1 after the upgrade file is stored in the corresponding program backup area, and the corresponding transmission completion flag is updated to 1 after the upgrade file is completely transmitted to the program operation area of the device to be upgraded, thereby the upgrade state can be determined quickly and accurately according to the upgrade flag and the transmission completion flag, and the reliability of the upgrade result is ensured.
Based on any of the above embodiments, the storing the upgrade file to the program backup area corresponding to the upgrade file includes:
reading the current value of the storage area mark;
determining the program backup area for storing the upgrade file based on the current value of the storage area flag, and updating the current value of the storage area flag to the program backup area for storing the upgrade file;
and storing the upgrade file to the program backup area corresponding to the current value of the storage area mark.
Specifically, in the process of determining the program backup area corresponding to the upgrade file, the current value of the storage area flag, that is, the program backup area corresponding to the current operating file operating in the program operating area, is read first, determining the program backup area corresponding to the current operating file according to the current value of the storage area mark, using the other one of the two program backup areas as the program backup area for storing the upgrade file, and updating the current value of the storage area mark into the program backup area corresponding to the upgrade file, so that the upgrade file and the current operating file are respectively stored in different program backup areas, and by updating the current value of the storage area flag in real time, in the upgrading process and the process of program rollback in upgrading failure, the file to be executed can be quickly and accurately determined, and the influence on the normal operation of equipment to be upgraded caused by upgrading and upgrading failure is avoided.
Based on any of the above embodiments, after the running the file to be executed in the program running area, the method further includes:
and if the file to be executed is successfully operated, updating the current value of the sending completion mark based on the current value of the sending completion mark.
Specifically, after a file to be executed in a program running area is run, if the file to be executed cannot be normally run, resetting the equipment to be upgraded; and if the file to be executed is the upgrading file, determining that the upgrading fails according to the upgrading mark and the sending completion mark when the equipment to be upgraded is reset, and acquiring the current running file to serve as the file to be executed. If the file to be executed is the current operating file, the fact that the current operating file obtained when the upgrading of the upgrading file fails is incorrect is indicated, the equipment to be upgraded is reset, and the current operating file is obtained again to serve as the file to be executed.
If the file to be executed can normally operate, which indicates that the upgrade is successful or the selection of the current operating file is correct, the current value of the sending completion flag is further updated by operating the file which can normally operate in the current program operating area, which indicates that the equipment to be upgraded can normally operate. The specific manner of updating the current value of the transmission completion flag based on the current value of the transmission completion flag may be set according to actual requirements, for example, when the current value of the transmission completion flag represents that the transmission of the upgrade file is completed, the transmission completion flag may be reset, that is, the current value of the transmission completion flag is reset to 0, or the current value of the transmission completion flag is updated to another value indicating that the upgrade is completed; when the current value of the transmission completion flag represents that the transmission of the upgrade file is not completed, the current value of the transmission completion flag may not be updated.
Based on any of the above embodiments, the updating the current value of the transmission completion flag based on the current value of the transmission completion flag includes:
and if the current value of the sending completion mark represents that the upgrading file is sent completely, updating the current value of the sending completion mark.
Specifically, if the to-be-executed file in the program running area of the to-be-upgraded device can run normally and the current value of the transmission completion flag represents that the transmission of the upgrade file is completed, which indicates that the to-be-upgraded device has executed the upgrade and the upgrade of the time is completed, the current value of the transmission completion flag may be updated from 1 to 0 to end the upgrade process, so that the upgrade can be executed normally when the upgrade file is received next time. If the file to be executed in the program operation area of the equipment to be upgraded can normally operate and the current value of the sending completion flag represents that the upgrading file is not sent completely, the upgrading is not executed on the equipment to be upgraded, and the sending completion flag does not need to be updated.
The following describes in detail an implementation process of the application online upgrade method according to an alternative embodiment. The program backup area comprises a program backup area A and a program backup area B.
Fig. 2 shows a schematic flow diagram of an online receiving method of an upgrade file, including:
s201, guiding the current running file in the program running area to run;
s202, reading the current value of a storage area flag2 when a program upgrading instruction is received;
s203, determining a program backup area for storing the upgrade file according to the current value of the storage area flag2, and updating the current value of the storage area flag2 into the program backup area for storing the upgrade file; if the current value of the storage region flag2 is B, the current value of the storage region flag2 is updated to A; if the current value of the storage region flag2 is A, the current value of the storage region flag2 is updated to B;
s204, resetting the upgrading flag1 and the sending completion flag3 to 0, and starting an upgrading file storage task; the method comprises the steps that when a current program normally runs, an upgrade file is received and stored on line;
s205, when the upgrade program is determined to be stored completely, updating the upgrade flag1 to 1, and recording the length of the upgrade file; after the upgrade program is stored, the equipment to be upgraded operates normally, and the upgrade is executed when the equipment is powered on or reset.
Fig. 3 shows a flow diagram of an online application program upgrading method, which includes:
s301, powering on or resetting the equipment to be upgraded;
s302, starting a bootstrap program;
s303, reading the current value of the upgrade flag1, the current value of the transmission completion flag3 and the current value of the storage area flag 2; if the normal upgrade condition is satisfied and all the flags are legal values (flag1 is 1, flag2 is a or B, and flag3 is 0), then step S304 is executed; if it is determined that the upgrade failure condition is satisfied and each flag is a legal value (flag1 ═ 0, flag2 ═ a or B, and flag3 ═ 1), then step S305 is performed; if the upgrade task is not determined (flag1 is equal to 0, and flag3 is equal to 0), then step S306 is executed;
s304, copying the upgrade file from the program backup area corresponding to the current value of the storage area flag to the program operation area, updating the current value of the upgrade flag1 and the current value of the transmission completion flag3, and executing the step S306; that is, flag1 is updated to 0, flag3 is updated to 1;
s305, copying the current operating file to the program operating area from the program backup area except the program backup area corresponding to the current value of the storage area flag, updating the current value of the storage area flag2 to the program backup area corresponding to the current operating file, and executing the step S306; that is, flag2 is updated to B or A;
s306, guiding the file operation in the program operation area, and executing the step S307 when the file operation is successful; otherwise, the equipment to be upgraded is automatically reset, and step S301 is executed;
s307, reading the current value of a transmission completion flag3, executing the step S308 when the current value of a transmission completion flag3 is 1, otherwise executing the step S309;
s308, updating the current value of the transmission completion flag3, namely updating the current value of the transmission completion flag3 from 1 to 0;
and S309, normally operating the file in the program operating area.
The application program online upgrading device provided by the invention is described below, and the application program online upgrading device described below and the application program online upgrading method described above can be referred to correspondingly. As shown in fig. 4, the application program online upgrade apparatus of the present invention includes:
a flag reading module 410, configured to read current values of flags in an identifier storage area when a boot program is started, where the flags include an upgrade flag, a transmission completion flag, and a storage area flag; the upgrading mark is used for representing whether an upgrading file exists or not, and the sending completion mark is used for representing whether the upgrading file is sent completely or not; the storage area mark is used for representing a program backup area corresponding to the upgrade file or a program backup area corresponding to the current operating file; the upgrade file and the current operation file are respectively stored in different program backup areas;
an upgrade execution module 420, configured to, when it is determined that a preset condition is met based on a current value of the upgrade flag and a current value of the transmission completion flag, obtain a file to be executed from the corresponding program backup area based on the current value of the storage area flag, transmit the file to be executed to a program running area of the device to be upgraded, update the current value of the flag and run the file to be executed in the program running area; the file to be executed is the upgrade file or the current operation file;
and the restart control module 430 is configured to start the boot program if the to-be-executed file runs abnormally.
Based on the foregoing embodiment, the upgrade execution module 420 is specifically configured to:
when the condition of normal upgrading is determined to be met, acquiring the upgrading file from the program backup area corresponding to the upgrading file based on the current value of the storage area mark, and sending the upgrading file serving as the file to be executed to the program operation area of the equipment to be upgraded;
and updating the current value of the upgrading mark and the current value of the transmission completion mark when the transmission of the file to be executed is determined to be completed.
Based on any of the above embodiments, the upgrade execution module 420 is specifically configured to:
when the condition that the upgrading failure is met is determined, acquiring the current operating file from the program backup area corresponding to the current operating file based on the current value of the storage area mark, and sending the current operating file serving as the file to be executed to the program operating area of the equipment to be upgraded;
and updating the current value of the storage area mark to the program backup area corresponding to the current operating file.
Based on any one of the above embodiments, the system further comprises a file receiving module; the file receiving module is used for:
starting the current running file in the program running area;
when a program upgrading instruction is received, storing the upgrading file to the program backup area corresponding to the upgrading file;
and updating the upgrading mark to be used as an initial value of the upgrading mark when the upgrading file is determined to be stored completely.
Based on any embodiment, the file receiving module is specifically configured to:
reading the current value of the storage area mark;
determining the program backup area for storing the upgrade file based on the current value of the storage area flag, and updating the current value of the storage area flag to the program backup area for storing the upgrade file;
and storing the upgrade file to the program backup area corresponding to the current value of the storage area mark.
Based on any of the above embodiments, the mobile terminal further includes an update module, where the update module is configured to:
and if the file to be executed is successfully operated, updating the current value of the sending completion mark based on the current value of the sending completion mark.
Based on any of the embodiments above, the update module is specifically configured to:
and if the current value of the transmission completion flag represents that the transmission of the upgrade file is completed, updating the current value of the transmission completion flag.
The invention also provides a terminal which comprises the application program online upgrading device in any embodiment.
Specifically, the terminal may further include or be connected to a storage medium, and a schematic structural diagram of the storage medium is shown in fig. 5, where the storage medium includes: a boot program area 510, a program execution area 520, an identification storage area 540, and two program backup areas 530;
the identifier storage area 540 is used for storing an upgrade identifier, a transmission completion identifier and a storage area identifier; the upgrade flag is used for representing whether an upgrade file exists or not, and the sending completion flag is used for representing whether the upgrade file is sent completely or not; the storage area mark is used for representing the program backup area 520 corresponding to the upgrade file or the program backup area 520 corresponding to the current operating file;
the two program backup 530 areas are respectively used for storing an upgrade file and a current operation file, and the upgrade file and the current operation file are respectively stored in different program backup areas;
the boot program area 510 is used to store a boot program.
The invention also provides a working machine comprising one or more terminals as described in the above embodiments.
Specifically, a working machine such as an excavator, a crane, a loader, or the like is used.
Fig. 6 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 6: a processor (processor)610, a communication Interface (Communications Interface)620, a memory (memory)630 and a communication bus 640, wherein the processor 610, the communication Interface 620 and the memory 630 communicate with each other via the communication bus 640. The processor 610 may call logic instructions in the memory 630 to perform an application online upgrade method, the method comprising: reading the current value of each mark in the mark storage area when a bootstrap program is started, wherein the marks comprise an upgrading mark, a sending completion mark and a storage area mark; the upgrading mark is used for representing whether an upgrading file exists or not, and the sending completion mark is used for representing whether the upgrading file is sent completely or not; the storage area mark is used for representing a program backup area corresponding to the upgrade file or a program backup area corresponding to the current operating file; the upgrade file and the current operation file are respectively stored in different program backup areas;
when it is determined that preset conditions are met based on the current value of the upgrading mark and the current value of the sending completion mark, obtaining files to be executed from the corresponding program backup area based on the current value of the storage area mark, sending the files to be executed to a program operation area of equipment to be upgraded, and updating the current values of the mark and operating the files to be executed in the program operation area; the file to be executed is the upgrade file or the current operation file;
and if the file to be executed runs abnormally, starting the bootstrap program.
In addition, the logic instructions in the memory 630 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. An online application program upgrading method is characterized by comprising the following steps:
reading the current value of each mark in the mark storage area when a bootstrap program is started, wherein the marks comprise an upgrading mark, a sending completion mark and a storage area mark; the upgrading mark is used for representing whether an upgrading file exists or not, and the sending completion mark is used for representing whether the upgrading file is sent completely or not; the storage area mark is used for representing a program backup area corresponding to the upgrade file or a program backup area corresponding to the current operating file; the upgrade file and the current operation file are respectively stored in different program backup areas;
when it is determined that preset conditions are met based on the current value of the upgrading mark and the current value of the sending completion mark, obtaining files to be executed from the corresponding program backup area based on the current value of the storage area mark, sending the files to be executed to a program operation area of equipment to be upgraded, and updating the current values of the mark and operating the files to be executed in the program operation area; the file to be executed is the upgrade file or the current operation file;
and if the file to be executed runs abnormally, starting the bootstrap program.
2. The method for upgrading an application program online according to claim 1, wherein when it is determined that a preset condition is met, acquiring a file to be executed from the corresponding program backup area based on the current value of the storage area flag, sending the file to be executed to a program running area of a device to be upgraded, and updating the current value of the flag includes:
when the condition of normal upgrading is determined to be met, acquiring the upgrading file from the program backup area corresponding to the upgrading file based on the current value of the storage area mark, and sending the upgrading file serving as the file to be executed to the program operation area of the equipment to be upgraded;
and updating the current value of the upgrading mark and the current value of the transmission completion mark when the transmission of the file to be executed is determined to be completed.
3. The method for upgrading an application program online according to claim 1, wherein when it is determined that a preset condition is met, acquiring a file to be executed from the corresponding program backup area based on the current value of the storage area flag, sending the file to be executed to a program running area of a device to be upgraded, and updating the current value of the flag includes:
when the condition that the upgrading failure is met is determined, acquiring the current operating file from the program backup area corresponding to the current operating file based on the current value of the storage area mark, and sending the current operating file serving as the file to be executed to the program operating area of the equipment to be upgraded;
and updating the current value of the storage area mark to the program backup area corresponding to the current operating file.
4. The method for upgrading an application program online according to claim 1, wherein reading current values of flags in an identifier storage area when a boot program is started, the flags including an upgrade flag, a transmission completion flag, and a storage area flag, further comprises:
starting the current running file in the program running area;
when a program upgrading instruction is received, storing the upgrading file to the program backup area corresponding to the upgrading file;
and updating the upgrading mark to be used as an initial value of the upgrading mark when the upgrading file is determined to be stored completely.
5. The method for upgrading an application program online according to claim 4, wherein the storing the upgrade file to the program backup area corresponding to the upgrade file includes:
reading the current value of the storage area mark;
determining the program backup area for storing the upgrade file based on the current value of the storage area flag, and updating the current value of the storage area flag to the program backup area for storing the upgrade file;
and storing the upgrade file to the program backup area corresponding to the current value of the storage area mark.
6. The method for upgrading an application program online according to any one of claims 1 to 5, wherein after the running the file to be executed in the program running area, the method further comprises:
and if the file to be executed is successfully operated, updating the current value of the sending completion mark based on the current value of the sending completion mark.
7. The method for upgrading an application program online according to claim 6, wherein the updating the current value of the transmission completion flag based on the current value of the transmission completion flag includes:
and if the current value of the sending completion mark represents that the upgrading file is sent completely, updating the current value of the sending completion mark.
8. An apparatus for upgrading an application on-line, comprising:
the mark reading module is used for reading the current values of all marks in the mark storage area when the bootstrap program is started, wherein the marks comprise an upgrading mark, a sending completion mark and a storage area mark; the upgrading mark is used for representing whether an upgrading file exists or not, and the sending completion mark is used for representing whether the upgrading file is sent completely or not; the storage area mark is used for representing a program backup area corresponding to the upgrade file or a program backup area corresponding to the current operating file; the upgrade file and the current operation file are respectively stored in different program backup areas;
the upgrading execution module is used for acquiring files to be executed from the corresponding program backup area based on the current value of the storage area mark when the preset condition is determined to be met based on the current value of the upgrading mark and the current value of the sending completion mark, sending the files to be executed to a program operation area of the equipment to be upgraded, and updating the current value of the mark and operating the files to be executed in the program operation area; the file to be executed is the upgrade file or the current operation file;
and the restarting control module is used for starting the bootstrap program if the file to be executed runs abnormally.
9. A terminal, comprising: the application online upgrade apparatus according to claim 8.
10. A work machine, comprising: one or more terminals as claimed in claim 9.
CN202210613696.XA 2022-05-31 2022-05-31 Application program online upgrading method and device, terminal and operation machine Pending CN114995854A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210613696.XA CN114995854A (en) 2022-05-31 2022-05-31 Application program online upgrading method and device, terminal and operation machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210613696.XA CN114995854A (en) 2022-05-31 2022-05-31 Application program online upgrading method and device, terminal and operation machine

Publications (1)

Publication Number Publication Date
CN114995854A true CN114995854A (en) 2022-09-02

Family

ID=83031917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210613696.XA Pending CN114995854A (en) 2022-05-31 2022-05-31 Application program online upgrading method and device, terminal and operation machine

Country Status (1)

Country Link
CN (1) CN114995854A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115756561A (en) * 2022-10-14 2023-03-07 广州汽车集团股份有限公司 Software upgrading method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115756561A (en) * 2022-10-14 2023-03-07 广州汽车集团股份有限公司 Software upgrading method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN115794257B (en) System starting method, device, electronic equipment and storage medium
CN113760332A (en) Software upgrading method and electronic equipment
CN114995854A (en) Application program online upgrading method and device, terminal and operation machine
CN114546537B (en) Starting sequence deployment method and related device for multiple operating systems
CN113515291A (en) Equipment online upgrading method and device
CN112612498A (en) Embedded equipment upgrading method and embedded equipment
EP0477385A1 (en) Method of resetting adapter module at failing time and computer system executing said method
CN115437674B (en) Firmware upgrading method, device, medium and electronic equipment
CN111984287A (en) Equipment upgrading method and system
CN115658152A (en) Firmware upgrading method, firmware, electronic device and computer readable storage medium
CN111221683A (en) Double-flash hot backup method, system, terminal and storage medium for data center switch
CN114860292A (en) Terminal equipment firmware upgrading control method and device, computer equipment and medium
EP4086756A1 (en) Method and apparatus for processing virtual machine component
CN114153503A (en) BIOS control method, device and medium
CN112783535A (en) Firmware upgrading method, embedded device and storage medium
CN113127029A (en) Firmware updating method and device, electronic equipment and storage medium
CN113778756A (en) Fault recovery method, device, equipment and medium for BMC (baseboard management controller) firmware
CN118349290B (en) Dual-memory chip start-up upgrade system, method, device, medium and product
CN111400094A (en) Method, device, equipment and medium for restoring factory settings of server system
CN118519834B (en) File system repairing method and device, storage medium and electronic device
CN114791832B (en) IOS system repairing method and device when equipment space is insufficient and related components
CN118245292B (en) Server restarting method and device, storage medium and server
CN117453255A (en) Method, device, equipment and storage medium for upgrading embedded equipment
CN118626110A (en) Firmware upgrading system, method and related equipment
CN114327535A (en) BMC firmware update protection method and related components

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination