CN113515291A - Equipment online upgrading method and device - Google Patents

Equipment online upgrading method and device Download PDF

Info

Publication number
CN113515291A
CN113515291A CN202110434780.0A CN202110434780A CN113515291A CN 113515291 A CN113515291 A CN 113515291A CN 202110434780 A CN202110434780 A CN 202110434780A CN 113515291 A CN113515291 A CN 113515291A
Authority
CN
China
Prior art keywords
upgrading
burning
successful
starting
mirror image
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
CN202110434780.0A
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.)
Beijing Huijun Technology Co ltd
Original Assignee
Beijing Huijun Technology 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 Beijing Huijun Technology Co ltd filed Critical Beijing Huijun Technology Co ltd
Priority to CN202110434780.0A priority Critical patent/CN113515291A/en
Publication of CN113515291A publication Critical patent/CN113515291A/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/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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
    • G06F9/4406Loading of operating system

Landscapes

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

Abstract

The embodiment of the disclosure discloses an online equipment upgrading method and device. The specific implementation mode of the method comprises the following steps: backing up a version to be upgraded to obtain a first mirror image, and storing the first mirror image into a mirror image storage partition of a flash; setting an upgrading state as the start of burning, and burning the version to a flash system partition; if the version is completely burned, setting the upgrading state as successful burning, and restarting the system; detecting an upgrade state; if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start; detecting whether the starting is successful; if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful. The embodiment overcomes the defect that the power can not be cut off in the equipment upgrading process, the power can be cut off randomly in the upgrading process, and the equipment can intelligently complete the version upgrading task.

Description

