CN110825563A - System recovery method and device and electronic equipment - Google Patents

System recovery method and device and electronic equipment Download PDF

Info

Publication number
CN110825563A
CN110825563A CN201911027707.0A CN201911027707A CN110825563A CN 110825563 A CN110825563 A CN 110825563A CN 201911027707 A CN201911027707 A CN 201911027707A CN 110825563 A CN110825563 A CN 110825563A
Authority
CN
China
Prior art keywords
recovery
upgrade package
partition
version
electronic equipment
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.)
Granted
Application number
CN201911027707.0A
Other languages
Chinese (zh)
Other versions
CN110825563B (en
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.)
Realme Chongqing Mobile Communications Co Ltd
Original Assignee
Realme Chongqing Mobile Communications 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 Realme Chongqing Mobile Communications Co Ltd filed Critical Realme Chongqing Mobile Communications Co Ltd
Priority to CN201911027707.0A priority Critical patent/CN110825563B/en
Publication of CN110825563A publication Critical patent/CN110825563A/en
Application granted granted Critical
Publication of CN110825563B publication Critical patent/CN110825563B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The embodiment of the application discloses a system recovery method and device and electronic equipment. The method comprises the following steps: detecting the running state of the electronic equipment; if the running state meets a preset condition, triggering a recovery mirror image in the backup partition to start running; and loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package. Therefore, a backup partition is added in the system, and the recovery image and the system upgrade package are stored in the backup partition, so that the recovery image file in the backup partition can be directly triggered to run and the system upgrade package of the same partition can be directly loaded to restore the system under the condition that the running state of the electronic equipment meets the preset condition, and the system upgrade package is not loaded from other partitions, thereby improving the stability.

Description

