CN110045971B - System upgrade recovery method and device - Google Patents
System upgrade recovery method and device Download PDFInfo
- Publication number
- CN110045971B CN110045971B CN201810043116.1A CN201810043116A CN110045971B CN 110045971 B CN110045971 B CN 110045971B CN 201810043116 A CN201810043116 A CN 201810043116A CN 110045971 B CN110045971 B CN 110045971B
- Authority
- CN
- China
- Prior art keywords
- upgrading
- upgrade
- state
- file
- recovery
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1433—Saving, restoring, recovering or retrying at system level during software upgrading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of monitoring, in particular to a system upgrade recovery method and device. The system upgrade recovery method is applied to electronic equipment, and comprises the following steps: reading an upgrade log generated by the electronic equipment in the system upgrade process before power failure, and judging whether system upgrade is finished or not according to the upgrade log; if the system upgrading is not finished, establishing network connection with an upgrading server, and sending an upgrading recovery request to the upgrading server; and receiving a secondary upgrade file fed back by the upgrade server based on the upgrade recovery request, and recovering the system upgrade according to the secondary upgrade file. According to the system upgrade recovery method and device provided by the embodiment of the invention, according to the read upgrade log, after the electronic equipment is powered off and restarted in the system upgrade process, the system upgrade can be automatically recovered, the problem of waste of manpower or material resources caused by returning the network camera to the factory again is avoided, and meanwhile, the defects of waste of storage space resources and increase of hardware cost can be avoided.
Description
Technical Field
The invention relates to the technical field of monitoring, in particular to a system upgrade recovery method and device.
Background
The network camera needs to upgrade the system in the using process, and a certain time is needed in the upgrading process, so that if the network camera is powered off due to environmental problems in the process, the network camera system cannot be restarted for use due to incomplete upgrading. At present, the network camera with incomplete system upgrade caused by power failure must be returned to a factory again to perform program burning through a serial port, and then the system can be restored or the system upgrade can be completed again so as to be started for use again, so that the waste of manpower and material resources is caused to a great extent. In the prior art, in order to solve the above problems, a system dual backup mechanism is usually adopted, that is, the whole system is backed up, and if the network camera is powered off in the process of updating the main system, the backup system is adopted to start the system for use. Therefore, how to solve the problem that the network camera cannot be restarted for use due to incomplete system upgrade caused by power failure in the system upgrade process, and simultaneously avoid the problem that the network camera is returned to the factory again to cause waste of manpower or material resources, and avoid the defects of waste of storage space resources and increase of hardware cost become technical problems to be solved urgently in the monitoring technical field.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for recovering system upgrade, so as to solve the above problem.
The system upgrade recovery method provided by the embodiment of the invention is applied to electronic equipment, and the method comprises the following steps:
reading an upgrade log generated by the electronic equipment in the system upgrade process before power failure, and judging whether system upgrade is finished or not according to the upgrade log;
if the system upgrading is not finished, establishing network connection with an upgrading server, and sending an upgrading recovery request to the upgrading server;
and receiving a secondary upgrade file fed back by the upgrade server based on the upgrade recovery request, and recovering system upgrade according to the secondary upgrade file.
Further, the recovery upgrade request is generated by:
acquiring the system upgrading state of the electronic equipment before power failure according to the upgrading log;
and generating a corresponding upgrade recovering request according to the system upgrade state.
Further, the system upgrade includes a kernel partition upgrade and a file system partition upgrade, the system upgrade state includes a first upgrade state representing that the kernel partition update is not completed and the file system partition update is not completed, and a second upgrade state representing that the kernel partition update is completed and the file system partition update is not completed, the secondary upgrade file includes a kernel image and a file system image, and a corresponding upgrade recovery request is generated according to the system upgrade state, including:
judging the upgrading state of the system;
if the system upgrading state is a first upgrading state, generating a first upgrading request for requesting to download the kernel image and the file system image;
and if the system upgrading state is the second upgrading state, generating a second upgrading request for requesting to download the file system image.
Further, the step of establishing a network connection with the upgrade server includes:
acquiring a first network configuration of the electronic equipment and a second network configuration of the upgrade server according to the upgrade log;
and establishing network connection with the upgrading server according to the first network configuration and the second network configuration.
Further, the method further comprises:
if the system is not upgraded completely, judging whether the system of the electronic equipment is in a usable state or not according to the upgrade log;
if the system of the electronic equipment is in an available state, starting the electronic equipment;
and if the system of the electronic equipment is not in an available state, executing the steps of establishing network connection with an upgrade server and sending a recovery upgrade request to the upgrade server.
Further, the system upgrade stage of the electronic device includes a first upgrade file receiving stage and a system update stage, and the step of determining whether the system of the electronic device is in an available state according to the upgrade log includes:
judging the system upgrading stage of the electronic equipment before power failure according to the upgrading log;
if the system upgrading stage of the electronic equipment is in a first upgrading file receiving stage before power failure, the system of the electronic equipment is in an available state;
and if the system upgrading stage of the electronic equipment is in the system updating stage before the power failure, the system of the electronic equipment is not in an available state.
Further, before the step of reading an upgrade log generated in the system upgrade process of the electronic device before power failure and judging whether system upgrade is completed according to the upgrade log, the method further comprises:
responding to system upgrading operation, sending a first upgrading request to the upgrading server, generating an upgrading log, and recording a first network configuration of the electronic equipment and a second network configuration of the upgrading server in the upgrading log;
and receiving a first-time upgrading file fed back by the upgrading server based on the first-time upgrading request, carrying out system upgrading according to the first-time upgrading file, and recording the system upgrading state of the electronic equipment in the upgrading log.
An embodiment of the present invention further provides a system upgrade recovery device, which is applied to an electronic device, and the device includes:
the upgrading judgment module is used for reading an upgrading log generated by the electronic equipment in the system upgrading process before power failure and judging whether system upgrading is finished or not according to the upgrading log;
the system comprises a request sending module, a recovery upgrading module and a recovery upgrading module, wherein the request sending module is used for establishing network connection with an upgrading server when system upgrading is not finished and sending a recovery upgrading request to the upgrading server;
and the recovery upgrading module is used for receiving a secondary upgrading file fed back by the upgrading server based on the recovery upgrading request and recovering the system upgrading according to the secondary upgrading file.
An embodiment of the present invention further provides an electronic device, including:
a memory;
a processor; and
a system upgrade recovery device comprising one or more processors stored in said memory and adapted to be executed by said processor
A software function module executed, the apparatus comprising:
the upgrading judgment module is used for reading an upgrading log generated by the electronic equipment in the system upgrading process before power failure and judging whether system upgrading is finished or not according to the upgrading log;
the system comprises a request sending module, a recovery upgrading module and a recovery upgrading module, wherein the request sending module is used for establishing network connection with an upgrading server when system upgrading is not finished and sending a recovery upgrading request to the upgrading server;
and the recovery upgrading module is used for receiving a secondary upgrading file fed back by the upgrading server based on the recovery upgrading request and recovering the system upgrading according to the secondary upgrading file.
The embodiment of the invention also provides a computer-readable storage medium, which stores instructions, and when the instructions are executed, the system upgrade recovery method is realized.
According to the system upgrade recovery method and device provided by the embodiment of the invention, the upgrade log generated by the electronic equipment in the system upgrade process before power failure is read, whether the system upgrade is completed or not is judged according to the upgrade log, if the system upgrade is not completed, the network connection with the upgrade server is established, the upgrade recovery request is sent to the upgrade server, the secondary upgrade file fed back by the upgrade server based on the upgrade recovery request is received, and the system upgrade is recovered according to the secondary upgrade file. Compared with the prior art, the system upgrade recovery method and device provided by the embodiment of the invention have the advantages that according to the read upgrade logs, the system upgrade can be automatically recovered after the electronic equipment is restarted after power failure in the system upgrade process, the problem of manpower or material resource waste caused by returning the network camera to a factory again is avoided, and meanwhile, the defects of storage space resource waste and hardware cost increase can be avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic structural block diagram of an electronic device according to an embodiment of the present invention.
Fig. 2 is a schematic flowchart of a system upgrade recovery method according to an embodiment of the present invention.
Fig. 3 is another partial flowchart of the system upgrade recovery method according to the embodiment of the present invention.
Fig. 4 is a flowchart illustrating sub-steps of step S200 in fig. 2.
Fig. 5 is another partial flowchart of the system upgrade recovery method according to the embodiment of the present invention.
Fig. 6 is a schematic structural block diagram of a system upgrade recovering apparatus according to an embodiment of the present invention.
Icon: 100-an electronic device; 110-system upgrade recovery means; 111-upgrade judging module; 112-request sending module; 113-resume upgrade module; 120-a processor; 130-memory.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "disposed," and "connected" are to be construed broadly, e.g., as being fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Referring to fig. 1, a schematic structural block diagram of an electronic device 100 applying the system upgrade recovery method and apparatus according to an embodiment of the present invention is shown. In this embodiment, the electronic device 100 may be a network camera, a network hard disk recorder, a vehicle-mounted device, or the like. The electronic device 100 includes a system upgrade recovery apparatus 110, a processor 120, and a memory 130.
The processor 120 and the memory 130 are electrically connected directly or indirectly to transmit or interact with each other, for example, the components may be electrically connected to each other through one or more communication buses or signal lines. The System upgrade recovery device 110 includes at least one software module which can be stored in the memory 130 in the form of software or Firmware (Firmware) or solidified in an Operating System (OS) of the network device. The processor 120 is used for executing executable modules stored in the memory 130, such as software functional modules and computer programs included in the system upgrade restoration apparatus 110. The processor 120 may execute the computer program upon receiving execution instructions.
The processor 120 may be an integrated circuit chip having signal processing capabilities. The processor 120 may also be a general-purpose processor, such as a Central Processing Unit (CPU), a Network Processor (NP), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present invention. Further, a general purpose processor may be a microprocessor or any conventional processor or the like.
The Memory 130 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 130 is used for storing a program, and the processing executes the program after receiving the execution instruction, and the method executed by the electronic device 100 as defined by the flow process disclosed in any embodiment of the present invention can be applied to the processor 120, or implemented by the processor 120.
It should be understood that the configuration shown in fig. 1 is merely illustrative, and the electronic device 100 may have fewer or more components than shown in fig. 1, or may have a different configuration than shown in fig. 1. Further, the components shown in fig. 1 may be implemented by software, hardware, or a combination thereof.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a system upgrade recovery method according to an embodiment of the present invention, where the method is applied to the electronic device shown in fig. 1. It should be noted that the method provided by the present invention is not limited by the specific sequence shown in fig. 2 and the following, and the specific flow and steps of the system upgrade recovery method are described in detail below with reference to fig. 2.
Step S100, reading an upgrade log generated by the electronic equipment in the system upgrade process before power failure, and judging whether system upgrade is finished according to the upgrade log.
In this embodiment, the system of the electronic device includes five partitions: the electronic equipment comprises a uboot partition, a kernel partition, a file system partition, a configuration partition and an engineering partition, wherein in the system upgrading of the electronic equipment, the software upgrading comprises kernel partition upgrading and file system partition upgrading.
In this embodiment, the upgrade log is generated in the system upgrade process of the electronic device before power failure. Therefore, referring to fig. 3, in this embodiment, before step S100, the system upgrade recovering method further includes step S001 and step S002.
And S001, responding to system upgrading operation, sending a first upgrading request to an upgrading server, generating an upgrading log, and recording the first network configuration of the electronic equipment and the second network configuration of the upgrading server in the upgrading log.
In this embodiment, a first upgrade request may be sent to an upgrade server through a Web page logged in a browser, and the upgrade log may be generated in the project partition.
And S002, receiving a first-time upgrading file fed back by the upgrading server based on the first-time upgrading request, upgrading the system according to the first-time upgrading file, and recording the system upgrading state of the electronic equipment in the upgrading log.
In the embodiment, the received first upgrade file comprises a kernel image and a file system image, and the kernel image and the file system image can be stored in a memory space of the electronic device. Optionally, in this embodiment, version verification is further performed on the received kernel image and the received file system image to obtain version information of the kernel image and the file system image, and then the version information is recorded in the upgrade log. In order to verify the necessity of the system upgrade of the electronic device, optionally, in this embodiment, the obtained version information is further determined, if the version information meets a preset system upgrade requirement, step S002 is executed to perform system upgrade according to the first upgrade file, and record the system upgrade state of the electronic device in the upgrade log, and if the version information does not meet the preset system upgrade requirement, the system upgrade of the electronic device is stopped. The preset system upgrade requirement may be that the version number carried in the obtained version information is higher than the version number carried in the version information of the original system of the electronic device, where the original system of the electronic device is the current system of the electronic device before power failure.
In this embodiment, the system upgrade is a software upgrade, and includes updating a kernel partition of a system according to the kernel mirror, and updating a file system partition of the system according to the file system mirror. And the electronic equipment writes a first label representing the system upgrading start into the upgrading log before receiving the first upgrading file and upgrading the system according to the first upgrading file. Thereafter, as an embodiment, after the system upgrade is completed, a second tag characterizing the completion of the system upgrade is written into the upgrade log. In order to more clearly and specifically record the respective update states of the kernel partition and the file system partition in the system upgrade process before power failure so as to improve the system upgrade efficiency of the electronic device after power failure, as another embodiment, in the system upgrade process, after the kernel partition is updated, a third tag representing that the kernel partition is updated is written into the upgrade log, and after the file system partition is updated, a fourth tag representing that the file system partition is updated is written into the upgrade log. It should be noted that, in the system upgrade of the electronic device, the kernel partition is updated first, and the file system partition is updated later, so it can be understood that, here, if the upgrade log includes the fourth tag, it indicates that the system upgrade is completed.
Based on the above settings, in step S100, after the upgrade log is read, if the upgrade log includes the second tag or the fourth tag, it indicates that the system upgrade is completed, otherwise, it indicates that the system upgrade is not completed.
Step S200, if the system is not upgraded completely, establishing network connection with an upgrade server, and sending an upgrade recovery request to the upgrade server.
In this embodiment, if the system upgrade is not completed, the first network configuration of the electronic device and the second network configuration of the upgrade server are obtained according to the upgrade log, and further, a network connection with the upgrade server is established according to the first network configuration and the second network configuration.
Before power failure, if the system of the electronic device is upgraded and the implementation mode that the second tag is written to indicate that the system is upgraded is adopted, the upgrade recovery request is used for requesting to download the kernel image and the file system image.
Before the power failure, if the implementation mode that the fourth tag is written to indicate that the system upgrade of the electronic device is completed is adopted after the system upgrade of the electronic device is completed, the upgrade resuming request may be implemented by two substeps, i.e., step S210 and step S220, shown in fig. 4.
And step S210, acquiring the system upgrading state of the electronic equipment before power failure according to the upgrading log.
Optionally, in this embodiment, the system upgrade status of the electronic device may be represented according to a third tag and a fourth tag written in the upgrade log. Therefore, the obtaining of the system upgrade state of the electronic device is to read the third tag and the fourth tag from the upgrade log.
And step S220, generating a corresponding upgrade recovery request according to the system upgrade state.
Optionally, in this embodiment, the system upgrade state includes a first upgrade state representing that the updating of the kernel partition is not completed and the updating of the file system partition is not completed, and a second upgrade state representing that the updating of the kernel partition is completed and the updating of the file system partition is not completed. In implementation, the system upgrade state of the electronic device may be determined by reading and determining whether the upgrade log includes the third tag and the fourth tag. For example, when the upgrade log does not include the third tag and does not include the fourth tag, the system upgrade status is determined to be the first upgrade status, and when the upgrade log includes the third tag and does not include the fourth tag, the system upgrade status is determined to be the second upgrade status.
In this embodiment, the secondary upgrade file includes a kernel image and a file system image. The upgrade recovery request includes a first upgrade request and a second upgrade request. The first upgrade request corresponds to the first upgrade status, and is used for requesting to download the kernel image and the file system image. The second upgrade request corresponds to the second upgrade status, and is used for requesting to download the file system image. And if the system upgrading state is a first upgrading state, generating the first upgrading request, and if the system upgrading state is a second upgrading state, generating the second upgrading request. Therefore, the kernel mirror image can be prevented from being downloaded again under the condition that the system upgrading state is the second upgrading state, and the step of updating the kernel partition of the system of the electronic equipment which is completed before power failure is repeated, so that the system upgrading efficiency of the electronic equipment after power failure is effectively improved.
And step S300, receiving a secondary upgrade file fed back by the upgrade server based on the upgrade recovery request, and recovering system upgrade according to the secondary upgrade file.
If the received secondary upgrade file is a kernel image and a file system image, the system upgrade is restored according to the secondary upgrade file, including updating a kernel partition of a system according to the kernel image, and updating a file system partition of the system according to the file system image, so that the system of the electronic equipment is complete, and the electronic equipment can be started for use. If the received secondary upgrade file is a file system mirror image, the system upgrade is restored according to the secondary upgrade file, and the file system partition of the system is updated according to the file system mirror image, so that the system of the electronic equipment is completed, and the electronic equipment can be started for use.
Referring to fig. 5, in order to enable the electronic device to be quickly and automatically started for use without system upgrade after power failure, optionally, in this embodiment, the method for recovering system upgrade further includes step S400, step S500, and step S600.
And step S400, if the system upgrading is not finished, judging whether the system of the electronic equipment is in an available state according to the upgrading log.
In this embodiment, before power failure, the system upgrade stage includes a first upgrade file receiving stage and a system update stage. In view of this, the system upgrade stage of the electronic device before power failure may be determined according to the upgrade log, so as to determine whether the system of the electronic device is in an available state. In this embodiment, it is agreed that the system of the electronic device is in an available state if the system upgrade stage of the electronic device before power failure is in the first upgrade file receiving stage, and the system of the electronic device is not in an available state if the system upgrade stage of the electronic device before power failure is in the system update stage.
In implementation, the system upgrading stage of the electronic equipment before power failure is judged by judging whether the first label representing the system upgrading start exists in the upgrading log. For example, if the first tag does not exist in the upgrade log, it indicates that the system upgrade stage of the electronic device is in a first upgrade file receiving stage before the power failure, that is, it indicates that the system upgrade of the electronic device has not been initiated before the power failure, and thus, the system of the electronic device is in an available state if the original system of the electronic device is not damaged. If the first tag exists in the upgrade log, it indicates that the system upgrade stage of the electronic device is in a system update stage before power failure, that is, it indicates that the system upgrade of the electronic device has been initiated but not completed before power failure, so that the system of the electronic device is not in an available state if the original system of the electronic device is damaged.
And S500, if the system of the electronic equipment is in an available state, starting the electronic equipment to realize quick start and use of the electronic equipment after power failure.
Here, the electronic device is started based on the legacy system of the electronic device.
Step S600, if the system of the electronic device is not in an available state, executing step S200, establishing a network connection with an upgrade server, and sending a resume upgrade request to the upgrade server.
Referring to fig. 6, an embodiment of the present invention further provides a system upgrade recovering apparatus 110, which is applied to the electronic device 100 shown in fig. 1, where the system upgrade recovering apparatus 110 includes:
and the upgrade judging module 111 is configured to read an upgrade log generated by the electronic device in a system upgrade process before power failure, and judge whether system upgrade is completed according to the upgrade log. The description of the upgrade determination module 111 may specifically refer to the detailed description of step S100 shown in fig. 2, that is, step S100 may be performed by the upgrade determination module 111.
A request sending module 112, configured to establish a network connection with the upgrade server when system upgrade is not completed, and send a upgrade recovery request to the upgrade server. The description of the request sending module 112 may refer to the detailed description of step S200 shown in fig. 2, that is, step S200 may be executed by the request sending module 112.
And a recovery upgrading module 113, configured to receive a secondary upgrading file fed back by the upgrading server based on the recovery upgrading request, and recover system upgrading according to the secondary upgrading file. The description of the recovery upgrade module 113 may refer to the detailed description of step S300 shown in fig. 2, that is, step S300 may be performed by the recovery upgrade module 113.
In summary, the method and apparatus for recovering system upgrade provided in the embodiments of the present invention read the upgrade log generated by the electronic device during the system upgrade process before power failure, determine whether the system upgrade is completed according to the upgrade log, if the system upgrade is not completed, establish a network connection with the upgrade server, send a request for recovering upgrade to the upgrade server, receive the secondary upgrade file fed back by the upgrade server based on the request for recovering upgrade, and recover the system upgrade according to the secondary upgrade file. Compared with the prior art, the system upgrade recovery method and device provided by the embodiment of the invention have the advantages that the system upgrade can be automatically recovered after the electronic equipment is powered off and started up according to the read upgrade log, the problem of manpower or material resource waste caused by returning the network camera to a factory again is avoided, and meanwhile, the defects of storage space resource waste and hardware cost increase can be avoided.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. 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 an electronic 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. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Claims (8)
1. A system upgrade recovery method applied to an electronic device, the method comprising:
reading an upgrade log generated by the electronic equipment in the system upgrade process before power failure, and judging whether system upgrade is finished or not according to the upgrade log; the system upgrading comprises kernel partition upgrading and file system partition upgrading;
if the system is not upgraded completely, establishing network connection with an upgrade server, and sending an upgrade recovery request to the upgrade server;
receiving a secondary upgrade file fed back by the upgrade server based on the upgrade recovery request, and recovering system upgrade according to the secondary upgrade file; the secondary upgrade file comprises a kernel mirror image and a file system mirror image;
the upgrade recovery request is generated by the following steps:
acquiring the system upgrading state of the electronic equipment before power failure according to the upgrading log; the system upgrading state comprises a first upgrading state which represents that the updating of the kernel partition is not finished and the updating of the file system partition is not finished, and a second upgrading state which represents that the updating of the kernel partition is finished and the updating of the file system partition is not finished;
generating a corresponding upgrade recovery request according to the system upgrade state;
the step of generating a corresponding upgrade recovery request according to the system upgrade status includes:
judging the upgrading state of the system;
if the system upgrading state is a first upgrading state, generating a first upgrading request for requesting to download the kernel image and the file system image;
and if the system upgrading state is the second upgrading state, generating a second upgrading request for requesting to download the file system image.
2. The system upgrade recovery method according to claim 1, wherein the step of establishing a network connection with the upgrade server comprises:
acquiring a first network configuration of the electronic equipment and a second network configuration of the upgrade server according to the upgrade log;
and establishing network connection with the upgrade server according to the first network configuration and the second network configuration.
3. The system upgrade recovery method according to claim 1, further comprising:
if the system upgrading is not finished, judging whether the system of the electronic equipment is in an available state or not according to the upgrading log;
if the system of the electronic equipment is in an available state, starting the electronic equipment;
and if the system of the electronic equipment is not in an available state, executing the steps of establishing network connection with an upgrade server and sending an upgrade recovery request to the upgrade server.
4. The system upgrade recovery method according to claim 3, wherein the system upgrade stage of the electronic device includes a first upgrade file receiving stage and a system update stage, and the step of determining whether the system of the electronic device is in an available state according to the upgrade log includes:
judging the system upgrading stage of the electronic equipment before power failure according to the upgrading log;
if the system upgrading stage of the electronic equipment is in a first upgrading file receiving stage before power failure, the system of the electronic equipment is in an available state;
and if the system upgrading stage of the electronic equipment is in the system updating stage before the power failure, the system of the electronic equipment is not in an available state.
5. The system upgrade recovery method according to claim 1, wherein before the step of reading an upgrade log generated during the system upgrade of the electronic device before power failure and determining whether the system upgrade is completed according to the upgrade log, the method further comprises:
responding to system upgrading operation, sending a first upgrading request to the upgrading server, generating an upgrading log, and recording a first network configuration of the electronic equipment and a second network configuration of the upgrading server in the upgrading log;
and receiving a first-time upgrading file fed back by the upgrading server based on the first-time upgrading request, carrying out system upgrading according to the first-time upgrading file, and recording the system upgrading state of the electronic equipment in the upgrading log.
6. A system upgrade recovery device, applied to an electronic device, the device comprising:
the system comprises an upgrading judgment module, a power failure detection module and a power failure detection module, wherein the upgrading judgment module is used for reading an upgrading log generated by the electronic equipment in the system upgrading process before power failure and judging whether system upgrading is finished or not according to the upgrading log; the system upgrading comprises kernel partition upgrading and file system partition upgrading;
the system comprises a request sending module, a recovery upgrading module and a recovery upgrading module, wherein the request sending module is used for establishing network connection with an upgrading server when system upgrading is not finished and sending a recovery upgrading request to the upgrading server;
the recovery upgrading module is used for receiving a secondary upgrading file fed back by the upgrading server based on the recovery upgrading request and recovering system upgrading according to the secondary upgrading file; the secondary upgrade file comprises a kernel mirror image and a file system mirror image;
the recovery upgrading module is further used for acquiring the system upgrading state of the electronic equipment before power failure according to the upgrading log; the system upgrading state comprises a first upgrading state which represents that the updating of the kernel partition is not finished and the updating of the file system partition is not finished, and a second upgrading state which represents that the updating of the kernel partition is finished and the updating of the file system partition is not finished; generating a corresponding upgrade recovery request according to the system upgrade state;
the recovery upgrading module is also used for judging the upgrading state of the system; if the system upgrading state is a first upgrading state, generating a first upgrading request for requesting to download the kernel image and the file system image; and if the system upgrading state is the second upgrading state, generating a second upgrading request for requesting to download the file system image.
7. An electronic device, comprising:
a memory;
a processor; and
a system upgrade recovery apparatus comprising one or more software functional modules stored in said memory and executed by said processor, said apparatus comprising:
the upgrading judgment module is used for reading an upgrading log generated by the electronic equipment in the system upgrading process before power failure and judging whether system upgrading is finished or not according to the upgrading log; the system upgrading comprises kernel partition upgrading and file system partition upgrading;
the system comprises a request sending module, a recovery upgrading module and a recovery upgrading module, wherein the request sending module is used for establishing network connection with an upgrading server when system upgrading is not finished and sending a recovery upgrading request to the upgrading server;
the recovery upgrading module is used for receiving a secondary upgrading file fed back by the upgrading server based on the recovery upgrading request and recovering system upgrading according to the secondary upgrading file; the secondary upgrade file comprises a kernel mirror image and a file system mirror image;
the recovery upgrading module is further used for acquiring the system upgrading state of the electronic equipment before power failure according to the upgrading log; the system upgrading state comprises a first upgrading state which represents that the updating of the kernel partition is not finished and the updating of the file system partition is not finished, and a second upgrading state which represents that the updating of the kernel partition is finished and the updating of the file system partition is not finished; generating a corresponding upgrade recovery request according to the system upgrade state;
the recovery upgrading module is also used for judging the upgrading state of the system; if the system upgrading state is a first upgrading state, generating a first upgrading request for requesting to download the kernel image and the file system image; and if the system upgrading state is the second upgrading state, generating a second upgrading request for requesting to download the file system image.
8. A computer-readable storage medium storing instructions that, when executed, implement the system upgrade recovery method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810043116.1A CN110045971B (en) | 2018-01-16 | 2018-01-16 | System upgrade recovery method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810043116.1A CN110045971B (en) | 2018-01-16 | 2018-01-16 | System upgrade recovery method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110045971A CN110045971A (en) | 2019-07-23 |
CN110045971B true CN110045971B (en) | 2023-03-24 |
Family
ID=67273072
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810043116.1A Active CN110045971B (en) | 2018-01-16 | 2018-01-16 | System upgrade recovery method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110045971B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113672264B (en) * | 2021-05-13 | 2023-08-01 | 星汉智能科技股份有限公司 | System upgrading method and device of embedded universal integrated circuit card and electronic equipment |
CN115562900B (en) * | 2022-12-06 | 2023-03-14 | 苏州浪潮智能科技有限公司 | AMD server system installation power-off processing method, device, equipment and medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103677947A (en) * | 2014-01-03 | 2014-03-26 | 深圳英飞拓科技股份有限公司 | Equipment dual-system protection method and equipment dual-system upgrading method on basis of linux |
US8689048B1 (en) * | 2011-09-22 | 2014-04-01 | Emc Corporation | Non-logging resumable distributed cluster |
WO2015074536A1 (en) * | 2013-11-21 | 2015-05-28 | 乐视致新电子科技(天津)有限公司 | Intelligent television and upgrading method and apparatus thereof |
WO2015176454A1 (en) * | 2014-05-19 | 2015-11-26 | 中兴通讯股份有限公司 | Method and device for upgrading software |
EP3037968A1 (en) * | 2014-12-26 | 2016-06-29 | Kyocera Document Solutions Inc. | Electronic device and firmware recovery program that ensure recovery of firmware |
CN106843957A (en) * | 2017-01-17 | 2017-06-13 | 青岛海信移动通信技术股份有限公司 | System firmware upgrade method and device |
WO2017118334A1 (en) * | 2016-01-08 | 2017-07-13 | 阿里巴巴集团控股有限公司 | Log collection client and updating method therefor |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6836657B2 (en) * | 2002-11-12 | 2004-12-28 | Innopath Software, Inc. | Upgrading of electronic files including automatic recovery from failures and errors occurring during the upgrade |
US20040076043A1 (en) * | 2002-10-21 | 2004-04-22 | Phoenix Technologies Ltd. | Reliable and secure updating and recovery of firmware from a mass storage device |
KR100750132B1 (en) * | 2005-09-27 | 2007-08-21 | 삼성전자주식회사 | Method and system for booting, updating software automatically and recovering update error, and computer readable medium recording the method |
CN103488491B (en) * | 2012-06-11 | 2016-11-23 | 腾讯科技(深圳)有限公司 | Terminal is carried out method and this terminal of system upgrade |
CN103019773B (en) * | 2012-11-23 | 2016-06-22 | Tcl集团股份有限公司 | Update power failure protection, system and mobile terminal |
CN105094933A (en) * | 2015-09-18 | 2015-11-25 | Tcl集团股份有限公司 | Method and device for handling abnormity after Android TV system is upgraded |
CN106610840A (en) * | 2015-10-22 | 2017-05-03 | 深圳市中兴微电子技术有限公司 | FOTA (Firmware Over-The-Air) upgrade method and system |
CN105955846A (en) * | 2016-04-29 | 2016-09-21 | 乐视控股(北京)有限公司 | Method and system for carrying out recovery after upgrade failure of mobile terminal on basis of network |
CN105975300A (en) * | 2016-04-29 | 2016-09-28 | 乐视控股(北京)有限公司 | System upgrading method and device |
CN106020884A (en) * | 2016-05-20 | 2016-10-12 | 江苏华辉云控科技有限公司 | Network camera system online update method |
-
2018
- 2018-01-16 CN CN201810043116.1A patent/CN110045971B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8689048B1 (en) * | 2011-09-22 | 2014-04-01 | Emc Corporation | Non-logging resumable distributed cluster |
WO2015074536A1 (en) * | 2013-11-21 | 2015-05-28 | 乐视致新电子科技(天津)有限公司 | Intelligent television and upgrading method and apparatus thereof |
CN103677947A (en) * | 2014-01-03 | 2014-03-26 | 深圳英飞拓科技股份有限公司 | Equipment dual-system protection method and equipment dual-system upgrading method on basis of linux |
WO2015176454A1 (en) * | 2014-05-19 | 2015-11-26 | 中兴通讯股份有限公司 | Method and device for upgrading software |
EP3037968A1 (en) * | 2014-12-26 | 2016-06-29 | Kyocera Document Solutions Inc. | Electronic device and firmware recovery program that ensure recovery of firmware |
WO2017118334A1 (en) * | 2016-01-08 | 2017-07-13 | 阿里巴巴集团控股有限公司 | Log collection client and updating method therefor |
CN106843957A (en) * | 2017-01-17 | 2017-06-13 | 青岛海信移动通信技术股份有限公司 | System firmware upgrade method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110045971A (en) | 2019-07-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9983791B2 (en) | System management controller and method of configuration file backup and recovery | |
CN112486629B (en) | Micro-service state detection method, micro-service state detection device, electronic equipment and storage medium | |
US8407526B1 (en) | Updating a firmware image using a firmware debugger application | |
US20150261546A1 (en) | Baseboard management controller and method of loading firmware | |
CN106951345B (en) | Consistency test method and device for disk data of virtual machine | |
CN109032838B (en) | Automatic verification method for consistency of backup and recovery data of virtual machine | |
US10802916B2 (en) | System and method to enable rapid recovery of an operating system image of an information handling system after a malicious attack | |
CN110045971B (en) | System upgrade recovery method and device | |
US20050108704A1 (en) | Software distribution application supporting verification of external installation programs | |
WO2018049798A1 (en) | Method and apparatus for reconstructing cache partition | |
US8949588B1 (en) | Mobile telephone as bootstrap device | |
KR102106449B1 (en) | Method, device and server for checking a defective function | |
CN105278993A (en) | Linux system based drive module upgrading method and apparatus | |
CN114116033B (en) | Method and device for modifying server configuration | |
US11334419B1 (en) | Information handling system fault analysis with remote remediation file system | |
KR20160059181A (en) | Apparatus and method for controlling updating software of AVN system in vehicle | |
TW201617861A (en) | Firmware updating method and electronic apparatus using the same | |
CN113961257A (en) | Automatic detection method, system and storage medium for activation of server operating system | |
US10831510B2 (en) | Method to design and test workflows | |
CN114327542B (en) | Service equipment updating method and device, electronic equipment and storage medium | |
CN109375928B (en) | Method and device for integrating and managing third-party driving software based on NSIS script | |
CN114153761B (en) | Detection method and system for external equipment interconnection bus interface equipment | |
US20240319987A1 (en) | State machine operation for non-disruptive update of a data management system | |
WO2016166900A1 (en) | Information processing device, information processing method, and information processing program | |
CN118484239A (en) | FRU data refreshing method and device of intelligent network card |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |