Backup method and device
By packaging, compressing and backing up files smaller than a certain threshold in the terminal device, the problem of slow backup speed is solved and the efficiency of data backup and user experience are improved.
Patent Information
- Application Number
- PCT/CN2024/082322
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-21
- Filing Date
- 2024-03-19
- Publication Date
- 2024-09-26
AI Technical Summary
The existing technology causes a large number of I/O operations during the data backup process in terminal devices, especially when backing up a large number of small files, resulting in slow backup speed and affecting user experience.
By packaging and compressing the files in the user space of the first application that are smaller than a certain threshold into a compressed package, and backing up the compressed package to the user space of the second application, the number of I/O operations is reduced and the backup speed is improved.
The backup time is significantly shortened and the user experience is improved, especially when backing up a large number of small files, the backup speed is reduced from 162 seconds to 32 seconds.
Smart Images

Figure CN2024082322_26092024_PF_FP
Abstract
Description
Backup method and device Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and in particular relates to a backup method and device. Background Art
[0002] As mobile applications and their usage scenarios expand, the data stored on devices is growing in size and importance. For example, users often have dozens or even hundreds of apps installed on their phones, and their photo albums may contain tens or even hundreds of gigabytes of images. Backing up device data to the cloud is an effective way to reduce the data usage on the device's limited storage space. For another example, a user might want to back up certain key data from application A to application B to prevent data loss after uninstalling application A. All of these processes involve backup. Therefore, effectively improving backup speed is crucial to improving user experience.
[0003] Summary of the Invention
[0004] In view of this, an embodiment of the present application provides a backup method and device, which first packages and compresses files with a volume smaller than a first threshold in the user space corresponding to the first application into a first compressed package, and then backs up the first compressed package to the user space corresponding to the second application, thereby reducing the overhead caused by the I / O operations generated by backing up a large number of small-volume files between the two user spaces, reducing backup latency, and improving user experience.
[0005] A first aspect of an embodiment of the present application provides a backup method that can be applied to a terminal. The method may include: determining a first application that requires data backup; packaging and compressing files in a user space corresponding to the first application that are smaller than a first threshold value to obtain a first compressed package, and storing the first compressed package in the user space corresponding to the first application; and backing up the first compressed package from the user space corresponding to the first application to the user space corresponding to a second application. For example, the first application may be an application that requires data backup, and the second application may be a "backup app" in an embodiment of the present application, which may be an application that assists in backing up data of the application that requires data backup to a cloud server.
[0006] According to the first aspect, in a first possible implementation of the first aspect, before packaging and compressing files in the user space corresponding to the first application whose volume is smaller than a first threshold, the method further includes: scanning the files in the user space corresponding to the first application. Exemplarily, the scanning step may be performed by a kernel process.
[0007] According to the first aspect and any of the aforementioned possible implementations of the first aspect, in a second possible implementation of the first aspect, the method further includes: generating a first briefing file, wherein the first briefing file is used to record information about files that need to be backed up in the user space corresponding to the first application. Exemplarily, the step of generating the first briefing file may be performed by a kernel process.
[0008] According to the second possible implementation of the first aspect, in a third possible implementation of the first aspect, the files that need to be backed up in the user space corresponding to the first application include: files whose hash values have changed in the user space corresponding to the first application, and / or, newly added files in the user space corresponding to the first application. It is understood that the terminal's file system may record metadata corresponding to each file, which may include the hash value of the file, and different files have different hash values. If the hash value of a file changes, it indicates that the file has been modified.
[0009] According to the second possible implementation of the first aspect, in a fourth possible implementation of the first aspect, the information about the files to be backed up in the user space corresponding to the first application includes: the file names and volumes of the files to be backed up in the user space corresponding to the first application. In other words, the first briefing file may record the file names and volumes of the files to be backed up in the user space corresponding to the first application, thereby facilitating the terminal to determine, based on the first briefing file, the files to be packaged and compressed into the first compressed package.
[0010] According to the second to fourth possible implementations of the first aspect, in a fifth possible implementation of the first aspect, the method further includes: generating a second presentation file based on the first presentation file, the second presentation file being used to record information about files recorded in the first presentation file whose volume is smaller than a first threshold. Exemplarily, the step of generating the second presentation file may be performed by a second application, which may be configured by a developer to determine, based on the first threshold, files recorded in the first presentation file whose volume is smaller than the first threshold, and record information about these files in the second presentation file.
[0011] According to the fifth possible implementation of the first aspect, in the sixth possible implementation of the first aspect, the step of packaging and compressing files in the user space corresponding to the first application whose volume is smaller than a first threshold to obtain a first compressed package specifically includes: packaging and compressing the files recorded in the second briefing file in the user space corresponding to the first application according to the second briefing file to obtain the first compressed package. In one possible implementation, the second application may send the second briefing file to the kernel process, so that the kernel process, based on the second briefing file, packages and compresses the files recorded in the second briefing file in the user space corresponding to the first application, i.e., the files whose volume is smaller than the first threshold, to obtain the first compressed package.
[0012] According to the first aspect and any of the foregoing possible implementations of the first aspect, in a seventh possible implementation of the first aspect, after backing up the first compressed package from the user space corresponding to the first application to the user space corresponding to the second application, the method further includes: deleting the first compressed package in the user space corresponding to the first application. This reduces the storage space occupied by the terminal by the compressed packages generated during the backup process.
[0013] According to the first aspect, and any of the above-mentioned possible implementations of the first aspect, in an eighth possible implementation of the first aspect, the method further includes: sending the first compressed package in the user space corresponding to the second application to the cloud server. In other words, the terminal can synchronize the first compressed package backed up in the user space corresponding to the second application to the cloud server, thereby completing the cloud backup process. The user can subsequently uninstall the first application from the terminal without worrying about data loss in the first application.
[0014] According to the first aspect, and any of the above-mentioned possible implementations of the first aspect, in a ninth possible implementation of the first aspect, the method further includes: deleting the first compressed package in the user space corresponding to the second application. This step can be performed after the first compressed package in the user space corresponding to the second application is sent to the cloud server. In other words, after completing the cloud backup process, the terminal can delete the first compressed package backed up to the user space corresponding to the second application, thereby reducing the terminal storage space occupied by the compressed packages generated during the backup process.
[0015] According to the ninth possible implementation of the first aspect, in a tenth possible implementation of the first aspect, during the process of sending the first compressed package in the user space corresponding to the second application to the cloud server, the method further includes: displaying a first interface of the second application, wherein the first interface includes a prompt indicating that data is being synchronized with the cloud server, thereby facilitating the user to know which stage of the cloud backup process has been reached.
[0016] According to the first aspect, and any of the above-mentioned possible implementations of the first aspect, in the eleventh possible implementation of the first aspect, the steps of packaging and compressing files in the user space corresponding to the first application whose volume is less than the first threshold to obtain a first compressed package, and backing up the first compressed package from the user space corresponding to the first application to the user space corresponding to the second application are performed by a kernel process. Exemplarily, the kernel process can be the installd process, or it can be another process with permission to back up data from one user space to another user space. The kernel process can be a kernel process native to the operating system, or it can be a kernel process confidently developed by the developer.
[0017] According to the first aspect, and any one of the above-mentioned possible implementations of the first aspect, in the twelfth possible implementation of the first aspect, the method also includes: displaying a second interface of the second application, wherein the second interface includes a start backup control; in response to an operation acting on the start backup control, the terminal executes the step of packaging and compressing files in the user space corresponding to the first application whose volume is smaller than a first threshold to obtain a first compressed package.
[0018] According to the first aspect, and any of the aforementioned possible implementations of the first aspect, in a thirteenth possible implementation of the first aspect, during the process of packaging and compressing files in the user space corresponding to the first application whose volume is less than a first threshold to obtain a first compressed package, the method further includes: displaying a third interface of the second application, wherein the third interface includes a prompt indicating that data is being prepared and / or a prompt prompting the user not to use the first application. This facilitates the user's understanding of the current stage of the cloud backup process, thereby preventing the user from using the first application and affecting the smooth execution of the backup process.
[0019] According to the first aspect, and any of the above-mentioned possible implementations of the first aspect, in the fourteenth possible implementation of the first aspect, the method further includes: sequentially backing up files in the user space corresponding to the first application whose volume is greater than or equal to the first threshold to the user space corresponding to the second application. In other words, for files with larger volumes, the backup method provided in the embodiment of the present application can skip the packaging and compression steps and directly back up these larger files sequentially to the user space corresponding to the second application. This achieves a balance between the overhead generated by I / O operations and the overhead generated by packaging and compression operations.
[0020] A second aspect of an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores instructions. When the instructions are executed by the processor, the electronic device is configured to execute the method provided by the first aspect and any one of the above-mentioned possible implementation methods of the first aspect.
[0021] A third aspect of an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed, an electronic device equipped with the computer-readable storage medium executes the method provided by the first aspect and any one of the above-mentioned possible implementations of the first aspect.
[0022] A fourth aspect of an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, an electronic device installed with the computer program product executes the method provided by the first aspect and any one of the above-mentioned possible implementations of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] FIG1 is a schematic diagram of a data backup provided by an embodiment of the present application;
[0024] FIG2 is a schematic diagram of a file backup between user spaces provided by an embodiment of the present application;
[0025] FIG3 is a schematic diagram of another file backup between user spaces provided by an embodiment of the present application;
[0026] FIG4 is a flowchart of a backup method provided by an embodiment of the present application;
[0027] 5A-5H are user interface diagrams of a set of cloud backup processes provided by an embodiment of the present application;
[0028] FIG6 is a schematic diagram of a first presentation file and a second presentation file provided in one embodiment of the present application;
[0029] FIG7 is a schematic diagram of another file backup between user spaces provided by an embodiment of the present application;
[0030] FIG8 is a flowchart of another backup method provided by an embodiment of the present application;
[0031] FIG9 is a schematic structural diagram of a backup device provided in one embodiment of the present application;
[0032] FIG10 is a schematic structural diagram of an electronic device provided in one embodiment of the present application;
[0033] FIG11 is a schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0035] When using a terminal, users often need to back up their data. Improving the backup speed is crucial to improving the user experience.
[0036] This application will now describe the backup method and apparatus provided by the embodiments of this application, using the example of backing up data in a terminal to the cloud, a scenario requiring data backup. However, it should be understood that this does not limit the backup method and apparatus provided by the embodiments of this application. The backup method and apparatus provided by the embodiments of this application can be applied to any scenario requiring backup. For example, it can also be applied to a scenario where data from one application is backed up to another application.
[0037] Figure 1 illustrates a schematic diagram of a terminal 10 backing up data from a first application (APP) to a cloud server 20. As shown in Figure 1 , the terminal 10 has a first APP and a backup APP installed. The first APP may be the APP that needs to back up data, and the backup APP may be an APP that assists in backing up data from the APP that needs to be backed up to the cloud server 20.
[0038] It is understood that the backup app can be an app developed or provided by the terminal manufacturer and pre-installed on the terminal for cloud backup services, or it can be an app provided by a third-party manufacturer and downloaded from the application market and later installed on the terminal for cloud backup services. The former is exemplified by the "Cloud Space" pre-installed on Huawei terminals, while the latter is exemplified by "Baidu Cloud."
[0039] Cloud server 20 may be a server provided, operated, or maintained by the manufacturer that provides the backup app. For example, if the backup app is "Cloud Space," cloud server 20 may be a server provided, operated, or maintained by Huawei; if the backup app is "Baidu Cloud," cloud server 20 may be a server provided, operated, or maintained by Baidu.
[0040] The first APP may include APPs pre-installed on the terminal 10, such as text messages, calendars, memos, recordings, galleries, etc., and may also include APPs installed by the user on the terminal 10, such as WeChat, Weibo, Honor of Kings, etc. downloaded and installed by the user through the application market.
[0041] As shown in Figure 1, each APP installed in the terminal 10 corresponds to a user space (User Space) for storing the data of the APP. The user space can also be called a "sandbox". The user space corresponding to each APP can be used to store part or all of the data associated with the APP, including but not limited to data generated by the user in the process of using the APP (such as cached data), code segment data corresponding to the APP, multimedia data obtained through the APP, etc. Each user space can correspond to a storage area in the storage device (such as a disk) of the terminal 10.
[0042] Each app has permission to operate data stored in its own user space, but generally does not have permission to directly operate data stored in other apps' user spaces. This mechanism helps achieve data isolation and control, improving data security.
[0043] In the scenario shown in FIG1 , the backup APP has the authority to operate the data stored in the user space corresponding to the backup APP, but generally does not have the authority to directly operate the data stored in the user space corresponding to the first APP.
[0044] In the process of backing up the data of the first app to the cloud server 20 using the backup app, the backup app first needs to call a process with higher operating permissions, such as a kernel process, and use this process to back up the data in the user space corresponding to the first app to the user space corresponding to the backup app. Then, the backup app transmits the data backed up in the user space corresponding to the backup app to the cloud server 20. In this way, the process of backing up the data of the first app installed on the terminal 10 to the cloud server 20 is completed.
[0045] In some possible implementations, the above-mentioned "having higher operating permissions" can be having administrator permissions, or having root permissions. The above-mentioned "kernel process" can be, for example, the installd process in kernel state, or other kernel processes with the same priority as the installd process, including but not limited to the zygote process, servicemanager process, media process, ueventd process, healthd process, logd process, adbd process, lmkd process, console process, vold process, netd process, debuggerd process, debuggerd64 process, ril-daemon process, surfaceflinger process, and the like. It should be understood that the embodiments of the present application do not limit which kernel process or processes the kernel process is. Those skilled in the art can select any one or more of the above-mentioned kernel processes according to actual needs, or can modify the kernel code to develop a kernel process by themselves for data backup between different user spaces.
[0046] It is understandable that the data may exist in the form of files in the terminal 10. Therefore, the process of backing up the data is the process of backing up the files one by one.
[0047] Figure 2 exemplifies a schematic diagram of file backup between user spaces. As shown in Figure 2, the user space corresponding to the first APP stores 16 files. As mentioned above, different user spaces correspond to different storage areas in the storage device. Backing up files from one storage area to another storage area requires read and write operations, generating input and output (Input / Output) operations, referred to as "I / O operations". Therefore, in the scenario shown in Figure 2, backing up the 16 files stored in the user space corresponding to the first APP to the user space corresponding to the backup APP will generate at least 16 I / O operations. The software and hardware resources of the operating system are limited, and a large number of I / O operations will bring huge system overhead and affect the backup speed. It should be understood that Figure 2 is only an example. In actual backup scenarios, the number of files that need to be backed up in a user space may be as many as dozens or hundreds. The large number of I / O operations generated by backing up a large number of files will seriously affect the backup speed and affect the user experience.
[0048] In view of this, as shown in Figure 3, an embodiment of the present application provides a backup method that first packages and compresses multiple files in the user space corresponding to the first app that needs data backup (or file backup) into a first compressed package (such as "1.tar" in Figure 3), and then backs up the first compressed package to the user space corresponding to the backup app. This can greatly reduce the number of I / O operations, achieving the beneficial effects of improving backup speed and user experience.
[0049] The inventors discovered in experiments that the large number of I / O operations generated by backing up a large number of files with smaller volumes using the method shown in FIG2 is the key to affecting the backup speed. The I / O operations generated by backing up files with larger volumes have a relatively small impact on the backup speed, but packaging and compressing files with larger volumes will bring about a higher time or space overhead. Therefore, in a possible implementation, the backup method provided by the embodiment of the present application can also first determine large files and small files (for example, files with a file volume less than a certain threshold value are determined as small files, or files with a file volume greater than a certain threshold value are determined as large files), and only small files are backed up using the method shown in FIG3 , while large files are still backed up using the method shown in FIG2 . This can thereby specifically reduce the impact of the I / O operations generated by backing up small files on the backup speed.
[0050] Next, possible specific implementations of the backup method provided in the embodiments of the present application will be further described with reference to the accompanying drawings.
[0051] Figure 4 exemplarily shows a flowchart of a backup method provided by an embodiment of the present application. The method may include steps S401-S409. The method shown in Figure 4 can be applied to the scenario in which the terminal 10 as shown in Figure 1 backs up the data of the first APP to the cloud server 20, and can be understood as a further refinement of the backup method in this scenario. Therefore, the aforementioned introduction and description related to Figure 1 are also applicable to the embodiment shown in Figure 4, and will not be repeated here. The execution process of the method shown in Figure 4 can occur in the process of a Huawei mobile phone displaying the interface shown in Figures 5A-5H, so for the sake of convenience of description, Figures 5A-5H are first introduced, and then the backup method shown in Figure 4 is introduced in combination with Figures 5A-5H.
[0052] This embodiment of the present application is described using the example of a Huawei mobile phone (e.g., Mate50Pro) as the terminal 10 and the backup app "Cloud Space." As shown in FIG5A , a Cloud Space icon is displayed on the Huawei mobile phone's home screen. The user can click this icon to open the Cloud Space app. In response to opening the Cloud Space, the Huawei mobile phone may display the Cloud Space homepage interface shown in FIG5B . This homepage interface may include the user's logged-in Huawei account information, such as the account name "188******00" and profile picture. The homepage interface may also include the Cloud Space usage of the Huawei account. As shown in FIG5B , the Cloud Space has a total of 5GB, of which 3.6GB is currently used. The homepage interface may also include the data categories of the used Cloud Space, such as Gallery, Cloud Backup, and Other. The homepage interface may also include information about the terminal devices logged in with the Huawei account that can perform Cloud backup (such as the device name and the time of the last backup). As shown in FIG5B , the last backup time of the Mate50Pro (the current device) is 23:00 on March 1, 2023, and the last backup time of the HUAWEI Mate30 is 12:17 this morning. The home page interface may also include other functions such as searching for devices.
[0053] In response to clicking on the terminal device "Mate 50 Pro" that can perform cloud backup, the Huawei phone can display the cloud backup interface corresponding to "Mate 50 Pro" as shown in Figure 5C. The cloud backup interface can include prompt information, such as "Your Mate 50 Pro has not been backed up for 3 days." The cloud backup interface can also include operation options to turn on or off the cloud backup function, setting options for the automatic backup frequency (as shown in Figure 5C, set to once every 7 days), backup options, and options for managing backup data. Among them, the total number of apps installed in the Mate 50 Pro that can perform cloud backup, and the number of apps installed in the Mate 50 Pro that have turned on the cloud backup function can also be displayed under the backup options. As shown in Figure 5C, "4 / 5 items" means that there are a total of 5 apps that can perform cloud backup, of which 4 apps have the cloud backup function turned on, and the cloud backup function of the remaining 1 app is not turned on (or has been turned off).
[0054] In response to clicking the backup option, the Huawei phone may display the backup options interface as shown in Figure 5D. The backup options interface can be used to enable or disable cloud backup for specific apps. As shown in Figure 5D, cloud backup is enabled for four apps: Messages, Gallery, Voice Recordings, and Notes, while it is disabled for WeChat. Users can adjust the cloud backup status of the apps displayed on the backup options interface by clicking the on / off button. The backup options interface may include information about apps eligible for cloud backup, such as the app's identifier (e.g., name, icon) and the volume (or size) of the data available for cloud backup for each app. As shown in Figure 5D, the data available for cloud backup for "Messages" is 1.5MB, for "Gallery" is 155MB, and so on. In one possible implementation, the backup options interface may also categorize pre-installed apps on the Huawei phone and user-installed apps. As shown in Figure 5D, WeChat is displayed under the "Third-Party Application Data" category, distinguishing it from pre-installed apps such as Messages, Gallery, Voice Recordings, and Notes.
[0055] In one possible implementation, the backup options interface may further display an add control (not shown in FIG5D ), and the user may click the add control to add an app that is not displayed in the backup options interface to the backup interface. Correspondingly, the backup options interface may further display a delete control (not shown in FIG5D ), and the user may click the delete control to delete an app that is displayed in the backup options interface from the backup options interface.
[0056] As shown in Figure 5E, in response to clicking the "Start Backup" button, the Huawei phone displays the interface shown in Figure 5F and begins data preparation. The interface shown in Figure 5F may include a prompt message to remind the user that data is currently being prepared and to remind the user not to frequently use the apps selected in the backup option. In Figure 5F, the "Start Backup" button corresponding to Figure 4E can be changed to a "Pause Backup" button. When the Huawei phone displays the interface shown in Figure 5F, the user can pause data preparation by clicking the Pause Backup button.
[0057] When data preparation is complete, the Huawei phone may display the interface shown in Figure 5G and begin data upload. The interface shown in Figure 5G may include a prompt message to inform the user that the current data preparation is complete and the user can use the selected APP in the backup option. Similar to Figure 4F, the interface shown in Figure 5G may also display a "Pause Backup" button, and the user can pause data upload by clicking the Pause Backup button.
[0058] When the data upload is complete, meaning the data backup process from the Huawei phone to the cloud server is complete, the Huawei phone may display the interface shown in Figure 5H. This completes the user-triggered process of backing up the Mate 50 Pro's local data to the cloud server. The interface shown in Figure 5H may include a prompt message to inform the user that the data backup is complete, and may also display a prompt message to inform the user that no backup data is currently available.
[0059] During the process of the Huawei mobile phone displaying the interface as shown in Figures 5A-5H, in one possible implementation, steps S401-S408 in the embodiment of Figure 4 may occur after the user clicks the "Start Backup" button as shown in Figure 5E and before the data upload interface as shown in Figure 5G is displayed, and step S409 in the embodiment of Figure 4 may occur during the process of displaying the data upload interface as shown in Figure 5G.
[0060] S401: The backup APP determines the first APP that needs to back up data.
[0061] As mentioned above, the first APP is an APP that needs to perform data backup, and the backup APP is an APP that assists in backing up the data of the APP that needs to perform data backup to the cloud server 20.
[0062] Taking the terminal 10 as a Huawei mobile phone and the backup APP as "Cloud Space" as an example, the user can manually turn on or off the cloud backup function of the APP that can be cloud-backed up through the interface shown in Figure 5D; the user can manually add or delete the APP that can be cloud-backed up through the interface shown in Figure 5D (not shown in Figure 5D).
[0063] In one possible implementation, when a user clicks the "Start Backup" button as shown in Figure 5E, the cloud space identifies the app with the cloud backup function enabled at that time as the first app to be backed up. Referring to the example of Figures 5A-5H, when the user clicks the "Start Backup" button as shown in Figure 5E, the cloud backup function of the four apps (Messages, Gallery, Recordings, and Memos) is enabled. Therefore, in this example, the first apps include Messages, Gallery, Recordings, and Memos.
[0064] S402. The backup APP calls the installd process, triggering the installd process to scan the files in the user space corresponding to the first APP.
[0065] In one possible implementation, after determining in step S401 that a first app requires data backup, the backup app can inform the installd process of the first app's information, which in turn causes the installd process to scan the files in the user space corresponding to the first app based on the first app's information. Referring to the examples in Figures 5A-5H , the first app's information can include the names or identifiers of four apps: Information, Gallery, Recording, and Memos. Consequently, the installd process scans the files in the user space corresponding to each of these four apps.
[0066] The scanning process can be understood as the process in which the installd process determines the files that actually need to be backed up in the user space corresponding to the first APP. It can be understood that the file system of the terminal 10 stores metadata information corresponding to each file, which may include the hash value of the file. The installd process can determine whether the file has been modified compared to the last scan, or whether it is a new file added after the last scan based on the hash value of each file. The installd process can determine the files whose hash values have changed and the newly added files as the files that actually need to be backed up. For files whose hash values have not changed compared to the last scan, the installd process may consider that they do not need to be backed up.
[0067] S403. The installd process generates a first briefing file, which is used to record information about files that need to be backed up in the user space corresponding to the first APP.
[0068] In one possible implementation, the installd process scans the user space corresponding to the first app, determines the files that actually need to be backed up (such as files whose hash values have changed compared to the last scan and newly added files), and records the information of these files that actually need to be backed up in a first briefing file. The first briefing file can be stored in the memory of the terminal 10.
[0069] For example, the first briefing file can be a text file in ".txt" format, which records the file names of the files that actually need to be backed up after the installd process scans the user space of the first APP, and can also record the volume (or size) corresponding to each file that actually needs to be backed up. It can be understood that if there are multiple first APPs, the installd process can generate a first briefing file for each APP in the first APP.
[0070] The example in Figure 6 shows a schematic diagram of the first briefing file. As shown in Figure 6, the user space corresponding to the first app includes 24 files, of which the installd process scans and determines that "1.txt", "2.txt", "3.png", "4.png", "5.jpg", "6.txt", "7.doc", and "8.doc" are files that need to be backed up. The installd process can then generate the first briefing file shown in Figure 6, which records the file name information and file size information of these 8 files.
[0071] S404. The installd process sends the first briefing file to the backup APP.
[0072] In some possible implementations, the installd process may send the first briefing file generated in step S403 to the backup APP, so that the backup APP may learn information about files that need to be backed up this time in the user space corresponding to the first APP through the first briefing file.
[0073] In other possible implementations, step S404 may not be performed. Instead, the installd process may send the address where the first briefing file is stored to the backup app, so that the backup app can read the first briefing file from the address to obtain information about the files in the user space corresponding to the first app that need to be backed up. For example, the installd process may send a pointer to the first briefing file to the backup app.
[0074] S405. The backup APP generates a second briefing file based on the first briefing file. The second briefing file is used to record information about files in the first briefing file whose volume is smaller than the first threshold.
[0075] In one possible implementation, the backup app developer configures a preset policy within the backup app, so that the backup app generates a second briefing file based on the first briefing file based on the preset policy. For example, the preset policy may include recording information about files whose size is smaller than a first threshold in the second briefing file. The second briefing file may be stored in the memory of terminal 10.
[0076] For example, the second briefing file can be a text file in ".txt" format, which records information about files in the first briefing file whose file size is less than the first threshold. It is understood that if there are multiple first apps, the backup app can generate a second briefing file for each app in the first app.
[0077] In the example of Figure 6, a schematic diagram of the second briefing file is shown as an example. As shown in Figure 6, the file name information and file size information of 8 files are recorded in the first briefing file. Assuming that the first threshold is 2MB, the backup APP records the information of files with a file size less than 2MB in the second briefing file. As shown in Figure 6, the size (or volume) of "1.txt", "2.txt", "3.png", "5.jpg", "6.txt", and "7.doc" is less than 2MB, and the size of "4.png" and "8.doc" is greater than 2MB. Therefore, the second briefing file generated by the backup APP includes the information of the 6 files "1.txt", "2.txt", "3.png", "5.jpg", "6.txt", and "7.doc", but does not include the information of the 2 files "4.png" and "8.doc". As shown in Figure 6, the information of the files in the second briefing file can only include the file name information, thereby reducing the size of the second briefing file. Of course, the second briefing file can also include both file name information and file size information (not shown in Figure 6).
[0078] S406. The backup APP sends the second briefing file to the installd process.
[0079] In some possible implementations, the backup APP can send the second briefing file generated in step S405 to the installd process, so that the installd process can know through the second briefing file which files in the user space corresponding to the first APP need to be packaged and compressed before being backed up to the user space corresponding to the backup APP.
[0080] In other possible implementations, step S405 may not be performed. Instead, the backup app may send the address where the second briefing file is stored to the installd process, so that the installd process can read the second briefing file from the address to determine which files in the user space corresponding to the first app should be packaged and compressed before being backed up to the user space corresponding to the backup app. For example, the backup app may send a pointer to the second briefing file to the installd process.
[0081] S407. The installd process packages and compresses the files whose volume is smaller than the first threshold in the user space corresponding to the first APP according to the second briefing file to obtain a first compressed package, and stores the first compressed package in the user space corresponding to the first APP.
[0082] Specifically, the installd process packages and compresses the files recorded in the second briefing file in the user space corresponding to the first APP (that is, files with a volume smaller than the first threshold) according to the information recorded in the second briefing file, obtains a first compressed package, and stores it in the user space corresponding to the first APP.
[0083] For example, as shown in FIG7 , combined with the example of FIG6 , assuming that the second briefing file is as shown in FIG6 , the installd process will package and compress the six files “1.txt”, “2.txt”, “3.png”, “5.jpg”, “6.txt”, and “7.doc” in the user space corresponding to the first APP into a first compressed package “1.tar” based on the information of the six files “1.txt”, “2.txt”, “3.png”, “5.jpg”, “6.txt”, and “7.doc” recorded in the second briefing file. However, the installd process will not package and compress the two files “4.png” and “8.doc” recorded in the first briefing file but not in the second briefing file.
[0084] It is understood that "1.tar" in Figure 7 is only an example of the first compressed file. The first compressed file in the backup method provided in the embodiment of the present application may also be a compressed file in other file formats, such as ".zip".
[0085] Optionally, after the installd process packages and compresses files in the user space corresponding to the first app that are smaller than a first threshold value based on the second briefing file and obtains a first compressed package, the terminal 10 can execute an operation to delete the second briefing file. This prevents the second briefing file generated during the backup process from occupying the storage space of the terminal 10. Specifically, the deletion operation can be executed by the installd process, or by the backup app after the installd process notifies the backup app. This application does not limit this.
[0086] S408. The installd process backs up the first compressed package from the user space corresponding to the first APP to the user space corresponding to the backup APP.
[0087] In a possible implementation, after the installd process obtains the first compressed package, step S408 is executed to back up the first compressed package from the user space corresponding to the first APP to the user space corresponding to the backup APP.
[0088] As mentioned above, in the implementation shown in Figure 2, if the files in the user space corresponding to the first APP are not packaged and compressed, the installd process will need to perform the same number of I / O operations as the number of files that need to be backed up, resulting in a large amount of system overhead. If there are a large number of small files with relatively small volumes in the user space corresponding to the first APP, the overhead generated by the I / O operation will become non-negligible compared to the overhead generated by the backup operation itself. This seriously affects the speed of file backup. In view of this, in the backup method provided in the embodiment of the present application, for such a large number of small files, they are first packaged and compressed into a compressed package in the user space corresponding to the first APP, and then the compressed package is backed up from the user space corresponding to the first APP to the user space corresponding to the backup APP. This can greatly reduce the overhead of I / O operations generated by backing up small files individually between user spaces in sequence, thereby greatly speeding up the file backup and improving the user experience.
[0089] Optionally, after step S408 is completed, an operation of deleting the first compressed package in the user space corresponding to the first APP may be performed, thereby reducing the storage space occupied by the first compressed package generated during the backup process on the terminal 10. In some possible implementations, the operation of deleting the first compressed package in the user space corresponding to the first APP may be performed by the installd process. In other possible implementations, the operation of deleting the first compressed package in the user space corresponding to the first APP may also be performed by the first APP or triggered by the installd process to be performed by the first APP.
[0090] In some possible implementations, there may be files whose file information is included in the first briefing file but not in the second briefing file. In other words, among the files to be backed up, there are files whose size is larger than the first threshold. For such files, the method shown in Figure 2 can still be used. The installd process will sequentially back up each file whose size is larger than the first threshold from the user space corresponding to the first app to the user space corresponding to the backup app. It is understood that for ease of description, this process is not shown in Figure 4.
[0091] In the example of Figure 7, since the size of the two files "4.png" and "8.doc" is greater than the first threshold value, i.e., 2MB, the installd process can still use the method shown in Figure 2 to back up the two files "4.png" and "8.doc" from the user space corresponding to the first APP to the user space corresponding to the backup APP in turn.
[0092] It can be understood that when backing up files with larger volumes between user spaces, the overhead generated by the I / O operation is relatively small, while performing a packing and compression operation on files with larger volumes will generate a larger overhead. Therefore, the backup method provided in the embodiment of the present application can only perform a backup between user spaces in the manner shown in Figure 3 for files with smaller volumes, and still perform a backup between user spaces in the manner shown in Figure 2 for files with larger volumes. In this way, a balance is achieved between the overhead generated by the I / O operation and the overhead generated by the packing and compression, and the benefits are maximized. When those skilled in the art actually apply the method provided in the embodiment of the present application, they can obtain the optimal first threshold value for software and hardware products with different performances through experimental testing. The above only uses 2MB as an example of the first threshold value.
[0093] Optionally, after the installd process backs up the files in the user space corresponding to the first app that are larger than the first threshold to the user space corresponding to the backup app, the terminal 10 can delete the first briefing file. This prevents the first briefing file generated during the backup process from occupying the storage space of the terminal 10. Specifically, the deletion operation can be performed by the installd process, or by the first app after the installd process notifies the first app. This application does not limit this.
[0094] In some possible implementations, taking the terminal 10 as a Huawei mobile phone and the backup APP as "Cloud Space" as an example, the Huawei mobile phone can start executing steps S401-S408 in response to the user clicking the "Start Backup" button as shown in Figure 5E. At the same time, in response to clicking the "Start Backup" button as shown in Figure 5E, the Huawei mobile phone can display the interface shown in Figure 5F. During the execution of steps S401-S408, the Huawei mobile phone is preparing the data to be backed up, so it can display the interface shown in Figure 5F, prompting the user that the data is currently being prepared and reminding the user not to frequently use the applications selected in the backup option that need to be backed up in the cloud. When step S408 is completed, that is, the data preparation is completed, and the first compressed package has been backed up from the user space corresponding to the first APP to the user space corresponding to the cloud space, the Huawei mobile phone can display the interface shown in Figure 5G, that is, the Huawei mobile phone starts to execute step S409.
[0095] It is understood that, for ease of description, although the embodiment of FIG4 does not illustrate the process of backing up files larger than the first threshold from the user space corresponding to the first app to the user space corresponding to the backup app, this does not mean that this step has not been performed. Before executing step S409, it is understood that the installd process has also completed the process of backing up files larger than the first threshold (if any) from the user space corresponding to the first app to the user space corresponding to the backup app.
[0096] S409. The backup APP synchronizes the first compressed package to the cloud server 20.
[0097] The terminal 10 has a function of communicating with the cloud server 20, for example, communicating with the cloud server 20 through a cellular communication network or a WiFi network accessed by the terminal 10. The terminal 10 synchronizes the first compressed package to the cloud server 20 through the network.
[0098] It can be understood that step S409 is a necessary step for the scenario of synchronizing the data of the first APP to the cloud server 20. If the scenario is to back up the data of the first APP to another APP to prevent the data of the first APP from being lost after the first APP is deleted (the cloud server 20 may not be set), step S409 may not be performed.
[0099] After the backup app synchronizes the first compressed package to the cloud server 20, the terminal 10 can delete the first compressed package from the user space corresponding to the backup app. In some possible implementations, the backup app can perform this operation; in other possible implementations, the installd process can perform this operation, or the installd process can trigger the backup app to perform this operation. This reduces the storage space occupied by the first compressed package generated during the backup process on the terminal 10.
[0100] It is understood that, for ease of description, although the embodiment of FIG. 4 does not illustrate the process of synchronizing files larger than the first threshold from the user space corresponding to the backup app to the cloud server 20, this does not mean that this step has not been performed. During the execution of step S409, it is understood that the backup app has also completed the process of synchronizing files larger than the first threshold (if any) from the user space corresponding to the backup app to the cloud server 20.
[0101] Accordingly, after completing the synchronization of files (if any) with a size larger than the first threshold from the user space corresponding to the backup app to the cloud server 20, the terminal 10 may also execute an operation to delete files with a size larger than the first threshold in the user space corresponding to the backup app. This deletion operation may be executed by the backup app, by the installd process, or by the installd process triggering the backup app to execute. This reduces the storage space occupied by the backup files generated during the backup process on the terminal 10.
[0102] Optionally, after the cloud server 20 obtains the first compressed package sent by the terminal 10, it can perform a decompression operation on the first compressed package to obtain the files in the first compressed package.
[0103] In some other possible implementations, after the backup APP obtains the first compressed package, it may first decompress the first compressed package and then synchronize the data in the first compressed package to the cloud server 20.
[0104] It should be understood that the embodiment of FIG4 is merely described using the installd process as an example of a possible implementation method, and this does not constitute a limitation on the backup method provided in the embodiment of the present application. The installd process can be replaced by other processes that can implement the above-mentioned functions, such as processes with higher permissions such as performing read and write operations on files in user space, such as kernel processes. Specifically, it can be replaced by a kernel process with the same priority as the installd process, which has been described above and will not be repeated here.
[0105] In other possible implementations, those skilled in the art may develop a new kernel process for executing the backup method provided in the embodiments of the present application instead of using the existing kernel process of the operating system, or rewriting the existing kernel process of the operating system to enable it to execute the backup method provided in the embodiments of the present application. Regardless of the implementation method, any process that can execute the same function as the installd process in the backup method provided in the embodiments of the present application can be understood as an equivalent replacement for the installd process.
[0106] It should be understood that in the embodiment of Figure 4, the first briefing file and the second briefing file are used as the medium for transmitting information about files in the user space corresponding to the first APP between the installd process and the backup APP. However, this does not constitute a limitation on the backup method provided in the embodiment of the present application. Those skilled in the art may also adopt other methods in actual application to realize the interaction of information about files in the user space corresponding to the first APP between the installd process and the backup APP. For example, the installd process may also store the information about the files that need to be backed up this time in the user space corresponding to the first APP obtained by scanning into a list variable and pass it to the backup APP; the backup APP may also store the information about the files in the user space corresponding to the first APP that need to be packaged and compressed into the first compressed package into another list variable and pass it to the installd process.
[0107] That is to say, the first briefing file in the embodiment of Figure 4 can be replaced by an implementation method such as "first information medium", and the second briefing file can be replaced by an implementation method such as "second information medium" without changing the technical essence of the backup method provided in the embodiment of the present application.
[0108] The inventor designed an experiment to store 2,000 small files of 1MB in the user space corresponding to the first APP. Under the same network connection conditions, if the backup method provided in the embodiment of the present application is not applied, the cloud backup process shown in Figures 5E-5H will be completed in 162 seconds; if the backup method provided in the embodiment of the present application is applied, the cloud backup process shown in Figures 5E-5H will be completed in only 32 seconds. It can be seen that the method provided in the embodiment of the present application achieves the beneficial technical effect of significantly reducing the backup time by first packaging and compressing the files in the user space corresponding to the first APP to obtain a first compressed package, and then backing up the first compressed package from the user space corresponding to the first APP to the user space corresponding to the backup APP.
[0109] Figure 8 exemplarily shows a flowchart of a backup method provided by an embodiment of the present application. The method may include steps S801-S805. The method shown in Figure 8 can be applied to the scenario in which the terminal 10 shown in Figure 1 backs up the data of the first APP to the cloud server 20, and can be understood as a further refinement of the backup method in this scenario. Therefore, the aforementioned introduction and description related to Figure 1 also apply to the embodiment shown in Figure 8, and will not be repeated here. The execution process of the method shown in Figure 8 can occur in the process of a Huawei mobile phone displaying the interface shown in Figures 5A-5H. Figures 5A-5H have been introduced above and will not be repeated here.
[0110] The backup method shown in FIG8 differs from the backup method shown in FIG4 in that certain steps previously performed by the backup app in FIG8 (such as the step of determining the files in the user space corresponding to the first app whose volume is less than a first threshold, such as step S405) are now performed by the kernel process (corresponding to the installd process in the embodiment of FIG4). This simplifies the communication process between the kernel process and the backup app through the first and second briefing files.
[0111] In other words, the backup method shown in Figure 8 does not rely on the existence of the first and second briefing files. After executing step S801, the backup app calls the kernel process, triggering the kernel process to execute step S802. The kernel process then completes the process of determining the files in the user space corresponding to the first app that are smaller than the first threshold. This eliminates the need for the kernel process to first send the first briefing file back to the backup app, then for the backup app to determine the files that are smaller than the first threshold from the first briefing file, and then generate the second briefing file.
[0112] After the kernel process scans the files in the user space corresponding to the first APP, the files whose volume is smaller than the first threshold can be packaged and compressed into a first compressed package and stored in the user space corresponding to the first APP, and then step S804 is executed (similar to step S408 of the embodiment of Figure 4, which will not be repeated).
[0113] Compared to the embodiment shown in Figure 4 , the embodiment shown in Figure 8 can, on the one hand, reduce the communication and information transmission overhead between the kernel process and the backup app. However, on the other hand, because the kernel process is typically used to perform a large number of various operations, the implementation of Figure 8 will occupy a large amount of computing resources of the kernel process, which may affect the kernel process's execution of other tasks of the operating system.
[0114] In specific implementations, those skilled in the art may also configure the terminal 10 to use the implementation shown in FIG4 and the implementation shown in FIG8 in different scenarios. For example, when the kernel process load is high, the implementation shown in FIG4 is used; when the kernel process load is low and relatively idle, the implementation shown in FIG8 is used.
[0115] The present application also provides a backup device 900, which can be configured to execute any one or more of the backup methods provided in the present application. As shown in Figure 9, the backup device 900 may include a processing module 901, a storage module 902, and optionally, a communication module 903. The storage module 902 stores instructions that, when executed by the processing module 901, cause the backup device 900 to execute any one or more of the backup methods provided in the present application.
[0116] For example, the processing module 901 may be configured to execute any one or more of steps S401-S409 and steps S801-S805. The storage module 902 may be configured to store files in the user space corresponding to the first app, files in the user space corresponding to the backup app, the first briefing file, the second briefing file, etc. The communication module 903 may be configured to send the first compressed package to the cloud server 20 when the backup device 900 executes step S409 or step S805.
[0117] An embodiment of the present application also provides a non-volatile computer-readable storage medium, which stores instructions. When these instructions are executed, the device equipped with the computer-readable storage medium executes any one or more backup methods provided in the embodiment of the present application.
[0118] An embodiment of the present application also provides a computer program product, which includes instructions. When these instructions are executed, a device installed with the computer program product executes any one or more backup methods provided in the embodiments of the present application.
[0119] The present application also provides a communication system, comprising the backup device 900 and the cloud server 20. The backup device 900 can be configured to execute any one or more backup methods provided in the present application. The cloud server 20 can be configured to receive and store at least the first compressed packet sent by the backup device 900.
[0120] 10 exemplarily shows a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 can be the terminal 10 in the embodiment of the present application, or it can be the cloud server 20.
[0121] The electronic device 100 may include at least one of a mobile phone, a foldable electronic device, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, or a smart city device. Among them, the smart home device may include, but is not limited to, the following examples: a smart large screen, a smart TV, a smart speaker, a sweeper, a smart light, and a smart toilet. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.
[0122] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air 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.
[0123] It should be understood that the structures illustrated in the embodiments of the present application do 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 may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0124] 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 video codec, a digital signal processor (DSP), a baseband processor, a microcontroller unit (MCU), and / or a neural network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0125] The processor 110 can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and execution.
[0126] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 may be a cache memory. This memory can store instructions or data that have been used or are frequently used by processor 110. When processor 110 needs to use the instruction or data, it can directly access it from this memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0127] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface. The processor 110 may be connected to modules such as a touch sensor, an audio module, a wireless communication module, a display, and a camera through at least one of the above interfaces.
[0128] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0129] The USB connector 130 is an interface that complies with USB standard specifications and can be used to connect the electronic device 100 and peripheral devices. Specifically, it can be a Mini USB connector, a Micro USB connector, a USB Type C connector, etc. The USB connector 130 can be used to connect a charger to enable the charger to charge the electronic device 100, and can also be used to connect other electronic devices to enable data transmission between the electronic device 100 and other electronic devices. It can also be used to connect headphones to output audio stored in the electronic device through the headphones. The connector can also be used to connect other electronic devices, such as VR devices. In some embodiments, the standard specifications of the universal serial bus can be USB1.x, USB2.0, USB3.x and USB4.
[0130] The charging management module 140 is used to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device through the power management module 141.
[0131] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0132] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0133] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0134] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0135] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0136] The wireless communication module 160 can provide wireless communication solutions applied to the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Bluetooth low energy (BLE), ultra wide band (UWB), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0137] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other electronic devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0138] Electronic device 100 can implement display functions using a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information. Of course, the processor may also not include a GPU and use a non-GPU processing unit to implement the aforementioned functions.
[0139] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be 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, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or more display screens 194.
[0140] The electronic device 100 can realize the camera function through the camera module 193, ISP, video codec, GPU, display screen 194, application processor AP, neural network processor NPU, etc.
[0141] The camera module 193 can be used to collect color image data and depth data of the subject. The ISP can be used to process the color image data collected by the camera module 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then transmitted to the ISP for processing and converted into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, and skin color. The ISP can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be provided in the camera module 193.
[0142] In some embodiments, the camera module 193 may be composed of a color camera module and a 3D sensing module.
[0143] In some embodiments, the photosensitive element of the camera of the color camera module can be a charge coupled device (CCD) or complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV.
[0144] In some embodiments, the 3D sensing module may be a time of flight (TOF) 3D sensing module or a structured light 3D sensing module. Structured light 3D sensing is an active depth sensing technology, and the basic components of a structured light 3D sensing module may include an infrared emitter, an IR camera module, and the like. The working principle of the structured light 3D sensing module is to first emit a light spot with a specific pattern to the object being photographed, then receive the light spot pattern coding on the surface of the object, and then compare the similarities and differences with the original projected light spot, and calculate the three-dimensional coordinates of the object using the triangulation principle. The three-dimensional coordinates include the distance between the electronic device 100 and the object being photographed. TOF 3D sensing may be an active depth sensing technology, and the basic components of a TOF 3D sensing module may include an infrared emitter, an IR camera module, and the like. The working principle of the TOF 3D sensing module is to calculate the distance (i.e., depth) between the TOF 3D sensing module and the object being photographed by using the time it takes for the infrared light to return to obtain a 3D depth map.
[0145] Structured light 3D sensing modules can also be used in facial recognition, motion-sensing game consoles, industrial machine vision inspection, and other fields. Time-of-flight 3D sensing modules can also be used in game consoles, augmented reality (AR) and virtual reality (VR).
[0146] In other embodiments, the camera module 193 may also be composed of two or more cameras. The two or more cameras may include a color camera, which can be used to collect color image data of the object being photographed. The two or more cameras may use stereo vision technology to collect depth data of the object being photographed. Stereo vision technology is based on the principle of human eye parallax. Under natural light, two or more cameras are used to capture images of the same object from different angles, and then triangulation and other calculations are performed to obtain distance information between the electronic device 100 and the object being photographed, that is, depth information.
[0147] In some embodiments, the electronic device 100 may include one or more camera modules 193. Specifically, the electronic device 100 may include one front camera module 193 and one rear camera module 193. The front camera module 193 may generally be used to capture color image data and depth data of the photographer facing the display screen 194, while the rear camera module may be used to capture color image data and depth data of the subject (e.g., a person, scenery, etc.) facing the photographer.
[0148] In some embodiments, the CPU or GPU or NPU in the processor 110 can process the color image data and depth data collected by the camera module 193. In some embodiments, the NPU can identify the color image data collected by the camera module 193 (specifically the color camera module) through a neural network algorithm based on the skeleton point recognition technology, such as a convolutional neural network algorithm (CNN), to determine the skeleton points of the person being photographed. The CPU or GPU can also run a neural network algorithm to determine the skeleton points of the person being photographed based on the color image data. In some embodiments, the CPU or GPU or NPU can also be used to confirm the figure of the person being photographed (such as body proportions, fatness and thinness of body parts between skeleton points) based on the depth data and identified skeleton points collected by the camera module 193 (which can be a 3D sensing module), and can further determine the body beautification parameters for the person being photographed, and finally process the captured image of the person being photographed according to the body beautification parameters so that the body shape of the person being photographed in the captured image is beautified. The subsequent embodiments will describe in detail how to perform body beautification processing on the image of the photographed person based on the color image data and depth data collected by the camera module 193, which will not be described in detail here.
[0149] The digital signal processor is used to process digital signals and can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0150] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0151] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0152] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be saved on the external memory card or transferred from the electronic device to the external memory card.
[0153] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional methods or data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.
[0154] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0155] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0156] The speaker 170A, also called a "speaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or output audio signals for hands-free calls through the speaker 170A.
[0157] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0158] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0159] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0160] The buttons 190 may include a power button, a volume button, etc. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0161] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0162] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0163] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or separated from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support one or more SIM card interfaces. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0164] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0165] FIG11 exemplarily shows a software structure block diagram of an electronic device 100 provided in an embodiment of the present application.
[0166] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: from top to bottom: the application layer, the application framework layer, the Android runtime (ART) and native C / C++ libraries, the hardware abstraction layer (HAL), and the kernel layer.
[0167] The application layer can include a series of application packages.
[0168] As shown in FIG11 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
[0169] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0170] As shown in FIG11 , the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, an activity manager, an input manager, and the like.
[0171] The window manager provides window management services (WMS). WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system.
[0172] Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0173] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0174] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0175] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0176] The Activity Manager can provide Activity Management Service (AMS), which can be used to start, switch, and schedule system components (such as activities, services, content providers, and broadcast receivers) as well as manage and schedule application processes.
[0177] The Input Manager provides Input Management Service (IMS), which manages system inputs, such as touch screen input, key input, and sensor input. The IMS retrieves events from input device nodes and, through interaction with the WMS, distributes the events to the appropriate window.
[0178] The Android runtime consists of the core libraries and the Android runtime. The Android runtime is responsible for converting source code into machine code. It primarily utilizes ahead-of-time (AOT) and just-in-time (JIT) compilation technologies.
[0179] The core library primarily provides basic Java class library functionality, such as basic data structures, mathematics, IO, tools, databases, and networking. It also provides an API for users to develop Android applications.
[0180] Native C / C++ libraries can include multiple functional modules, such as surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.
[0181] Among them, the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media framework supports the playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES provides the drawing and operation of 2D graphics and 3D graphics in the application. SQLite provides a lightweight relational database for the application of the electronic device 100.
[0182] The hardware abstraction layer runs in user space, encapsulates kernel layer drivers, and provides a calling interface to the upper layer.
[0183] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, and sensor drivers. The "kernel process" and "installd process" in the embodiments of this application can be located in the kernel layer.
[0184] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
[0185] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A backup method, applied to a terminal, It is characterized in that The method comprises: Identify the first application that needs data backup; Packing and compressing files whose volumes are smaller than a first threshold in the user space corresponding to the first application to obtain a first compressed package, wherein the first compressed package is stored in the user space corresponding to the first application; The first compressed package is backed up from a user space corresponding to the first application to a user space corresponding to a second application.
2. The method according to claim 1, It is characterized in that Before packaging and compressing the files in the user space corresponding to the first application whose volume is smaller than the first threshold, the method further includes: Scan files in the user space corresponding to the first application.
3. The method according to claim 1 or 2, It is characterized in that The method further comprises: A first briefing file is generated, where the first briefing file is used to record information about files that need to be backed up in the user space corresponding to the first application.
4. The method according to claim 3, It is characterized in that The files that need to be backed up in the user space corresponding to the first application include: files whose hash values have changed in the user space corresponding to the first application, and / or files that are newly added in the user space corresponding to the first application.
5. The method according to claim 3, It is characterized in that The information of the files that need to be backed up in the user space corresponding to the first application includes: the file names and volumes of the files that need to be backed up in the user space corresponding to the first application.
6. The method according to any one of claims 3 to 5, It is characterized in that The method further comprises: A second briefing file is generated according to the first briefing file, wherein the second briefing file is used to record information of files whose volumes are smaller than the first threshold among the files recorded in the first briefing file.
7. The method according to claim 6, It is characterized in that The step of packaging and compressing files in the user space corresponding to the first application with a volume smaller than a first threshold to obtain a first compressed package specifically includes: According to the second briefing file, the files recorded in the second briefing file in the user space corresponding to the first application are packaged and compressed to obtain the first compressed package.
8. The method according to any one of claims 1 to 7, It is characterized in that After backing up the first compressed package from the user space corresponding to the first application to the user space corresponding to the second application, the method further includes: Delete the first compressed package in the user space corresponding to the first application.
9. The method according to any one of claims 1 to 8, It is characterized in that The method further comprises: Send the first compressed package in the user space corresponding to the second application to the cloud server.
10. The method according to any one of claims 1 to 9, It is characterized in that The method further comprises: Delete the first compressed package in the user space corresponding to the second application.
11. The method according to claim 9, It is characterized in that In the process of sending the first compressed package in the user space corresponding to the second application to the cloud server, the method further includes: The first interface of the second application is displayed, wherein the first interface includes prompt information for prompting that data is being synchronized with the cloud server.
12. The method according to any one of claims 1 to 11, It is characterized in that The step of packaging and compressing files whose volume is smaller than a first threshold in the user space corresponding to the first application to obtain a first compressed package, and the step of backing up the first compressed package from the user space corresponding to the first application to the user space corresponding to the second application are executed by the kernel process.
13. The method according to any one of claims 1 to 12, It is characterized in that The method further comprises: Displaying a second interface of the second application, wherein the second interface includes a start backup control; In response to the operation acting on the start backup control, the terminal executes the step of packaging and compressing files in the user space corresponding to the first application whose volume is smaller than a first threshold to obtain a first compressed package.
14. The method according to any one of claims 1 to 13, It is characterized in that In the process of packaging and compressing the files whose volumes in the user space corresponding to the first application are smaller than the first threshold to obtain the first compressed package, the method further includes: A third interface of the second application is displayed, wherein the third interface includes prompt information for prompting that data is being prepared, and / or prompt information for prompting the user not to use the first application.
15. The method according to any one of claims 1 to 14, It is characterized in that The method further comprises: Back up files in the user space corresponding to the first application that have a volume greater than or equal to the first threshold in sequence to the first The user space corresponding to the second application.
16. An electronic device, comprising a processor and a memory, wherein the memory stores instructions, and when the instructions are executed by the processor, the electronic device is configured to execute the method according to any one of claims 1 to 15.
17. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed, an electronic device installed with the computer-readable storage medium executes the method according to any one of claims 1 to 15.
18. A computer program product, comprising instructions, which, when executed, enable an electronic device installed with the computer program product to execute the method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Security data backup method and security data backup system
CN109284203A
File backup method, terminal and communication system
CN110837439A
Application data backup and recovery method and device, equipment and storage medium
CN111182070A
Concurrent writing to a file during backup of the file
US20190073272A1
