Recovery method, electronic equipment, storage medium and chip

By recording the recovery progress in electronic devices and responding to appropriate conditions, the problem of easy interruption during cloud recovery is solved, and stable continuous recovery after interruption is achieved to avoid data loss or repeated downloads.

CN120066849APending Publication Date: 2025-05-30HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311586286.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

Cloud recovery process is prone to interruption, resulting in data loss or repeated data downloads.

Method used

By recording the recovery progress in the electronic device, detecting and responding to the stop recovery conditions and the continuation recovery conditions, ensuring that the recovery process can be continued after an interruption.

Benefits of technology

It effectively avoids data loss or repeated downloads after recovery interruption, and improves the stability and efficiency of the recovery process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066849A_ABST
    Figure CN120066849A_ABST
Patent Text Reader

Abstract

The invention provides a recovery method, an electronic device, a storage medium and a chip, and relates to the technical field of recovery, and the method recovers the recovery process of data in the electronic device in the dimension of an application, and recovers the next application after the recovery of one application is completed. The recovery process of each application is divided into a plurality of stages: an application resource file downloading stage, an application data downloading stage, a data processing stage, a data recovery stage and the like; in the process of recovering the data of the application, after execution of each stage is completed, the recovery stage is updated to be completed at the current stage; when the recovery process is interrupted, according to the recorded recovery completed stage, it can be determined that recovery continues from the next stage of the recovery completed stage; according to the method, continuous recovery can be performed after recovery interruption, and the condition of data loss or repeated data downloading during continuous recovery is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of recovery technologies, and in particular, to a recovery method, an electronic device, a storage medium, and a chip. Background Art

[0002] Currently, many device manufacturers provide cloud backup solutions for the data of electronic devices. In the case where an electronic device is lost or damaged, a user can download the data of a certain time node of the electronic device from a cloud server through a new electronic device, and then import the data of that time node into the new electronic device to achieve the recovery of the data of a certain time node of the electronic device; in the case where the electronic device is not lost or not completely damaged, the user can also restore the data in the electronic device to the data corresponding to a certain time node backed up by the cloud server.

[0003] However, due to reasons such as a large amount of data involved in the cloud recovery process, high power consumption, long recovery time, and high request pressure on the cloud server side, the cloud recovery process often interrupts, and after the interruption, the recovery needs to be restarted; even if the previous cloud recovery process can be continued, problems such as data loss or duplicate data download often occur. Summary of the Invention

[0004] This application provides a recovery method, an electronic device, a storage medium, and a chip, which can continue the recovery after the recovery is interrupted and reduce the situation of data loss or duplicate data download during the continued recovery.

[0005] To achieve the above object, the first aspect of this application adopts the following technical solution:

[0006] This application provides a recovery method, including:

[0007] During the process of an electronic device recovering a first application:

[0008] After the first recovery stage of the first application is completed, the electronic device updates the recovery state of the first application to the first recovery stage has been completed;

[0009] The electronic device executes a first process corresponding to the second recovery stage of the first application;

[0010] During the execution of the first process, the electronic device detects that a stop recovery condition is met;

[0011] In response to the stop recovery condition being met, the electronic device interrupts the first process in the recovery process of the first application;

[0012] The electronic device monitors that a condition for continuing the recovery is met;

[0013] In response to meeting the connection recovery condition, the electronic device queries that the recovery status of the first application is that the first recovery stage has been completed;

[0014] The electronic device continues to recover from the next recovery stage of the first recovery stage, and the next recovery stage of the first recovery stage is the second recovery stage.

[0015] During the process of recovering the data of the application, after each stage is completed, the recovery stage is updated to the current stage has been completed; when the recovery process is interrupted, it is possible to determine to continue the recovery from the next stage of the completed recovery stage according to the recorded completed recovery stage; this method can continue the recovery after the interruption and reduce the situation of data loss or data repeated download during the connection recovery.

[0016] As another implementation manner of the first aspect, the second recovery stage is the application data download stage of the first application; the process corresponding to the application data download stage of the first application includes:

[0017] The electronic device traverses the list of cloud files, and obtains the first cloud file that is not marked as downloaded in the list of cloud files, and the list of cloud files stores the cloud files to be recovered by the first application;

[0018] The electronic device sends a first download request to the cloud server, and the first download request carries the first cloud file;

[0019] The electronic device receives the first cloud file sent by the cloud server;

[0020] The electronic device writes a downloaded mark for the first cloud file in the list of cloud files;

[0021] The electronic device traverses the list of cloud files until each cloud file in the list of cloud files has a downloaded mark.

[0022] As another implementation manner of the first aspect, the electronic device continues to recover from the next recovery stage of the first recovery stage, including:

[0023] The electronic device continues to traverse the list of cloud files until each cloud file in the list of cloud files has a downloaded mark;

[0024] After each cloud file in the list of cloud files has a downloaded mark, the electronic device updates the recovery status of the first application to data download has been completed.

[0025] As another implementation of the first aspect, the second recovery stage is the data processing stage of the first application, and the process of the data processing stage of the first application includes:

[0026] The electronic device traverses the list of files to be uploaded to the cloud, and obtains the first file to be uploaded to the cloud that is not marked as processed in the list of files to be uploaded to the cloud. The list of files to be uploaded to the cloud stores the files to be uploaded to the cloud for the first application to be recovered.

[0027] If the first file to be uploaded to the cloud is a data block of a large file, the electronic device merges the data blocks belonging to the same large file into a directory file with the file type of a large file.

[0028] If the first file to be uploaded to the cloud is a tar package, the electronic device unpacks the first file to be uploaded to the cloud to obtain multiple directory files with the file type of small files.

[0029] If the first file to be uploaded to the cloud is a normal file, the electronic device modifies the file name of the first file to be uploaded to the cloud, and the first file to be uploaded to the cloud with the modified file name is a directory file.

[0030] The electronic device writes a processed mark for the first file to be uploaded to the cloud in the list of files to be uploaded to the cloud.

[0031] The electronic device traverses the list of files to be uploaded to the cloud until each file to be uploaded to the cloud in the list of files to be uploaded to the cloud has a processed mark.

[0032] As another implementation of the first aspect, the electronic device continues to recover from the next recovery stage of the first recovery stage, including:

[0033] The electronic device continues to traverse the list of files to be uploaded to the cloud until each file to be uploaded to the cloud in the list of files to be uploaded to the cloud has a processed mark.

[0034] As another implementation of the first aspect, the second recovery stage is the data recovery stage of the first application, and the process of the data recovery stage of the first application includes:

[0035] The electronic device sequentially restores the directory files of the first application to the directories corresponding to the directories.

[0036] As another implementation of the first aspect, before the electronic device restores the first application, the method further includes:

[0037] The electronic device obtains the list of applications to be recovered this time, and the list of applications includes the first application and the second application.

[0038] The electronic device updates the recovery status in the data table of the first application to the initial status, and updates the recovery status in the data table of the second application to the initial status.

[0039] As another implementation of the first aspect, after the electronic device interrupts the first process in the recovery process of the first application, the method further includes:

[0040] In response to meeting the continuous recovery condition, the electronic device queries that the recovery status of the first application is that the first recovery stage has been completed, including:

[0041] In response to meeting the continuous recovery condition, the electronic device traverses the data tables of each application in the application list to obtain the first application whose first recovery stage is not recovery completed;

[0042] The electronic device queries that the recovery status of the first application is that the first recovery stage has been completed.

[0043] As another implementation of the first aspect, after the electronic device updates the recovery status in the data table of the first application to the initial status and updates the recovery status in the data table of the second application to the initial status, the method further includes:

[0044] The electronic device executes the second process corresponding to the application resource file download stage of the first application.

[0045] As another implementation of the first aspect, the number of the application resource files is at least two; the process corresponding to the application resource file download stage of the first application includes:

[0046] The electronic device queries the application resource files without a downloaded mark and obtains that the first resource file has no downloaded mark;

[0047] The electronic device sends a second download request to the cloud server, and the second download request carries the first resource file;

[0048] The electronic device receives the first resource file sent by the cloud server;

[0049] The electronic device records the downloaded mark of the first resource file;

[0050] The electronic device queries the application resource files without a downloaded mark until each application resource file has a downloaded mark.

[0051] As another implementation of the first aspect, the method further includes:

[0052] During the process that the electronic device executes the second process corresponding to the application resource file download phase of the first application, the electronic device detects that the stop and resume condition is satisfied;

[0053] In response to the stop and resume condition being satisfied, the electronic device interrupts the second process during the resume process of the first application;

[0054] The electronic device monitors that the continue and resume condition is satisfied;

[0055] In response to the continue and resume condition being satisfied, the electronic device queries the resume state of the first application as the initial state;

[0056] The electronic device queries for application resource files without a downloaded mark until each application resource file has a downloaded mark;

[0057] The electronic device updates the resume state of the first application to indicate that the application resource file download phase is completed.

[0058] In a second aspect, there is provided an electronic device, including a processor, and the processor is configured to call a computer program stored in a memory to implement the method according to any one of the first aspect of the present application.

[0059] In a third aspect, there is provided a chip, including a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the method according to any one of the first aspect of the present application.

[0060] In a fourth aspect, there is provided a computer-readable storage medium, which stores a computer program, and when the computer instruction runs on an electronic device, the electronic device is enabled to implement the method according to any one of the first aspect of the present application.

[0061] In a fifth aspect, an embodiment of the present application provides a computer program product, and when the computer program product runs on a device, the device is enabled to execute the method according to any one of the first aspect of the present application.

[0062] It can be understood that the beneficial effects of the above second aspect to fifth aspect can refer to the relevant descriptions in the above first aspect, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 It is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application;

[0064] Figure 2 It is a schematic diagram of an interface of an application implementing a cloud resume solution provided by an embodiment of the present application;

[0065] Figure 3It is a technical architecture diagram of a cloud backup and cloud recovery method provided by an embodiment of the present application;

[0066] Figure 4 It is a schematic flowchart of a cloud recovery method provided by an embodiment of the present application;

[0067] Figure 5 It is the relationship among application data, application resource files, data snapshots, application metadata, etc. provided by an embodiment of the present application;

[0068] Figure 6 It is a timing diagram of the recovery preparation stage in a cloud recovery solution provided by an embodiment of the present application;

[0069] Figure 7 For Figure 6 It is an interaction timing diagram between a recovery service and an environment awareness module in the embodiment shown;

[0070] Figure 8 It is a timing diagram of the data download stage in a cloud recovery solution provided by an embodiment of the present application;

[0071] Figure 9 It is a timing diagram of the recovery execution stage in a cloud recovery solution provided by an embodiment of the present application;

[0072] Figure 10 It is a timing diagram of the recovery completion stage in a cloud recovery solution provided by an embodiment of the present application;

[0073] Figure 11 It is a sequential recovery timing diagram after interrupted recovery in the recovery preparation stage of a cloud recovery process provided by an embodiment of the present application;

[0074] Figure 12 It is a flowchart of sequential recovery after interrupted recovery in the recovery preparation stage of another cloud recovery process provided by an embodiment of the present application;

[0075] Figure 13 It is a flowchart of sequential recovery after interrupted recovery in the data download stage of a cloud recovery process provided by an embodiment of the present application;

[0076] Figure 14 It is a flowchart of sequential recovery after interrupted recovery in the recovery execution stage of a cloud recovery process provided by an embodiment of the present application;

[0077] Figure 15 It is a flowchart of sequential recovery after interrupted recovery in the recovery completion stage of a cloud recovery process provided by an embodiment of the present application. Detailed implementation manners

[0078] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details.

[0079] It should be understood that when used in the specification and appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0080] It should also be understood that in the embodiments of the present application, "one or more" means one, two, or more than two; "and / or" describes the association relationship of associated objects and indicates that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0081] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", "fourth", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0082] The reference to "one embodiment" or "some embodiments" in the specification of the present application means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0083] A cloud recovery method provided by an embodiment of the present application can be applied to an electronic device to restore the data backed up in a cloud server to the electronic device. The electronic device can be an electronic device such as a tablet computer, a mobile phone, a wearable device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The specific type of the electronic device is not limited in the embodiments of the present application.

[0084] Figure 1 The structural schematic diagram of an electronic device is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0085] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown, or combine certain components, or split certain components, or have different component arrangements. The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0086] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors. For example, the processor 110 is used to execute the cloud recovery method in the embodiments of the present application.

[0087] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may hold the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0088] The internal memory 121 may be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area.

[0089] In addition, the internal memory 121 may include a high-speed random access memory, and may also include non-volatile memories, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc. The application data, application resource index files, etc. in the embodiments of the present application may all be stored in the internal memory.

[0090] The audio module 170 is used to convert digital audio signals into analog audio signals for output, and is also used to convert analog audio inputs into digital audio signals. The audio module 170 may also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be provided in the processor 110, or some functional modules of the audio module 170 may be provided in the processor 110.

[0091] The speaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or hands-free calls through the speaker 170A.

[0092] The touch sensor 180K, also known as a "touch panel". The touch sensor 180K may be provided on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch control screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual outputs related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K may also be provided on the surface of the electronic device 100, at a different position from the display screen 194. For example, operations in the cloud backup interface provided in the embodiments of the present application.

[0093] The electronic device 100 realizes the display function through the GPU, the display screen 194, the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0094] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1. For example, in the embodiments of the present application Figure 2 The interface shown is displayed by the display.

[0095] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0096] The embodiments of the present application do not particularly limit the specific structure of the execution subject of a cloud recovery method. As long as it can run the code recording a cloud recovery method of the embodiments of the present application to communicate according to a cloud recovery method provided by the embodiments of the present application. For example, the execution subject of a cloud recovery method provided by the embodiments of the present application may be a functional module in the electronic device that can call and execute the program, or a communication device applied to the electronic device, such as a chip.

[0097] During the process of the user using the electronic device, the electronic device may be replaced for various reasons. As an example, due to the damage of the old electronic device or the need for upgrading, a new electronic device needs to be replaced. When replacing the new electronic device, cloning technology can be used to clone the data in the old electronic device to the new electronic device.

[0098] However, there are still some cases where users cannot use cloning technology to clone the data in the old electronic device to the new electronic device. For example, when the user's old electronic device is lost or completely damaged and cannot be powered on, the user can no longer operate the old electronic device, so the data in the old electronic device cannot be cloned to the new electronic device.

[0099] The embodiments of the present application provide a cloud backup solution and a cloud recovery solution, which can back up the data of an electronic device at a certain time node to a cloud server. Even if the electronic device is lost or damaged, the user can download the data of the electronic device at a certain time node from the cloud server through the new electronic device, so as to import the data at that time node into the new electronic device, thereby restoring the data of the old electronic device at a certain time node in the new electronic device. When the electronic device is not lost or not completely damaged, the user can also restore the data in the electronic device to the data corresponding to a certain time node backed up by the cloud server.

[0100] Of course, in actual applications, the user can back up the data of multiple time nodes of the electronic device to the cloud server. Subsequently, the user can restore the data in the electronic device to the data corresponding to any time node among the multiple time nodes backed up by the cloud server. The user can also download the data corresponding to any time node among the multiple time nodes from the cloud server through the new electronic device, so as to import the data corresponding to the downloaded time node into the new electronic device.

[0101] Refer to Figure 2 , which is a schematic diagram of the interface of a cloud backup application implementing the cloud recovery solution provided by the embodiments of the present application.

[0102] Refer to Figure 2 In (a) of, it is a schematic diagram of the backup interface. In specific implementation, the user can open the backup interface through the account center in the electronic device, and can also open the backup interface through the application icon of the cloud backup application displayed on the desktop of the electronic device system. The user can also open the backup interface in other ways.

[0103] It should be noted that this interface schematic diagram is only used to illustrate the following content: the frequency of automatic backup of the electronic device can be set, the applications to be backed up can be selected, and the user can also manually trigger the electronic device to perform cloud backup. In actual applications, an interface different from Figure 2 can be set, or the above content can be displayed through multiple interfaces. When the user clicks on a backup record shown in (a) of Figure 2 , the electronic device responds to this operation and displays the recovery interface described in (b) of Figure 2 .

[0104] Refer to Figure 2In (b) of [description], a recovery interface for a backup record is shown, where the user can select the application to be recovered on this interface.

[0105] Generally, the data in an electronic device is divided into three categories: system data (such as system settings and desktop layout, etc.), system applications (such as gallery, contacts, notes, etc.), and third-party applications (such as third-party instant messaging applications, etc.). In the embodiments of this application, the desktop layout is separated from the system data as an independent item of application data for the user to select whether to back up or recover the desktop layout.

[0106] In the recovery interface, a recovery control is also set. The user can click the recovery control to trigger the electronic device to restore the selected application data to the electronic device.

[0107] There are more applications that can be selected during cloud backup.

[0108] And for a single application (such as an instant messaging application), a large number of files are generated, and the storage of these file data in the electronic device is also relatively scattered. As an example, there are some files in the data directory of the instant messaging application (such as / data / data / xxx.xxx.xxx / file / b3d74ae13647da4b7f8b259c376834 / attachment / .ref / d / eda84554-7892-4124-8f1d-7f69d38fcebd), and there are some files in the sandbox directory (such as / android / data / xxx.xxx.xxx / file / e2b13889818aa6a711935f5481405139 / music / piecebc16b1ac66e102953d7397dccd0002e2); even there are some files on the external memory card (such as sdcard / picture / xxx.xxx.xxx / mmexport1699003060871.mp4).

[0109] For general users, the data to be backed up each time may be as high as dozens of G, and the number of files is in the tens of thousands. Therefore, like the backup process, the recovery process has a large amount of data, high power consumption, and long upload time, resulting in this process being easily interrupted or aborted. In addition, the cloud server may need to serve a large number of electronic devices for backup and recovery, with a large request pressure and a low success rate.

[0110] In view of this, the embodiments of this application provide a cloud recovery method, which performs data recovery from the dimension of the application and can continue the subsequent data recovery from the interrupted position in the case of recovery interruption.

[0111] Refer toFigure 3 is a technical architecture diagram of the backup method and recovery method provided by the embodiments of this application. This technical architecture diagram involves a cloud server and an electronic device.

[0112] The cloud server includes a backup server and a file storage server.

[0113] The backup server is used to store the backup records and backup application metadata of each device under each account. Among them, the backup records record the backup ID, backup time, backup size, etc. of different devices during cloud backup. For example, it can record the backup ID, backup time, and backup size of the latest backup of different devices, or it can record the backup ID, backup time, and backup size of each backup when different devices are backed up multiple times. The backup application metadata records the relevant information of the backed-up application (the specific content can refer to the description of subsequent embodiments).

[0114] The file storage server is used to store the actual files of each backed-up application, such as various files such as the database, installation package, audio, video, documents, and pictures of the application.

[0115] In actual applications, the backup server is used to communicate with the electronic device to execute the backup process, and the backup server can store the actual files uploaded by the electronic device in the file storage server. In the subsequent embodiments of this application, the backup process is uniformly described by the cloud server.

[0116] The electronic device includes a backup application and some data, which can include system data, system applications, and third-party applications. Among them, the system data includes system setting information, desktop layout information, etc. The system applications include the gallery, contacts, etc. The third-party applications include instant messaging applications, video applications, etc.

[0117] The backup application includes a backup service and a recovery service, as well as some modules that support the backup service and the recovery service (for example, a data replication and recovery module, a file upload and download module, and an environment perception module);

[0118] Among them, the backup service is used to upload the data in the electronic device to the cloud server, and the recovery service is used to download the data from the cloud server and restore these data to the electronic device.

[0119] The data replication and recovery module includes a data replication module and a data recovery module; the file upload and download module includes a file upload module and a file download module; the environment perception module is used to monitor the network status of the electronic device (for example, whether it is connected to a wireless local area network), storage status (for example, whether the local storage space is sufficient to cache the data to be backed up, and whether the cloud server has enough space to back up the data), screen status (for example, whether it is in a locked screen state), and charging status (for example, whether the battery is sufficient and whether an external power source is connected), etc.

[0120] The backup service includes a data caching module, a data processing module, and a data uploading module. The data caching module is used to call the data replication module to cache the data to be backed up; the data processing module is used to process the cached data to be backed up, for example, assembling small files or fragmenting large files, generating data snapshots based on the data to be backed up, etc.; the data uploading module is used to call the file uploading module to upload the processed data to the cloud server.

[0121] The recovery service includes a data downloading module, a data processing module, and a recovery execution module. The data downloading module is used to call the file downloading module to download data from the cloud server; the data processing module is used to decompress, assemble, delete, etc. the downloaded data; the recovery execution module is used to restore the processed data to the original directory.

[0122] Of course, the above cloud backup process can back up system data, system applications, and third-party applications. Among them, when backing up third-party applications, it needs to be implemented through PMS (package manager service) or BMS (backup manager service) in the Framework layer. PMS or BMS can provide the ability to read the data directory generated by the operation of third-party applications.

[0123] In addition, when specifically implementing, the file scanning rules of the application can be set. In the file scanning rules, some data of the backup application is set. For example, the chat records of the instant messaging application are backed up, and the log files generated during the operation of the instant messaging application are not backed up.

[0124] Refer to Figure 4 , which is a schematic flowchart of the recovery method provided by the embodiment of the present application.

[0125] The recovery method includes three major stages: a recovery preparation stage, a recovery execution stage, and a recovery completion stage.

[0126] In the recovery preparation stage: environmental detection is performed through the environmental perception module. For example, the status of the electronic device is detected to detect whether the electronic device meets the recovery conditions; the remaining storage space of the electronic device can also be detected to determine whether the remaining storage space of the electronic device is sufficient to store the backup data; when the device status detection meets the backup conditions and the storage space is sufficient, a recovery record is created, and the meta data at the time of backup is persisted.

[0127] In the resume execution phase: First, it is necessary to download data from the server, and then restore the downloaded data to the corresponding directory. In practical applications, if the data to be restored this time includes multiple applications (for example, Application A, Application B, and Application C), it is necessary to first download data for one application and restore the downloaded data of this application to the corresponding directory; after the data of the previous application is restored to the corresponding directory, download data for the next application and restore the downloaded data of the next application to the corresponding directory; and so on in a loop until the data of multiple applications is downloaded from the cloud server and restored to the corresponding directory.

[0128] The embodiment of this application describes the data download process and data restoration process taking one of the applications, Application A, as an example. Before describing the resume execution process of Application A, the backup execution process of Application A is briefly described first.

[0129] When backing up Application A, the electronic device reads the directory of the application selected by the user through PMS or BMS, and caches the application data (such as chat records, pictures, videos, audio, documents, etc.) read from the directory of the application in a temporary storage space; then processes the cached application data to generate a data snapshot. After generating the data snapshot of Application A, upload the application data and application resource files of Application A (such as the data snapshot of Application A, installation package, and icon, etc.). After uploading the application data and application resource files of Application A is completed, upload the metadata (meta) of Application A. The metadata of this Application A includes: information related to the data snapshot of Application A, information related to the application installation package, information related to the application icon, etc.

[0130] Correspondingly, when restoring Application A, the electronic device first downloads the application resource files of Application A from the cloud server according to the meta data stored locally. The application resource files include the data snapshot of Application A, installation package, and icon, etc. After downloading the application resource files of Application A, download the application data of Application A according to the data snapshot of Application A. After downloading the application of Application A, process the application data, for example, *******; restore the processed data to the directory recorded in the data snapshot.

[0131] In the resume completion phase: Delete the local resume records and cache files, and the overall backup is completed.

[0132] To facilitate the understanding of the professional terms in the above backup execution phase, refer to Figure 5 , which describes the relationships among application data, application resource files, data snapshots, application metadata, etc.

[0133] Application data is the file to be backed up obtained by scanning the application directory during backup. For example, files such as chat records, pictures, videos, audio, and documents of an instant messaging application.

[0134] The data snapshot is generated from these application data during the backup phase and records some information about these application data.

[0135] The application resource files include: data snapshot, application installation package, application icon, and application backup instructions.

[0136] The application backup instructions include information such as the version of the application installation package and the version of the system at the time of backup.

[0137] The application metadata records: relevant information of the data snapshot, relevant information of the application installation package, relevant information of the application icon, relevant information of the application backup instructions, etc. The above information is uploaded to the cloud server during the backup phase.

[0138] As an example of the data snapshot of Application A. The data snapshot of Application A is constructed by two tables, one of which is the local file list (refer to Table 1), and the other is the cloud-bound file list (refer to Table 2).

[0139] Table 1 is the local file list app_data_detail provided by the embodiment of the present application

[0140]

[0141] It can be understood that the local file list is used to record information about the files in the application data (such as application ID, file size, hash value, modification time, whether there are changes, file type, etc.), and some information about these files in the electronic device (such as the local file path of the file, the unique identifier of the file in the local area, etc.).

[0142] Table 2 is the cloud-bound file list upload_app_data_detail provided by the embodiment of the present application

[0143]

[0144]

[0145] It can be understood that the cloud-bound file list is used to record information about the files in the application data (such as application ID, file size, hash value, etc.), and some information about these files in the cloud server (such as the download path on the cloud side, the unique identifier on the cloud side).

[0146] As an example of an application metadata.

[0147]

[0148] It can be understood that the application metadata includes relevant information about the snapshot (data snapshot), apk (application installation package), info.xml (application backup description), and icon (application icon).

[0149] After describing the above professional terms, the recovery solution provided by the embodiments of the present application will be described in detail below.

[0150] As Figure 4 shown, the recovery solution includes: a recovery preparation stage, an application resource file download stage, an application data download stage, a data processing stage, a data recovery stage, and a recovery completion stage.

[0151] Below, through Figures 6 to 10 describe the above cloud recovery solution, where Figure 6 is a timing diagram of the recovery preparation stage in the cloud recovery solution. Figure 7 For Figure 6 shown in the specific implementation manner of the environmental status detection in the recovery preparation stage. Figure 8 is a timing diagram of the data download stage in the cloud recovery solution, Figure 9 is a timing diagram of the recovery execution stage in the cloud recovery solution, Figure 10 is a timing diagram of the recovery completion stage in the cloud recovery solution.

[0152] First, describe Figure 6 shown in the timing diagram of the recovery preparation stage.

[0153] S101, the recovery service receives a click operation on the recovery control.

[0154] S102, the recovery service sends an environmental status acquisition request to the environmental perception module.

[0155] In the embodiments of the present application, recovery conditions are set, and the recovery conditions include various states of the electronic device, for example, network status (connected to a wireless local area network), battery status (the battery of the electronic device is greater than 10%), storage space status (for example, the remaining storage space of the electronic device is greater than 5GB), etc.

[0156] It should be noted that the numbers such as 10% and 5GB are only for illustration and do not impose any limitation on the present application.

[0157] S103, after receiving the environmental status acquisition request, the environmental perception module detects the environmental status.

[0158] The environmental status is related to the pre-set backup conditions, for example, the battery status of the electronic device, the local remaining storage space, and the network status, etc.

[0159] S104, the environmental perception module sends the detected environmental status to the recovery service.

[0160] In S105, after the recovery service receives the environmental status sent by the environmental perception module, it determines that the environmental status meets the recovery conditions.

[0161] In practical applications, the recovery service can send a request for obtaining the environmental status to the environmental perception module once to instruct the environmental perception module to detect the environmental status. In practical applications, the recovery service can also send multiple different environmental status detection instructions to the environmental perception module. Different environmental status detection instructions correspond to different detection contents. For example, the power status detection instruction is used to detect the power status; the network status detection instruction is used to detect the network status.

[0162] In S106, when the environmental status meets the backup conditions, the recovery service sends a recovery lock application request to the cloud server.

[0163] This recovery lock application request is used to lock the current recovery process. Therefore, when applying for the recovery lock, the unique identifier of this device needs to be carried. For example, the MAC address of the device can be used as the unique identifier.

[0164] In S107, the cloud server sends an application result to the recovery service: the application is successful.

[0165] In S108, when the recovery service determines that the environmental status meets the backup conditions, it can also send an environmental monitoring request to the environmental perception module.

[0166] Only when the current status meets the condition of automatic backup, an environmental status monitoring instruction is sent to the environmental perception module to instruct the environmental perception module to continue monitoring the environmental status; similarly, the recovery service can send one monitoring request to the environmental perception module, or can also send multiple environmental status monitoring requests to the environmental perception module. Different environmental monitoring requests correspond to different monitoring contents.

[0167] In S109, after the environmental perception module receives the environmental status monitoring request, it starts to monitor the environmental status.

[0168] In the embodiment of the present application, the environmental perception module detects the environmental status to obtain the current environmental status; the environmental perception module monitors the environmental status to detect the environmental status in real time according to a certain time period.

[0169] In the above embodiment, there is no strict sequence between the backup service executing step S106 and executing step S108. The backup service can also execute step S108 first and then execute step S106.

[0170] In S110, after the recovery service receives the information that the recovery lock application is successful, it randomly generates a locally unique recovery ID.

[0171] S111, The recovery service associates the recorded application list with the applied recovery ID.

[0172] S112, The recovery service updates the recovery stage in each recovery data table to the initial state.

[0173] The recovery solution provided by the embodiments of the present application performs backups from the application dimension. The recovery service sequentially backs up the applications in the recovery list, that is, only after one application recovery is completed will the next application be recovered. The embodiments of the present application set a recovery data table for each application, and the recovery data table records the recovery stage of the application. Therefore, in the case of a recovery interruption, the recovery service can view the recovery data tables of each application in the recovery list to determine which applications have been recovered (for example, the recovery stage is recovery completed), and which applications have not been recovered (for example, the recovery stage is the initial state).

[0174] In addition, in actual applications, there may be a recovery interruption during the recovery of a certain application. In order to be able to continue the interrupted application recovery process, corresponding status identifiers are set for multiple recovery stages. For example, the initial state is: 0; the application resource file download stage is completed: 10; the application data download stage is completed: 20; the data processing stage is completed: 30; the data recovery stage is: 40; the recovery is completed: 200. After each recovery stage is completed, the status identifier is updated in the recovery data table of the application. In the case of a recovery interruption, it is possible to determine which stages of the current application recovery process have been completed based on the status identifier recorded in the recovery data table of the application, and continue the subsequent recovery process from which stage. Among them, the recovery data table of the application can be referred to as shown in Table 3.

[0175] Table 3 Recovery data table of the application cbk_recovery_app_info

[0176]

[0177] After step S112, the status identifier corresponding to the initial state is recorded in the stage of the recovery data table of each application. Subsequently, the recovery service can sequentially restore the data related to each application to this electronic device according to the recorded application list.

[0178] In Figure 6 In the example shown, during the recovery preparation stage, the recovery service needs to determine whether the current recovery conditions are met through the environment perception module. Similarly, during the recovery process, the recovery service also needs to monitor the environmental status through the environment perception module to interrupt the recovery when the environmental status is not suitable for continued recovery.

[0179] The embodiments of the present application set the recovery conditions that the environmental state needs to meet during recovery: the battery power is greater than 10%, connected to a wireless local area network, and the remaining local storage space is greater than the threshold. Of course, the above examples are only for illustration.

[0180] The following will Figure 7 describe in detail the interaction between the recovery service and the environmental perception module during the recovery process of the above embodiments.

[0181] S301, the recovery service sends a battery status acquisition request to the environmental perception module.

[0182] S302, after receiving the battery status acquisition request, the environmental perception module detects that the battery status is greater than 10%.

[0183] S303, the environmental perception module sends the detected battery status to the recovery service: greater than 10%.

[0184] S304, when the recovery service determines that the received battery status meets the power status condition, it sends a network status acquisition request to the environmental perception module.

[0185] S305, after receiving the network status acquisition request, the environmental perception module detects that the network status is connected to a wireless local area network.

[0186] S306, the environmental perception module sends the detected network status to the recovery service: connected to a wireless local area network.

[0187] S307, when the recovery service determines that the received network status meets the network status condition, it sends a remaining storage space acquisition request to the environmental perception module.

[0188] S308, after receiving the remaining storage space acquisition request, the environmental perception module detects the remaining local storage space.

[0189] S309, the environmental perception module sends the remaining local storage space to the recovery service.

[0190] In practical applications, the sending order of each environmental status acquisition request is not sequential. When any environmental status meets the corresponding condition, the next environmental status acquisition request is sent until each environmental status meets the corresponding condition. Of course, if any environmental status does not meet the corresponding condition, it means that the current environment does not meet the recovery condition, and the subsequent process needs to be stopped, and naturally, data recovery will not be performed.

[0191] Steps S301 to S309 correspond to Figure 6Steps S102 to S104 in the illustrated embodiment. In practical applications, the environmental states related to recovery can be obtained through a single environmental state acquisition request, or can be obtained through multiple environmental state acquisition requests.

[0192] As described above, when the current environmental state meets the recovery conditions, the environmental perception module also needs to continue monitoring the environmental state during the recovery process, so as to stop the recovery in case the state change causes it not to meet the conditions for continuing the recovery.

[0193] S310, when the recovery service determines that all environmental states meet their respective corresponding conditions, it sends a listening registration request for the network state to the environmental perception module.

[0194] S311, after receiving the listening registration request for monitoring the network state, the environmental perception module starts monitoring the network state.

[0195] S312, the environmental perception module sends a message indicating successful listening registration of the network state to the recovery service.

[0196] S313, after receiving the message indicating successful listening registration of the network state, the recovery service sends a listening registration request for the power state to the environmental perception module.

[0197] S314, after receiving the listening registration request for the power state, the environmental perception module starts monitoring the power state.

[0198] S315, the environmental perception module sends a message indicating successful listening registration of the power state to the recovery service.

[0199] In practical applications, the sending order of the listening registration requests for each environmental state is also not in a specific sequence. The listening registration request for the next environmental state is sent when the listening registration for any environmental state is successful, until the messages indicating successful listening registration for each environmental state are received.

[0200] Steps S310 to S315 correspond to Figure 6 Steps S108 to S109 in the illustrated embodiment. In practical applications, the environmental perception module can be instructed to monitor the environmental state through a single environmental state monitoring request, or can be instructed to monitor the environmental state through multiple environmental state listening registration requests.

[0201] In practical applications, after the recovery starts, if the environmental state changes to a situation not suitable for recovery, the recovery service may interrupt the recovery.

[0202] S316, the recovery service executes the recovery process. For example, applying for a recovery lock and S110 and subsequent processes.

[0203] S317. During the recovery process, the environment perception module monitors any state change.

[0204] S318. The environment perception module sends the status change to the recovery service.

[0205] S319. The recovery service determines that the current conditions do not meet the requirements for continuing the recovery based on the received status change.

[0206] During the recovery process, it is possible that the Wi-Fi network is disconnected or the battery is continuously consumed.

[0207] Generally, when the Wi-Fi network is disconnected, the current recovery process is interrupted; when the battery level is less than 10%, a warning can be issued; when the battery level is less than 5%, the recovery process is interrupted.

[0208] S320. The recovery service stops the recovery.

[0209] Of course, if the environmental state changes to meet the recovery conditions again within a short time after the recovery is interrupted, the current interrupted recovery can be continued.

[0210] S321. The environment perception module monitors any state change.

[0211] S322. The environment perception module sends the status change to the recovery service.

[0212] S323. The recovery service determines that the current conditions meet the requirements for continuing the recovery based on the received status change.

[0213] S324. The recovery service continues the recovery.

[0214] As Figure 6 shown, after the recovery preparation stage ends, the recovery stage in the data table of each application is in the initial state. Subsequently, the recovery service will restore the data of each application to this electronic device in sequence according to the application list of this recovery. The application resource file download stage during the process of recovering one of the applications (for example, Application A) is described below.

[0215] Refer to Figure 8 , which is the timing diagram of the application resource file download stage during the process of recovering Application A provided by the embodiment of this application.

[0216] S401. The recovery service reads the metadata of Application A to obtain the un-downloaded application resource files.

[0217] As described above, the metadata of Application A includes the relevant information of each application resource file, and this relevant information includes the cloud-side path and the cloud-side unique identifier.

[0218] In the embodiment of the present application, the application resource file of Application A includes a data snapshot, an installation package, an icon, and an application backup description.

[0219] In specific implementation, it is also necessary to download one application resource file and then download the next one.

[0220] S402, The recovery service sends a file download instruction to the file upload / download module. The file download instruction carries the cloud-side address and the cloud-side unique identifier of an undownloaded application resource file.

[0221] S403, After receiving the file download instruction, the file upload / download module sends the file download instruction to the cloud server.

[0222] S404, The cloud server sends the application resource file to the file upload / download module.

[0223] S405, After receiving the application resource file, the file upload / download module sends the application resource file to the recovery service.

[0224] The process from step S401 to step S405 is looped until each application resource file is downloaded to the local.

[0225] S406, After determining that each application resource file has been received, the recovery service updates the recovery stage in the recovery data table of Application A to "application resource file download completed".

[0226] In the embodiment of the present application, since the number of application resource files is small, the recovery service can determine which application resource files have been downloaded and which have not been downloaded according to the received application resource files.

[0227] S501, After the recovery service updates the recovery stage in the recovery data table of Data A to "application resource file download completed", it reads the data snapshot to obtain the download addresses of the non-downloaded cloud files in the cloud file list.

[0228] As mentioned above, the application resource file includes a data snapshot. Therefore, after downloading the application resource file, the data snapshot can be obtained. As mentioned above, the data snapshot includes a cloud file list, and the cloud-side addresses of each cloud file are recorded in the cloud file list.

[0229] S502, The recovery service sends a file download instruction to the file upload / download module. The file download instruction carries the cloud-side address of the cloud file.

[0230] S503, After receiving the file download instruction, the file upload / download module sends the file download instruction to the cloud server.

[0231] S504, after the cloud server receives the file download instruction, it sends the cloud file to the file upload / download module according to the address.

[0232] S505, after the file upload / download module receives the cloud file, it sends the cloud file to the recovery service.

[0233] S506, after the recovery service receives the cloud file, it caches the cloud file in the temporary recovery directory.

[0234] S507, the recovery service marks the downloaded cloud files in the cloud file list as downloaded.

[0235] The processes of steps S501 to S507 are looped until each cloud file in the cloud file list is cached in the temporary recovery directory.

[0236] S508, after the recovery service determines that the cloud files in the cloud file list are all cached in the temporary recovery directory, it updates the recovery phase in the recovery data table of application A to application data download completed.

[0237] Refer to Figure 9 , which is the timing diagram of the recovery execution phase in the process of recovering application A provided by the embodiment of the present application.

[0238] S601, the recovery service determines the processing method of the cloud files in the temporary recovery directory that are not marked as processed according to the local file list and the cloud file list in the data snapshot.

[0239] In the embodiment of the present application, in the backup phase, some files are large and can be split into multiple small data blocks; some files are small and can be packed into large files (tar packages).

[0240] Of course, large and small are only relative concepts. As an example, files with a size less than 2M are recorded as small files, files with a size greater than 500M are recorded as large files, and other files are recorded as ordinary files.

[0241] Correspondingly, in the recovery phase, it is necessary to merge these small data into large files; unpack the tar package into small files; of course, it is also necessary to update the names of ordinary files to local file names.

[0242] S602, the recovery service processes the cloud files according to the processing methods of each cloud file: modify the local file name for ordinary files; unpack the tar package into small files; merge data blocks into large files.

[0243] This processing process can process the cloud files into local files.

[0244] S603, the recovery service marks the processed cloud files as processed.

[0245] S604, after processing each file uploaded to the cloud is completed, the recovery service updates the recovery phase in the recovery data table of Application A to data processing completed.

[0246] After data processing is completed, local files (original large files, small files, and ordinary files) need to be restored to the corresponding directories.

[0247] Before actual recovery, the process of Application A needs to be killed first.

[0248] S701, the recovery service sends a data area recovery instruction to the file copy recovery module according to the directories of each local file recorded in the local file list. This data area recovery instruction carries the file or cache address of the data area.

[0249] S702, after receiving the data area recovery instruction, the file copy recovery module writes the data area file to the data directory of the first application.

[0250] In the embodiments of this application, the data recovery module can call PMS or BMS to write files to the corresponding directories.

[0251] S703, after the file copy recovery module finishes the recovery, it generates information indicating that the data area recovery is completed.

[0252] S704, the file copy recovery module sends the information indicating that the data area recovery is completed to the recovery service.

[0253] S705, the recovery service sends a sandbox directory recovery instruction to the file copy recovery module according to the directories of each local file recorded in the local file list. This sandbox directory recovery instruction carries the file or cache address of the sandbox directory.

[0254] S706, after receiving the sandbox directory recovery instruction, the file copy recovery module writes the sandbox directory file to the sandbox directory of the first application.

[0255] S707, after the file copy recovery module finishes the recovery, it generates information indicating that the sandbox directory recovery is completed.

[0256] S708, the file copy recovery module sends the information indicating that the sandbox directory recovery is completed to the recovery service.

[0257] S709, the recovery service sends an external SD card directory recovery instruction to the file copy recovery module according to the directories of each local file recorded in the local file list. This external SD card directory recovery instruction carries the file or cache address of the external SD card directory.

[0258] S710, after the file copy and recovery module receives the external SD card directory recovery instruction, it writes the external SD card directory file to the external SD card directory of the first application.

[0259] S711, after the file copy and recovery module finishes the recovery, it generates the information indicating that the recovery is completed.

[0260] S712, the file copy and recovery module sends the information indicating that the external SD card directory recovery is completed to the recovery service.

[0261] S713, after the recovery service receives the information indicating that each directory recovery is completed, it updates the recovery stage in the recovery data table of Application A to recovery success.

[0262] After step S713, Application A in the application list is recovered, and the data of other applications in the application list can continue to be recovered according to the process of recovering the data of Application A. For example, execute Figure 8 and Figure 9 to continue to recover the data of Application B according to the process shown. If this recovery process also includes more applications, loop through Figure 8 and Figure 9 to recover other applications to this electronic device as well. The embodiments of the present application will not elaborate further.

[0263] After each application in the application list is recovered, it is necessary to execute Figure 10 the timing diagram of the recovery completion stage shown.

[0264] S801, the recovery service checks that the recovery stage in the data table of each application in the application list is recovery completed.

[0265] S802, the recovery service sends a recovery lock release request to the cloud server.

[0266] S803, the cloud server sends the information indicating successful release to the recovery service.

[0267] S804, the recovery service deletes the cached data in the temporary recovery directory.

[0268] The cached data deleted by the recovery service can be the cloud - uploaded files of each cached application, etc. In actual applications, the cached data of one application can be deleted after each application is recovered to save cache space; or all cached data can be deleted after all applications are recovered. The embodiments of the present application do not limit the specific implementation method.

[0269] S805, generate the mark indicating that this recovery is completed. After S805, this recovery process ends.

[0270] The above describes the complete process of the cloud recovery solution from the application dimension. In actual applications, recovery may be interrupted. As mentioned above, since the recovery data table of each application records the current recovery stage, it is possible to determine to continue the recovery from the next stage based on the recovery stage in the recovery data table.

[0271] As an example, if the recovery data table of the application records that the current recovery stage is the initial state, the recovery continues from the application resource file download stage; if the recovery data table of the application records that the current recovery stage is the application resource file download completed, the recovery continues from the application data download stage; if the recovery data table of the application records that the current recovery stage is the application data download completed, the recovery continues from the data processing stage; if the recovery data table of the application records that the current recovery stage is the data processing completed, the recovery continues from the data recovery stage; if the recovery data table of the application records that the current recovery stage is the recovery successful, it means that the application has been recovered.

[0272] During the recovery of the electronic device, as Figure 7 shown, due to changes in the environmental state, the recovery service may stop the recovery. After the recovery service stops the recovery, the subsequent processes are no longer executed; of course, in actual applications, when the environmental state meets the conditions for continuing the recovery again within a short period of time, the recovery service can still continue the recovery.

[0273] As another example, in actual applications, the recovery process may also be interrupted due to other reasons. If the data recovery is interrupted due to other reasons, the user can also manually trigger the continuation of the recovery.

[0274] As an example, after the recovery is interrupted, the manual recovery control in the cloud recovery interface is updated to the continue recovery control. The user can manually trigger the continuation of the recovery by clicking the continue recovery control in the cloud recovery interface; in response to the operation of continuing the recovery, the recovery service first detects whether the conditions for manual recovery are met through the environmental perception module. If the conditions for manual recovery are met, the recovery can still continue.

[0275] To make the above process of continuing the recovery clearer, the following describes the process of continuing the recovery after the interruption in the recovery preparation stage through Figure 11 a description of the process of continuing the recovery after the interruption in the recovery preparation stage. Figure 11 It is based on the Figure 6 sequence diagram shown and is the process of continuing the recovery after the interruption in the recovery.

[0276] After executing S110 and before successfully executing S111 to update the recovery stage in the recovery data table of each application to the initial state; after the environmental state changes and the environmental state does not meet the conditions for continuing the recovery, the electronic device starts to execute steps S317 to S320, thereby interrupting the recovery. This process can be referred toFigure 7 the relevant description in

[0277] After the interruption recovery, when the environmental state changes and meets the conditions for continuing the recovery, the electronic device starts to execute steps S321 to S323. This process can refer to the relevant description in 7.

[0278] After S323, if the backup stage "stage" in the recovery data table for viewing the recovery service applications is empty (in actual applications, if the "stage" in the recovery data table for any application is empty, it means that the recovery preparation stage is not completed), then the recovery continues from step S106. In actual applications, S108 and S109 can be skipped. This is because if the environmental detection meets the recovery conditions, it means that the environmental perception module has been monitoring the changes in the environmental state.

[0279] In Figure 12 In the shown example, taking the interruption between S110 and S111 as an example, in actual applications, the interruption can occur in any step during the recovery preparation stage. This application will not list them one by one.

[0280] To illustrate that if an interruption occurs in any step during the recovery preparation stage, the recovery can continue, refer to Figure 13 , which is the flowchart for continuing the recovery when an interruption occurs in any step during the recovery preparation stage.

[0281] S901, Stop the recovery.

[0282] This step can be Figure 11 the interruption caused by environmental changes described in steps S317 to S320 in the shown example; it can also be a recovery interruption caused by other reasons. For example, the user manually interrupts the current recovery process, an interruption occurs due to an error during the running process during the recovery execution, an interruption caused by the communication mechanism, etc.

[0283] S902, Meet the conditions for continuing the recovery.

[0284] This step can be Figure 12 steps S321 to S323 in the shown example. For example, the time between the interruption recovery and the continued recovery is short, only a few seconds.

[0285] This step can also be a set of multiple small steps:

[0286] S9021, The recovery service receives the operation manually triggered by the user to continue the recovery;

[0287] S9022, The recovery service executes S102 to S105 to determine that the current conditions for manual recovery are met;

[0288] S9023 resumes the service and executes S108, successfully registering with the environmental perception module to monitor the environmental status.

[0289] Generally, when the time between interruption recovery and continuous recovery is relatively long (for example, several hours have passed), the environmental status may change, and the environmental perception module may no longer monitor changes in the environmental status. Therefore, it is necessary to re-determine the conditions for manual recovery and re-register for environmental status monitoring.

[0290] S903, after meeting the conditions for continued recovery, the recovery service checks the recovery stage in the recovery data table of each application in the application list. If it is found that the stage in the recovery data table of an application is empty, recovery can continue from S106.

[0291] It should be noted that in S902, two cases of meeting the conditions for continued recovery are listed. The first case is that generally the environmental perception module is still monitoring changes in the environmental status; the second case is that the environmental status monitoring has been re-registered. Therefore, after S903, when executing step S106 and subsequent processes, it is no longer necessary to execute S108 and S109.

[0292] For ease of description, subsequent embodiments of this application will all be Figure 12 described in the manner shown for the process of continuous recovery after interruption recovery. S901 and S902 in subsequent embodiments can refer to Figure 12 the detailed description therein and will not be elaborated further hereinafter.

[0293] Refer to Figure 13 , which is the timing diagram for continuous recovery in the case of interruption during the data download stage provided by the embodiments of this application. Figure 8 shown.

[0294] During the process of the electronic device executing steps S401 to S406, when any step is executed, it further includes:

[0295] S901, stop recovery.

[0296] S1001, the recovery service generates an interruption error message.

[0297] S902, meet the conditions for continued recovery.

[0298] S1002, the recovery service searches for the application ID whose first recovery stage is not "recovery completed" in the order of applications in the application list, and the recovery stage is: initial state.

[0299] During the recovery process, recovery is performed in the order of applications in the application list. Therefore, the application for interruption recovery can be determined by the application ID whose first recovery stage is not "recovery completed".

[0300] S401. Read the metadata of Application A (information related to each application resource file) to obtain the un-downloaded application resource files. In the specific implementation process, since the number of application resource files is small during the application resource file download phase, the downloaded application resource files can be determined. If the execution is interrupted and resumes at S401, and it is found that one application resource file has been downloaded, then continue to download other application resource files.

[0301] Continue to execute the subsequent processes of S401.

[0302] During the process of the electronic device executing steps S501 to S508, when any step is executed, it also includes:

[0303] S901. Stop the recovery.

[0304] S1101. The recovery service generates an interruption error message S902, and the condition for continuing the recovery is met.

[0305] S1102. The recovery service searches for the first application ID (Application A) whose recovery phase is not recovery completed in the order of applications in the application list. The recovery phase is: the application resource file download is completed.

[0306] S501. Read the data snapshot to obtain the download addresses of the un-downloaded cloud upload files in the cloud upload file list.

[0307] Since each downloaded cloud upload file is marked as downloaded, it is possible to continue downloading the cloud upload files that have not been successfully downloaded.

[0308] Continue to execute the subsequent processes of S501.

[0309] During the process of the electronic device executing steps S601 to S604, when any step is executed, it also includes:

[0310] S901. Stop the recovery.

[0311] S1201. The recovery service generates an interruption error message S902, and the condition for continuing the recovery is met.

[0312] S1202. The recovery service searches for the first application ID (Application A) whose recovery phase is not recovery completed in the order of applications in the application list. The recovery phase is: the application data download is completed.

[0313] S601. Determine the processing method of the unmarked and unprocessed cloud upload files (ordinary files, data blocks, and tar packages) in the temporary recovery directory based on the local file list and the cloud upload file list in the data snapshot. Continue to execute the subsequent processes of S601.

[0314] During the process of the electronic device executing steps S701 to S705, when any step is being executed, it further includes:

[0315] S901, Stop recovery.

[0316] S1301, Generate an interruption error message for the recovery service. S902, Conditions for continuing recovery are met.