System recovery method and device and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a system recovery method and apparatus, and an electronic device.
Background
With the continuous development of communication technology, electronic devices such as computers and smart phones have become more and more popular. The system built in the electronic device is usually an open source system, and due to the continuous change of the use requirement, the system built in the same electronic device is often required to be continuously upgraded. In the upgrading process of the system, the system upgrading may fail for some reasons, and even the system cannot be started normally.
Disclosure of Invention
In view of the foregoing problems, the present application provides a system recovery method, an apparatus and an electronic device to improve the foregoing problems.
In a first aspect, an embodiment of the present application provides a system recovery method, which is applied to an electronic device, where the electronic device includes a recovery partition and a backup partition, where a recovery image file and a system upgrade package are stored in the backup partition, and the method includes: detecting the running state of the electronic equipment; if the running state meets a preset condition, triggering a recovery mirror image in the backup partition to start running; and loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package.
In a second aspect, an embodiment of the present application provides a system recovery apparatus, where the apparatus includes: the detection unit is used for detecting the running state of the electronic equipment; the triggering and upgrading unit is used for triggering the recovery mirror image in the backup partition to start running if the running state meets a preset condition; and the loading recovery unit is used for loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package.
In a third aspect, an embodiment of the present application provides an electronic device, including one or more processors and a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the methods described above.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, wherein the program code performs the above-mentioned method when running.
According to the system recovery method, the system recovery device and the electronic equipment, the running state of the electronic equipment is detected firstly; if the running state meets a preset condition, triggering a recovery mirror image in the backup partition to start running; and loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package. Therefore, a backup partition is added in the system, and the recovery image and the system upgrade package are simultaneously stored in the backup partition, so that the recovery image file in the backup partition can be directly triggered to run and the system upgrade package of the same partition can be directly loaded to restore the system under the condition that the running state of the electronic equipment meets the preset condition, and the system upgrade package is not loaded from other partitions, thereby improving the stability.
Drawings
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart illustrating a system recovery method according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating a system recovery method according to another embodiment of the present application;
FIG. 3 is a flow chart illustrating a system recovery method according to yet another embodiment of the present application;
fig. 4 shows a block diagram of a system recovery apparatus according to an embodiment of the present application;
fig. 5 shows a block diagram of a trigger upgrade unit according to an embodiment of the present application;
FIG. 6 is a block diagram of an electronic device for executing a system recovery method according to an embodiment of the present application in real time;
fig. 7 illustrates a storage unit for storing or carrying program code for implementing a system recovery method according to an embodiment of the present application in real time.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the continuous development of communication technology, electronic devices such as computers and smart phones have become more and more popular. The system built in the electronic device is usually an open source system, and due to the continuous change of the use requirement, the system built in the same electronic device is often required to be continuously upgraded.
System upgrades come in many forms, for example, Over-the-air technology (OTA) upgrades may be employed. For the electronic device, an Android system, an IOS system, or other operating system may be installed. At present, for an electronic device with an Android operating system, there are two schemes for installing a system upgrade package: recovery OTA mode and ab system mode. In the recovery OTA mode, system update of the electronic device is implemented through the recovery OTA. Specifically, when a device manufacturer has a new version of software to iterate, a new system upgrade package is generated, the new system upgrade package is sent to the electronic device used by the user in an OTA manner, and then the electronic device installs the new system upgrade package in a recovery mode to implement system update.
And in the ab system mode, double systems are used, and double backup is performed on most system read-only partitions such as a system partition, a year partition, a boot partition and the like in the electronic equipment, so that although the stability is improved, compared with the first recovery OTA scheme, the recovery OTA scheme occupies an extra large amount of disk space, and in a normal condition, compared with the recovery OTA scheme, the disk consumption of more than 6GB can be increased.
In the process of researching the system upgrade of the related electronic equipment, the inventor finds that the recovery OTA mode has much smaller disk overhead but insufficient system stability compared with the absystem mode. In the recovery mode, when the OTA upgrade process is powered off or a program is abnormal, which causes the restart system to re-execute the OTA upgrade, at this time, a part of the upgraded partition may not be compatible with the recovery partition of the old version, thereby causing abnormal phenomena such as a dead lock or a failure to boot the terminal device in the restart process.
Therefore, the inventor proposes that in the present application, in addition to all existing partitions, a backup partition is added in an electronic device system, and a recovery image and a system upgrade package are stored in the backup partition, so that when an operating state of the electronic device meets a preset condition, a recovery image file in the backup partition can be directly triggered to operate and a system upgrade package of the same partition can be directly loaded to restore the system, and the system upgrade package is not loaded from other partitions, so that stability is improved, and extra disk space overhead is reduced as little as possible.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a system recovery method provided in the embodiment of the present application includes:
step S110: and detecting the running state of the electronic equipment.
It can be understood that the method is applied to an electronic device, which may be a mobile electronic device such as a smart phone, a tablet computer, a notebook computer, a palm computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a wearable device, a navigation device, etc. installed with an Android system, or a fixed electronic device such as a digital TV, a desktop computer, etc.
As one mode, the electronic device includes a recovery partition and a backup partition, where a recovery image file and a system upgrade package are stored in the backup partition. Illustratively, the backup partition may be named a bak partition. The electronic equipment detects and records the running state of the electronic equipment, and executes the subsequent system recovery operation after detecting that the running state meets a certain condition.
Optionally, the electronic device may detect an operation state of the electronic device in real time during an operation process. The running process may be a process in which the electronic device runs the application program. For example, for some applications, a system file may be called during the running process, and during the calling process, a data error may be caused, so that the electronic device cannot load a display interface (e.g., a desktop). Then in such a case, a subsequent system recovery operation may need to be performed to enable the system to resume normal operation in order to load the display interface.
Furthermore, the running process may also be a process of triggering mirror running in the recovery partition to perform system upgrade. It should be noted that, in the process of triggering the mirror operation in the recovery partition to load the system upgrade package in the cache partition, the electronic device may stay in the recovery mode all the time due to a data error. For example, the electronic device is continuously restarted, but directly enters the recovery mode after each restart. Then in such a case, a subsequent system recovery operation may need to be performed to enable the system to resume normal operation to leave recovery mode.
Based on the foregoing manner, the electronic device may implement a condition that whether the operating state of the electronic device satisfies a preset condition, where the preset condition includes: after the electronic equipment is started, the desktop cannot be loaded within a limited time; the electronic equipment repeatedly triggers upgrading based on a recovery mode within a specified time; alternatively, the electronic device formats the user data more than a defined number of times. The limited time and the designated time and the limited times may be dynamically changed parameters, and may be changed according to the operation state of the electronic device and the number of applications running or user operations.
For example, the defined time may be determined based on a current time period. It should be noted that the electronic device sometimes fails to load the desktop may be due to a delay in processing data by the processor, in which case the electronic device may resume displaying the desktop after waiting a period of time and the processor processes the previously delayed data. However, if the electronic device is directly triggered to perform the subsequent system recovery operation during the period of the delayed processing of the processor, it may cause inconvenience to the user. Then, as one way, the electronic device may configure the defined time as a first duration when detecting that the electronic device is currently in a first time period, and configure the defined time as a second duration when detecting that the electronic device is in a second time period. Wherein the first time period may be a time period in which a user detected based on the user representation uses the electronic device more frequently (e.g., daytime), and the second time period may be a time period in which a user detected based on the user representation uses the electronic device less frequently (e.g., late night). Correspondingly, the first time length is longer than the second time length, so that the waiting time can be longer in the time period when the frequency of using the electronic equipment by the user is higher, and the interference to the use of the user is avoided.
Step S120: and if the running state meets a preset condition, triggering a recovery mirror image in the backup partition to start running.
It can be understood that when the operation state of the electronic device meets the preset condition, the device is triggeredPortions areAnd starting running the recovery image file in the partition. For example, after the electronic device is started for 10min, the desktop cannot be loaded all the time, and in this way, the electronic device acquires that the current operating state of the electronic device meets the preset condition, and then starts to operate the devicePortions areThe recovery image file in the partition is, for example, executed by a boot of the electronic device and the recovery partition. Wherein, the recovery mirror image operated in the backup partition can not read parameters from the cache partition of the primary partition, but directly loads the backupPortions areSystem upgrade package in partition.
Step S130: and loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package.
By one approach, the system upgrade package includes two types: after the running state of the electronic equipment meets the preset conditionPrepare forPortions areThe other is that the running state of the electronic equipment does not meet the preset condition, and when the electronic equipment detects that the system upgrade package of a new version exists, the electronic equipment directly loads the system upgrade package sent by the server in an OTA mode. And selecting different system upgrading packages to update the system versions according to different running states of the electronic equipment.
Optionally, the electronic device initiates a new version detection, and when detecting that the current version of the local software stored in the electronic device is different from the new version, the electronic device may send a version upgrade request to the server, and after receiving the version upgrade request, the server may directly return a system upgrade package to the electronic device, or return a download path to the electronic device, so that the electronic device obtains the system upgrade package that is issued by the server to the network server in advance from the network server side according to the download path.
According to the system recovery method, the running state of the electronic equipment is detected firstly, if the running state meets the preset condition, the recovery image in the backup partition is triggered to start running, and the system upgrade package is loaded after the recovery image is run so that the electronic equipment can recover and run the system corresponding to the system upgrade package. Therefore, a backup partition is added in the system, and the recovery image and the system upgrade package are stored in the backup partition, so that the recovery image file in the backup partition can be directly triggered to run and the system upgrade package of the same partition can be directly loaded to restore the system under the condition that the running state of the electronic equipment meets the preset condition, the system upgrade package is not loaded from other partitions, the stability is improved, and the extra disk space overhead is reduced as little as possible.
Referring to fig. 2, a system recovery method provided in the embodiment of the present application includes:
step S210: and detecting the running state of the electronic equipment.
As one mode, before detecting the operating state of the electronic device, the method further includes: receiving the system upgrading packet sent by the server in an OTA mode; or receiving the address of the system upgrading packet sent by the server in an OTA mode, and downloading the system upgrading packet from the address of the system upgrading packet.
It should be noted that the compiling process of the system upgrade package downloaded according to the server sending address or the system upgrade package directly downloaded through the OTA method is executed on the server side.
After acquiring a recovery image file (recovery. img), the server adds the recovery image file to a compiling process of the system upgrade package, and the system upgrade package containing the recovery image file can be obtained through the compiling process. After the server obtains the system upgrade package, the server can send the system upgrade package to the electronic device through an OTA mode between the server and the electronic device, or the electronic device can download the system upgrade package from the system upgrade package address through the system upgrade package address provided by the server to obtain the system upgrade package; even the local electronic device can be connected to another electronic device through a Bluetooth connection mode, so that the system upgrade package can be obtained through downloading of the other electronic device according to the system version information of the local electronic device.
Step S220: and if the running state meets the preset condition, writing a specified field for triggering recovery mirror running in the backup partition into the misc partition of the electronic equipment, and restarting the electronic equipment.
The misc partition is a partition name specified by the Android system and used for storing starting and upgrading information; the recovery mode is an upgrade recovery mode of the Android system, and particularly refers to a mode capable of modifying data or a system in the Android system. In the recovery mode, the system with the upgrade package can be backed up or upgraded, and factory restoration operation can also be performed.
As one mode, after the electronic device records and determines that the operating state of the electronic device meets the preset condition, a specified field for triggering recovery mirror image operation in the backup partition is written into the misc partition of the electronic device, and meanwhile, the electronic device is restarted each time the electronic device detects an action of writing the specified field into the misc partition.
Step S230: and after the electronic equipment is restarted, triggering a recovery image in the backup partition to start running based on the identified specified field in the misc partition.
As one approach, the electronic device reboot may identify a particular field written in the miscc partition, and when this field is identified, the recovery image in the backup partition may begin to run.
It should be noted that the misc partition has a boot Control information Block (BCB), which is mainly used for storing recovery boot information. The communication interface is a communication interface between the Bootloader and recovery and also a communication interface between the Bootloader and the Main system. BCB information is information written into the BCB in the OTA upgrading process, namely specific fields of the misc partition are written, and the misc partition is used for informing the Bootloader whether to enter a recovery mode after restarting; that is, if the BCB information is not cleared, the electronic device enters a recovery mode when restarting; if the BCB information is cleared, the electronic equipment can be ensured to directly enter a normal boot mode (namely a Main system mode) of an Android system when being restarted, and can not enter a recovery mode, so that abnormal phenomena such as jamming or incapability of booting and the like when the electronic equipment is restarted are avoided.
Step S240: and clearing the target field which triggers recovery mirror operation in the backup partition in the misc partition.
As one way, when the electronic device detects that the system has a new version of the upgrade package, the electronic device downloads the system upgrade package and stores it in the backup partition. After the system loads the system upgrade package of the backup partition, the system automatically clears the field which is written in the misc partition and triggers the recovery mirror image operation in the backup partition.
Step S250: and clearing the data of the user partition.
As another mode, the system also clears the original user data of the user partition after loading the system upgrade package of the bak partition, and then stores the updated user data in the user partition.
Step S260: and loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package.
According to the system recovery method, before the running state of the electronic equipment is detected, a system upgrade package downloaded by a server in an OTA mode is received, then the running state of the electronic equipment is detected, if the running state meets a preset condition, a specified field for triggering recovery mirror image running in a backup partition is written into a miscc partition of the electronic equipment, the electronic equipment is restarted, after the electronic equipment is restarted, the recovery mirror image in the backup partition is triggered to start running based on the identification of the specified field in the miscc partition, the system upgrade package is loaded, and specific fields and user data in the miscc partition used in the process are deleted in the system upgrade process. Therefore, the user data and the used fields in the misc partition are deleted and the system upgrade package is loaded in the system upgrade process, so that upgrade failure caused by insufficient system memory in the upgrade process is avoided, the stability is improved, and extra disk space overhead is reduced as little as possible.
Referring to fig. 3, a system recovery method provided in an embodiment of the present application is applied to an electronic device, where the electronic device includes a recovery partition and a backup partition, and a recovery image file and a system upgrade package are stored in the backup partition, where the system upgrade package is a first version of the system upgrade package, and the method includes:
step S310: and detecting the running state of the electronic equipment.
Step S320: and if the running state meets a preset condition, triggering a recovery mirror image in the backup partition to start running.
Step S330: and loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package.
Step S340: and operating the electronic equipment of the system corresponding to the system upgrade package of the first version, and acquiring the system upgrade package of the second version corresponding to the system upgrade package of the first version from a network.
Optionally, the second version of the system upgrade package integrates more functions than the first version of the system upgrade package, or the second version of the system upgrade package integrates more functions than the first version of the system upgrade package. That is, the second version system upgrade package is an optimized version of the first version system upgrade package.
For example, the system upgrade package of the first version may include driving functions of sensors such as a gravity sensor, a light sensor, a distance sensor, an acceleration sensor, a magnetic field sensor, and a GPS; the system upgrade package of the second version can also comprise the driving functions of sensors such as an air pressure sensor, a proximity sensor, a temperature sensor and a fingerprint sensor besides the sensors such as a gravity sensor, a light sensor, a distance sensor, an acceleration sensor, a magnetic field sensor and a GPS, and further the system upgrade package of the first version can realize more functions compared with the system upgrade package of the first version.
It should be noted that, in order to further achieve the reduction of the storage space occupied by the system upgrade package of the first version. The system upgrade package of the first version may integrate only basic system functions and network functions, and may not include the driving functions of the aforementioned sensors such as the gravity sensor, the light sensor, the distance sensor, the acceleration sensor, the magnetic field sensor, and the GPS. It is understood that the network function is that the electronic device may access the network to download the second version of the system upgrade package after running the system corresponding to the first version of the system upgrade package.
As one mode, the step of obtaining the system upgrade package of the second version corresponding to the system upgrade package of the first version from the network includes: and downloading a second version of system upgrade package corresponding to the first version of system upgrade package in an OTA mode, and storing the second version of system upgrade package in a cache partition of the electronic equipment.
It should be noted that the cache partition is a cache partition of the android system, and stores data and application programs most frequently accessed by the system. And (4) clearing the cache partition, not affecting personal data, but deleting the cache content stored in the partition, wherein the cache content can be automatically generated again in the subsequent mobile phone use process.
Optionally, the electronic device downloads an optimized second version system upgrade package corresponding to the first version system upgrade package in an OTA manner, stores the downloaded second version system upgrade package in the cache partition, and deletes the cache content already stored in the cache partition after the system analyzes, loads and installs the upgrade package, so that the subsequent system can operate better.
Step S350: and performing system upgrade based on the system upgrade package of the second version, so that the electronic equipment runs the system corresponding to the system upgrade package of the second version.
As one way, the step of performing system upgrade based on the second version of the system upgrade package includes: triggering an image file in the recovery partition of the electronic equipment to start running so as to enable the electronic equipment to enter a recovery mode; and the electronic equipment in recovery mode loads the system upgrade package of the second version from the cache partition to carry out system upgrade.
Optionally, when the operating state of the electronic device meets a preset condition, triggering an image file in a recovery partition of the electronic device to start operating, where the starting of the recovery image indicates that the electronic device enters a recovery mode, and in the recovery mode, backing up or upgrading a system already having an upgrade package, or performing factory restoration operation.
For example, the system upgrade package of the second version may be a full upgrade package of the initial version, the electronic device loaded with the upgrade package of the initial version is also the initial version, and at this time, the upgrade package of the optimized version normally pushed by the OTA mode may be loaded, and the electronic device is updated to the latest version. Therefore, the upgrade package prefabricated by the backup partition can be reduced to about 1GB (the size of the upgrade package of the initial version is about 1GB), and the consumption of the disk space is further reduced.
According to the system recovery method, the running state of the electronic equipment is detected firstly, if the running state meets the preset condition, the recovery mirror image in the backup partition is triggered to start running, the first version system upgrade package is loaded after the recovery mirror image runs, and the electronic equipment upgrades the first version system upgrade package to the corresponding optimized second version system upgrade package so that the electronic equipment runs the system corresponding to the second version system upgrade package. Therefore, the upgrade package prefabricated by the backup partition can be reduced to about 1GB, and the consumption of the disk space is further reduced.
Referring to fig. 4, a system recovery apparatus 400 according to an embodiment of the present application includes:
the detecting unit 410 is configured to detect an operating state of the electronic device.
As one mode, the electronic device includes a recovery partition and a backup partition, where a recovery image file and a system upgrade package are stored in the backup partition.
Optionally, the boot partition and the recovery partition of the electronic device detect and record the operating state of the electronic device, and when the operating state is detected to meet a certain condition, the subsequent upgrade operation is executed.
And the triggering and upgrading unit 420 is configured to trigger the recovery mirror image in the backup partition to start running if the running state meets a preset condition.
As one mode, the electronic device records and judges whether the operating state of the electronic device meets a preset condition, where the preset condition includes: after the electronic equipment is started, the desktop cannot be loaded within a limited time; the electronic equipment repeatedly triggers upgrading based on a recovery mode within a specified time; alternatively, the electronic device formats the user data more than a defined number of times. The limited time and the designated time and the limited times are only one configuration and can be changed along with the operation state of the electronic equipment.
It can be understood that when the operation state of the electronic device meets the preset condition, the device is triggeredPortions areAnd starting running the recovery image file in the partition. For example, when the electronic device is started 10miAfter n, the desktop can not be loaded all the time, and at this time, the electronic equipment acquires that the current running state of the electronic equipment meets the preset condition, and then the electronic equipment starts to run standbyPortions areRecovery image files in the partitions. The recovery mirror image does not read parameters from the cache partition of the primary partition, but directly loads a system upgrade package in the backup partition.
As shown in fig. 5, the trigger upgrade unit 420 further includes a write restart module 422, an identification trigger module 424, and a clear data module 426.
A write restart module 422, configured to write, if the operating state meets a preset condition, a specified field for triggering recovery mirror image operation in a backup partition into a miscc partition of the electronic device, and restart the electronic device;
and the identification triggering module 424 is used for triggering the recovery image in the backup partition to start running based on the identified specified field in the misc partition after the electronic device is restarted.
And a clear data module 426, configured to clear the target field in the misc partition that triggers recovery mirror operation in the backup partition and clear data of the user partition.
A loading recovery unit 430, configured to load the system upgrade package after the recovery image is run, so as to enable the electronic device to recover to run the system corresponding to the system upgrade package.
By one approach, the system upgrade package includes two types: the electronic equipment directly loads the system upgrade package sent by the server in an OTA mode when detecting that a new version of the system upgrade package exists. And selecting different system upgrading packages to update the system versions according to different running states of the electronic equipment.
Optionally, the electronic device initiates a new version detection, when it is detected that the current version of the local software stored in the electronic device is different from the new version, the electronic device sends a version upgrade request to the server, and after receiving the version upgrade request, the server may directly return a system upgrade package to the electronic device, or return a download path to the electronic device, so that the electronic device obtains the system upgrade package that is issued by the server to the network server in advance from the network server side according to the download path.
It should be noted that the device embodiment and the method embodiment in the present application correspond to each other, and specific principles in the device embodiment may refer to the contents in the method embodiment, which is not described herein again.
An electronic device provided by the present application will be described with reference to fig. 6.
Referring to fig. 6, based on the system recovery method and apparatus, another electronic device 100 capable of executing the system recovery method is further provided in the embodiment of the present application. The electronic device 100 includes one or more processors 102 (only one shown), a memory 104, and a network module 106 coupled to each other. The memory 104 stores programs that can execute the content of the foregoing embodiments, and the processor 102 can execute the programs stored in the memory 104.
Processor 102 may include one or more processing cores, among other things. The processor 102 interfaces with various components throughout the electronic device 100 using various interfaces and circuitry to perform various functions of the electronic device 100 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 104 and invoking data stored in the memory 104. Alternatively, the processor 102 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 102 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 102, but may be implemented by a communication chip.
The Memory 104 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 104 may be used to store instructions, programs, code sets, or instruction sets. The memory 104 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
The network module 106 is configured to receive and transmit electromagnetic waves, and implement interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, for example, an audio playing device. The network module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The network module 106 may communicate with various networks, such as the internet, an intranet, a wireless network, or with other devices via a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. For example, the network module 106 may interact with a base station.
Referring to fig. 7, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 800 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-volatile computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
According to the system recovery method, the system recovery device and the electronic equipment, the running state of the electronic equipment is detected firstly; if the running state meets a preset condition, triggering a recovery mirror image in the backup partition to start running; and loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package. Therefore, a backup partition is added in the system, and the recovery image and the system upgrade package are stored in the backup partition, so that the recovery image file in the backup partition can be directly triggered to run and the system upgrade package of the same partition can be directly loaded to restore the system under the condition that the running state of the electronic equipment meets the preset condition, the system upgrade package is not loaded from other partitions, the stability is improved, and the extra disk space overhead is reduced as little as possible.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A system recovery method is applied to an electronic device, the electronic device comprises a recovery partition and a backup partition, a recovery image file and a system upgrade package are stored in the backup partition, and the method comprises the following steps:
detecting the running state of the electronic equipment;
if the running state meets a preset condition, triggering a recovery mirror image in the backup partition to start running;
and loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package.
2. The method according to claim 1, wherein the step of triggering a recovery image in the backup partition to start running if the running status meets a preset condition comprises:
if the running state meets a preset condition, writing a specified field for triggering recovery mirror running in a backup partition into a misc partition of the electronic equipment, and restarting the electronic equipment;
and after the electronic equipment is restarted, triggering a recovery image in the backup partition to start running based on the identified specified field in the misc partition.
3. The method of claim 2, wherein triggering a recovery image in the backup partition to start running after the electronic device reboots based on the identifying of the specified field in the miscc partition further comprises:
clearing the target field triggering recovery mirror image operation in the backup partition in the misc partition;
and clearing the data of the user partition.
4. The method according to any one of claims 1 to 3, wherein the preset conditions include:
after the electronic equipment is started, the desktop cannot be loaded within a limited time;
the electronic equipment repeatedly triggers upgrading based on a recovery mode within a specified time; alternatively, the first and second electrodes may be,
the electronic device formats the user data more than a defined number of times.
5. The method according to any of claims 1-3, wherein said detecting an operational state of said electronic device further comprises:
receiving the system upgrading packet sent by the server in an OTA mode; alternatively, the first and second electrodes may be,
and receiving the address of the system upgrading packet sent by the server in an OTA mode, and downloading the system upgrading packet from the address of the system upgrading packet.
6. The method of any of claims 1-3, wherein the system upgrade package is a first version of the system upgrade package; after the step of loading the system upgrade package after running the recovery image, so as to enable the electronic device to resume running the system corresponding to the system upgrade package, the method further includes:
the electronic equipment of the system corresponding to the system upgrading package of the first version is operated, a system upgrading package of a second version corresponding to the system upgrading package of the first version is obtained from a network, and the integrated functions of the system upgrading package of the second version are more than those of the system upgrading package of the first version or the integrated functions of the system upgrading package of the second version are higher than those of the system upgrading package of the first version;
and performing system upgrade based on the system upgrade package of the second version, so that the electronic equipment runs the system corresponding to the system upgrade package of the second version.
7. The method of claim 6, wherein the step of obtaining the second version of the system upgrade package corresponding to the first version of the system upgrade package from the network comprises:
downloading a second version of system upgrade package corresponding to the first version of system upgrade package in an OTA mode, and storing the second version of system upgrade package in a cache partition of the electronic equipment;
the step of upgrading the system based on the system upgrading package of the second version comprises the following steps:
triggering an image file in the recovery partition of the electronic equipment to start running so as to enable the electronic equipment to enter a recovery mode;
and the electronic equipment in recovery mode loads the system upgrade package of the second version from the cache partition to carry out system upgrade.
8. A system recovery apparatus, the apparatus comprising:
the detection unit is used for detecting the running state of the electronic equipment;
the triggering and upgrading unit is used for triggering the recovery mirror image in the backup partition to start running if the running state meets a preset condition;
and the loading recovery unit is used for loading the system upgrade package after the recovery image is operated so as to enable the electronic equipment to recover to operate the system corresponding to the system upgrade package.
9. An electronic device comprising one or more processors and memory; one or more programs stored in the memory and configured to be executed by the one or more processors to perform the method of any of claims 1-7.
10. A computer-readable storage medium, having program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-7.
CN201911027707.0A 2019-10-22 2019-10-22 System recovery method and device and electronic equipment Active CN110825563B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911027707.0A CN110825563B (en) 2019-10-22 2019-10-22 System recovery method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911027707.0A CN110825563B (en) 2019-10-22 2019-10-22 System recovery method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110825563A true CN110825563A (en) 2020-02-21
CN110825563B CN110825563B (en) 2022-12-06