Equipment online upgrading method and device
Technical Field
The embodiment of the disclosure relates to the technical field of embedded equipment, in particular to an online equipment upgrading method and device.
Background
The internet of things enables each piece of equipment to be connected to the internet, information development is changed at a high speed, so the equipment often needs to be updated iteratively to repair new functions and repair product defects, and the most common upgrading method at present is Over-the-air technology (technology for downloading an upgrading package on a remote server through a wireless network and upgrading a system or application) -online upgrading; the mobile phone adopts a recovery upgrading mode, a special upgrading system is needed, small embedded Internet of things equipment is not suitable for double-system and recovery upgrading and is expensive, the existing upgrading method has great risk at present, and the general method is to remind a user that power cannot be off as much as possible, otherwise the equipment is damaged and cannot be started, so that the equipment which breaks down is up to more than 5% every year, great repair cost is brought, and the project operation and maintenance cost is increased.
Disclosure of Invention
The embodiment of the disclosure provides an online equipment upgrading method and device.
In a first aspect, an embodiment of the present disclosure provides an online device upgrade method, including: backing up the version to be upgraded to obtain a first mirror image, and storing the first mirror image into a mirror image storage partition of the flash; setting an upgrading state as the start of burning, and burning the version to a flash system partition; if the version is completely burned, setting the upgrading state as successful burning, and restarting the system; detecting an upgrade state; if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start; detecting whether the starting is successful; if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful.
In some embodiments, the method further comprises: if the upgrading state is starting or burning is started, burning the first mirror image into a flash system partition; if the first mirror image is completely burned, setting the upgrading state as successful burning, and starting the system; and setting the upgrading state as starting and guiding the embedded software system to start.
In some embodiments, the method further comprises: if the starting fails, checking the upgrading state; if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start; detecting whether the starting is successful; if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful.
In some embodiments, the method further comprises: if the upgrading state is starting or burning is started, burning the first mirror image into a flash system partition; if the burning is finished, setting the upgrading state as successful burning, and starting the system; and setting the upgrading state as starting and guiding the embedded software system to start.
In some embodiments, the method further comprises: and backing up the original version to obtain a second mirror image, and storing the second mirror image into a mirror image storage partition of the flash.
In some embodiments, the method further comprises: if the starting failure times exceed a preset threshold value, setting the upgrading state as the start of burning, and burning the second mirror image to the system partition of the flash; if the second mirror image is completely burned, setting the upgrading state as successful burning, and restarting the system; detecting an upgrade state; if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start; detecting whether the starting is successful; if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful.
In some embodiments, backing up the version to be upgraded to obtain the first mirror image includes: carrying out version detection on the version to be upgraded; and if the version is legal, backing up the version to obtain a first mirror image.
In a second aspect, an embodiment of the present disclosure provides an apparatus for online upgrade of a device, including: the backup unit is configured to backup the version to be upgraded to obtain a first mirror image and store the first mirror image into a mirror image storage partition of the flash; the burning unit is configured to set the upgrading state as the burning start and burn the version to the system partition of the flash; the restarting unit is configured to set the upgrading state as successful burning and restart the system if the version burning is finished; a first detection unit configured to detect an upgrade status; the guiding unit is configured to set the upgrading state as starting and guide the embedded software system to start if the upgrading state is successful in burning or upgrading; a second detection unit configured to detect whether the booting is successful; and the ending unit is configured to end the upgrading if the starting is successful, and set the upgrading state as upgrading success.
In some embodiments, the burning unit is further configured to: if the upgrading state is starting or burning is started, burning the first mirror image into a flash system partition; the restart unit is further configured to: if the first mirror image is completely burned, setting the upgrading state as successful burning, and starting the system; the guiding unit is further configured to: and setting the upgrading state as starting and guiding the embedded software system to start.
In some embodiments, the first detection unit is further configured to: if the starting fails, checking the upgrading state; the guiding unit is further configured to: if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start; the second detection unit is further configured to: detecting whether the starting is successful; the ending unit is further configured to end the upgrade if the start is successful, and set the upgrade status as upgrade successful.
In some embodiments, the burning unit is further configured to: if the upgrading state is starting or burning is started, burning the first mirror image into a flash system partition; the restart unit is further configured to: if the first mirror image is completely burned, setting the upgrading state as successful burning, and starting the system; the guiding unit is further configured to: and setting the upgrading state as starting and guiding the embedded software system to start.
In some embodiments, the backup unit is further configured to: and backing up the original version to obtain a second mirror image, and storing the second mirror image into a mirror image storage partition of the flash.
In some embodiments, the apparatus further comprises a fallback unit configured to: if the starting failure times exceed a preset threshold value, setting the upgrading state as the start of burning, and burning the second mirror image to the system partition of the flash; if the second mirror image is completely burned, setting the upgrading state as successful burning, and restarting the system; detecting an upgrade state; if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start; detecting whether the starting is successful; if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful.
In some embodiments, the backup unit is further configured to: carrying out version detection on the version to be upgraded; and if the version is legal, backing up the version to obtain a first mirror image.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; storage means on which one or more computer programs are stored which, when executed by one or more processors, cause the one or more processors to carry out a method according to any one of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method as in any one of the first aspect.
The method and the device for upgrading the equipment on line provided by the embodiment of the disclosure occupy less system resources and have low cost; meanwhile, the integrity of the system can be automatically repaired, the later operation and maintenance cost of the product is reduced, and the operation and maintenance cost can be saved by about 5-10% in the life cycle of the product through preliminary evaluation.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for online upgrade of a device according to the present disclosure;
FIG. 3 is a schematic diagram of an application scenario of the device online upgrade method according to the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a method for online upgrade of a device according to the present disclosure;
FIG. 5 is a schematic block diagram of one embodiment of an online upgrade apparatus for a device according to the present disclosure;
FIG. 6 is a schematic block diagram of a computer system suitable for use with an electronic device implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the device online upgrade method or device online upgrade apparatus of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various communication client applications, such as an internet of things application, a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like, may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, and 103 may be various electronic devices based on an embedded linux or OpenWRT system platform, including but not limited to internet of things devices such as televisions, refrigerators, washing machines, and telephones.
The server 105 may be a server providing various services, such as a background system server providing support for systems running on the terminal devices 101, 102, 103. The background system server may send the latest system upgrade package to the terminal device.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein. The server may also be a server of a distributed system, or a server incorporating a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology.
It should be noted that the device online upgrade method provided by the embodiment of the present disclosure is generally executed by the terminal devices 101, 102, and 103, and accordingly, the device online upgrade apparatus is generally disposed in the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for online upgrade of a device according to the present disclosure is shown. The online upgrading method of the equipment comprises the following steps:
step 201, the version to be upgraded is backed up to obtain a first mirror image, and the first mirror image is stored in a mirror image storage partition of the flash.
In this embodiment, an execution main body of the device online upgrade method (for example, the terminal device shown in fig. 1) may acquire the version to be upgraded from the server in a wired connection manner or a wireless connection manner, and download the version into the memory. In order to prevent upgrading failure caused by power failure in the upgrading process, the version to be upgraded can be backed up to obtain a first mirror image, and the first mirror image is stored in a mirror image storage partition of the flash. Data in the mirror image storage partition of the flash cannot be lost when power is lost. When the flash is powered on, the backup version can be obtained from the mirror image storage partition of the flash again, and the upgrading is carried out again. The mirror image storage partition of the flash can keep the mirror images of two versions, an original version and a version to be upgraded. If two versions already exist before, the oldest version can be overwritten with the version to be upgraded.
Step 202, setting the upgrade state as the start of burning, and burning the version to the system partition of the flash.
In this embodiment, the upgrade state is saved in the communication partition on the flash. The method of the present disclosure maintains four states: start of burning (burn start), success of burning (burn ok), boot (boot), and success of upgrade (boot). The version upgrading process comprises two stages: a burning stage and a starting stage. The burn start (burn start) and the burn ok (burn ok) are used to record the status of the burn stage. If the power is lost in the burning stage, the state is still burning start when the power is powered on again, and burning needs to be repeated. Boot (boot) and upgrade success (bootOK) are used to record the state of the boot phase.
Step 203, if the version burning is finished, setting the upgrading state as successful burning, and restarting the system.
In this embodiment, if the recording process is completed without an accident, the upgrade status is changed to recording success. Therefore, even if the subsequent process fails due to power failure, the recording operation does not need to be re-recorded. And restarting the system after the burning is successful, wherein the BIOS system is started.
Step 204, detecting the upgrading state.
In this embodiment, the upgrade status is detected after startup. Detection is initiated by the bootstrap program (e.g., uboot). The boot program will detect the upgrade status each time it is powered on. And judging whether to re-burn or restart according to the upgrading state.
And step 205, if the upgrade state is recording success or upgrading success, setting the upgrade state as start and guiding the embedded software system to start.
In this embodiment, if the upgrade status is recording success or upgrading success, it indicates that recording does not need to be resumed, and only the embedded software system needs to be booted. The current upgrading state is recorded as the starting state before the embedded software system is started so as to prevent power failure in the starting process of the embedded software system, and the stage of the upgrading process can be judged according to the upgrading state. And loading the data of the system partition of the flash into a memory in the starting process of the embedded software system, jumping to the forefront of the memory, starting to enter the system starting, and starting various applications.
Step 206, detecting whether the starting is successful.
In the embodiment, whether the startup is successful is detected by reading the environment variable in the communication partition of the flash.
And step 207, if the starting is successful, finishing the upgrading, and setting the upgrading state as successful upgrading.
In this embodiment, if the start is successful, it indicates that the version upgrade is successful, and the upgrade is ended. And modifying the upgrading state into upgrading success. If a power loss occurs thereafter, the upgrade process is not re-entered. If the watchdog timer is set, it needs to be cleared to avoid device restart.
And step 208, if the upgrading state is starting or burning is started, burning the first mirror image into the system partition of the flash.
In this embodiment, if it is detected that the upgrade status is the start or the start of burning after power-on, it indicates that the last upgrade is unsuccessful and the upgrade needs to be performed again. And acquiring the backed-up first mirror image from the mirror image storage partition of the flash, and burning the first mirror image into the system partition of the flash.
Step 209, if the first mirror image is completely burned, the upgrade status is set to be successfully burned, and the system is started.
In this embodiment, after the re-burning is successful, the upgrade status needs to be modified to be the successful burning, so that the situation that the upgrade status cannot be recovered when the power is lost in the re-burning process can be avoided. After the recording is successful, it means that the recording stage is finished, and the system is started to enter the start stage, and step 205 and step 207 are continuously executed.
According to the method provided by the embodiment of the disclosure, the system upgrade is divided into different upgrade states according to the time sequence, the system is judged to be abnormal through the management of the different upgrade states of the system, and the corresponding system repair strategy is adopted, so that the problems of power interruption, system damage and the like of a user in the system upgrade process are solved. And detecting the starting problem of the system mirror image through the boot and boot OK mark judgment of the system in the starting stage, and automatically burning and repairing the system mirror image through a bootstrap program.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the device online upgrade method according to the present embodiment. In the application scenario of fig. 3, the terminal device downloads the upgrade package from the server and backs up the upgrade package to a system partition of a flash that does not lose data even if power is lost. Before burning, the upgrading state is set to burn start, and then the burning of the upgrading package is started. If the power is cut off in the burning process, the upgrading state is detected firstly after the power is powered on again. And if the upgrade state is detected to be burn start, acquiring the backup upgrade package from the system partition of the flash, and restarting burning. If the burning is successful, the upgrading state is converted into burn OK, and the upgrading package is used for starting the equipment, so that the upgrading state is modified into boot. If the power is lost in the starting process, the upgrading state is detected firstly after the power is re-electrified, and if the upgrading state is detected to be boot, the backup upgrading packet is obtained from the system partition of the flash, and burning is restarted. If the burning is successful, the upgrading state is converted into burn OK, the upgrading package is used for starting the equipment, and the upgrading state is modified into boot. If the starting is finished without power failure in the starting process, the upgrading is finished, and the upgrading state is set to bootOK. If power failure occurs again, the upgrading state is detected firstly after power is powered on again, if the upgrading state is detected to be bootOK, the last upgrading is successful, the upgrading is not performed, only the system starting process is completed, the upgrading state is set to boot before starting, and the upgrading state is modified to bootOK after the starting is successful.
With further reference to FIG. 4, a flow 400 of yet another embodiment of a device online upgrade method is shown. The process 400 of the online upgrade method for the device includes the following steps:
step 401, backing up the original version to obtain a second mirror image, and storing the second mirror image in a mirror image storage partition of the flash.
In this embodiment, an execution main body (for example, the terminal device shown in fig. 1) of the device online upgrade method may back up an original version to obtain a second mirror image. And storing the second image to the image storage partition of the flash. The mirror image storage partition of the flash can keep two versions of mirror images, an original version (namely the currently used version) and a version to be upgraded.
Step 402, if the number of failed start-up times exceeds a predetermined threshold, setting the upgrade state as start of burning, and burning the second mirror image to the system partition of the flash.
In this embodiment, the number of times of start failure is counted during the upgrade process using the version to be upgraded. If the number of failed start-up times exceeds a preset threshold, the version to be upgraded has a problem and cannot be used. Thus requiring a fallback to the original version. This step is substantially the same as step 202, except that the step is to burn the image of the original version into the system partition of the flash.
Step 403, if the second mirror image is completely burned, setting the upgrade status as the burning success, and restarting the system.
In this embodiment, if the recording process is completed without an accident, the upgrade status is changed to recording success. Therefore, even if the subsequent process fails due to power failure, the recording operation does not need to be re-recorded. And restarting the system after the burning is successful, wherein the BIOS system is started.
Step 404, an upgrade status is detected.
And 405, if the upgrading state is recording success or upgrading success, setting the upgrading state as starting and guiding the embedded software system to start.
Step 406, detecting whether the startup is successful.
Step 407, if the start is successful, the upgrade is ended, and the upgrade state is set to be the upgrade success.
Steps 404 and 407 are substantially the same as steps 204 and 207, and therefore, the description is omitted.
And step 408, if the upgrading state is starting or burning is started, burning the second mirror image into the system partition of the flash.
In this embodiment, if it is detected that the upgrade status is the start or the start of burning after power-on, it indicates that the last upgrade is unsuccessful and the upgrade needs to be performed again. And if the starting failure times exceed a preset threshold value, acquiring a second mirror image which is well backed up from a mirror image storage partition of the flash, and burning the second mirror image into a system partition of the flash. Otherwise, obtaining the first mirror image which is well backed up from the mirror image storage partition of the flash, and burning the first mirror image into the system partition of the flash.
And 409, if the second mirror image is completely burned, setting the upgrading state as successful burning, and starting the system.
In this embodiment, after the re-burning is successful, the upgrade status needs to be modified to be the successful burning, so that the situation that the upgrade status cannot be recovered when the power is lost in the re-burning process can be avoided. After the recording is successful, it means that the recording stage is finished, and the system is started to enter the start stage, and step 405 and step 407 are continuously executed.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the device online upgrade method in this embodiment represents a step of rollback of version upgrade failure. Therefore, the scheme described in the embodiment can be used for dealing with various unexpected situations, and the situation that the equipment cannot be used due to upgrade failure is avoided.
With further reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for online upgrade of a device, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the device online upgrade apparatus 500 of the present embodiment includes: the device comprises a backup unit 501, a burning unit 502, a restarting unit 503, a first detection unit 504, a guiding unit 505, a second detection unit 506 and an ending unit 507. The backup unit 501 is configured to backup a version to be upgraded to obtain a first mirror image, and store the first mirror image in a mirror image storage partition of the flash; a burning unit 502 configured to set an upgrade state as burning start and burn a version to a system partition of the flash; a restart unit 503 configured to set the upgrade status as recording success if the version recording is completed, and restart the system; a first detection unit 504 configured to detect an upgrade status; a guiding unit 505 configured to set the upgrade status as start and guide the embedded software system to start if the upgrade status is recording success or upgrading success; a second detection unit 506 configured to detect whether the booting is successful; and an ending unit 507 configured to end the upgrade if the start is successful, and set the upgrade status as upgrade successful.
In this embodiment, the specific processing of the backup unit 501, the burning unit 502, the restarting unit 503, the first detecting unit 504, the guiding unit 505, the second detecting unit 506 and the ending unit 507 of the device online upgrade apparatus 500 may refer to step 201 and step 207 in the corresponding embodiment of fig. 2.
In some optional implementations of the present embodiment, the burning unit 502 is further configured to: if the upgrading state is starting or burning is started, burning the first mirror image into a flash system partition; the restart unit 503 is further configured to: if the first mirror image is completely burned, setting the upgrading state as successful burning, and starting the system; the guiding unit 505 is further configured to: and setting the upgrading state as starting and guiding the embedded software system to start.
In some optional implementations of the present embodiment, the first detection unit 504 is further configured to: if the starting fails, checking the upgrading state; the guiding unit 505 is further configured to: if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start; the second detection unit 506 is further configured to: detecting whether the starting is successful; the ending unit 507 is further configured to end the upgrade if the start is successful, and set the upgrade status as upgrade successful.
In some optional implementations of the present embodiment, the burning unit 502 is further configured to: if the upgrading state is starting or burning is started, burning the first mirror image into a flash system partition; the restart unit 503 is further configured to: if the first mirror image is completely burned, setting the upgrading state as successful burning, and starting the system; the guiding unit 505 is further configured to: and setting the upgrading state as starting and guiding the embedded software system to start.
In some optional implementations of this embodiment, the backup unit 501 is further configured to: and backing up the original version to obtain a second mirror image, and storing the second mirror image into a mirror image storage partition of the flash.
In some optional implementations of this embodiment, the apparatus further comprises a fallback unit (not shown in the drawings) configured to: if the starting failure times exceed a preset threshold value, setting the upgrading state as the start of burning, and burning the second mirror image to the system partition of the flash; if the second mirror image is completely burned, setting the upgrading state as successful burning, and restarting the system; detecting an upgrade state; if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start; detecting whether the starting is successful; if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful.
In some embodiments, the backup unit 501 is further configured to: carrying out version detection on the version to be upgraded; and if the version is legal, backing up the version to obtain a first mirror image.
According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
An electronic device, comprising: one or more processors; a storage device having one or more computer programs stored thereon that, when executed by the one or more processors, cause the one or more processors to implement the method of flows 200 or 400.
A computer-readable medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method of flow 200 or 400.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The calculation unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 601 performs the various methods and processes described above, such as the device online upgrade method. For example, in some embodiments, the device online upgrade method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the above described method of online upgrade of a device may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured by any other suitable means (e.g., by means of firmware) to perform the device online upgrade method.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a server of a distributed system or a server incorporating a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology. The server may be a server of a distributed system or a server incorporating a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (10)

1. An online equipment upgrading method comprises the following steps:
backing up a version to be upgraded to obtain a first mirror image, and storing the first mirror image into a mirror image storage partition of a flash;
setting an upgrading state as the start of burning, and burning the version to a flash system partition;
if the version is completely burned, setting the upgrading state as successful burning, and restarting the system;
detecting an upgrade state;
if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start;
detecting whether the starting is successful;
if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful.
2. The method of claim 1, wherein the method further comprises:
if the upgrading state is starting or burning is started, burning the first mirror image into a flash system partition;
if the first mirror image is completely burned, setting the upgrading state as successful burning, and starting the system;
and setting the upgrading state as starting and guiding the embedded software system to start.
3. The method according to claim 1 or 2, wherein the method further comprises:
if the starting fails, checking the upgrading state;
if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start;
detecting whether the starting is successful;
if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful.
4. The method of claim 3, wherein the method further comprises:
if the upgrading state is starting or burning is started, burning the first mirror image into a flash system partition;
if the first mirror image is completely burned, setting the upgrading state as successful burning, and starting the system;
and setting the upgrading state as starting and guiding the embedded software system to start.
5. The method of claim 1, wherein the method further comprises:
and backing up the original version to obtain a second mirror image, and storing the second mirror image into a mirror image storage partition of the flash.
6. The method of claim 5, wherein the method further comprises:
if the starting failure times exceed a preset threshold value, setting the upgrading state as the start of burning, and burning the second mirror image to the system partition of the flash;
if the second mirror image is completely burned, setting the upgrading state as successful burning, and restarting the system;
detecting an upgrade state;
if the upgrading state is successful in burning or upgrading, setting the upgrading state as starting and guiding the embedded software system to start;
detecting whether the starting is successful;
if the starting is successful, the upgrading is finished, and the upgrading state is set to be successful.
7. The method of claim 1, wherein backing up the version to be upgraded to obtain the first mirror image comprises:
carrying out version detection on the version to be upgraded;
and if the version is legal, backing up the version to obtain a first mirror image.
8. An apparatus for online upgrade of a device, comprising:
the backup unit is configured to backup a version to be upgraded to obtain a first mirror image, and store the first mirror image into a mirror image storage partition of the flash;
the burning unit is configured to set the upgrading state as the burning start and burn the version to the system partition of the flash;
the restarting unit is configured to set the upgrading state as successful burning and restart the system if the version burning is finished;
a first detection unit configured to detect an upgrade status;
the guiding unit is configured to set the upgrading state as starting and guide the embedded software system to start if the upgrading state is successful in burning or upgrading;
a second detection unit configured to detect whether the booting is successful;
and the ending unit is configured to end the upgrading if the starting is successful, and set the upgrading state as upgrading success.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more computer programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110434780.0A 2021-04-22 2021-04-22 Equipment online upgrading method and device Pending CN113515291A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110434780.0A CN113515291A (en) 2021-04-22 2021-04-22 Equipment online upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110434780.0A CN113515291A (en) 2021-04-22 2021-04-22 Equipment online upgrading method and device

