CN112612498A - Embedded equipment upgrading method and embedded equipment - Google Patents

Embedded equipment upgrading method and embedded equipment Download PDF

Info

Publication number
CN112612498A
CN112612498A CN202011611718.6A CN202011611718A CN112612498A CN 112612498 A CN112612498 A CN 112612498A CN 202011611718 A CN202011611718 A CN 202011611718A CN 112612498 A CN112612498 A CN 112612498A
Authority
CN
China
Prior art keywords
upgrading
program
main application
application program
embedded device
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
CN202011611718.6A
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.)
Shenzhen Jiuzhou Electric Appliance Co Ltd
Original Assignee
Shenzhen Jiuzhou Electric Appliance 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 Shenzhen Jiuzhou Electric Appliance Co Ltd filed Critical Shenzhen Jiuzhou Electric Appliance Co Ltd
Priority to CN202011611718.6A priority Critical patent/CN112612498A/en
Publication of CN112612498A publication Critical patent/CN112612498A/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention relates to an embedded device upgrading method, an embedded device and a storage medium, wherein the method comprises the following steps: running the main application program; confirming whether an upgrading program needs to be upgraded in the main application program; and if the upgrading is needed, downloading a first upgrading packet of the upgrading program, and updating the upgrading program based on the first upgrading packet. According to the embedded equipment upgrading method and the embedded equipment, the upgrading program is upgraded in the main application program, so that the backup upgrading program can be stored without occupying extra space, the problem that the upgrading program is damaged and cannot be upgraded due to power failure in the self-upgrading process of the upgrading program can be solved, and the safe upgrading of the upgrading program can be realized, so that the purposes of low cost and power failure prevention for safely upgrading the upgrading program are achieved.

Description