Family

ID=69550625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911027707.0A Active CN110825563B (en) 2019-10-22 2019-10-22 System recovery method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110825563B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111209141A (en) * 2019-12-30 2020-05-29 晶晨半导体(深圳)有限公司 Dual-system switching method and device applied to system iteration
CN112817625A (en) * 2021-01-29 2021-05-18 青岛海信移动通信技术股份有限公司 System upgrading method and device, electronic equipment and storage medium
CN112948182A (en) * 2021-03-30 2021-06-11 广东九联科技股份有限公司 Set top box emergency backup recovery upgrading method and system
CN113419751A (en) * 2021-05-26 2021-09-21 荣耀终端有限公司 System upgrading method and device for terminal equipment
CN113805956A (en) * 2021-06-15 2021-12-17 荣耀终端有限公司 Operating system configuration method, operating system configuration device, operating system storage medium, and program product
CN116048628A (en) * 2022-07-21 2023-05-02 荣耀终端有限公司 Equipment starting method and electronic equipment
CN116204353A (en) * 2022-12-08 2023-06-02 武汉海微科技有限公司 Recovery and restoration method, device and equipment of vehicle-mounted system and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6591376B1 (en) * 2000-03-02 2003-07-08 Hewlett-Packard Development Company, L.P. Method and system for failsafe recovery and upgrade of an embedded operating system
CN103533431A (en) * 2012-08-15 2014-01-22 Tcl集团股份有限公司 Method and system for realizing system upgrade based on intelligent television, and intelligent television
CN104636171A (en) * 2015-03-04 2015-05-20 深圳市欧珀通信软件有限公司 Upgrading method and device and mobile device
CN105094933A (en) * 2015-09-18 2015-11-25 Tcl集团股份有限公司 Method and device for handling abnormity after Android TV system is upgraded
CN107105345A (en) * 2017-02-17 2017-08-29 青岛海信宽带多媒体技术有限公司 A kind of set top box upgrading method and set top box
CN107168818A (en) * 2017-03-30 2017-09-15 努比亚技术有限公司 Terminal and brush machine failure recovery method
CN109032632A (en) * 2018-07-13 2018-12-18 深圳高新兴物联科技有限公司 A kind of FOTA upgrade method, wireless communication terminal and storage medium
CN109753411A (en) * 2019-01-17 2019-05-14 Oppo广东移动通信有限公司 Abnormality eliminating method, device, mobile terminal and storage medium
CN109753299A (en) * 2019-01-16 2019-05-14 Oppo广东移动通信有限公司 A kind of method for upgrading system, device and computer storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6591376B1 (en) * 2000-03-02 2003-07-08 Hewlett-Packard Development Company, L.P. Method and system for failsafe recovery and upgrade of an embedded operating system
CN103533431A (en) * 2012-08-15 2014-01-22 Tcl集团股份有限公司 Method and system for realizing system upgrade based on intelligent television, and intelligent television
CN104636171A (en) * 2015-03-04 2015-05-20 深圳市欧珀通信软件有限公司 Upgrading method and device and mobile device
CN105094933A (en) * 2015-09-18 2015-11-25 Tcl集团股份有限公司 Method and device for handling abnormity after Android TV system is upgraded
CN107105345A (en) * 2017-02-17 2017-08-29 青岛海信宽带多媒体技术有限公司 A kind of set top box upgrading method and set top box
CN107168818A (en) * 2017-03-30 2017-09-15 努比亚技术有限公司 Terminal and brush machine failure recovery method
CN109032632A (en) * 2018-07-13 2018-12-18 深圳高新兴物联科技有限公司 A kind of FOTA upgrade method, wireless communication terminal and storage medium
CN109753299A (en) * 2019-01-16 2019-05-14 Oppo广东移动通信有限公司 A kind of method for upgrading system, device and computer storage medium
CN109753411A (en) * 2019-01-17 2019-05-14 Oppo广东移动通信有限公司 Abnormality eliminating method, device, mobile terminal and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111209141A (en) * 2019-12-30 2020-05-29 晶晨半导体(深圳)有限公司 Dual-system switching method and device applied to system iteration
CN112817625A (en) * 2021-01-29 2021-05-18 青岛海信移动通信技术股份有限公司 System upgrading method and device, electronic equipment and storage medium
CN112817625B (en) * 2021-01-29 2024-03-08 青岛海信移动通信技术有限公司 System upgrading method and device, electronic equipment and storage medium
CN112948182A (en) * 2021-03-30 2021-06-11 广东九联科技股份有限公司 Set top box emergency backup recovery upgrading method and system
CN112948182B (en) * 2021-03-30 2024-01-30 广东九联科技股份有限公司 Method and system for recovering and upgrading emergency backup of set top box
CN113419751A (en) * 2021-05-26 2021-09-21 荣耀终端有限公司 System upgrading method and device for terminal equipment
CN113419751B (en) * 2021-05-26 2022-04-29 荣耀终端有限公司 System upgrading method and device for terminal equipment
CN113805956A (en) * 2021-06-15 2021-12-17 荣耀终端有限公司 Operating system configuration method, operating system configuration device, operating system storage medium, and program product
CN116048628A (en) * 2022-07-21 2023-05-02 荣耀终端有限公司 Equipment starting method and electronic equipment
CN116048628B (en) * 2022-07-21 2023-09-29 荣耀终端有限公司 Equipment starting method and electronic equipment
CN116204353A (en) * 2022-12-08 2023-06-02 武汉海微科技有限公司 Recovery and restoration method, device and equipment of vehicle-mounted system and storage medium
CN116204353B (en) * 2022-12-08 2023-10-20 武汉海微科技有限公司 Recovery and restoration method, device and equipment of vehicle-mounted system and storage medium