[0317] S1302, The recovery service searches for the first application ID (Application A) whose recovery stage is not recovery completed in the order of the applications in the application list. The recovery stage is: data processing completed in S701, and the data area recovery instruction (carrying the files in the data area) continues to execute the subsequent process of S701. Before executing the process of S701, first kill the process of Application A.

[0318] Refer to Figure 15 , the timing diagram for continuing recovery in the case of interruption at the recovery completed stage provided by the embodiments of the present application. Figure 10 as shown.

[0319] During the process of the electronic device executing steps S801 to S805, when any step is being executed, it further includes:

[0320] S901, Stop recovery.

[0321] S902, Conditions for continuing recovery are met.

[0322] S801, When the conditions for continuing recovery are met, check that the recovery stage in the data table of each application in the application list is recovery completed.

[0323] Continue to execute the subsequent process of S801.

[0324] Through the above examples, it can be understood that in the case of interruption at any stage during the recovery process, recovery can be continued according to the information recorded in the recovery data table of the application, and the process of continuing recovery can avoid problems such as duplicate data upload and missing data upload.

[0325] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not imply the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0326] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program runs on an electronic device, it can implement the steps in the above various method embodiments.

[0327] The embodiments of the present application further provide a computer program product. When the computer program product runs on an electronic device or a wireless router, the electronic device can implement the steps in the above-mentioned method embodiments.

[0328] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-mentioned method embodiments of the present application, a computer program can be used to instruct the relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the first device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium may not be an electrical carrier signal and a telecommunication signal.

[0329] The embodiments of the present application further provide a chip. The chip includes a processor, and the processor is coupled to a memory. The processor calls the computer program stored in the memory to implement the steps in any method embodiment of the present application. The chip can be a single chip or a chip module composed of multiple chips.

[0330] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0331] Those of ordinary skill in the art can realize that the units and method steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0332] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A recovery method, characterized in that, it includes: During the process of the electronic device recovering the first application: After the first recovery stage of the first application is completed, the electronic device updates the recovery status of the first application to the first recovery stage has been completed; The electronic device executes the first process corresponding to the second recovery stage of the first application; During the execution of the first process, the electronic device detects that the stop recovery condition is met; In response to meeting the stop recovery condition, the electronic device interrupts the first process in the recovery process of the first application; The electronic device monitors that the continue recovery condition is met; In response to meeting the continue recovery condition, the electronic device queries the recovery status of the first application as the first recovery stage has been completed; The electronic device continues to recover from the next recovery stage after the first recovery stage, and the next recovery stage after the first recovery stage is the second recovery stage.

2. The method according to claim 1, characterized in that, The second recovery stage is the application data download stage of the first application; the process corresponding to the application data download stage of the first application includes: The electronic device traverses the cloud upload file list to obtain the first cloud upload file in the cloud upload file list that is not marked as downloaded. The cloud upload file list stores the cloud upload files to be recovered by the first application; The electronic device sends a first download request to the cloud server, and the first download request carries the first cloud upload file; The electronic device receives the first cloud upload file sent by the cloud server; The electronic device writes a downloaded mark for the first cloud upload file in the cloud upload file list; The electronic device traverses the cloud upload file list until each cloud upload file in the cloud upload file list has a downloaded mark.

3. The method according to claim 2, characterized in that, The electronic device continues to recover from the next recovery stage after the first recovery stage, including: The electronic device continues to traverse the cloud upload file list until each cloud upload file in the cloud upload file list has a downloaded mark; After each cloud upload file in the cloud upload file list has a downloaded mark, the electronic device updates the recovery status of the first application to data download has been completed.

4. The method according to claim 1, characterized in that, The second recovery stage is the data processing stage of the first application, and the process of the data processing stage of the first application includes: The electronic device traverses the cloud upload file list to obtain the first cloud upload file in the cloud upload file list that is not marked as processed. The cloud upload file list stores the cloud upload files to be recovered by the first application; If the first cloud upload file is a data block of a large file, the electronic device merges the data blocks belonging to the same large file into a directory file with the file type of a large file; If the first cloud upload file is a tar package, the electronic device unpacks the first cloud upload file to obtain multiple directory files with the file type of small files; If the first file to be uploaded to the cloud is a normal file, the electronic device modifies the file name of the first file to be uploaded to the cloud, and the first file to be uploaded to the cloud with the modified file name becomes a directory file; The electronic device writes a processed flag of the first file to be uploaded to the cloud in the list of files to be uploaded to the cloud; The electronic device traverses the list of files to be uploaded to the cloud until each file to be uploaded to the cloud in the list of files to be uploaded to the cloud has a processed flag.

5. The method according to claim 4, wherein, The electronic device resumes from the next resume phase after the first resume phase, including: The electronic device continues to traverse the list of files to be uploaded to the cloud until each file to be uploaded to the cloud in the list of files to be uploaded to the cloud has a processed flag.

6. The method according to claim 1, wherein, The second resume phase is the data resume phase of the first application, and the process of the data resume phase of the first application includes: The electronic device sequentially resumes the directory files of the first application to the directories corresponding to the directories.

7. The method according to claim 1, wherein, Before the electronic device resumes the first application, the method further includes: The electronic device obtains a list of applications to be resumed this time, and the list of applications includes the first application and the second application; The electronic device updates the resume status in the data table of the first application to the initial state, and updates the resume status in the data table of the second application to the initial state.

8. The method according to claim 7, wherein, After the electronic device interrupts the first process in the resume process of the first application, the method further includes: In response to meeting the continuous resume condition, the electronic device queries that the resume status of the first application is that the first resume phase has been completed, including: In response to meeting the continuous resume condition, the electronic device traverses the data tables of each application in the list of applications, and obtains the first application whose first resume phase is not resume completed; The electronic device queries that the resume status of the first application is that the first resume phase has been completed.

9. The method according to claim 7, wherein, After the electronic device updates the resume status in the data table of the first application to the initial state and updates the resume status in the data table of the second application to the initial state, the method further includes: The electronic device executes the second process corresponding to the application resource file download phase of the first application.

10. The method according to claim 9, wherein, The number of the application resource files is at least two; the process corresponding to the application resource file download phase of the first application includes: The electronic device queries the application resource files without a downloaded flag, and obtains that the first resource file has no downloaded flag; The electronic device sends a second download request to the cloud server, and the second download request carries the first resource file; The electronic device receives the first resource file sent by the cloud server; The electronic device records the downloaded flag of the first resource file; The electronic device queries the application resource files without a downloaded flag until each application resource file has a downloaded flag.

11. The method according to claim 10, wherein, the method further comprises: during the process that the electronic device executes a second process corresponding to a download phase of an application resource file of the first application, the electronic device detects that a stop and resume condition is satisfied; in response to the stop and resume condition being satisfied, the electronic device interrupts the second process during the resume process of the first application; the electronic device monitors that a continuous resume condition is satisfied; in response to the continuous resume condition being satisfied, the electronic device queries that a resume state of the first application is the initial state; the electronic device queries for application resource files without a downloaded flag until each application resource file has a downloaded flag; the electronic device updates the resume state of the first application to completed for the application resource file download phase.

12. An electronic device, wherein, the electronic device includes a processor, and the processor is configured to call a computer program in a memory to execute the method according to any one of claims 1-11.

13. A computer-readable storage medium, wherein, the computer-readable storage medium stores computer instructions, and when the computer instructions run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1-11.

14. A chip, wherein, the chip includes a processor, and the processor is configured to call a computer program in a memory to execute the method according to any one of claims 1-11.