Embedded equipment upgrading method and embedded equipment
Technical Field
The embodiment of the invention relates to the field of embedded devices, in particular to an embedded device upgrading method and an embedded device.
Background
Currently, software in a complete embedded device mainly comprises three modules, namely a bootstrap program, a main application program and an upgrading program. The boot program is the program which runs earliest after being electrified, is mainly used for initializing bottom hardware and is responsible for checking and starting running of a boot operating system and an application program; the main application program is a main program started and operated by a bootstrap program, can interact with a user and has a visual user interface; the upgrading program is an auxiliary program for starting and running the bootstrap program, and is mainly used for self-upgrading and main application program upgrading so as to solve software bug and add new functions, meet new requirements of users and improve user experience.
The existing embedded device upgrading scheme is that an upgrading program is generally responsible for self-upgrading and main application program upgrading, at least one upgrading program is generally backed up in order to ensure that the device is not damaged due to power failure, when the upgrading program is damaged due to power failure in the self-upgrading process of the upgrading program, the backup upgrading program can be started to continuously complete the previous incomplete upgrading due to power failure after a boot program is started next time and the damage of the upgrading program is detected. The scheme has the defects that an additional space is needed for backing up the upgrading program, and when the cost of the embedded equipment is limited, the space is insufficient, and the backup upgrading program cannot be stored additionally, the safe upgrading requirement cannot be met.
Disclosure of Invention
The embodiment of the invention aims to provide an embedded device software upgrading method, an embedded device and a storage medium, which can realize the safe upgrading of upgrading software on the premise of not occupying extra space.
In a first aspect, an embodiment of the present invention provides an embedded device upgrading method, where the method includes the following steps:
running the main application program;
confirming whether an upgrading program needs to be upgraded in the main application program;
and if the upgrading is needed, downloading a first upgrading packet of the upgrading program, and updating the upgrading program based on the first upgrading packet.
In some embodiments, the method further comprises:
and upgrading the main application program in the upgrading program.
In some embodiments, said upgrading said primary application in said upgrade procedure comprises:
confirming whether the main application program needs to be upgraded in the main application program;
if the main application program needs to be upgraded, writing an upgrading flag bit and restarting the embedded equipment;
when the embedded equipment is powered on, operating a bootstrap program;
reading the upgrading flag bit in the bootstrap program, and determining whether the main application program needs to be upgraded or not based on the upgrading flag bit;
if the main application program is determined to need to be upgraded, starting an upgrading program;
and downloading a second upgrade package of the main application program in the upgrade program, and updating the main application program based on the second upgrade package.
In some embodiments, before the confirming whether the upgrade program requires upgrading and confirming whether the host application program requires upgrading, the method further comprises:
detecting whether upgrading is needed;
and if the upgrading is needed, downloading the configuration file, and judging whether the upgrading is the upgrading of the main application program or the upgrading program according to the configuration file.
In some embodiments, the method further comprises:
and if the upgrade is not needed, waiting for a preset time and then continuously judging whether the upgrade is needed.
In some embodiments, the method further comprises:
and clearing the upgrading flag bit.
In some embodiments, the method further comprises:
and starting the main application program if the main application program does not need to be upgraded in the bootstrap program based on the upgrading flag bit.
In some embodiments, the method further comprises:
and prompting after the updating of the upgrading program is completed.
In a second aspect, an embodiment of the present invention provides an embedded device, where the embedded device includes:
at least one processor, and a memory communicatively coupled to the at least one processor, the memory storing instructions executable by the at least one processor to enable the at least one processor to perform the method described above.
In a third aspect, embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by the embedded device, cause the embedded device to perform the above-mentioned method.
Compared with the prior art, the application has the following beneficial effects at least: according to the embedded equipment upgrading method and the embedded equipment, the upgrading program is upgraded in the main application program, so that the backup upgrading program can be stored without occupying extra space, the problem that the upgrading program is damaged and cannot be upgraded due to power failure in the self-upgrading process of the upgrading program can be solved, and the safe upgrading of the upgrading program can be realized, so that the purposes of low cost and power failure prevention for safely upgrading the upgrading program are achieved.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a hardware block diagram of an embedded device according to an embodiment of the present invention;
FIG. 2 is a flowchart of an embodiment of an upgrade method for an embedded device;
FIG. 3 is a flowchart of a host application upgrade process in one embodiment of an embedded device upgrade method of the present invention;
fig. 4 is a flowchart of another embodiment of an upgrade method for an embedded device of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, 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 method for upgrading an embedded device according to the embodiment of the present invention may be applied to an embedded device, and fig. 1 shows a hardware structure of an embedded device, and as shown in fig. 1, an embedded device 10 includes a memory 11 and a processor 12. The memory 11, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 11 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 11 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 11 may optionally include memory located remotely from the processor 12, which may be connected to the embedded device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor 12 is a control center of the embedded device 10, and is connected to various parts of the whole embedded device by using various interfaces and lines, and executes various functions and processing data of the embedded device 10 by running or executing software programs and/or modules stored in the memory 11 and calling data stored in the memory 11, so as to perform overall monitoring on the embedded device 10, for example, implement the embedded device upgrade method according to any embodiment of the present invention.
The processor 12 may be one or more, and one processor 12 is illustrated in fig. 1. The processor 12 and the memory 11 may be connected by a bus or other means, such as the bus connection in fig. 1. The processor 12 may include a Central Processing Unit (CPU), Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), controller, Field Programmable Gate Array (FPGA) device, or the like. The processor 12 may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
An embodiment of the present invention further provides an embedded device upgrade method, which may be applied to the embedded device shown in fig. 1, as shown in fig. 2, where the method includes the steps of
S101: running the main application program;
s102: confirming whether an upgrading program needs to be upgraded in the main application program;
s103: and if the upgrading is needed, downloading a first upgrading packet of the upgrading program, and updating the upgrading program based on the first upgrading packet.
The upgrading of the upgrading program is executed in the main application program, whether the upgrading program needs to be upgraded or not is firstly confirmed, if the upgrading program needs to be upgraded, a first upgrading package is obtained, and the upgrading is carried out based on the first upgrading package. The first upgrade package may be downloaded from a remote server online, and in other embodiments, the first upgrade package may also be directly stored in the embedded device for easy invocation.
The embodiment puts the upgrading process of the upgrading program into the main application program for execution, so that the backup upgrading program can be stored without occupying extra space, the problem that the upgrading program is damaged and cannot be upgraded due to power failure of the upgrading program in the upgrading process can be avoided, and the safe upgrading of the upgrading program can be realized, thereby achieving the purposes of low cost and power failure prevention for safely upgrading the upgrading program.
In other embodiments, the method further includes a step of upgrading the main application program, where the main application program may be upgraded in an upgrade program, as shown in fig. 3, the upgrading of the main application program specifically includes:
s201: confirming whether the main application program needs to be upgraded in the main application program;
s202: if the main application program needs to be upgraded, writing an upgrading flag bit and restarting the embedded equipment;
s203: when the embedded equipment is powered on, operating a bootstrap program;
s204: reading the upgrading flag bit in the bootstrap program, and determining whether the main application program needs to be upgraded or not based on the upgrading flag bit;
s205: if the main application program is determined to need to be upgraded, starting an upgrading program;
s206: and downloading a second upgrade package of the main application program in the upgrade program, and updating the main application program based on the second upgrade package.
That is, in the embodiment of the present invention, the upgrade of the main application is performed in the upgrade program. Firstly, when the main application program is normally executed, whether the main application program needs to be upgraded is confirmed, if the main application program needs to be upgraded, an upgrade flag bit is written in, and the embedded equipment is restarted. And after the embedded equipment is restarted, the embedded equipment firstly enters a bootstrap program, the bootstrap program can judge whether the main application program needs to be upgraded or not by reading the upgrading flag bit, if the main application program needs to be upgraded, the upgrading program is started through the bootstrap program, and the main application program is upgraded in the upgrading program.
After the embedded device is restarted by introducing the upgrading zone bit, the bootstrap program can judge whether the main application program needs to be upgraded or not through the upgrading zone bit, if the main application program needs to be upgraded, the upgrading program needs to be started because the main application program needs to be upgraded in the upgrading program, and the upgrading of the main application program is completed in the upgrading program. If the host application does not require an upgrade, the host application may be entered directly. In other embodiments, the upgrade flag may be cleared by the upgrade program after the upgrade of the primary application is complete, so that the primary application may not be updated indefinitely.
In the embodiment of the invention, the main application program and the upgrading program are mutually upgraded, so that the backup upgrading program can be stored without occupying extra space, the problem that the upgrading program is damaged and cannot be upgraded due to power failure in the self-upgrading process of the upgrading program can be avoided, and the safe upgrading of the upgrading program and the main application program can be realized.
The second upgrade package may be downloaded from a remote server online, and in other embodiments, may also be directly stored in the embedded device for convenient invocation.
In some embodiments, the host application may determine whether to upgrade the host application or upgrade the program by reading the configuration file. The main application program can firstly judge whether the upgrading is needed, if the upgrading is needed, the configuration file is downloaded, and whether the upgrading is the main application program or the upgrading program is judged according to the configuration file. If the upgrade is not needed, waiting for a preset time (for example, 1 minute) and then judging whether the upgrade is needed.
The following describes an implementation process of the method for upgrading an embedded device according to an embodiment, as shown in fig. 3, the method includes:
step S301, the embedded device is powered on, and the power-on state is kept:
step S302, operating a bootstrap program;
step S303, reading an upgrading flag bit;
step S304, judging whether the main application program is upgraded or not according to the upgrading flag bit, if so, executing step S315, and if not, executing step S305;
step S305, starting a main application program;
step S306, judging whether upgrading is available, if yes, executing step S307, and if not, executing step S312;
step S307, acquiring a configuration file;
step S308, judging whether the upgrading is the upgrading of the main application program or the upgrading program according to the configuration file, if the upgrading is the upgrading program, executing step S309, and if the upgrading is the application program, executing step S313;
step S309, upgrading the upgrading program, downloading the first upgrading packet;
step S310, updating an upgrading program;
step S311, finishing upgrading and sending out a prompt;
step S312, waiting for a preset time, and continuing to execute step S306 to judge whether upgrading exists;
step S313, writing in an upgrading flag bit;
step S314, restarting;
step S315, starting an upgrading program;
step S316, downloading a second upgrade package;
step S317, updating the main application;
step S318, clearing the flag bit;
and step S319, restarting.
In the embodiment, the main application program and the upgrading program are mutually upgraded, and the upgrading flag bit is set for judging whether the main application program is upgraded or not, so that the program design is more convenient, and meanwhile, the safe upgrading of power failure prevention of the main application program and the upgrading program under the condition of no backup is realized.
Embodiments of the present invention also provide a non-volatile computer storage medium, where the computer storage medium stores computer-executable instructions, which are executed by one or more processors, such as one processor 11 in fig. 1, so that the one or more processors may perform the method for upgrading an embedded device in any of the method embodiments, for example, perform the steps shown in fig. 2 to fig. 4 described above; the functions of the various devices described in fig. 1 may also be implemented.
Embodiments of the present invention also provide a computer program product, including a computer program stored on a non-volatile computer-readable storage medium, where the computer program includes program instructions, which, when executed by a computer, cause the embedded device to perform an embedded device upgrade method in any of the above method embodiments, for example, to execute the method steps in fig. 2 to 4 described above, and implement the functions of each apparatus in fig. 1.
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; within the idea of the invention, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, it will 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 the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. An embedded device upgrading method is characterized by comprising the following steps:
running the main application program;
confirming whether an upgrading program needs to be upgraded in the main application program;
and if the upgrading is needed, downloading a first upgrading packet of the upgrading program, and updating the upgrading program based on the first upgrading packet.
2. The method for upgrading an embedded device according to claim 1, further comprising:
and upgrading the main application program in the upgrading program.
3. The method for upgrading the embedded device according to claim 2, wherein the upgrading the main application program in the upgrading program comprises:
confirming whether the main application program needs to be upgraded in the main application program;
if the main application program needs to be upgraded, writing an upgrading flag bit and restarting the embedded equipment;
when the embedded equipment is powered on, operating a bootstrap program;
reading the upgrading flag bit in the bootstrap program, and determining whether the main application program needs to be upgraded or not based on the upgrading flag bit;
if the main application program is determined to need to be upgraded, starting an upgrading program;
and downloading a second upgrade package of the main application program in the upgrade program, and updating the main application program based on the second upgrade package.
4. The method for upgrading an embedded device according to claim 3, wherein before the confirming whether the upgrade program needs to be upgraded and the confirming whether the main application program needs to be upgraded, the method further comprises:
detecting whether upgrading is needed;
and if the upgrading is needed, downloading the configuration file, and judging whether the upgrading is the upgrading of the main application program or the upgrading program according to the configuration file.
5. The method for upgrading an embedded device according to claim 4, further comprising:
and if the upgrade is not needed, waiting for a preset time and then continuously judging whether the upgrade is needed.
6. The method for upgrading the embedded device according to any one of claims 2 to 5, further comprising:
and clearing the upgrading flag bit.
7. The method for upgrading an embedded device according to claim 3, further comprising:
and starting the main application program if the main application program does not need to be upgraded in the bootstrap program based on the upgrading flag bit.
8. The method for upgrading an embedded device according to claim 1, further comprising:
and prompting after the updating of the upgrading program is completed.
9. An embedded device, comprising:
at least one processor, and a memory communicatively coupled to the at least one processor, the memory storing instructions executable by the at least one processor to enable the at least one processor to perform the method of any of claims 1-8.
10. A non-transitory computer-readable storage medium having stored thereon computer-executable instructions that, when executed by the embedded device, cause the embedded device to perform the method of any of claims 1-8.
CN202011611718.6A 2020-12-30 2020-12-30 Embedded equipment upgrading method and embedded equipment Pending CN112612498A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011611718.6A CN112612498A (en) 2020-12-30 2020-12-30 Embedded equipment upgrading method and embedded equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011611718.6A CN112612498A (en) 2020-12-30 2020-12-30 Embedded equipment upgrading method and embedded equipment

Publications (1)

Publication Number Publication Date
CN112612498A true CN112612498A (en) 2021-04-06

Family

ID=75249717

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011611718.6A Pending CN112612498A (en) 2020-12-30 2020-12-30 Embedded equipment upgrading method and embedded equipment

Country Status (1)

Country Link
CN (1) CN112612498A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157301A (en) * 2021-05-20 2021-07-23 厦门紫光展锐科技有限公司 Terminal version upgrading method, system, storage medium and terminal
CN113741943A (en) * 2021-11-08 2021-12-03 湘投云储科技有限公司 Embedded equipment program upgrading system and method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1630668A1 (en) * 2004-08-31 2006-03-01 ASUSTeK Computer Inc. Boot method based on hibernation files for preventing unauthorized modifications
CN103442272A (en) * 2013-09-11 2013-12-11 东莞市远峰科技有限公司 System upgrading method
WO2016202088A1 (en) * 2015-06-17 2016-12-22 中兴通讯股份有限公司 Bootstrap program upgrade method, embedded device, control device and embedded system
CN107153559A (en) * 2017-05-19 2017-09-12 北京有初科技有限公司 The application program updating method of a kind of electronic equipment
CN111240720A (en) * 2020-03-27 2020-06-05 武汉光谷信息光电子创新中心有限公司 Boot program upgrading method and device and storage medium
CN111984298A (en) * 2020-07-17 2020-11-24 歌尔光学科技有限公司 Program upgrading area in flash memory, program upgrading method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1630668A1 (en) * 2004-08-31 2006-03-01 ASUSTeK Computer Inc. Boot method based on hibernation files for preventing unauthorized modifications
CN103442272A (en) * 2013-09-11 2013-12-11 东莞市远峰科技有限公司 System upgrading method
WO2016202088A1 (en) * 2015-06-17 2016-12-22 中兴通讯股份有限公司 Bootstrap program upgrade method, embedded device, control device and embedded system
CN107153559A (en) * 2017-05-19 2017-09-12 北京有初科技有限公司 The application program updating method of a kind of electronic equipment
CN111240720A (en) * 2020-03-27 2020-06-05 武汉光谷信息光电子创新中心有限公司 Boot program upgrading method and device and storage medium
CN111984298A (en) * 2020-07-17 2020-11-24 歌尔光学科技有限公司 Program upgrading area in flash memory, program upgrading method and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157301A (en) * 2021-05-20 2021-07-23 厦门紫光展锐科技有限公司 Terminal version upgrading method, system, storage medium and terminal
CN113741943A (en) * 2021-11-08 2021-12-03 湘投云储科技有限公司 Embedded equipment program upgrading system and method
CN113741943B (en) * 2021-11-08 2022-03-18 湘投云储科技有限公司 Embedded equipment program upgrading system and method