Publications (1)

Publication Number Publication Date
CN113515291A true CN113515291A (en) 2021-10-19

Family

ID=78062411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110434780.0A Pending CN113515291A (en) 2021-04-22 2021-04-22 Equipment online upgrading method and device

Country Status (1)

Country Link
CN (1) CN113515291A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129349A (en) * 2022-07-22 2022-09-30 四川虹美智能科技有限公司 Online upgrading method, device, equipment and medium for electronic control firmware
CN115373906A (en) * 2022-10-24 2022-11-22 北京智芯微电子科技有限公司 Backup starting method, device, equipment and chip of embedded system architecture

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156249A (en) * 2014-08-18 2014-11-19 四川九成信息技术有限公司 Embedded software upgrading method
WO2016131294A1 (en) * 2015-07-16 2016-08-25 中兴通讯股份有限公司 Version upgrade processing method and device
CN106843940A (en) * 2016-12-30 2017-06-13 长沙湘计海盾科技有限公司 A kind of fast updating method of embedded system
CN112004155A (en) * 2020-08-24 2020-11-27 深圳创维-Rgb电子有限公司 OAD upgrading method and device, smart television and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156249A (en) * 2014-08-18 2014-11-19 四川九成信息技术有限公司 Embedded software upgrading method
WO2016131294A1 (en) * 2015-07-16 2016-08-25 中兴通讯股份有限公司 Version upgrade processing method and device
CN106843940A (en) * 2016-12-30 2017-06-13 长沙湘计海盾科技有限公司 A kind of fast updating method of embedded system
CN112004155A (en) * 2020-08-24 2020-11-27 深圳创维-Rgb电子有限公司 OAD upgrading method and device, smart television and readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129349A (en) * 2022-07-22 2022-09-30 四川虹美智能科技有限公司 Online upgrading method, device, equipment and medium for electronic control firmware
CN115373906A (en) * 2022-10-24 2022-11-22 北京智芯微电子科技有限公司 Backup starting method, device, equipment and chip of embedded system architecture
CN115373906B (en) * 2022-10-24 2023-02-17 北京智芯微电子科技有限公司 Backup starting method, device, equipment and chip of embedded system architecture

