Data backup method, electronic equipment, storage medium and chip
By dividing the cloud backup process into multiple stages and recording the backup progress, the problem of cloud backup interruption is solved, and the integrity and efficiency of data backup are achieved.
Patent Information
- Application Number
- CN202311589407.8
- 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
The existing cloud backup technology is prone to interruption during data backup due to device power failure, shutdown or user misoperation, and cloud servers may crash when processing a large number of backup requests, resulting in incomplete backup.
Ensure the integrity and continuity of data backup by dividing the application's backup process into a data preparation stage, a data upload stage, an application resource file upload stage and a backup completion stage, and when the backup is interrupted, determine to continue the backup from the next stage according to the recorded backup stage.
It realizes that the backup can be continued when the data backup is interrupted, avoiding repeated backups or missing part of the data, and ensuring the integrity and efficiency of the backup data.
Smart Images

Figure CN120066850A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data backup, and in particular, to a data backup method, an electronic device, a storage medium, and a chip. Background Art
[0002] Data backup is the process of backing up data in an electronic device to another electronic device, other storage media, or a server. Among them, the process of backing up data to a server can also be called cloud backup of data. Since the server has a larger storage space, currently, data backup mainly uses cloud backup.
[0003] Generally, the amount of data backed up by the user each time is large. Therefore, the cloud backup process consumes a large amount of power and has a long upload time. There may be a situation where the data backup process is interrupted due to power failure, shutdown, or incorrect operation of the user of the electronic device. In addition, the cloud server may need to serve a large number of electronic devices for backup. There may be a situation where multiple electronic devices back up to the server at the same time, resulting in a large request pressure on the server side and a crash, causing the backup process to be interrupted. Summary of the Invention
[0004] The present application provides a data backup method, an electronic device, a storage medium, and a chip, which can improve the efficiency of data backup of application programs in the electronic device, and can also continue the backup in the case of data backup interruption, avoiding problems such as duplicate data backup after continuous backup, or incomplete backup data due to missing some data.
[0005] To achieve the above object, the first aspect of the present application adopts the following technical solution:
[0006] The present application provides a data backup method, including:
[0007] The electronic device records the backup stage of the applications in the application list as the initial state, and the applications in the application list include the first application;
[0008] After being recorded as the initial state, the electronic device obtains the first attribute information of the directory file of the first application;
[0009] After obtaining the first attribute information of the directory file of the first application, the electronic device updates the backup stage of the first application to data preparation completed;
[0010] After updating the backup stage of the first application to data preparation completed, the electronic device sends the data of the first application to the server based on the first attribute information of the first application;
[0011] After sending the data of the first application to the server, the electronic device updates the backup stage of the first application to application resource file upload completed;
[0012] After the backup phase of the first application is updated and the upload of the application resource file is completed, the electronic device receives the information that the backup of the first application sent by the server is completed;
[0013] In response to the information that the backup is completed, the electronic device updates the backup phase of the first application to backup completed.
[0014] This application divides the backup process of the application into several stages: data preparation stage, data upload stage, and application backup completed. In the case of backup interruption, the next stage can be determined according to the recorded backup phase to continue the backup, so that in the case of data backup interruption, the backup can also be continued, avoiding problems such as duplicate backup of data after continuing the backup, or incomplete backup data due to missing some data.
[0015] As an implementation manner of the first aspect, before the electronic device updates the backup phase of the first application to data preparation completed, the method further includes:
[0016] The electronic device writes the first attribute information of the directory file of the first application in the data snapshot, and the first attribute information includes the file ID;
[0017] The electronic device caches the directory file of the first application in the data snapshot in the first storage space.
[0018] As an implementation manner of the first aspect, after the electronic device sets the backup phase of the application in the application list to the initial state and before the electronic device updates the backup phase of the first application to data preparation completed, the method further includes:
[0019] The electronic device interrupts the backup;
[0020] After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition;
[0021] The electronic device queries that the backup phase of the first application is the initial state;
[0022] The electronic device clears the data snapshot of the first application and the directory file in the first storage space
[0023] The electronic device reads the file scanning rule of the first application, and the file scanning rule records the backup directory;
[0024] The electronic device obtains the first attribute information of the directory file of the first application from the backup directory of the first application.
[0025] As an implementation of the first aspect, the electronic device sending the data of the first application to the server based on the first attribute information of the first application includes:
[0026] The electronic device sends the directory file of the first application recorded in the data snapshot to the server;
[0027] After sending each directory file of the first application, the electronic device updates the backup stage of the first application to application data upload completed;
[0028] The electronic device sends the application resource file of the first application to the server;
[0029] Correspondingly, after sending each application resource file of the first application, the electronic device updates the backup stage of the first application to application resource file upload completed.
[0030] As an implementation of the first aspect, after the electronic device updates the backup stage of the first application to data preparation completed and before the electronic device updates the backup stage of the first application to application data upload completed, the method further includes:
[0031] The electronic device interrupts the backup;
[0032] After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition;
[0033] The electronic device queries that the backup stage of the first application is data preparation stage completed;
[0034] The electronic device continues to send the directory file of the first application recorded in the data snapshot to the server.
[0035] As an implementation of the first aspect, the electronic device sending the application resource file of the first application to the server includes:
[0036] The electronic device traverses the data snapshot to obtain a first ID without a cloud-side unique identifier, and the first ID is the file ID of the first file;
[0037] The electronic device sends the first file to the server;
[0038] The electronic device receives the cloud-side unique identifier of the first file sent by the server;
[0039] The electronic device writes the cloud-side unique identifier of the first file into the data snapshot;
[0040] The electronic device continues to send the directory file of the first application recorded in the data snapshot to the server, including:
[0041] The electronic device continues to traverse the data snapshot until there is no directory file without a cloud-side unique identifier in the data snapshot.
[0042] As an implementation manner of the first aspect, after the electronic device updates the backup stage of the first application to after the application data upload is completed and before the application resource file upload of the first application is completed, the method further includes:
[0043] The electronic device interrupts the backup;
[0044] After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition;
[0045] The electronic device queries that the backup stage of the first application is the application data upload stage has been completed;
[0046] The electronic device continues to send the application resource file of the first application to the server.
[0047] As an implementation manner of the first aspect, the electronic device sending the application resource file of the first application to the server includes:
[0048] The electronic device queries the cloud-side unique identifier of the application resource file, obtains a second ID without a cloud-side unique identifier, and the second ID is the file ID of the first application resource file;
[0049] The electronic device sends the first application resource file to the server;
[0050] The electronic device receives the cloud-side unique identifier of the first application resource file sent by the server;
[0051] The electronic device records the cloud-side unique identifier of the first application resource file;
[0052] The electronic device continues to send the application resource file of the first application to the server, including:
[0053] The electronic device continues to query the cloud-side unique identifier of the application resource file until each application resource file has a cloud-side unique identifier.
[0054] As an implementation manner of the first aspect, before the electronic device receives the information that the backup of the first application sent by the server is completed, the method further includes:
[0055] The electronic device sends the backup completion confirmation request to the server, and the backup completion confirmation request carries the metadata of the first application, and the metadata of the first application includes the second attribute information of the application resource file.
[0056] As an implementation manner of the first aspect, after the electronic device updates the backup stage of the first application to after the application resource file is uploaded and before the backup of the first application is updated to completed, the method further includes:
[0057] The electronic device interrupts the backup;
[0058] After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition;
[0059] The electronic device queries that the backup stage of the first application is after the application resource file is uploaded;
[0060] The electronic device resends the backup completion confirmation request to the server.
[0061] As an implementation manner of the first aspect, the applications in the application list further include a second application. After the electronic device updates the backup stage of the first application to completed, the method further includes:
[0062] The electronic device backs up the data of the second application until the backup stage of the second application is completed;
[0063] When the backup stage of each application in the application list is completed, the electronic device sends an overall backup completion confirmation request to the server, and the confirmation request carries the application list;
[0064] The electronic device receives the overall backup completion information sent by the server;
[0065] The electronic device generates a mark for this backup completion.
[0066] As an implementation manner of the first aspect, after the backup stage of each application in the application list is completed, the method further includes:
[0067] The electronic device interrupts the backup;
[0068] After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition;
[0069] The electronic device queries that the backup stage of each application in the file list is completed;
[0070] The electronic device resends a confirmation request for the completion of the overall backup to the server.
[0071] As an implementation manner of the first aspect, before the electronic device sets the backup stage of the applications in the application list to the initial state, the method further includes:
[0072] The electronic device sends a backup ID application request to the server;
[0073] The electronic device receives the backup ID sent by the server;
[0074] The electronic device establishes a correspondence relationship between the backup ID and the application list.
[0075] As an implementation manner of the first aspect, before the electronic device sets the backup stage of the applications in the application list to the initial state, the method further includes:
[0076] The electronic device interrupts the backup;
[0077] After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup conditions;
[0078] The electronic device queries that the backup stage of each application in the file list is empty;
[0079] The electronic device resends a backup ID application request to the server.
[0080] 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 aspects of the present application.
[0081] 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 aspects of the present application.
[0082] In a fourth aspect, there is provided a computer-readable storage medium storing 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 aspects of the present application.
[0083] 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 aspects of the present application.
[0084] It can be understood that the beneficial effects of the above second aspect to the fifth aspect can refer to the relevant descriptions in the above first aspect, and will not be repeated here. Description of the Drawings
[0085] Figure 1 Schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application;
[0086] Figure 2 Schematic diagram of an interface of a backup application for implementing a cloud backup solution provided in an embodiment of the present application;
[0087] Figure 3 Technical architecture diagram of a cloud backup method provided in an embodiment of the present application;
[0088] Figure 4 Flowchart of a cloud backup method provided in an embodiment of the present application;
[0089] Figure 5 Relationships among application data, application resource files, data snapshots, application metadata, etc. provided in an embodiment of the present application;
[0090] Figure 6 Timing diagram of a backup preparation stage in a cloud backup solution provided in an embodiment of the present application;
[0091] Figure 7 For Figure 6 Interaction timing diagram between a backup service and a status detection module in the embodiment shown;
[0092] Figure 8 For Figure 6 Another interaction timing diagram between a backup service and a status detection module in the embodiment shown;
[0093] Figure 9 Timing diagram of a data preparation stage in a cloud backup solution provided in an embodiment of the present application;
[0094] Figure 10 Timing diagram of a data uploading to cloud stage in a cloud backup solution provided in an embodiment of the present application;
[0095] Figure 11 Timing diagram of a backup completion stage in a cloud backup solution provided in an embodiment of the present application;
[0096] Figure 12 Flowchart of resuming backup after backup interruption provided in an embodiment of the present application;
[0097] Figure 13 Timing diagram of resuming backup after backup interruption in a backup preparation stage of a cloud backup process provided in an embodiment of the present application. Detailed implementation manners
[0098] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, in order 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.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] The reference to "one embodiment" or "some embodiments" etc. described 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, the statements "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 all 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.
[0103] A cloud backup method provided by an embodiment of the present application can be applied to an electronic device to back up the data in the electronic device to a cloud server. 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 embodiment of the present application does not limit the specific type of the electronic device.
[0104] Figure 1The 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 jack 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.
[0105] 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 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.
[0106] 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 backup method in the embodiments of the present application.
[0107] 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 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 and reduces the waiting time of the processor 110, thus improving the efficiency of the system.
[0108] 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.
[0109] In addition, the internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc. Application data, application resource index files, etc. in the embodiments of the present application may all be stored in the internal memory.
[0110] The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor may transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation may be provided through the display screen 194. In some other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100, at a different position from where the display screen 194 is located. For example, operations in the cloud backup interface provided in the embodiments of the present application.
[0111] The electronic device 100 implements the display function through the GPU, the display screen 194, and 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 perform 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.
[0112] 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 (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.
[0113] The embodiments of the present application do not particularly limit the specific structure of the execution subject of a cloud backup method. As long as the code recording a cloud backup method of the embodiments of the present application can be run to communicate according to the cloud backup method provided by the embodiments of the present application. For example, the execution subject of the cloud backup method provided by the embodiments of the present application can 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.
[0114] Data backup is the process of backing up the data in an electronic device to another electronic device, other storage media, or a server. The process of backing up data to a server can also be called cloud backup of data. Since the server has a larger storage space, cloud backup is currently the main method for data backup. For the cloud backup process of general file data (such as documents, pictures, audio, etc. stored in an electronic device), the electronic device can upload each selected independent file to the cloud server in sequence.
[0115] Currently, the number of files stored in electronic devices is increasing. For ordinary users, the data to be backed up each time may be as high as dozens of G, and the number of files is tens of thousands. Therefore, the cloud backup process has a large amount of data, high power consumption, and long upload time. There may be situations where the data backup process is interrupted due to power failure, shutdown, or user's incorrect operation of the electronic device. In addition, the cloud server may need to serve a large number of electronic devices for backup. There may be a situation where multiple electronic devices back up to the server simultaneously, resulting in a large request pressure on the server side and a crash, causing the backup process to be interrupted.
[0116] In view of this, embodiments of the present application provide a method for resuming after interruption during cloud backup, which backs up the data of each application in the order of applications. For example, the applications to be backed up this time include Application A, Application B, and Application C. First, the data of Application A is backed up. After the data backup of Application A is completed, the data of Application B is backed up; after the data backup of Application B is completed, the data of Application C is backed up.
[0117] During the process of backing up the data of each application, the backup process of the application is divided into several stages: data preparation stage, application data upload stage, application resource file upload stage, and application backup completed. In the case of backup interruption, it is possible to determine to continue the backup from the next stage according to the recorded backup stage.
[0118] In addition, during the backup process, the electronic device generates a data snapshot based on the attribute information of the directory files in the application's directory (such as file path, file ID, etc.). According to the attribute information recorded in the data snapshot, the directory files of the application are copied to the cache space, and then the directory files are uploaded from the cache space later, so that the backed-up directory files are data with consistent time, avoiding data mismatch between the directory files backed up earlier and those backed up later due to too long backup time; the attribute information of the directory files of the application is obtained through one process of obtaining attribute information, and the cached directory files are obtained through one process of copying directory files, with relatively high backup efficiency.
[0119] The cloud-side unique identifier of each directory file can be recorded in the data snapshot. This cloud-side unique identifier is a flag indicating successful upload returned by the server after receiving the directory file. Therefore, the electronic device can upload the directory files without a cloud-side unique identifier to the server one by one by traversing the data snapshot, which can avoid the loss of directory files. After uploading the directory files, the electronic device sends application resource files (data snapshot, installation package, icon, etc.) to the server. Similarly, the server also returns a corresponding cloud-side unique identifier for each application resource file received; after the server receives the cloud-side unique identifier of each application resource file, metadata (related information of the data snapshot, related information of the installation package, related information of the icon, etc.) is uploaded to the server. After the server receives the metadata, it can compare the information recorded in the metadata with the stored files to determine that the backup is completed.
[0120] To understand the above backup process, the backup solution provided by embodiments of the present application will be described in detail below.
[0121] Refer to Figure 2 , which is a schematic interface diagram of a backup application for implementing the backup solution provided by embodiments of the present application. Users can use the backup application to implement data backup and recovery.
[0122] It should be noted that this interface schematic diagram is only used to illustrate the following: This interface can be used to set the frequency of automatic backup of the electronic device, can be used to select the data to be backed up, and can also include an immediate backup control 11. The electronic device can start performing cloud backup after receiving a click operation from the user corresponding to the immediate backup control 11. In practical applications, interfaces different from Figure 2 can be set, or the above content can be displayed through multiple interfaces.
[0123] In specific implementation, the user can open the backup application through the account center in the electronic device to display the interface shown in (a) of Figure 2 , and can also open the interface shown in (a) of Figure 2 through the application icon of the backup application displayed on the desktop of the electronic device system, and can also open the interface shown in (a) of Figure 2 through other means.
[0124] The electronic device can automatically start data backup, and this process can be called automatic backup. In the interface shown in (a) of Figure 2 , the frequency of automatic backup can be set. For example, backup once every 7 days, backup once every 3 days, backup once a day, etc. The user can display multiple backup frequency options through the control 12 in the interface, and the user selects one of the options to set the frequency of automatic backup. For example, Figure 2 is set to perform automatic backup once every 7 days. Of course, in practical applications, the user can use the control 13 to turn on or turn off automatic backup, and the state of the control 13 shown in the figure is the on state of automatic backup.
[0125] In Figure 2 , in the interface described in (a), the user can also select the data to be backed up. The user clicks on the backup data setting control 14 shown in (a) of Figure 2 to enter the backup data setting interface shown in (b) of Figure 2 .
[0126] Multiple data entries are displayed in the backup data setting interface: system data (such as system settings, alarm settings, input method settings, etc.), desktop layout, gallery, contacts, notes, instant messaging applications. The user can select specific data to be backed up. For example, turning on the control 15 corresponding to the system data entry indicates that the system data needs to be backed up during the backup process; not turning on the control 16 corresponding to the notes entry indicates that the data of the notes application does not need to be backed up during the backup process. See Figure 2, the controls corresponding to system data, desktop layout, gallery, contacts, and instant messaging applications are all in the enabled state, while the controls corresponding to the notes application are all in the disabled state. In this case, the electronic device can perform data backup on the data of system data, desktop layout, gallery, contacts, and instant messaging applications, but does not perform data backup on the data of the notes application. In this example, the data of system data, desktop layout, gallery, contacts, and instant messaging applications can also be referred to as the backup data set by the user.
[0127] After the user sets the backup data, the electronic device can be triggered to display the interface shown in (a) in Figure 2 through a gesture operation.
[0128] In Figure 2 the interface shown in (a), the user can trigger the electronic device to perform data backup by clicking the immediate backup control 11. This process can be called manual backup.
[0129] Of course, the electronic device can also automatically trigger the backup of the backup data set by the user based on the set automatic backup frequency.
[0130] Referring to Figure 3 , it is the technical architecture diagram of the data backup method provided by the embodiment of the present application. This technical architecture diagram involves a cloud server and an electronic device.
[0131] The cloud server includes a backup server and a file storage server. The backup server and the file storage server can be two independent servers, or the backup server and the file storage server can also be deployed on the same server.
[0132] The backup server is used to store the backup records and application metadata of each device. Among them, the backup records record the backup ID, backup time, backup size, etc. of each device during cloud backup. A device can perform multiple data backups. Therefore, the backup server can also record the backup ID, backup time, and backup size of each backup when the same device performs multiple backups. The application metadata records the relevant information of each application in the backup data set by the user (the specific content can refer to the description of the subsequent embodiments).
[0133] The file storage server is used to store the actual files of each application to be backed up, such as various files such as the database, installation package, audio, video, document, and picture of the application.
[0134] 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 the present application, the backup process is uniformly described using the cloud server.
[0135] The electronic device includes a backup application and other applications. The backup application is an application used to implement the backup process, and the other applications are applications in the backup data set by the user (for example, Figure 2 the gallery application, contact application, and instant messaging application shown in (b) of
[0136] 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 a status detection module);
[0137] 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 this data to the electronic device.
[0138] 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 status detection 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 the locked screen state), and charging status (for example, whether the battery power is sufficient and whether an external power source is connected), etc.
[0139] The backup service includes a data caching module, a data processing module, and a data upload 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, assemble small files or fragment large files, generate a data snapshot based on this data to be backed up, etc.; the data upload module is used to call the file upload module to upload the processed data to the cloud server.
[0140] The recovery service includes a data download module, a data processing module, and a recovery execution module. The data download module is used to call the file download module to download data from the cloud server; the data processing module is used to decompress, assemble, and delete the downloaded data, etc.; the recovery execution module is used to restore the processed data to the original directory.
[0141] 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 the PMS (package manager service) or BMS (backup manager service) in the Framework layer. The PMS or BMS can provide the ability to read the data directory generated by the operation of third-party applications.
[0142] In addition, during specific implementation, file scanning rules corresponding to each application (excluding backup applications) can be stored in the electronic device. The file scanning rules of an application record the backup directory and the prohibited backup directory corresponding to the application. In practical applications, the backup service backs up the files in the backup directory to the cloud server; it no longer backs up the files in the prohibited backup directory. For example, when backing up the chat records of an instant messaging application, it does not back up the log files generated during the operation of the instant messaging application.
[0143] Referring to Figure 4 , it is a schematic flowchart of the cloud backup method provided by the embodiment of the present application.
[0144] The cloud backup method includes three major stages: the backup preparation stage, the backup execution stage, and the backup completion stage. In the backup preparation stage: the environment is detected through the status detection module. For example, the status of the electronic device is detected to determine whether the electronic device meets the backup conditions; the remaining storage space of the electronic device and the remaining storage space of the personal account on the cloud server can also be detected to determine whether the remaining storage space of the electronic device is sufficient to cache the backup data and whether the remaining storage space of the personal account on the cloud server is sufficient to back up the data; when the device status detection meets the backup conditions and the storage space is sufficient, a backup ID for this cloud backup of the electronic device is applied for from the cloud server.
[0145] The backup execution stage includes a data preparation stage and a data uploading to the cloud stage. The data uploading to the cloud stage includes an application data (such as the directory files mentioned above) uploading stage, an application resource file uploading stage, and a backup completion stage (for uploading meta data)
[0146] First, it is necessary to cache the application data in the data preparation stage to generate data snapshots (i.e., data preparation), and then upload the application data to the cloud server (i.e., data uploading to the cloud). In practical applications, if the data to be backed up this time includes the data of multiple applications (for example, applications A, B, and C), it is necessary to prepare the data for one application first and upload the data of that application to the cloud server; after the data of the previous application is uploaded to the cloud server, prepare the data for the next application and upload the data of the next application to the cloud server; and so on in a loop until the data of multiple applications are all uploaded to the cloud server. Of course, in practical applications, it is also possible to complete the data preparation for multiple applications and then upload the data of each application to the cloud server in sequence.
[0147] In the embodiment of this application, taking an application A as an example, the data preparation process and the process of uploading data to the cloud are described. The electronic device reads the directory of the application selected by the user for backup through the PMS or BMS, and caches the application data (such as chat records, pictures, videos, audios, documents, etc.) read from the directory of the application in a temporary storage space; then, the cached application data is processed to generate a data snapshot (for details, refer to the explanation below). After generating the data snapshot of application A, the electronic device can upload the application data of application A to the cloud server (i.e., the application data upload stage). After the electronic device uploads the application data, it also needs to upload the application resource files (such as the data snapshot of application A, the installation package, and the icon, etc.) to the cloud server (i.e., the application resource file upload stage). After the upload of the application resource files of application A is completed, the electronic device can upload the metadata (meta) of application A to the cloud server (i.e., the meta data upload stage, which is the backup completion stage). 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. In actual applications, some application resource files can be uploaded, and correspondingly, the metadata can also be the information related to some application resource files.
[0148] In the backup completion stage: After confirming that the backup of all applications (such as application A, application B, and application C) in this backup is completed, the overall backup is completed.
[0149] To facilitate the understanding of the professional terms in the above backup execution stage, refer to Figure 5 , which describes the relationships among application data, application resource files, data snapshots, application metadata, etc.
[0150] Application data includes the files to be backed up obtained by scanning the application directory. Taking an instant messaging application as an example, the data of this instant messaging application can include data such as chat records, pictures, videos, audios, and documents.
[0151] The data snapshot is generated from the application data and records some information about these application data (specifically refer to Table 1 and Table 2). 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 file list for uploading to the cloud (refer to Table 2).
[0152] The local file list is used to record the information of the files in the application data (such as application ID, file size, hash value, modification time, whether there are changes, file type, etc.), as well as some information about these files in the electronic device (such as the local file path of the file and the unique identifier of the file in the local).
[0153] Table 1 is the local file list app_data_detail provided by the embodiment of this application
[0154]
[0155]
[0156] The cloud upload file list is used to record information about files in application data (such as application ID, file size, hash value, etc.), as well as 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).
[0157] Table 2 shows the cloud upload file list upload_app_data_detail provided in the embodiments of the present application
[0158] Field Name Type Description backup_id string Backup ID app_id string Application ID uuid string Local Unique Identifier cloud_name string File Name Rule path(hash)_filename cloud_path string Cloud-side Download Path cloud_fid string Cloud-side Unique Identifier of the File Uploaded to the Cloud fileid cloud_size long File Size cloud_hash string File Hash Value data1……data10 string Reserved 10 Extension Fields
[0159] Application resource files include: data snapshots, application installation packages, application icons, and application backup instructions. Application backup instructions include: information such as the version of the application installation package and the system version of the electronic device during backup.
[0160] The application metadata records: relevant information about data snapshots, relevant information about application installation packages, relevant information about application icons, relevant information about application backup instructions, etc.
[0161] As an example of application metadata.
[0162]
[0163] It can be understood that the application metadata includes relevant information about snapshot (data snapshot), relevant information about apk (application installation package), relevant information about info.xml (application backup instructions), and relevant information about icon (application icon).
[0164] After describing the above professional terms, the cloud backup solution provided in the embodiments of the present application will be described in detail below.
[0165] As shown in Figure 4 The cloud backup solution includes: a backup preparation stage, a data preparation stage, a data cloud upload stage (including an application data upload stage and an application resource file upload stage), and a backup completion stage.
[0166] Below, through Figures 6 to 11 the above cloud backup solution will be described, where Figure 6 is a timing diagram of the backup preparation stage in the cloud backup solution. Figure 7 and Figure 8 are Figure 6 the specific implementation manner of the environmental status detection in the backup preparation stage shown in Figure 9 is a timing diagram of the data preparation stage in the cloud backup solution, Figure 10It is a sequence diagram of the data uploading phase in the cloud backup solution. Figure 11 It is a sequence diagram of the backup completion phase in the cloud backup solution.
[0167] First, describe Figure 6 the sequence diagram of the backup preparation phase shown.
[0168] Refer to Figure 2 shown. The automatic cloud backup frequency can be set through the backup application, and which application data needs to be backed up can be set. The backup application can generate an application list (excluding the note ID) according to the interface shown in Figure 2 (b) in. Therefore, the cloud backup frequency and the application list are recorded in the backup application, and the application ID of the current backup is recorded in the application list. When the time corresponding to the cloud backup frequency arrives, the electronic device will execute the subsequent cloud backup process; similarly, when the electronic device receives a click operation on the control 11, the electronic device will also execute the subsequent cloud backup process. In the embodiment of the present application, the above cloud backup solution is described by taking the data backup of application A this time as an example. In specific implementation, after the backup of application A is completed, the next application is backed up.
[0169] S101. After the backup service reaches the automatic backup time point or receives a manual backup operation, it sends an environment status acquisition request to the status detection module.
[0170] In the embodiment of the present application, whether it is manual backup or automatic backup, backup conditions are set, and the backup conditions include various states of the electronic device, such as network status (connected to the 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 5G), etc. Of course, in actual applications, in order to make the backup process not easily interrupted, more backup conditions can also be set. For example, the remaining storage space of the personal space in the cloud server can also be increased to be greater than 5G, etc.
[0171] It should be noted that the numbers such as 10% and 5G are only for illustration and do not impose any limitation on the present application. The subsequent embodiments of the present application will describe in detail the backup conditions for automatic backup and the backup conditions for manual backup respectively. Each state in the above backup conditions can be obtained through the status detection module.
[0172] S102. After the status detection module receives the device status acquisition request, it detects the device status.
[0173] The environment status is related to the pre-set backup conditions, such as the battery status, screen status, remaining storage space, and network status of the electronic device, etc.
[0174] In practical applications, during automatic backup, the status detection module detects multiple environmental statuses related to the backup conditions of automatic backup; during manual backup, the status detection module detects multiple environmental statuses related to the backup conditions of manual backup. For details, refer to the description of the following embodiments.
[0175] S103. The status detection module sends the detected environmental status to the backup service.
[0176] Exemplarily, the device status is as follows: connected to a wireless local area network, connected to an external power supply, the remaining storage space of the electronic device is greater than 5G (which can also be the specific remaining storage space of the electronic device), and the screen is locked.
[0177] S104. After receiving the environmental status sent by the status detection module, the backup service determines that the environmental status meets the backup conditions.
[0178] Exemplarily, the conditions for setting automatic cloud backup include: connected to a wireless local area network, connected to an external power supply, the remaining local storage space is greater than the threshold, and the screen is locked. It can be determined that the device status received in S103 meets the conditions for automatic cloud backup.
[0179] In practical applications, the backup service can send a request for obtaining the environmental status to the status detection module once to instruct the status detection module to detect the environmental status. In practical applications, the backup service can also send multiple different environmental status detection instructions to the status detection 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 screen status detection instruction is used to detect the screen status, and so on.
[0180] S105. When the device status meets the backup conditions, the backup service sends a backup ID application request to the cloud server.
[0181] As mentioned above, the backup IDs of different devices are different. Therefore, each time a backup ID is applied for, 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.
[0182] S106. After receiving the backup ID application request, the cloud server generates the backup ID for this cloud backup according to the device unique identifier.
[0183] In practical applications, when generating the backup ID, the backup ID and the historical backup ID of the same device each time a backup is performed can be different. Therefore, other parameters can also be combined when generating the backup ID, such as the current backup time, etc.
[0184] S107. The cloud server sends the generated backup ID to the backup service.
[0185] S108. When the backup service determines that the device status meets the backup conditions, it may also send an environmental monitoring request to the status detection module.
[0186] Only when the current status meets the conditions for automatic backup, send a device status monitoring instruction to the status detection module to instruct the status detection module to continue monitoring the device status; similarly, the backup service can send a monitoring request to the status detection module, or can send multiple device status monitoring requests to the status detection module. Different environmental monitoring requests correspond to different monitoring contents.
[0187] S109. After receiving the device status monitoring request, the status detection module starts to monitor the device status.
[0188] In the embodiments of the present application, the status detection module detects the device status by obtaining the current device status; the status detection module monitors the device status by detecting the device status in real time according to a certain time period.
[0189] S110. The backup service receives the information indicating the start of monitoring sent by the status detection module.
[0190] In the above embodiments, there is no strict sequence between the backup service executing step S105 and executing step S108. The backup service can also first execute step S108 and then execute step S105.
[0191] S111. After receiving the backup ID, the backup service establishes a corresponding relationship between the application list and the backup ID.
[0192] S112. The backup service updates the backup phase of each application in the backup data table to the initial state.
[0193] The cloud backup solution provided by the embodiments of the present application performs backups from the application dimension. The backup service backs up the applications in the backup list in sequence, that is, only after one application is backed up will the next application be backed up. The embodiments of the present application set up a backup data table for each application, and the backup data table records the backup phase of the application; therefore, in the case of backup interruption, the backup service can view the backup data tables of each application in the backup list to determine which applications have been backed up (for example, the backup phase is backup completed), and which applications have not been backed up (for example, the backup phase is the initial state).
[0194] In addition, in practical applications, it is possible that a backup interruption occurs during the backup process of a certain application. In order to resume the interrupted application backup process, the backup execution process of a single application can also be divided into several more detailed backup stages: data preparation stage, application data upload stage, application resource file upload stage, application backup completion (corresponding to meta data upload). At the same time, corresponding status identifiers are set for multiple backup stages. For example, the completion of the data preparation stage is: 10; the completion of the application data upload is: 20; the completion of the application resource file upload is: 30; the completion of the backup is: 200. Of course, before backing up an application, the backup stage needs to be initialized to the initial state, and the initial state can be represented by the character "0".
[0195] After the completion of each backup stage, update the status identifier in the backup data table of the application. In the case of a backup interruption, it is possible to determine which stages of the current application backup process have been completed based on the status identifier recorded in the backup data table of the application, and continue the subsequent backup process from which stage. Among them, the backup data table of the application can refer to Table 3 shown below.
[0196] Table 3 Backup data table of the application cbk_backup_app_info
[0197]
[0198] After step S111, the status identifier corresponding to the initial state is recorded in the stage of each application in the backup data table. Subsequently, the backup service can sequentially back up the data related to each application to the cloud server according to the recorded application list.
[0199] In practical applications, a backup data table can be set for each application, or the information of multiple applications can be recorded in the form of entries in a single backup data table.
[0200] In Figure 6 In the example shown, during the backup preparation stage, the backup service needs to determine whether the current backup conditions are met through the status detection module. Similarly, during the backup process, the backup service also needs to monitor the device status through the status detection module to interrupt the backup in the case where the device status is not suitable for continued backup.
[0201] The embodiments of the present application set the backup conditions that the device status needs to meet during automatic backup; and also set the backup conditions that the device status needs to meet during manual backup.
[0202] For example, the conditions for automatic cloud backup include: connected to an external power source, screen locked, connected to a wireless local area network, local remaining storage space greater than a threshold; remaining storage space of the personal account greater than a threshold, etc. The backup conditions for manual backup include: connected to a wireless local area network, battery power greater than 10%, local remaining storage space greater than a threshold; remaining storage space of the personal account greater than a threshold, etc. Of course, the above examples are only for illustration.
[0203] Next, through Figure 7 Describe in detail the interaction between the backup service and the status detection module during the automatic backup process of the above embodiments.
[0204] Figure 6 Steps S101 to S103 in the illustrated embodiment correspond to steps S201 to S212. Figure 6 S101 to S103 in
[0205] S201, the backup service sends a power status acquisition request to the status detection module.
[0206] S202, after the status detection module receives the power status acquisition request, it detects that the power status is connected to an external power source.
[0207] S203, the environmental perception module sends the detected power status: connected to an external power source to the backup service.
[0208] S204, when the backup service determines that the received power status meets the power status condition, it sends a network status acquisition request to the status detection module.
[0209] S205, after the status detection module receives the network status acquisition request, it detects that the network status is connected to a wireless local area network.
[0210] S206, the status detection module sends the detected network status: connected to a wireless local area network to the backup service.
[0211] S207, when the backup service determines that the received network status meets the network status condition, it sends a screen status acquisition request to the status detection module.
[0212] S208, after the status detection module receives the screen status acquisition request, it detects that the screen status is: locked screen state.
[0213] S209, the status detection module sends the screen status: locked screen state to the backup service.
[0214] S210, when the backup service determines that the received screen status meets the screen status condition, it sends a remaining storage space acquisition request to the status detection module.
[0215] In S211, after the status detection module receives a request for obtaining the remaining storage space, it detects the local remaining storage space and the remaining storage space of the personal account.
[0216] In the embodiment of the present application, when the cloud backup interface is opened, the status detection module can obtain the remaining storage space of the personal account from the cloud server, or when performing environment detection, interact with the cloud server to obtain the remaining storage space of the personal account from the cloud server. The embodiment of the present application does not limit the specific implementation manner.
[0217] In S212, the status detection module sends the local remaining storage space and the remaining storage space of the personal account to the backup service.
[0218] In actual applications, the sending order of requests for obtaining the status of each device is not sequential. The next request for obtaining the device status is sent when the status of any device meets the corresponding conditions until the status of each device meets the corresponding conditions. Of course, if the status of any one device does not meet the corresponding conditions, it means that the current environment does not meet the conditions for automatic backup, and the subsequent process needs to be stopped, and naturally cloud backup will not be performed.
[0219] As mentioned above, when the current device status meets the conditions for automatic backup, the status detection module also needs to continuously monitor the device status during the backup process to stop the backup when the status change causes it not to meet the conditions for continued backup.
[0220] Figure 6 Steps S108 to S110 in
[0221] In S213, when the status detection module determines that the status of each device meets its corresponding conditions, it sends a monitoring registration request for the network status to the status detection module.
[0222] In S214, after the status detection module receives the monitoring registration request for monitoring the network status, it starts to monitor the network status.
[0223] In S215, the status detection module sends information indicating successful registration of network status monitoring to the backup service.
[0224] In S216, after the backup service receives the information indicating successful registration of network status monitoring, it sends a monitoring registration request for the power status to the status detection module.
[0225] In S217, after the status detection module receives the monitoring registration request for the power status, it starts to monitor the power status.
[0226] In S218, the status detection module sends information indicating successful registration of power status monitoring to the backup service.
[0227] After the backup service receives the information indicating successful registration of power status monitoring, it sends a registration request for screen status monitoring to the status detection module.
[0228] After the status detection module receives the registration request for screen status monitoring, it starts monitoring the screen status.
[0229] The status detection module sends the information indicating successful registration of screen status monitoring to the backup service.
[0230] In actual applications, the order of sending registration requests for monitoring the status of each device is not specified. The registration request for the next device status is sent when the registration of any device status monitoring is successful, until the information indicating successful registration of monitoring for each device status is received.
[0231] Next, through Figure 8 The interaction between the backup service and the status detection module during the manual backup process of the above embodiment will be described in detail.
[0232] Figure 6 Steps S101 to S103 in the illustrated embodiment correspond to steps S301 to S312. Figure 6 S101 to S103 in
[0233] S301, After the backup service receives the operation to trigger manual backup, it sends a request to obtain the power status to the status detection module.
[0234] S302, After the status detection module receives the request to obtain the power status, it detects that the power status is greater than 10%.
[0235] S303, The status detection module sends the detected power status: greater than 10% to the backup service.
[0236] S304, When the backup service determines that the received power status meets the power status condition, it sends a request to obtain the network status to the status detection module.
[0237] S305, After the status detection module receives the request to obtain the network status, it detects that the network status is connected to a wireless local area network.
[0238] S306, The status detection module sends the detected network status: connected to a wireless local area network to the backup service.
[0239] S310, When the backup service determines that the received screen status meets the screen status condition, it sends a request to obtain the remaining storage space to the status detection module.
[0240] In S311, after the status detection module receives a request for obtaining the remaining storage space, it detects the local remaining storage space and the remaining storage space of the personal account.
[0241] In S312, the status detection module sends the local remaining storage space and the remaining storage space of the personal account to the backup service.
[0242] As described above, when the current device status meets the conditions for manual backup, it is also necessary for the status detection module to continuously monitor the device status during the backup process, so as to stop the backup in case the status change causes the conditions for continuing the backup not to be met.
[0243] Figure 6 Steps S108 to S110 in [reference] can specifically include S313 to S318.
[0244] In S313, when the status detection module determines that each device status meets its corresponding conditions, it sends a listening registration request for the network status to the status detection module.
[0245] In S314, after the status detection module receives the listening registration request for monitoring the network status, it starts to monitor the network status.
[0246] In S315, the status detection module sends information indicating successful listening registration of the network status to the backup service.
[0247] In S316, after the backup service receives the information indicating successful listening registration of the network status, it sends a listening registration request for the power status to the status detection module.
[0248] In S317, after the status detection module receives the listening registration request for the power status, it starts to monitor the power status.
[0249] In S318, the status detection module sends information indicating successful listening registration of the power status to the backup service.
[0250] As Figure 6 shown, after the backup preparation stage ends, the backup stage of each application in the data table is in the initial state. Subsequently, the backup service will sequentially back up the data of each application to the cloud server according to the application list of this backup. The data preparation stage during the process of backing up one of the applications (for example, Application A) is described below.
[0251] Referring to Figure 9 , it is the timing diagram of the data preparation stage during the data backup process of Application A provided by the embodiment of the present application.
[0252] In S401, the backup service reads the file scanning rules of Application A.
[0253] In the embodiments of the present application, the configuration file (JSON file) can record the file scanning rules of one or more applications. The backup directory and the prohibited backup directory of the application are recorded in the file scanning rules. The backup service can upload the files in the backup directory to the cloud server, and will not upload the files in the prohibited backup directory to the cloud server.
[0254] In practical applications, different file scanning rules can be set for different applications, the same file scanning rules can be set for the same type of applications, or the same file scanning rules can be set for all applications.
[0255] S402. The backup service sends a scanning instruction for the directory files of Application A to the data replication and recovery module. The scanning instruction carries the file scanning rules of Application A.
[0256] Exemplarily, the scanning instruction carried can be the backup directory and the prohibited backup directory of Application A.
[0257] In a specific implementation, the backup service can call the data replication module in the data replication and recovery module to scan the directory of Application A through the data replication module.
[0258] As an example, sdcard / picture / xxx.xxx.xxx / is the backup directory, and / data / data / xxx.xxx.xxx / file / b3d74ae13647da4b7f8b259c376834 / attachment / .ref / d / eda84554-7892-4124-8f1d-7f69d38fcebd is the prohibited backup directory.
[0259] S403. After receiving the scanning instruction for the directory files of Application A, the data replication and recovery module obtains the number of files and file information in the backup directory of Application A according to the file scanning rules of Application A.
[0260] As an example of file information, the file information includes: file path, file name, file size, file hash value.
[0261] sdcard / picture / xxx.xxx.xxx, mmexport1699003060871.mp4, 15.32MB, ngreht8dhge47tgdtgh;
[0262] / android / data / xxx.xxx.xxx / file / e2b13889818aa6a711935f5481405139 / music, piecebc16b1ac66e102953d7397dccd0002e2, 3.35MB, ithdbght246bgdg。
[0263] During this process, the data replication module in the data replication and recovery module traverses the backup directory of Application A through BMS or PMS, thereby copying all files in the backup directory of Application A. These are obtained through the backup directory and can also be recorded as directory files.
[0264] S404, the data replication and recovery module scans file information from Application A through a scanning operation.
[0265] S405, the data replication and recovery module sends the file information to the backup service.
[0266] S406, after receiving the file information, the backup service records the file information of Application A in the local file list of the data snapshot of Application A. In this step, the relevant information of the application data of Application A scanned is recorded in the local file list of the data snapshot.
[0267] As an example of the local file list (application ID, number of files, file path, file name, file size, file hash value):
[0268] dsgrbgfd, 1, sdcard / picture / xxx.xxx.xxx, mmexport1699003060871.mp4, 15.32MB, ngreht8dhge47tgdtgh;
[0269] dsgrbgfd, 1, / android / data / xxx.xxx.xxx / file / e2b13889818aa6a711935f5481405139 / music, piecebc16b1ac66e102953d7397dccd0002e2, 3.35MB, ithdbght246bgdg。
[0270] S407, the backup service sends a fetch instruction to the data replication and recovery module, and the fetch instruction carries the relevant information of each file.
[0271] The relevant information can be the path, name, etc. of the file.
[0272] S408, after receiving the fetch instruction, the data replication and recovery module obtains the file from the directory of Application A according to the file information.
[0273] Among them, copying is just one way of acquisition. In actual applications, cutting is also possible. For example, in order to save storage space, some files in the gallery application can be cut and then uploaded to the cloud server. S409, the data copy and recovery module obtains the files from Application A.
[0274] S410, the data copy and recovery module sends the files of Application A to the backup service.
[0275] S411, after the backup service receives the files from Application A, it processes the files of Application A to obtain one or more cloud upload files of Application A.
[0276] As an example of the processing, a file with a large amount of data can be split into small data blocks, and the small data blocks are cloud upload files; or multiple files with a small amount of data can be packaged, and the packaged file is a cloud upload file.
[0277] In actual applications, it is also possible to directly package or split these files when copying them through the data copy and recovery module. The embodiments of the present application do not limit the specific modules for realizing packaging and splitting.
[0278] S412, the backup service updates some basic information in the cloud upload file list of the data snapshot according to each cloud upload file.
[0279] For example, write the application ID, local unique identifier, number of files, file size, hash value, etc.
[0280] S413, the backup service updates the backup phase in the backup data table of Application A to data preparation completed.
[0281] Exemplarily, the backup data table sequentially records: backup ID, application ID, backup phase; fenegfhhgdg, 5ffd64w9, 10; among them, fenegfhhgdg is the backup ID, 5ffd64w9 is the application ID, and 10 indicates that the data preparation phase is completed.
[0282] Refer to Figure 10 , which is the timing diagram of the cloud upload phase in the backup process of Application A provided by the embodiments of the present application. The cloud upload phase includes the application data upload phase, the application resource file upload phase, and the backup completion phase.
[0283] In the embodiments of the present application, the basic information of the cloud-uploaded files has been stored in the cloud-uploaded file list. After any cloud-uploaded file is backed up to the cloud server, the cloud server will return the relevant information of the cloud-uploaded file on the cloud server. For example, the unique identifier of the cloud-uploaded file on the cloud side. The electronic device writes the unique identifier of the cloud-uploaded file on the cloud side in the cloud-uploaded file list. Therefore, by traversing the cloud-uploaded file list, the cloud-uploaded files without the unique identifier on the cloud side can be obtained, so as to upload each cloud-uploaded file in the cloud-uploaded file list to the cloud server.
[0284] S501. After the backup service completes data preparation in the backup phase of updating the backup data table of data A, it traverses the cloud-uploaded file list in the data snapshot of application A to obtain the file IDs of the cloud-uploaded files without the unique identifier on the cloud side.
[0285] S502. The backup service sends a file upload instruction to the file upload / download module. The file upload instruction carries the cloud-uploaded file without the unique identifier on the cloud side in the cloud-uploaded file list or the cache address of the cloud-uploaded file without the unique identifier on the cloud side in the cloud-uploaded file list. The file upload instruction can also carry the file ID of the cloud-uploaded file.
[0286] Alternatively, the file upload instruction can carry the file ID of the cloud-uploaded file without carrying the cloud-uploaded file itself.
[0287] The backup service can obtain the cloud-uploaded file from the cache space according to the file ID and send it to the file upload / download module.
[0288] This process can call the file upload module in the file upload / download module.
[0289] S503. After receiving the file upload instruction, the file upload / download module uploads the cloud-uploaded file without the unique identifier on the cloud side in the cloud-uploaded file list to the cloud server.
[0290] S504. After receiving the cloud-uploaded file, the cloud server generates cloud-upload information.
[0291] This cloud-upload information is used to update various information in the cloud-uploaded file list, such as the unique identifier on the cloud server and / or the storage path on the cloud server, etc.
[0292] S505. The cloud server sends the cloud-upload information to the file upload / download module.
[0293] S506. After receiving the cloud-upload information, the file upload / download module sends the cloud-upload information to the backup service.
[0294] S507. After receiving the cloud-upload information, the backup service writes the cloud-upload information (including the unique identifier on the cloud side) of the uploaded file in the cloud-uploaded file list.
[0295] In this step, it is also necessary to write the cloud - side unique identifier in the cloud - uploading information into the reference of the local file list.
[0296] The processes of steps S501 to S507 are looped until each cloud - uploading file of application A recorded in the cloud - uploading file list is uploaded to the cloud server. After each cloud - uploading file of application A recorded in the cloud - uploading file list is uploaded to the cloud server, each cloud - uploading file of application A in the cloud - uploading file list has a cloud - side unique identifier.
[0297] S508. After the backup service determines that the cloud - uploading files in the cloud - uploading file list all have cloud - side unique identifiers, it updates the backup phase in the backup data table of application A to "application data upload completed".
[0298] Exemplarily, the information of application A recorded in the backup data table is: xxx(backup ID).xxx(application ID).20.
[0299] S601. After the backup service updates the backup phase in the backup data table of application A to "application data upload completed", it reads the application resource files of application A.
[0300] In the embodiment of the present application, the application resource files of application A include data snapshots, installation packages, icons, and application backup descriptions.
[0301] In specific implementation, it is also necessary to upload one application resource file and then upload the next one.
[0302] S602. The backup service sends a file - uploading instruction to the file upload - download module, and the file - uploading instruction carries an application resource file or the storage address of an application resource file.
[0303] S603. After receiving the file - uploading instruction, the file upload - download module sends the application resource file to the cloud server.
[0304] S604. After receiving the application resource file, the cloud server generates cloud - uploading information according to the application resource file. The cloud - uploading information also includes the unique identifier of the application resource file.
[0305] S605. The cloud server sends the cloud - uploading information of the application resource file to the file upload - download module.
[0306] S606. After receiving the cloud - uploading information, the file upload - download module sends the cloud - uploading information to the backup service.
[0307] The processes of steps S601 to S606 are looped until each application resource file is uploaded to the cloud server.
[0308] S606. After the backup service determines that it has received the unique cloud - side identifier of each application resource file, it updates the backup stage in the backup data table of Application A to "application resource file upload completed".
[0309] In the embodiment of this application, the number of application resource files is small. After the cloud server receives each application resource file, it will also send the unique cloud - side identifier of the application resource file to the backup service. Therefore, the backup service can determine the uploaded and un - uploaded application resource files based on the received unique cloud - side identifier, and thus upload each application resource file to the cloud server.
[0310] S701. After the backup service updates the backup stage in the backup data table of Application A to "application resource file upload completed", it generates the metadata of Application A based on the cloud - uploading information of the application resource files of Application A.
[0311] S702. The backup service sends a backup completion confirmation request for Application A to the cloud server, and this request carries the metadata of Application A.
[0312] S703. After the cloud server receives this request, it compares the stored application resource files and metadata of Application A to determine that the backup of Application A is completed.
[0313] S704. The cloud server sends the information that the backup of Application A is completed to the backup service.
[0314] S705. After the backup service receives the information that the backup of Application A is completed sent by the cloud server, it updates the backup stage in the backup data table of Application A to "backup completed".
[0315] After step S705, the backup of Application A in the application list is completed, and the data of other applications in the application list can continue to be backed up according to the data backup process of Application A. For example, execute Figure 9 and Figure 10 The shown process continues to back up the data of Application B. If there are more applications in this backup process, loop and execute Figure 9 and Figure 10 The other applications have also been backed up to the cloud server, and the embodiments of this application will not be elaborated further.
[0316] After backing up each application in the application list, it is necessary to execute Figure 11 The timing diagram of the backup completion stage shown.
[0317] S801. The backup service checks that the backup stage in the data table of each application in the application list is "backup completed".
[0318] S802. The backup service sends an overall backup completion confirmation request to the cloud server, and this request carries the application list.
[0319] In S803, after the cloud server receives the overall backup complete confirmation request, it compares the received application list with the metadata of the stored applications to confirm the completion of the overall backup.
[0320] In S804, the cloud server sends the information that the overall backup is completed to the backup service.
[0321] In S805, the backup service deletes the cached data.
[0322] The cached data deleted by the backup service can be the application data of each cached application, etc. In practical applications, after each application is backed up, the cached data of one application can be deleted to save the cache space; or after all applications are backed up, all the cached data can be deleted. The embodiments of the present application do not limit the specific implementation manner.
[0323] In S806, a mark indicating the completion of this backup is generated. After S806, this backup process ends.
[0324] As described above, since the current completed stage is recorded in the backup data table of each application, in the case of backup interruption, the backup can be continued from the next stage according to the backup stage recorded in the backup data table.
[0325] Refer to Figure 12 , which is a schematic diagram of the process for resuming interrupted backup.
[0326] In S901, during the backup process, the backup service detects a backup interruption event and stops the backup.
[0327] In practical applications, after the backup starts, if the device state changes to a situation where it is not suitable to continue the backup, the backup service may interrupt the backup.
[0328] For example, the status detection module monitors any status change. The status detection module sends the status change situation to the backup service. The backup service determines that the current condition for continuing the backup is not met according to the received status change situation, that is, the backup service detects a backup interruption event, and then stops the backup.
[0329] During the automatic backup process, it is possible that the wifi network is disconnected, the charging is disconnected, or the screen is unlocked, etc.
[0330] Generally, in the case of the wifi network being disconnected, the current automatic backup is interrupted; in the case of the charging being disconnected but the battery power is still greater than 10%, the backup can continue; in the case of the charging being disconnected but the battery power is less than or equal to 10%, the automatic backup is interrupted. In the case of the screen being unlocked, the current backup can continue. The above examples are only for illustration, and in practical applications, the conditions for interrupting the backup and resuming the backup can be set according to the situation.
[0331] During the backup process, the backup service may stop backing up due to changes in the environmental state. After the backup service stops backing up, the subsequent processes will no longer be executed. Of course, in actual applications, when the environmental state meets the conditions for continued backup again within a short period of time, the backup service can continue the backup.
[0332] In actual applications, the backup interruption may also be caused by other reasons. For example, during the backup process, the user operates the interface display control of the backup application, and the content of this control can be "Stop Backup". When the user clicks this control, the current backup process can be interrupted. Errors that occur during the operation process may also cause interruptions during the backup execution.
[0333] S902. The backup service detects that the conditions for continued backup are met.
[0334] If the environmental state changes to meet the backup conditions again within a short time after the backup is interrupted, the current interrupted backup can be continued.
[0335] For example, the status detection module monitors any status change and sends the status change situation to the backup service. The backup service determines that the current conditions for continued backup are met based on the received status change situation.
[0336] In actual applications, the backup process may also be interrupted due to other reasons. If the data backup is interrupted due to other reasons, the user can also manually trigger the continued backup.
[0337] As an example, after the backup is interrupted, the backup interface of the backup application displays a control, and the content of this control can be "Continue Backup". When the user clicks this control, the continued backup can be manually triggered; the backup service executes S101 to S104 to determine that the current conditions for manual backup are met; the backup service executes S108 to S110 to successfully register for listening to the environmental state with the status detection module, which can also be understood as detecting that the conditions for continued backup are met.
[0338] In the case of a long time between the interrupted backup and the continued backup (for example, several hours have passed), the environmental state may change, and the status detection module may no longer monitor the change of the environmental state. Therefore, it is necessary to re-determine that the current conditions for manual backup are met and re-register for listening to the environmental state.
[0339] S903. The backup service sequentially searches for the application ID whose first backup stage is not backup completed in the backup data table. In the embodiments of the present application, during backup, the backup service sequentially backs up each application according to the order of the applications in the application list; therefore, the backup service sequentially searches for the application ID whose first backup stage is not backup completed in the backup data table, and this application ID is the application being backed up when the backup is interrupted.
[0340] Of course, if the backup phase of each application in the backup data table is "backup completed", the application ID with the first backup phase not being "backup completed" cannot be found. In this case, start from 801 to confirm whether the overall backup is completed.
[0341] S904, after the backup service finds the application ID with the first backup phase not being "backup completed", query the information recorded in the backup phase corresponding to the application ID.
[0342] S905, if no information is recorded in the backup phase, it means that the backup preparation phase has not been completed, so start from the backup preparation phase, that is, start from S105.
[0343] In practical applications, S108 to S110 can be skipped. This is because the status detection meets the backup conditions again, indicating that the status detection module has been monitoring the changes in the environment status.
[0344] S905, if the information recorded in the backup phase indicates the initial state, the backup service clears the information of the application ID in the data snapshot and deletes the locally cached files.
[0345] S401, after clearing the information of the application ID in the data snapshot and deleting the locally cached files, start to execute S401 and continue the backup from the data preparation phase.
[0346] If the information recorded in the backup phase indicates that the data preparation phase is completed, start to execute the application data upload phase from S501.
[0347] If the information recorded in the backup phase indicates that the application data upload is completed, start to execute the application resource file upload phase from S601.
[0348] If the information recorded in the backup phase indicates that the application resource file upload is completed, start to execute the backup completed phase from S701.
[0349] Based on the above understanding, if the current backup phase recorded in the backup data table of the application is the initial state, continue the backup from the data preparation phase; if the current backup phase recorded in the backup data table of the application is data preparation completed, continue the backup from the application data upload phase; if the current backup phase recorded in the backup data table of the application is application data upload completed, continue the backup from the application resource file upload phase; if the current backup phase recorded in the backup data table of the application is application resource file upload completed, continue the backup from the backup completed phase; if the current backup phase recorded in the backup data table of the application is backup successful, it means that the application has been backed up.
[0350] To make the above process of continuing the backup clearer, the following Figure 13Describe the subsequent backup process after interrupting the backup during the backup preparation phase. Figure 13 It is the subsequent backup process after interrupting the backup based on the Figure 6 sequence diagram shown.
[0351] After executing S110 and before successfully executing S111 to update the backup stage in the backup data table of each application to the initial state; after the environmental state changes and the environmental state does not meet the condition for continuing the backup, the electronic device starts to execute steps S223 to S226, thereby interrupting the backup.
[0352] After interrupting the backup, when the environmental state changes and meets the condition for continuing the backup, the electronic device starts to execute steps S227 to S229.
[0353] After S229, if the backup service checks that the stage in the backup data table is all empty, it continues the backup from step S105. In practical applications, S108 to S110 can be skipped. This is because if the environmental detection meets the backup condition, it means that the status detection module has been monitoring the change of the environmental state.
[0354] The processes of continuing the backup after interrupting other backup stages will not be exemplified one by one.
[0355] From the above examples, it can be understood that in the case of interrupting at any stage during the backup process, the backup can be continued according to the information recorded in the backup data table of the application, and the process of continuing the backup can avoid problems such as duplicate data upload and missing data upload.
[0356] An embodiment of the present application provides a data backup method, including:
[0357] The electronic device records the backup stage of the applications in the application list as the initial state, and the applications in the application list include the first application;
[0358] After recording as the initial state, the electronic device obtains the first attribute information of the directory file of the first application;
[0359] After obtaining the first attribute information of the directory file of the first application, the electronic device updates the backup stage of the first application to data preparation completed;
[0360] After updating the backup stage of the first application to data preparation completed, the electronic device sends the data of the first application to the server based on the first attribute information of the first application;
[0361] After sending the data of the first application to the server, the electronic device updates the backup stage of the first application to application resource file upload completed;
[0362] After the application resource file upload is completed during the backup stage of updating the first application, the electronic device receives the information indicating that the backup of the first application is completed sent by the server;
[0363] In response to the information indicating that the backup is completed, the electronic device updates the backup stage of the first application to backup completed.
[0364] It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0365] 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, the steps in the above method embodiments can be implemented.
[0366] The embodiments of the present application also 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 method embodiments.
[0367] 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 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 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, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and 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 cannot be an electrical carrier signal and a telecommunication signal.
[0368] The embodiments of the present application also provide a chip. The chip includes a processor, the processor is coupled to a memory, and 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.
[0369] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0370] 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 herein 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 this application.
[0371] The above embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this 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 recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included in the protection scope of this application.
Claims
1. A data backup method, characterized in that, it includes: The electronic device records that the backup stage of the applications in the application list is in the initial state, and the applications in the application list include the first application; After recording as the initial state, the electronic device obtains the first attribute information of the directory file of the first application; After obtaining the first attribute information of the directory file of the first application, the electronic device updates the backup stage of the first application to data preparation completed; After updating the backup stage of the first application to data preparation completed, the electronic device sends the data of the first application to the server based on the first attribute information of the first application; After sending the data of the first application to the server, the electronic device updates the backup stage of the first application to application resource file upload completed; After updating the backup stage of the first application to application resource file upload completed, the electronic device receives the information that the backup of the first application sent by the server; In response to the backup completed information, the electronic device updates the backup stage of the first application to backup completed.
2. The method according to claim 1, characterized in that, Before the electronic device updates the backup stage of the first application to data preparation completed, the method further includes: The electronic device writes the first attribute information of the directory file of the first application in the data snapshot, and the first attribute information includes the file ID; The electronic device caches the directory file of the first application in the data snapshot in the first storage space.
3. The method according to claim 2, characterized in that, After the electronic device sets the backup stage of the applications in the application list to the initial state and before the electronic device updates the backup stage of the first application to data preparation completed, the method further includes: The electronic device interrupts the backup; After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition; The electronic device queries that the backup stage of the first application is in the initial state; The electronic device clears the data snapshot of the first application and the directory file in the first storage space The electronic device reads the file scanning rule of the first application, and the file scanning rule records the backup directory; The electronic device obtains the first attribute information of the directory file of the first application from the backup directory of the first application.
4. The method according to claim 2 or 3, characterized in that, The electronic device sending the data of the first application to the server based on the first attribute information of the first application includes: The electronic device sends the directory file of the first application recorded in the data snapshot to the server; After sending each directory file of the first application, the electronic device updates the backup stage of the first application to application data upload completed; The electronic device sends the application resource file of the first application to the server; Correspondingly, after sending each application resource file of the first application, the electronic device updates the backup stage of the first application to application resource file upload completed.
5. The method according to claim 4, characterized in that, After the data preparation for the backup stage of the first application is completed by the electronic device and before the application data upload for the backup stage of the first application is completed, the method further includes: The electronic device interrupts the backup. After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition. The electronic device queries that the backup stage of the first application is that the data preparation stage has been completed. The electronic device continues to send the directory file of the first application recorded in the data snapshot to the server.
6. The method according to claim 5, wherein, The electronic device sending the application resource file of the first application to the server includes: The electronic device traverses the data snapshot to obtain a first ID without a cloud-side unique identifier, and the first ID is the file ID of the first file. The electronic device sends the first file to the server. The electronic device receives the cloud-side unique identifier of the first file sent by the server. The electronic device writes the cloud-side unique identifier of the first file in the data snapshot. The electronic device continuing to send the directory file of the first application recorded in the data snapshot to the server includes: The electronic device continues to traverse the data snapshot until there is no directory file without a cloud-side unique identifier in the data snapshot.
7. The method according to any one of claims 4 to 6, wherein, After the application data upload for the backup stage of the first application is completed by the electronic device and before the application resource file upload for the backup stage of the first application is completed, the method further includes: The electronic device interrupts the backup. After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition. The electronic device queries that the backup stage of the first application is that the application data upload stage has been completed. The electronic device continues to send the application resource file of the first application to the server.
8. The method according to claim 7, wherein, The electronic device sending the application resource file of the first application to the server includes: The electronic device queries the cloud-side unique identifier of the application resource file to obtain a second ID without a cloud-side unique identifier, and the second ID is the file ID of the first application resource file. The electronic device sends the first application resource file to the server. The electronic device receives the cloud-side unique identifier of the first application resource file sent by the server. The electronic device records the cloud-side unique identifier of the first application resource file. The electronic device continuing to send the application resource file of the first application to the server includes: The electronic device continues to query the cloud-side unique identifier of the application resource file until each application resource file has a cloud-side unique identifier.
9. The method according to any one of claims 1 to 8, wherein, Before the electronic device receives the information that the backup of the first application is completed sent by the server, the method further includes: The electronic device sends the backup completion confirmation request to the server, and the backup completion confirmation request carries the metadata of the first application, and the metadata of the first application includes the second attribute information of the application resource file.
10. The method according to claim 9, wherein, after the electronic device updates the backup stage of the first application to after the application resource file is uploaded and before the electronic device updates the backup stage of the first application to backup completed, the method further includes: The electronic device interrupts the backup; After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition; The electronic device queries that the backup stage of the first application is after the application resource file is uploaded; The electronic device resends the backup completion confirmation request to the server.
11. The method according to any one of claims 1 to 10, wherein, The applications in the application list further include a second application. After the electronic device updates the backup stage of the first application to backup completed, the method further includes: The electronic device backs up the data of the second application until the backup stage of the second application is backup completed; When the backup stage of each application in the application list is backup completed, the electronic device sends an overall backup completion confirmation request to the server, and the confirmation request carries the application list; The electronic device receives the overall backup completion information sent by the server; The electronic device generates a mark for this backup completion.
12. The method according to claim 11, wherein, After the backup stage of each application in the application list is backup completed, the method further includes: The electronic device interrupts the backup; After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition; The electronic device queries that the backup stage of each application in the file list is backup completed; The electronic device resends the overall backup completion confirmation request to the server.
13. The method according to any one of claims 1 to 12, wherein, Before the electronic device sets the backup stage of the applications in the application list to the initial state, the method further includes: The electronic device sends a backup ID application request to the server; The electronic device receives the backup ID sent by the server; The electronic device establishes a corresponding relationship between the backup ID and the application list.
14. The method according to claim 13, wherein, Before the electronic device sets the backup stage of the applications in the application list to the initial state, the method further includes: The electronic device interrupts the backup; After interrupting the backup, the electronic device detects that the device state of the electronic device meets the backup condition; The electronic device queries that the backup stage of each application in the file list is empty; The electronic device resends the backup ID application request to the server.
15. 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-14.
16. A computer-readable storage medium, characterized in that 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-14.
17. A chip, characterized in that 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-14.