Also Published As

Publication number Publication date
CN110825563B (en) 2022-12-06

Similar Documents

Publication Publication Date Title
CN110825563B (en) System recovery method and device and electronic equipment
US8539471B2 (en) Updating firmware of an electronic device
CN110597542B (en) Software automatic OTA (over the air) upgrading method and device and electronic equipment
US11222118B2 (en) Method for updating selinux security policy and terminal
CN102830984A (en) Method for updating firmware, chip and communication terminal
CN103150231A (en) Computer booting method and computer system
KR101555210B1 (en) Apparatus and method for downloadin contents using movinand in portable terminal
CN113474756A (en) Application processing method and device, storage medium and electronic equipment
CN110515671B (en) Initialization method, initialization device, terminal device and readable storage medium
CN110489138B (en) Application updating method, device and storage medium
CN113032183A (en) System management method, device, computer equipment and storage medium
CN116700768B (en) Application processing method and related device
CN112214353A (en) Firmware recovery method and device, computer equipment and storage medium
CN109976790B (en) Application updating method, device, terminal and storage medium
WO2023169035A1 (en) Operating system upgrade method, electronic device, and storage medium
CN113396391A (en) Method and device for starting application program, electronic equipment and storage medium
CN109634782A (en) A kind of detection method of system robustness, device, storage medium and terminal
CN115756561A (en) Software upgrading method and device, computer equipment and storage medium
KR20080023064A (en) Program update method and system for wireless communication terminal
CN105700895A (en) Adaptation method for terminal system, terminal and system server
CN106168917B (en) blue screen processing method and device and electronic equipment
CN104683594A (en) SIM card-oriented method for loading mobile phone operating system
US20120185686A1 (en) Method, Apparatus and Computer Program for Loading Files During a Boot-Up Process
CN116661812B (en) Equipment upgrading method, electronic equipment and system
KR100588199B1 (en) Method for recovering download mode in program download fail state of portable terminal, and portable terminal employing it

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