Similar Documents

Publication Publication Date Title
CN107844386B (en) Data backup and recovery method and device
CN107589994B (en) Method, device, system and storage medium for managing application process priority
CN110225078B (en) Application service updating method, system and terminal equipment
CN113515291A (en) Equipment online upgrading method and device
CN115794257B (en) System starting method, device, electronic equipment and storage medium
CN112882734A (en) Upgrading method and device, computer equipment and medium
CN110780942A (en) System starting method and device, node equipment and computer readable storage medium
CN105867962A (en) System upgrading method and device
CN114860322A (en) Substrate management controller, control method and electronic equipment
CN113703823A (en) BMC (baseboard management controller) firmware upgrading method and device, electronic equipment and storage medium
CN111949290B (en) Hot patch management method and device, electronic equipment and storage medium
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN115509821A (en) System exception handling method, device, equipment and storage medium
CN115454515A (en) System processing method and device and electronic equipment
CN114995854A (en) Application program online upgrading method and device, terminal and operation machine
CN115658152A (en) Firmware upgrading method, firmware, electronic device and computer readable storage medium
CN114153503A (en) BIOS control method, device and medium
TW202131170A (en) Firmware corruption recovery
CN105867961A (en) System upgrading and degrading method and device
CN111694608A (en) System upgrading method and device for terminal equipment, electronic equipment and terminal equipment
CN117453255A (en) Method, device, equipment and storage medium for upgrading embedded equipment
CN115202928A (en) Method and device for processing boot configuration data of operating system
CN118012660A (en) System abnormal starting recovery method, device, equipment and storage medium
CN114816565A (en) Firmware loading method and device and electronic equipment
CN117687647A (en) Program upgrading method, device, electronic equipment, storage medium and program product

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