Similar Documents

Publication Publication Date Title
CN106257417B (en) Boot program upgrading method, embedded equipment, control equipment and embedded system
CN104102518B (en) double-CPU system and program upgrading method thereof
CN110083374B (en) Upgrade rollback method, system and terminal equipment
EP2375323A1 (en) Firmware image update and management
CN106775610B (en) Electronic equipment starting method and electronic equipment
JPWO2013103023A1 (en) Information processing apparatus, information processing method, and computer program
CN106227568A (en) Terminal unit start, upgrade method and equipment
CN112612498A (en) Embedded equipment upgrading method and embedded equipment
CN105653405A (en) Fault processing method and system of U-boot
CN107391174B (en) Control method and control device for online upgrading of system
CN115756561A (en) Software upgrading method and device, computer equipment and storage medium
CN111475175A (en) Method, device and medium for installing and guiding operation system based on ARM server
CN107396185B (en) Upgrading method and system
WO2018166322A1 (en) Repairing method and device for system partition
WO2024041283A1 (en) Client upgrading method and apparatus, terminal device, and storage medium
KR101529713B1 (en) Method for improving system stability of android devices in abnormal power switching, and computer-readable recording medium for the same
CN114995854A (en) Application program online upgrading method and device, terminal and operation machine
CN102541585A (en) Remote upgrade method and embedded system
CN114546455A (en) MCU software upgrading method and device for double partitions
CN115658152A (en) Firmware upgrading method, firmware, electronic device and computer readable storage medium
CN111176693B (en) Upgrading method of digital television system
CN117311764A (en) Firmware upgrading and restoring method, device, equipment and storage medium
CN104978208A (en) Warm restart method and device thereof
US11385885B2 (en) System and method of downloading a firmware to a server
CN117492799A (en) Software upgrading method and device, terminal equipment and storage medium

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Tan Jun

Inventor after: Zhang Peng

Inventor before: Zhang Peng