File migration method, electronic device and storage medium

By redirecting the content provider in the FUSE file system, the problem of users being unable to migrate main space files in the privacy space is solved, the file migration function is implemented, the user experience is improved and system security is maintained.

CN116069723BActive Publication Date: 2024-08-30HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111300248.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-04
Publication Date
2024-08-30
Estimated Expiration
2041-11-04

AI Technical Summary

Technical Problem

On electronic devices using the FUSE file system, users cannot access or migrate files in the main space in the private space, causing the file migration process to fail and affecting the user experience.

Method used

By redirecting the content provider, applications in the private space are allowed to obtain file access and write permissions in the main space, thereby realizing file migration. The specific method is that when an application in the privacy space needs to access a file in the main space, the system redirects to the content provider in the main space and completes the migration of the file when the permission conditions are met.

Benefits of technology

It realizes the function of file migration for users in the privacy space under the FUSE file system, improving the user experience without affecting the security management performance of the FUSE file system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116069723B
    Figure CN116069723B
Patent Text Reader

Abstract

The present application relates to the field of intelligent terminal technology, and specifically to a file migration method, an electronic device and a storage medium. The electronic device to which the method is applied is provided with a main space, a privacy space and a first application, and the file system of the electronic device is a user space file system. The method comprises: receiving a first access request from a first application to a first type of file, and the space in which the first application is run is a privacy space; if it is determined that the first application has read and write permissions to the first type of file, the content provider corresponding to the first type of file is redirected from the second content provider in the privacy space to the first content provider in the main space; receiving a first migration request from the first application to a first designated file in the first type of file, wherein the first migration request is used to request the migration of the first designated file from the main space to the privacy space. The present application meets the needs of users for file migration on electronic devices that apply the FUSE file system, and is conducive to improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent terminals, and in particular to a file migration method, an electronic device and a storage medium. Background Art

[0002] With the development of the field of intelligent terminal technology, in order to meet people's needs, terminal electronic devices provide a multi-user mechanism, that is, multiple user spaces can be set on an electronic device, and the data and applications in each user space are independent. For example, the mobile phone used by the user is set with a main space and a private space. The user can log in to the main space to socialize, send data, process files and other matters. The user can also store some private data, private files, etc. in the private space, so that the user can view the private data or files by logging in to the private space, but cannot view the private data or files in the private space when logging in to the main space.

[0003] However, in the operating systems currently used by electronic devices, such as Android 11.0 and above, the system uses a user space file system (Filesystem in User Space, FUSE) with stronger file system management capabilities, and FUSE distinguishes users for the external storage of electronic devices, that is, users of each space can only access the stored data or files under the user name of this space. For example, when a user logs in to the main space, he can only access the data or files under the user name of the main space, and when a user logs in to the privacy space, he can only access the data or files under the user name of the privacy space. The result is that when the user logs in to the privacy space, if he wants to migrate some data or files (such as photos, or videos, etc.) in the main space to the privacy space for privacy protection, the file migration process cannot be completed because the data or files in the main space cannot be accessed from the privacy space. This will cause inconvenience to the user's use of the privacy space, resulting in a poor user experience. Summary of the invention

[0004] The embodiment of the present application provides a file migration method, an electronic device and a storage medium. By redirecting the processing of the content provider, on an electronic device that applies the FUSE file system, when a user performs an authorized file migration operation in a privacy space, when the file migration operation needs to access the file or file storage path of the main space, the content provider of the u0 user can be redirected to obtain access and write permissions to the files in the main space, and the process of migrating the files in the main space to the privacy space, or the process of migrating the files in the privacy space to the main space can be completed. The redirection processing of the present application scheme can also enable the user to perform an authorized file migration operation in the main space. When the file migration operation needs to access the file or file storage path of the privacy space, the content provider of the u10 user can be redirected to obtain access and write permissions to the files in the privacy space, and the process of migrating the files in the main space to the privacy space, or the process of migrating the files in the privacy space to the main space can be completed. Based on the present application scheme, the electronic device that applies the FUSE file system can also meet the user's file migration needs, and does not affect the security management performance of the FUSE file system itself, which is conducive to improving the user experience.

[0005] In a first aspect, an embodiment of the present application provides a file migration method, which is applied to an electronic device, wherein a main space, a privacy space and a first application are provided on the electronic device, and the file system of the electronic device is a user space file system, and the method comprises: receiving a first access request from a first application to a first type of file in the main space, wherein the space running the first application is the privacy space; upon determining that the first application has read permission for the first type of file in the main space, in response to the first access request, redirecting the content provider corresponding to the first type of file from the second content provider in the privacy space to the first content provider in the main space; wherein the first content provider is used for the first application to obtain the first type of file; receiving a first migration request from the first application to a first designated file in the first type of file in the main space, wherein the first migration request is used to request that the first designated file be migrated from the main space to the privacy space; and in response to the first migration request, migrating the first designated file from the main space to the privacy space upon determining that the first application has read and write permission for the first type of file in the main space.

[0006] That is, after the first application running in the privacy space has the read and write permissions for the first type of files in the main space, it can read the first type of files from the main space and write them to the privacy space, and can also delete the first type of files in the main space. It can be understood that in the context description of this application, unless otherwise specified, the description of "reading" files is equivalent to the description of "accessing" files, and the description of "reading and writing permissions" is equivalent to "migration permissions", which will not be repeated below.

[0007] It can be understood that the above-mentioned read and write permissions are, for example, the migration permissions described in the following embodiments, that is, when the privacy space is a space designated for opening migration permissions and the first application performing the file migration operation is also an application authorized to open migration permissions, when the first application running in the privacy space requests access to the first type of files in the main space, the system of the electronic device can redirect the content provider corresponding to the first type of files from the original default second content provider of the privacy space to the first content provider of the main space, thereby obtaining the permission to access the first type of files in the main space; at this time, the electronic device can display a file list of the first type of files in the main space for the user to select, and when the user selects the first designated file to be migrated, the system of the electronic device can obtain the first designated file based on the redirected first content provider of the main space and migrate it to the privacy space. For example, refer to the following embodiments Figure 5b As shown, when the user selects a picture 521 type file to access on the operation interface 520 displayed by the electronic device, the Activity management service of the electronic device performs redirection processing to obtain the first content provider of the main space to access the picture file of the main space, and then the user can Figure 5c In the picture selection interface 530 shown, the picture file to be migrated is selected to complete the migration process.

[0008] Among them, the electronic device can, for example, implement the redirection processing process of the content provider of the first category of files through the Activity management service in the system. The Activity management service completes the above redirection process when it is determined that the privacy space running the first application and the first application both meet the conditions for opening the migration permission. The above first content provider is, for example, the content provider created by the content provider of the main space in the following embodiment. After the Activity management service obtains the content provider created by the content provider of the main space, it instantiates it and then returns the handle of the instantiated content provider instance to the first application for the first application to call and access the corresponding first category file resources.

[0009] In a possible implementation of the first aspect above, the first migration request includes a first file path and a second file path, wherein the first file path is an acquisition path for the first specified file, and the second file path is a write path for the first specified file; and the first file path points to the main space, and the second file path points to the privacy space.

[0010] In a possible implementation of the first aspect above, the content provider corresponding to the first type of file is redirected from the second content provider in the privacy space to the first content provider in the main space, including: returning the identity identification file of the main space user in response to the first access request; obtaining the first content provider based on the identity identification file of the main space user, wherein the first content provider is used to provide the first file path.

[0011] In a possible implementation of the first aspect above, migrating the first designated file from the main space to the privacy space includes: obtaining the first designated file from the main space based on the first file path; and writing the obtained first designated file into the privacy space based on the second file path.

[0012] That is, the first migration request responded by the electronic device is to migrate the first designated file from the main space to the private space. Accordingly, the electronic device needs to obtain the first designated file from the main space (i.e., the first file path is required), and then write the obtained first designated file to the private space (i.e., the second file path is required). It can be understood that before the user selects the first designated file, the electronic device first responds to the first access request of the first application, redirects to the first content provider of the main space, and then obtains access rights to the first category of files in the main space, that is, obtains the acquisition path to the first designated file, that is, the first file path.

[0013] As described above, the electronic device can, for example, redirect the content provider through the Activity management service in the system. The specific process is to first return the main space user ID to the management module in the Activity management service based on the first access request of the first application. Then, the Activity management service searches the instance cache pool based on the main space user ID to see if there is a content provider instance under the name of the main space user. If not, the content provider of the main space user is requested to create a corresponding content provider and then instantiate it, thereby obtaining the first content provider of the main space. For details, please refer to the following embodiment. Figure 7 or Figure 8 The description of the relevant steps in will not be repeated here.

[0014] In a possible implementation of the first aspect, when the first application is a file migration service, it is determined that the first application has read and write permissions for the first type of files in the main space.

[0015] That is, the application designated to enable migration permissions may be, for example, the file migration service described in the following embodiments. When the Activity management service of the electronic device determines that the application requesting to migrate files is the file migration service running in the privacy space, the activity management service of the electronic device performs the above-mentioned redirection processing and returns the first content provider of the main space to the file migration service to enable the file migration service of the privacy space to read and write permissions for files in the main space, thereby completing the migration process.

[0016] In a possible implementation of the first aspect above, the method also includes: when it is determined that the first application does not have the migration permission for the first category of files, in response to the first migration request, returning the identity file of the privacy space user; obtaining a second content provider based on the identity file of the privacy space user, wherein the second content provider cannot provide a path to access the first specified file.

[0017] That is, if the file migration service running in the privacy space is not the one that responds to the user's file migration operation, for example, another application running in the privacy space that does not meet the conditions for opening migration permissions responds to the user's file migration operation, then the activity management service of the electronic device does not redirect the content provider of the first category of files, and returns to the content provider of the privacy space by default. In this case, the first application running in the privacy space has no right to access the files in the main space, and can only access the files in this space (i.e., the privacy space). In this case, the electronic device, for example, displays the file list of the first category of files in the privacy space, but cannot display the file list of the first category of files in the main space.

[0018] In a possible implementation of the first aspect above, the method further includes: receiving a second migration request from the first application for a second designated file in the privacy space, the second migration request being used to request that the second designated file be migrated from the privacy space to the main space; wherein, the space in which the first application is running is the privacy space; when it is determined that the first application has read and write permissions for the second designated file, in response to the second migration request, redirecting the content provider corresponding to the second designated file from the fourth content provider of the privacy space to the third content provider of the main space; wherein, the third content provider is used for the first application to write the second designated file into the main space, so as to migrate the second designated file from the privacy space to the main space.

[0019] That is, if the user's file migration operation is to migrate the second designated file in the current space (i.e., the privacy space) to another space (i.e., the main space), then the activity management service of the electronic device can redirect the content provider corresponding to the second designated file upon receiving the migration request for the second designated file, redirecting the second content provider of the privacy space originally returned by default to the first content provider of the main space, and writing the second designated file of the privacy space to the main space based on the redirected first content provider to complete the migration process. For example, refer to the following embodiment Fig.9c As shown, when the user selects an image file to be migrated in the file list of the private space displayed by the electronic device, the Activity management service of the electronic device performs redirection processing to obtain the first content provider of the main space to receive the image file selected by the user to be migrated.

[0020] In a possible implementation of the first aspect above, the second migration request includes a third file path and a fourth file path, wherein the third file path is an access path of the second specified file, and the fourth file path is a write path of the second specified file; and the third file path points to the privacy space, and the fourth file path points to the main space.

[0021] In a possible implementation of the first aspect above, the content provider corresponding to the second designated file is redirected from the fourth content provider of the privacy space to the third content provider of the main space, including: returning the identity identification file of the main space user in response to the second migration request; obtaining the third content provider based on the identity identification file of the main space user, wherein the third content provider is used to provide the fourth file path.

[0022] In a possible implementation of the first aspect above, migrating the second designated file from the privacy space to the main space includes: obtaining the second designated file from the privacy space based on the third file path; and writing the obtained second designated file into the main space based on the fourth file path.

[0023] That is, the second migration request responded by the electronic device is to migrate the second designated file from the privacy space to the main space. Accordingly, the electronic device needs to obtain the second designated file from the privacy space (i.e., the third file path is required), and then write the obtained second designated file to the main space (i.e., the fourth file path is required). In this case, after the user selects the second designated file, the Activity management service of the electronic device performs redirection processing to obtain the third content provider of the main space to obtain the fourth file path corresponding to the second designated file to be migrated to the main space.

[0024] In a possible implementation of the first aspect, when the first application is a file migration service, it is determined that the first application has migration permission for the second designated file.

[0025] In a possible implementation of the first aspect above, the first category of files includes any one of pictures, videos, audios, and contacts.

[0026] In a possible implementation of the first aspect above, the type of the second designated file includes any one of a picture, a video, an audio, and a contact.

[0027] It is understood that after the first designated file is migrated from the main space to the private space, the electronic device can also display the first designated file in response to the user's operation of viewing the first designated file on the interface of the second application (such as any one of the gallery, recorder or contacts) running in the private space. Figures 5e to 5f The above and related descriptions will not be repeated here.

[0028] It can be understood that after the second designated file is migrated from the private space to the main space, the method further includes: the electronic device can also display the second designated file in response to the user's operation of viewing the second designated file on the interface of the second application (such as any one of the gallery, recorder or contacts) running in the main space. For details, please refer to the following embodiments Figures 9e to 9f The above and related descriptions will not be repeated here.

[0029] In a second aspect, an embodiment of the present application provides a file migration method, which is applied to an electronic device, wherein a main space, a privacy space and a first application are provided on the electronic device, and the file system of the electronic device is a user space file system, and the method comprises: receiving a first access request from a first application to a first type of file in the privacy space, wherein the space running the first application is the main space; upon determining that the first application has read permission for the first type of file in the privacy space, in response to the first access request, redirecting the content provider corresponding to the first type of file from the first content provider in the main space to the second content provider in the privacy space; wherein the second content provider is used for the first application to obtain the first type of file; receiving a second migration request from the first application to a first designated file in the first type of file in the privacy space, wherein the second migration request is used to request to migrate the first designated file from the privacy space to the main space; and in response to the second migration request, migrating the first designated file from the privacy space to the main space upon determining that the first application has read and write permission for the first type of file in the privacy space.

[0030] That is, after the first application running in the main space has the read and write permissions for the first type of files in the privacy space, it can read the first type of files from the privacy space and write them to the main space, and can also delete the first type of files in the privacy space. The above-mentioned read and write permissions are, for example, the migration permissions described in the following embodiments, that is, when the main space is a space designated for opening migration permissions and the first application performing the file migration operation is also an application authorized to open migration permissions, when the first application running in the main space requests to access the first type of files in the main space, the system of the electronic device can redirect the content provider corresponding to the first type of files from the original default first content provider of the main space to the second content provider of the privacy space, thereby obtaining the permission to access the first type of files in the privacy space; at this time, the electronic device can display a file list of the first type of files in the privacy space for the user to select, and when the user selects the first designated file to be migrated, the system of the electronic device can obtain the first designated file based on the redirected first content provider of the privacy space and migrate it to the main space.

[0031] In a possible implementation of the second aspect above, the method further includes: receiving a second migration request from the first application for a second designated file in the main space, the second migration request being used to request that the second designated file be migrated from the main space to the privacy space; wherein, the space in which the first application is running is the main space; when it is determined that the first application has read and write permissions for the second designated file, in response to the second migration request, redirecting the content provider corresponding to the second designated file from the third content provider of the main space to the fourth content provider of the main space; wherein the fourth content provider is used for the first application to write the second designated file into the privacy space, so as to migrate the second designated file from the main space to the privacy space.

[0032] That is, if the user's file migration operation is to migrate the second designated file in the current space (i.e., the main space) to other spaces (i.e., the privacy space), the Activity management service of the electronic device can redirect the content provider corresponding to the second designated file upon receiving the migration request for the second designated file, redirecting the first content provider of the main space that was originally returned by default to the second content provider of the privacy space, and writing the second designated file of the main space into the privacy space based on the redirected second content provider to complete the migration process.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; one or more memories storing one or more programs, and when one or more programs are executed by one or more processors, the electronic device executes the above-mentioned file migration method.

[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed on a computer, the computer executes the above-mentioned file migration method.

[0035] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which implements the above-mentioned file migration method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1a to Figure 1c The figure is a schematic diagram of an application scenario of the file migration method provided in an embodiment of the present application.

[0037] Figure 2a to Figure 2b The diagram shows the interaction between the user state and the kernel state of the user space file system used by the mobile phone 100 during the implementation of a file migration method provided in an embodiment of the present application.

[0038] Figure 3 Shown is a schematic diagram of a system software architecture of a mobile phone 100 provided in an embodiment of the present application.

[0039] Figure 4 The figure shows a schematic diagram of an implementation process of the file migration method of the present application provided in an embodiment of the present application.

[0040] Figure 5a to Figure 5f The figure shows a schematic diagram of part of the interface displayed during the process of migrating files in the main space to the private space by the mobile phone 100 provided in the embodiment of the present application implementing the solution of the present application.

[0041] Figure 6 The figure is a schematic diagram of the interaction process between various parts within the mobile phone 100 system during the implementation of a file migration method provided in an embodiment of the present application.

[0042] Figure 7 The figure shows a schematic diagram of the execution flow of a process in which the Activity management service 322 in the mobile phone 100 system returns a content provider instance handle in response to a call request of the file migration service 311 during the implementation of a file migration method provided in an embodiment of the present application.

[0043] Figure 8 The figure is a schematic diagram of the interactive execution flow between the file migration service 311, the Activity management service 322 and the Activity thread 3221 during the implementation of the file migration method of the present application provided in the embodiment of the present application.

[0044] Figures 9a to 9f The figure shows a partial interface diagram displayed by the mobile phone 100 during the process of migrating files in the privacy space to the main space provided in an embodiment of the present application.

[0045] Fig.10 Shown is a structural schematic diagram of a mobile phone 100 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] Figure 1a to Figure 1c According to an embodiment of the present application, a schematic diagram of an application scenario of a file migration method is shown.

[0047] like Figure 1a to Figure 1c As shown, the scenario includes a mobile phone 100, and the FUSE file system is applied to the system of the mobile phone 100. It can be understood that the mobile phone 100 creates a main space for responding to user operations by default when it leaves the factory, hereinafter referred to as the main space. When the user is using the mobile phone 100, the mobile phone 100 runs the main space by default, and the user can click the application icon on the desktop of the main space to run the various installed applications. The user can operate the mobile phone 100 to create another user operation space for protecting privacy data and isolated from the main space, hereinafter referred to as the privacy space. It can be understood that the main space and the privacy space can have the same system applications by default, but when the user creates a privacy space, the third-party applications installed in the main space will not be installed in the privacy space by default. If the user needs to install a third-party application in the privacy space, it can be installed independently in the privacy space. It can be understood that the running space provided to each application in the main space and the file system space under the name of the main space user are isolated from the running space provided to each application in the privacy space and the file system space under the name of the privacy space user. In order to simplify the description, in the following description, the file system space under the name of the main space user is referred to as the u0 user space, and the file system space under the name of the privacy space user is referred to as the u10 user space. Based on the above understanding, unless otherwise specified, this application generally does not distinguish between the main space user and the u0 user, and the privacy space user and the u10 user.

[0048] As an example, you can refer to the desktops of the main space and the private space. Figure 1a shown.

[0049] if Figure 1a The main space desktop of the mobile phone 100 is shown. Figure 1a Click the Gallery app on the main space desktop to open Figure 1b The gallery application interface 101 shown in FIG. Figure 1b As shown, the gallery application interface 101 shows that there are 3335 photos and 427 videos stored in the main space, of which 2362 are photos taken by the camera.

[0050] if Figure 1a The privacy space desktop of the mobile phone 100 is shown. Figure 1aClick the Gallery app on the Private Space desktop to open Figure 1c The gallery application interface 102 shown in FIG. Figure 1c As shown, the gallery application interface 102 shows that there are 0 photos and no video files stored in the private space.

[0051] pass Figure 1b The gallery application interface 101 and Figure 1c From the differences between the file data displayed in the gallery application interface 102 shown, it can be understood that different file system spaces (such as the u0 user space and u10 user space mentioned above) in the FUSE file system used by the mobile phone 100 are isolated from each other, that is, the file data in each file system space in the FUSE file system is displayed independently in the corresponding operation space.

[0052] In order to solve the problem that the file data in one file system space cannot be migrated to another file system space on an electronic device using the FUSE file system, the present application proposes a file migration method. This method enables the user to perform file migration operations in the privacy space. When the file migration operation needs to access the files or file storage path of the main space, it can be redirected to the content provider of the u0 user, thereby obtaining access and write permissions (i.e., read and write permissions) to the files in the main space through the content provider of the u0 user. When the file migration operation only needs to access the files in the privacy space, it can be completed through the local file stream read and write operations in the privacy space. Among them, redirecting to the content provider of the u0 user means that the Activity Manager Service (AMS) that can be called by the main space and the privacy space through the operating system of the electronic device transfers the file access request of the privacy space user (i.e., the u10 user) to the content provider of the main space, so as to authorize the specified application (e.g., the file migration service) in the specified space (e.g., the privacy space) to access the files in the main space. Among them, the Activity management service needs to first determine and verify whether the initiator of the file access request meets the conditions for opening the migration permission. When it is determined that the initiator of the file access request meets the conditions for opening the migration permission, the redirection process of transferring the file access request to the content provider of the main space is completed. It can be understood that in other embodiments, the file migration method provided by the present application can also enable users to perform file migration operations in the main space. When the file migration operation performed by the user in the main space needs to access the files or file storage paths in the privacy space, it can also be redirected to the content provider of the u10 user, thereby obtaining access and write permissions to the files in the privacy space through the content provider of the u10 user, which will not be repeated here.

[0053] The above-mentioned migration permission activation conditions include, for example, determining whether the current space operated by the user on the electronic device is a designated space (e.g., a privacy space), and determining whether the application that executes the corresponding instruction of the migration operation is a designated application (e.g., a file migration service). When it is determined that the current space is a privacy space and the application that responds to the user's migration operation is a file migration service, that is, it is determined that the current space and the application that responds to the user's migration operation meet the preset migration permission activation conditions, then the file migration service in the privacy space is allowed to access the original file system space, such as the u0 user space, to obtain the user-specified file, such as a picture file, and the file migration service is allowed to move the obtained picture file to the target file system space, such as to the u10 user space. In this way, when the user operates the electronic device to enter the privacy space again, he can run the gallery application in the privacy space to view the picture files moved from the main space.

[0054] Figure 2a to Figure 2b According to an embodiment of the present application, a schematic diagram of the interaction between the user state and the kernel state of the user space file system used by the mobile phone 100 during the implementation of the file migration method of the present application is shown.

[0055] like Figure 2a As shown, the FUSE file system used by the mobile phone 100 includes user state and kernel state. The user state includes the main space (corresponding to the u0 user) and the private space (corresponding to the u10 user). The user state also includes an Activity management service 322 that can be called by the main space and the private space. Among them, the main space and the private space both include a gallery application 312 and a content provider 321, and the private space also has a file migration service 311 installed. Figure 2a As shown, the user-state file system includes the u0 user space under the main space user and the u10 user space under the privacy space user, that is, the user-state file systems under different user names are isolated from each other.

[0056] The kernel state includes a user space file system that manages file data stored in an external storage area of ​​the mobile phone 100 (including built-in memory, external storage, and external storage such as an SD card or USB storage).

[0057] like Figure 2aAs shown, under the management of the FUSE file system, the attribute of the file system directory mounted in the u0 user space of the mobile phone 100 is u0_xxx, for example, the picture file directory is / storage / emulated / 0 / Pictures / , the video file directory is / storage / emulated / 0 / Movies / , and the audio file directory is / storage / emulated / 0 / Music / ; the attribute of the file system directory mounted in the u10 user space is u10_xxx, for example, the picture file directory is / storage / emulated / 10 / Pictures / , the video file directory is / storage / emulated / 10 / Movies / , and the audio file directory is / storage / emulated / 10 / Music / , and there is no restriction here.

[0058] It can be understood that applications such as the gallery application 312 in the main space of the user state can obtain the content provider created by the content provider 321 in the main space through the Activity management service 322, and then access the files in the main space for corresponding processing; applications such as the gallery application 312 in the privacy space of the user state can obtain the content provider created by the content provider 321 in the privacy space through the Activity management service 322, and then access the files in the privacy space for corresponding processing.

[0059] During the process of executing file migration on the mobile phone 100, taking the example of a user operating in the privacy space to migrate a user-specified file from the main space to the privacy space, the file migration service 311 running in the user-state privacy space can obtain the content provider created by the content provider 321 in the main space through the Activity management service 322 if the specified migration permission is met, and then access the files in the main space, such as copying, deleting, and other processing of the files in the main space, and write the copied files in the main space into the privacy space through the content provider created by the content provider 321 in the privacy space, so as to realize the migration of files in the main space to the privacy space.

[0060] In other embodiments, reference Figure 2b As shown, a file migration service 311' can also be set up in the main space in user mode. Taking the example of a user operating in the main space to migrate a user-specified file from the main space to the privacy space, the file migration service 311' running in the main space in user mode can obtain the content provider created by the content provider 321 in the privacy space through the Activity management service 322 if the specified migration permission is met, and then access the privacy space to write the files in the main space into the privacy space, so as to realize the migration of files in the main space to the privacy space.

[0061] It can be understood that the user file migration operation is an operation to migrate the specified files from the original file system space to the target file system space for management. Therefore, after the user completes the file migration operation in the privacy space, when the user operates the electronic device again to enter the target file system space, the specified files that have been migrated can be displayed in the corresponding file directory in the target file system space, and the specified files that have been migrated can be deleted in the corresponding file directory in the original file system space, without limitation. Among them, the target file system space can be either the above-mentioned u0 user space or the above-mentioned u10 user space, without limitation.

[0062] It can be understood that, through the file migration method provided by the present application, by opening the permission to migrate files for the designated application running in the designated space on the electronic device applying the FUSE file system, it is possible to facilitate the user to migrate some data in the main space that needs privacy protection to the privacy space, or migrate the data in the privacy space that no longer needs privacy protection to the main space, while maintaining the isolation of the file data in each space in the FUSE file system. Other unspecified file system spaces or unspecified applications cannot obtain the file migration permission in other spaces. For example, the cloned application in the privacy space (assuming that the application is a non-designated authorized application) cannot obtain the file migration permission for the image file in the main space, that is, the cloned application running in the privacy space can neither access or obtain the image file in the main space, nor copy the file data in the privacy space to the main space. Therefore, it can be understood that the solution provided by the present application can not only ensure the security of the file data in each space, but also meet the specific needs of users who want to achieve privacy protection by migrating files.

[0063] It can be understood that the file data targeted by the file migration method provided in this application may include pictures, audio, video, documents, contacts, etc., and is not limited here.

[0064] It can be understood that the electronic devices to which the file migration method provided by the present application is applicable may include, but are not limited to, mobile phones 100, laptop computers, desktop computers, tablet computers, servers, wearable devices, head-mounted displays, mobile email devices, car equipment, portable game consoles, portable music players, reader devices, televisions in which one or more processors are embedded or coupled, or other electronic devices capable of accessing the network. For ease of description, the following takes the mobile phone 100 as an example to describe the specific process and related interfaces of the electronic device implementing the solution of the present application.

[0065] Based on the above Figure 2aThe schematic diagram of the interaction between the user state and the kernel state of the FUSE file system shown takes the file migration service 311 set in the privacy space of the user state as an example, and combines with other drawings to introduce in detail the specific process of the user operating the file migration in the privacy space to implement the file migration method of the present application.

[0066] Figure 3 According to an embodiment of the present application, a schematic diagram of a system software architecture of a mobile phone 100 is shown.

[0067] The software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software architecture of the mobile phone 100.

[0068] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer 310, the application framework layer 320, the Android runtime 330 and the system library 340, and the kernel layer 350.

[0069] The application layer 310 may include a series of application packages.

[0070] like Figure 3 As shown, the application package may include applications such as file migration service 311, gallery 312, map 313, call 314, navigation 315, Bluetooth 316, music 317, video 318, etc.

[0071] The application framework layer 320 provides an application programming interface (API) and a programming framework for the application programs of the application layer 310. The application framework layer 320 includes some predefined functions.

[0072] like Figure 3 As shown, the application framework layer 320 may include a content provider (also known as a content provider, ContentProvider) 321, an Activity management service 322, a window manager 323, a view system 324, a resource manager 325, a notification manager 326, and the like.

[0073] The content provider 321 is used to store and obtain file data and make these data accessible to applications. The above file data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc. For the sake of distinction, the following description refers to the content provider created by the content provider 321 for specific application calls as a content provider. Similarly, the instantiated content provider is referred to as a content provider instance or instance.

[0074] It can be understood that on the mobile phone 100 that uses the FUSE file system, the content providers created by the content providers 321 of each space user (such as the main space user or the privacy space user) for accessing files in each file system space are also isolated from each other. Among them, the content provider created by the content provider 321 can be instantiated in the Activity management service 322 to form a content provider instance. It can be understood that the instantiated content provider is a callable file, and the application can call the content provider instance to access files in a certain file system space. Generally, the content provider instance for the application to call has a call identifier, that is, a handle. Therefore, the content provider 321 feeds back the handle of the content provider instance to the application through the Activity management service 322 for the application to call the content provider instance.

[0075] For example, in an embodiment of the present application, the system of the mobile phone 100 can, when determining whether the current space is a privacy space and the currently running application requesting file migration is a file migration service, feed back the instance handle for accessing files in the main space corresponding to the content provider created by the content provider 321 of the main space to the file migration service in the privacy space, so as to complete the process of migrating the specified files in the main space to the privacy space or migrating the specified space in the privacy space to the main space.

[0076] Activity management service 322 is used to provide query services, and save, manage and record the status (i.e. life cycle) of the four major components of Android through the activity stack. Activity management service 322 is started by the system server (System Server) when the system is turned on. The application of each file system space can obtain the handle of the instance corresponding to the content provider provided by the content provider 321 in this space through the Activity management service 322, and then access and obtain the file data in this space. In an embodiment of the present application, a specified application in a specified space, such as a file migration service in a privacy space, can obtain the handle of the instance corresponding to the content provider provided by the content provider 321 in the main space through the Activity management service 322, thereby obtaining the permission to access, copy, and delete the file data in the main space, and then complete the process of migrating the specified file in the main space to the privacy space or migrating the specified space in the privacy space to the main space.

[0077] The window manager 323 is used to manage window programs. The window manager 323 can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0078] The view system 324 includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system 324 can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures.

[0079] The resource manager 325 provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.

[0080] The notification manager 326 enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager 326 is used to notify the completion of downloads, message reminders, etc. The notification manager 326 can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0081] Android Runtime 330 includes core libraries and virtual machines. Android Runtime 330 is responsible for scheduling and management of the Android system.

[0082] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0083] The application layer 310 and the application framework layer 320 run in a virtual machine. The virtual machine executes the Java files of the application layer 310 and the application framework layer 320 as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0084] The system library 340 may include multiple functional modules, such as a surface manager 341 , a media library 342 , a 3D graphics processing library 343 (eg, OpenGL ES), a 2D graphics engine 344 (eg, SGL), and the like.

[0085] The surface manager 341 is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0086] The media library 342 supports 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.

[0087] The 3D graphics processing library 343 is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0088] The 2D graphics engine 344 is a drawing engine for 2D drawing.

[0089] The kernel layer 350 is a layer between hardware and software and includes at least a display driver 351 , a camera driver 352 , a touch driver 353 , an audio driver 354 , and a sensor driver 355 .

[0090] Based on the above Figure 3 The system software architecture of the mobile phone 100 is shown, and the specific process of the mobile phone 100 implementing the file migration method of the present application is described in detail below in conjunction with multiple flow charts.

[0091] Figure 4 According to the embodiment of the present application, a schematic diagram of an implementation process of the file migration method of the present application is shown. It can be understood that the execution subject of each step in the process is the mobile phone 100. For the convenience of description, the execution subject of each step will not be repeatedly described when describing the specific implementation process of each step of the process.

[0092] like Figure 4 As shown, the process includes:

[0093] 401: A user's file migration operation was detected.

[0094] For example, the user can start the file migration service on the display interface of the mobile phone 100, for example, by operating the mobile phone 100 to enter the privacy space management interface, and then select the file migration service from the main space to the privacy space, or select the file migration service from the privacy space to the main space.

[0095] As an example, Figure 5a to Figure 5f According to an embodiment of the present application, a schematic diagram of part of the interface displayed when the mobile phone 100 implements the solution of the present application to migrate files in the main space to the private space is shown.

[0096] The process of the user operating the mobile phone 100 to enter the privacy space management interface can be referred to Figure 5a As shown, after the user operates the mobile phone 100 to enter the privacy space, the user can operate the mobile phone 100 to open Figure 5a The privacy space management interface 510 is shown. For example, the user can Figure 1a As shown in the figure, click the setting application icon, select the "Privacy" option, and then click "Privacy Space" to enter the login interface of the privacy space. After verifying the password information set by the user, the mobile phone 100 enters the privacy space. The user is on the privacy space desktop of the mobile phone 100 (refer to the above Figure 1a Click on the Settings app icon, select the "Privacy" option, and then click "Privacy Space" to enter Figure 5a The privacy space management interface 510 is shown. In other embodiments, the user can operate the mobile phone 100 to open the privacy space management interface 510 through other operations, which are not limited here.

[0097] like Figure 5a As shown, the user can click the "Main Space to Private Space" option 511 or the "Privacy Space to Main Space" option 512 on the privacy space management interface 510 to enable the mobile phone 100 to run the file migration service. In addition, the user can click the exit button 513 on the privacy space management interface 510 to exit the privacy space and return to the main space, and can also click the delete button 514 on the privacy space management interface 510 to delete the created privacy space. After deleting the privacy space, the file data in the privacy space will also be deleted. For example, after the user clicks the "Main Space to Private Space" option 511, the mobile phone 100 can display Figure 5b The operation interface 520 for migrating to the privacy space is shown.

[0098] like Figure 5bAs shown, the operation interface 520 for migrating to the privacy space includes pictures 521, videos 522, and audio 523 that can be migrated. For example, when a user selects picture 521, the mobile phone 100 can display Figure 5c The picture selection interface 530 shown. Figure 5c to Figure 5f The following steps will be described in detail and will not be repeated here.

[0099] 402: Determine whether the current space is a space designated for opening migration permissions. If the determination result is yes, it indicates that the user's file migration operation may be a valid operation authorized by the system of the mobile phone 100, and the mobile phone 100 may continue to execute the following step 403 to further determine whether the application responding to the user's file migration operation is an application designated for opening migration permissions; if the determination result is no, it indicates that the user's file migration operation is not an operation authorized by the system of the mobile phone 100, that is, an invalid operation, and the mobile phone 100 may directly execute the following step 409 to prompt the user that the operation failed.

[0100] Exemplarily, the space designated for opening migration permissions may be a privacy space, for example. If the user's file migration operation is performed in a scenario where mobile phone 100 runs the privacy space, then the file migration operation may be a valid operation. If the user's file migration operation is not performed in a scenario where mobile phone 100 runs the privacy space, for example, the file migration operation is performed in a scenario where mobile phone 100 runs the main space or another user's operation space, then it can be determined that the operation is an invalid operation and is an operation that mobile phone 100 cannot respond to.

[0101] It can be understood that in other embodiments, the space designated for opening the migration permission may also be other user operation spaces, for example, which is not limited here.

[0102] 403: Determine whether the application responding to the user's file migration operation is an application designated to enable migration permissions. If the judgment result is yes, it indicates that the user's file migration operation is a valid operation that has been authorized by the mobile phone 100 system, and the mobile phone 100 can continue to execute the following step 404 and continue to respond to the user's next operation; if the judgment result is no, it indicates that the user's file migration operation is an invalid operation that has not been authorized by the mobile phone 100 system, and the mobile phone 100 can directly execute the following step 409 to prompt the user that the operation failed.

[0103] Exemplarily, the application designated to enable migration authority may be, for example, the file migration service 311 on the mobile phone 100. If the file migration operation performed by the user is performed by opening the file migration service 311, combined with the judgment result of the above step 402 being yes, it can be determined that the user's file migration operation is a valid operation authorized and permitted by the system of the mobile phone 100, and the mobile phone 100 needs to respond to the user's file migration operation and continue to perform the following steps to migrate the file. Conversely, if the file migration operation performed by the user is performed through other non-designated applications, for example, the file migration operation is performed through a cloned application installed on the mobile phone 100, and the cloned application is an application for which the mobile phone 100 has not designated the authorization of migration authority, it can be determined that the file migration operation is an operation not allowed by the system of the mobile phone 100, and the mobile phone 100 will not respond to the file migration operation.

[0104] It is understandable that in other embodiments, the above-mentioned application designated to enable migration permission may also be other applications that can ensure the security of data in each file system space of the mobile phone 100, and there is no limitation here.

[0105] 404: Displays the file page in the original file system space where the target file to be migrated is located.

[0106] Exemplarily, after the judgment process of the aforementioned steps 402 and 403, if it is determined that the user's file migration operation is a valid operation authorized and allowed by the system of mobile phone 100, mobile phone 100 can respond to the file migration operation and display the file page in the file system space where the target file (i.e., the specified file) that the user needs to migrate is located. The file system space where the target file is located may be referred to as the original file system space hereinafter, which may be, for example, the u0 user space or u10 user space created by the user on mobile phone 100.

[0107] As an example, the user in the above Figure 5b After selecting picture 521 in the operation interface 520 for migrating to the privacy space, the mobile phone 100 can display Figure 5c Picture selection interface 530 is shown. Figure 5c The picture selection interface 530 shown is a file page in the original file system space where the picture file to be migrated is located.

[0108] It can be understood that if the user's file migration operation is to migrate files in the main space to the private space, the mobile phone 100 can display the file page in the main space corresponding to the file that the user needs to migrate in response to the file migration operation, such as the above Figure 5cThe picture files displayed in the picture selection interface 530 shown; if the user's file migration operation is to migrate files in the privacy space to the main space, the mobile phone 100 responds to the file migration operation by displaying the file page in the privacy space corresponding to the file that the user needs to migrate, which will not be repeated here.

[0109] It is understood that in other embodiments, the mobile phone 100 may also first display the above-mentioned Figure 5b In the operation interface 520 shown, when the user selects the file type to be migrated on the displayed operation interface 520, the mobile phone 100 displays the file page of the corresponding file type. It can be understood that the file types that the user needs to migrate may include pictures, videos, audios, etc., which are not limited here.

[0110] 405: It is detected that the user selects a designated file to be migrated in the displayed file page, and an operation of migrating the selected designated file is determined.

[0111] Exemplarily, the user can select the file to be migrated, i.e., the designated file, for migration on the file page displayed by mobile phone 100. After detecting the user's confirmation migration operation, mobile phone 100 completes the migration of the designated file from the original file system space to the target file system space.

[0112] As an example, Figure 5c As shown, the picture selection interface 530 can select the picture to be migrated (ie, the specified file), and a check mark 531 can be displayed in the lower right corner of the selected picture to indicate that the file is selected. The style of the check mark 531 is referenced Figure 5c After selecting the picture to be migrated, the user can click the migration button 532, and the mobile phone 100 can pop up Figure 5c The migration confirmation box 533 is shown, and the user can further click the confirmation button 534 in the migration confirmation box 533 to complete the migration of the selected picture file, and the mobile phone 100 can then display Figure 5d Migration completion interface 540 is shown. Figure 5c The upper left corner of the picture selection interface 530 shown may also display the number of files that need to be migrated selected by the user, for example Figure 5c "148 items selected" is shown.

[0113] Continue as Figure 5c As shown, the user can also click the select all button 535 on the picture selection interface 530 to select all the pictures on the picture selection interface 530 (including those not shown in the picture selection interface 530). Figure 5c The picture on the interface shown in the figure) will not be repeated here. Figure 5cAfter the user clicks the migration button 532, the mobile phone 100 displays a migration confirmation box 533, and the user can also click the cancel button 536 to cancel the migration operation.

[0114] It is understandable that in other embodiments, the interface displayed by the mobile phone 100 in response to the user selecting a designated file to be migrated in the displayed file page and determining to migrate the selected designated file may also be in other interface forms, which is not limited here.

[0115] 406: Display the migration success prompt interface.

[0116] Exemplarily, after the user confirms the migration operation of the designated file on the interface displayed by the mobile phone 100, the designated file is successfully migrated from the original file system to the target file system, and the mobile phone 100 can display a prompt interface indicating successful migration.

[0117] As an example, the user in the above Figure 5c After selecting the designated file on the picture selection interface 530 to confirm the migration, the mobile phone 100 can display Figure 5d The migration completion interface 540 is shown. In other embodiments, the migration success prompt interface displayed by the mobile phone 100 may also be in other interface forms, which are not limited here.

[0118] It can be understood that, for example, in the above step 402, it has been determined that the current space of the mobile phone 100 is a privacy space designated to enable migration permissions, then the mobile phone 100 can complete the process of migrating files from the main space to the privacy space, or from the privacy space to the main space in response to the user's file migration operation. In other words, the target file system space receiving the specified file can be, for example, the main space or the privacy space.

[0119] 407: The user was detected opening the target file system space to view the operation of the specified file that has been migrated.

[0120] Exemplarily, for example, if the target file system space for receiving the migrated specified file is the u0 user space, the user opens the target file system space to view the operation of the migrated specified file, and can open the interface displaying the received specified file in the main space; for another example, if the target file system space for receiving the migrated specified file is the u10 user space, the user opens the target file system space to view the operation of the migrated specified file, such as running the corresponding application in the privacy space to open the interface displaying the received specified file.

[0121] As an example, through the above Figure 5a to Figure 5d The migration process shown in the figure is completed after the migration of the image files selected by the user is completed. Figure 5eAs shown, the user clicks the gallery application icon 551 on the privacy space desktop 550 to open the gallery application in the privacy space on the mobile phone 100, and the mobile phone 100 runs the gallery application and displays Figure 5f Gallery interface 560 is shown.

[0122] 408: Enter the target file system space and display the files that have been migrated.

[0123] Exemplarily, the mobile phone 100 can run the target file system space in response to the user operation, and display the migrated files. As described above, the target file system space can be, for example, the u0 user space or the u10 user space. Taking the target file system space as the u10 user space as an example, the interface of the mobile phone 100 running the corresponding application in response to the user operation in the privacy space to display the received designated file can be referred to Figure 5f The gallery interface 560 shown in FIG. Figure 5f As shown, the “all photos 148” displayed on the gallery interface 560 is obtained through the above Figure 5a to Figure 5d The migration operation completed 148 images from the main space to the private space.

[0124] It is understandable that in other embodiments, if the file specified by the user to be migrated is a file of other types, such as audio or contact, the mobile phone 100 can display a file display interface corresponding to the specified file type, which is not limited here.

[0125] 409: Displays an operation failure prompt interface.

[0126] Exemplarily, during the judgment process of the above steps 402 or 403, if it is determined that the user's file migration operation is not an operation permitted by the system authorization of mobile phone 100, that is, an invalid operation, then mobile phone 100 can display a prompt interface of operation failure. The prompt interface is, for example, an interface in which mobile phone 100 displays a pop-up window prompting that the operation failed, or it can be other forms of interfaces, which are not limited here.

[0127] It can be understood that the process in which the mobile phone 100 executes the above steps 401 to 409 to implement the file migration method of the present application is achieved based on the interaction between various parts within the operating system of the mobile phone 100.

[0128] Therefore, in order to more clearly illustrate the specific implementation process of the present application scheme, the specific implementation process of the present application scheme is described from another perspective in combination with the interaction flow diagram between the various parts within the mobile phone 100 system.

[0129] Figure 6 According to the embodiment of the present application, a schematic diagram of the interaction process between various parts within the mobile phone 100 system during the implementation of the file migration method of the present application is shown.

[0130] like Figure 6 As shown, the interaction process includes the following steps.

[0131] 601: The file migration service 311 requests a callable content provider instance. For the convenience of description, the file migration service 311 requesting the instance may be referred to as a "caller" hereinafter.

[0132] Exemplarily, the system of mobile phone 100 executes the file migration operation performed by the user through the file migration service 311, which requires the file migration service 311 to obtain the file migration permission of the original file system space of the specified file. Therefore, the file access request of the file migration service 311 can be used to request the migration permission for the file in the original file system space.

[0133] As an example, the file migration service 311 requests a callable content provider instance, for example, by using the get() function to issue a request, see “getContentResolver().query(uri,projection,null,null,null)”, where the “()” after “query” may represent relevant information of the content provider instance to be requested, such as the calling address of the requesting callable content provider instance, etc., which will not be repeated here.

[0134] It can be understood that the file migration service 311 can obtain the migration permission for the files in the original file system space by obtaining the content provider instance in the original file system space that can be called by the file migration service 311. Therefore, the file migration service 311 can directly request the callable content provider instance through the Activity management service 322. As described above, the original file space system can be, for example, the main space created by the mobile phone 100 at the factory, or the private space created by the user on the mobile phone 100, which is not limited here.

[0135] 602: The Activity Management Service 322 generates a content provider request data packet for a content provider instance for providing files required by the file migration service 311 in response to the instance request of the file migration service 311. The Activity Management Service 322 may generate a request data packet corresponding to the content provider instance in the file system space (e.g., u0 user space) for the files required by the file migration service 311 if it is determined that the instance request meets the preset response conditions; and may generate a request data packet corresponding to the content provider instance in the file system space (e.g., u10 user space) for the file migration service 311 if it is determined that the instance request does not meet the preset response conditions. In addition, the request data packet generated by the Activity Management Service 322 may include description information of the content provider required by the file migration service 511.

[0136] Exemplarily, the file migration service 311 requests the content provider instance corresponding to the file in the original file system space where the specified file is located through the activity management service 322. The activity management service 322 can generate a content provider request data packet of the content provider instance based on the file migration service 311 instance request. The request data packet at least includes description information for describing the file system space user ID and other data that the required content provider needs to provide, etc., which is not limited here. It can be understood that during the file migration process performed by the file migration service 311 running in the privacy space, whether migrating files from the main space to the privacy space or migrating files in the privacy space to the main space, the file migration service 311 needs to obtain access, copy, delete and other operation permissions for the file data in the main space.

[0137] It is understood that the Activity Management Service 322 determines whether the request of the File Migration Service 311 to the content provider instance meets the preset response condition. It can determine whether the preset response condition is met by determining whether the space running the File Migration Service 311 is a space (such as a privacy space) that specifies the opening of migration permissions, and determining whether the File Migration Service 311 is an application that specifies the opening of migration permissions. It is understood that before generating a content provider request data packet for the content provider instance, the Activity Management Service 322 can first search for a content provider instance in the instance cache pool of the system based on the judgment result. If so, the Activity Management Service 322 can directly return the queried instance to the File Migration Service 311. In this case, there is no need to generate an instance request data packet to request the content provider 321 to create a content provider, and after receiving the corresponding content provider returned by the content provider 321, the received content provider is instantiated, and finally the instantiated content provider is sent to the File Migration Service 311. The specific judgment process performed by the Activity management service 322 and the process of the Activity management service 322 querying the instance cache pool based on the judgment result will be described in detail below in conjunction with another flowchart and will not be repeated here.

[0138] 603 : The Activity management service 322 sends the generated content provider request data packet to the content provider 321 .

[0139] Exemplarily, when the Activity management service 322 determines that there is no content provider instance fed back to the file migration service 311 in the system's instance cache pool, the Activity management service 322 may send the generated instance request data packet to the content provider 321 to request the content provider 321 to create a content provider instance.

[0140] 604: The content provider 321 creates a content provider of a content provider instance based on the received content provider request data packet.

[0141] Exemplarily, after receiving the instance request data packet sent by the Activity management service 322 , the content provider 321 creates a content provider corresponding to the content provider instance and returns it to the Activity management service 322 .

[0142] 605 : The content provider 321 sends the created content provider to the Activity management service 322 .

[0143] 606: The Activity management service 322 instantiates the received content provider to obtain a corresponding content provider instance.

[0144] Exemplarily, after the Activity management service 322 receives the content provider returned by the content provider 321, it can instantiate the content provider, that is, bind the received content provider to the corresponding caller information and configure the corresponding calling parameters so that the content provider can be called by the corresponding caller. For example, the caller can be the file migration service 311. After the content provider is instantiated, it can be called by the file migration service 311 to access files in the corresponding file system space.

[0145] As an example, in the Android operating system installed in the mobile phone 100 that applies the FUSE file system, in the process of the Activity management service 322 in the above steps 602 to 606 responding to the instance request of the file migration service 311 to return the content provider instance, the data conversion performed by the Activity management service 322 and the process of instantiating the received content provider may include: (1) the Activity management service 322 first generates a ContextImpl class request file in response to the instance request of the file migration service 311; (2) the Activity management service 322 then queries the content provider instance in the instance cache pool through various calling functions (such as query function, acquire function, etc.) or generates an instance request data packet including the description information of the content provider instance to apply to the content provider 321 for creating the content provider instance; (3) the Activity management service 322 can also request the caller information from the application thread corresponding to the file migration service 311 through the Activity thread, that is, request the identity identification file ((Identity ID) of the file migration service 311) The caller information is packaged in the content provider returned by the content provider 321 in response to the creation request to bind the calling relationship between the requested content provider and the caller, thereby instantiating the content provider. The process of the content provider 321 creating the content provider and the process of the Activity management service 322 acquiring the content provider created by the content provider 321 and returning the content provider instance handle to the file migration service 311 after instantiating the content provider will be described in detail below and will not be repeated here.

[0146] It can be understood that in other embodiments, the data conversion process involved in the process in which the Activity management service 322 responds to the instance request of the file migration service 311 may also include other conversion methods, which are not limited here.

[0147] 607 : The Activity management service 322 sends the handle of the content provider instance to the file migration service 311 .

[0148] Exemplarily, after the Activity management service 322 completes the process of instantiating the received content provider, it can send the call handle of the instantiated content provider (ie, the content provider instance) to the file migration service 311. Afterwards, the file migration service 311 can call the instance based on the handle.

[0149] As an example, for example, the instance returned by the Activity management service 322 to the file migration service 311 is obtained after instantiation of the content provider created by the content provider 321 in the main space. The file migration service 311 can call the instance through the handle of the instance to access the file data in the main space, copy, delete and other operations on the files in the main space, and complete the file migration process.

[0150] Regarding the execution process of the above steps 602 to 607, the following is combined with another flowchart, and taking the migration of a specified file from the main space of the mobile phone 100 to the privacy space as an example, a detailed introduction is given to the judgment process performed by the Activity management service 322 after responding to the instance request of the file migration service 311 (caller), and the process of querying the instance cache pool to obtain the content provider instance based on the judgment result, or calling the content provider in the main space to create the content provider instance, and then instantiating the created content provider and returning it to the file migration service 311.

[0151] Figure 7 According to the embodiment of the present application, a schematic diagram of the execution flow of the process in which the Activity management service 322 in the mobile phone 100 system responds to the call request of the file migration service 311 and returns the content provider instance handle is shown in the implementation process of the file migration method of the present application. It can be understood that Figure 7 The execution entity of each step of the illustrated process is the Activity management service 322 in the mobile phone 100 system, and the execution entity of each step will not be repeatedly described in the description of the following steps.

[0152] like Figure 7 As shown, the process includes the following steps:

[0153] 701: In response to the caller's request, determine whether the current space is a privacy space. The privacy space is a space that specifies the migration permission. If the judgment result is yes, the Activity management service 322 can continue to execute the following step 702 to further confirm whether it is necessary to obtain the content provider instance in the main space and return it to the caller; if the judgment result is no, the Activity management service 322 executes the following step 704 to return the current space user ID of the mobile phone 100.

[0154] For example, when the file migration service 311 (caller) performs the user's file migration operation, if the specified file to be migrated is a file in the main space, the Activity management service 322 responds to the call request of the file migration service 311 and needs to first determine whether the current space of the mobile phone 100 is a private space, and confirm whether it is necessary to return to the content provider instance in the main space. The specific judgment process of this step can refer to the relevant description in the above step 402, which will not be repeated here.

[0155] 702: Determine whether the caller is a file migration service. If the result of the determination is yes, it can be determined that the caller can obtain the file migration permission of the main space, and the main space user ID can be returned to the management module in the Activity management service 322; if the result of the determination is no, it can be determined that the caller cannot obtain the file migration permission of the main space, and therefore can only return the current space user ID to the management module in the Activity management service 322.

[0156] For example, when the Activity management service 322 determines that the current space of the mobile phone 100 is a privacy space, it can further determine whether the caller is a file migration service, where the file migration service running in the privacy space is an application that specifies the opening of migration permissions. The specific judgment process of this step can refer to the relevant description in the above step 403, which will not be repeated here.

[0157] It can be understood that the execution order of the above step 701 and the present step 702, and the above steps 402 and 403 described in the embodiment of the present application can be executed simultaneously or one after another, and there is no limitation here.

[0158] 703: Return the main space user ID. After this step, continue to execute the following step 705.

[0159] Exemplarily, when it is determined that the caller can obtain the file migration permission of the main space, the Activity management service 322 may, for example, return the main space user ID to the management module within the service for obtaining the content provider instance in the main space.

[0160] 704: Return the current space user ID. After this step, continue to execute the following step 705.

[0161] Exemplarily, when it is determined that the caller cannot obtain the file migration permission of the main space, the Activity management service 322 may, for example, return the current space user ID to the management module within the service for obtaining the content provider instance within the current space.

[0162] It can be understood that in the embodiments of the present application, the current space may be, for example, a privacy space. In other embodiments, the current space may also be other spaces other than the main space and the privacy space, which is not limited here.

[0163] 705: In the instance cache pool, check whether there is a content provider instance under the user name corresponding to the returned user ID. If the judgment result is yes, the Activity management service 322 obtains the instance under the space name and returns it to the caller, that is, executes the following step 708; if the judgment result is no, the Activity management service 322 needs to request the content provider in the space to create a content provider instance, that is, executes the following step 706.

[0164] Exemplarily, the Activity Management Service 322 can query the instance cache pool within the service for the content provider instance requested by the caller. It can be understood that the instance cache pool within the Activity Management Service 322 stores the callable content provider instances corresponding to each application under each space user name. If it is the main space user ID, the Activity Management Service 322 can query each instance under the main space user name in the instance cache pool. If the instance requested by the caller can be queried, the handle of the queried instance can be returned to the caller. If it is the current space user ID, and the current space is, for example, a privacy space, the Activity Management Service 322 can query each instance under the privacy space user name in the instance cache pool. If the instance requested by the caller can be queried, the handle of the queried instance can be returned to the caller.

[0165] 706: Generate a content provider request data packet of the corresponding instance, and request the content provider of the space corresponding to the returned user ID to create a corresponding content provider.

[0166] For example, if the Activity management service 322 does not find the content provider instance under the name of the main space in the instance cache pool within the service, it is necessary to request the content provider of the main space to create a content provider of the content provider instance. The Activity management service 322 can, for example, generate a content provider request data packet of the content provider instance and send it to the content provider in the main space to request the content provider to create the content provider instance. For details, please refer to the relevant description in the above step 602, which will not be repeated here.

[0167] 707: Receive the content provider returned by the content provider 321, and instantiate the content provider.

[0168] Exemplarily, after receiving the request data packet sent by the Activity management service 322, the content provider in the main space can create a content provider of the content provider instance based on the description information in the data packet, and return it to the Activity management service 322. After receiving the content provider returned by the content provider, the Activity management service 322 can instantiate the content provider. The specific instantiation process can refer to the relevant description in the above step 606, which will not be repeated here.

[0169] 708: Returns to the caller the handle of the content provider instance requested by the caller.

[0170] Exemplarily, after the Activity management service 322 completes the process of instantiating the received content provider, it returns the handle of the content provider instance to the caller (e.g., the file migration service 311). The file migration service 311 can call the content provider instance based on the returned handle, such as the content provider instance corresponding to the file migration service in the main space, to obtain the specified file to be migrated in the main space. For details, please refer to the relevant description in the above step 607. No further details will be given here.

[0171] It can be understood that during the system operation of the mobile phone 100, the Activity management service 322 can be started through the Activity thread, obtain the content provider instance request of the file migration service 311 through the Activity thread, and return the handle of the content provider instance to the file migration service 311 through the Activity thread.

[0172] Therefore, in order to more clearly illustrate the implementation logic of the present application, the following will continue to describe in detail the interaction process between the file migration service 311 and the Activity management service 322 and the Activity thread 3221 in the mobile phone 100 system during the implementation of the file migration method of the present application in combination with another flowchart.

[0173] Figure 8 The diagram shows a flow chart of the interactive execution between the file migration service 311, the Activity management service 322 and the Activity thread 3221 in the mobile phone 100 system during the implementation of the file migration method of the present application.

[0174] like Figure 8 As shown, the interactive execution process includes the following steps:

[0175] 801: The file migration service 311 requests a callable content provider instance.

[0176] Exemplarily, the file migration service 311 (i.e., the caller) generates a content provider instance request in response to the user's file migration operation, for requesting a content provider instance that can provide the file resources to be migrated. It can be understood that the content provider instance requested by the file migration service 311 is the content provider instance after the content provider created by the content provider 321 of the main space is instantiated. The specific operation process of the file migration service 311 requesting the content provider instance can refer to the relevant description in the above step 601, which will not be repeated here.

[0177] 802: Activity thread 3221 determines whether there is a content provider instance that meets the caller's request among the connected content provider instances. If the determination result is yes, Activity thread 3221 can directly execute step 815; if the determination result is no, Activity thread 3221 can return the determination result that there is no content provider instance to Activity management service 322, and Activity management service 322 continues to execute the following step 803.

[0178] Exemplarily, the Activity thread 3221 first matches the saved content provider instance resources of the connected process based on the relevant information of the content provider instance requested by the file migration service 311 to determine whether there is the content provider instance requested by the file migration service 311. It can be understood that the content provider instance matched by the Activity thread 3221 is the content provider instance obtained after instantiation of the content provider created by the content provider 321 of the main space. If there is, it means that the file migration service 311 has called the content provider instance, and the handle of the matched content provider instance can be directly returned to the file migration service 311. If not, it means that the file migration service 311 is calling the content provider instance for the first time, and it is necessary to execute the following step 803 to determine whether the file migration service 311 has the authority to obtain the content provider of the main space, that is, to determine whether the caller has the file migration authority, which will not be repeated here.

[0179] 803: The Activity management service 322 determines whether the content provider instance request meets the preset response condition. If the judgment result is yes, it indicates that the Activity management service 322 can obtain the corresponding content provider instance of the main space and return it to the caller, and then the following step 804 can be continued; if the judgment result is no, it indicates that the Activity management service 322 cannot obtain the corresponding content provider instance of the main space and return it to the caller, and then the following step 805 is executed.

[0180] Exemplarily, the Activity management service 322 determines whether the content provider instance request meets the preset response conditions, including determining whether the current space running the file migration service 311 is a privacy space (or, determining whether the current user is a privacy space user), and determining whether the caller requesting the content provider instance is the file migration service 311 in the privacy space. In the case where it is determined that the current space running the file migration service 311 is a privacy space and the caller requesting the content provider instance is the file migration service 311 in the privacy space, continue to execute the following step 804 to return the main space user ID. If the current space running the file migration service 311 is not a privacy space, or the caller requesting the content provider instance is not the file migration service 311 in the privacy space, continue to execute the following step 805 to return the current space user ID. For details, please refer to the relevant description in the judgment process of the above steps 701 to 702, which will not be repeated here.

[0181] 804: The Activity management service 322 returns the main space user ID. It can be understood that step 804 is the same as the above step 703, and will not be repeated here.

[0182] 805: Activity management service 322 returns the privacy space user ID. It can be understood that the difference between step 805 and the above step 704 is that this step 805 is described based on the current space as a privacy space, so it is directly described as the Activity management service 322 returning the privacy space user ID to the management module within the service, which is not repeated here.

[0183] 806: The Activity management service 322 searches the instance cache pool for a content provider instance under the user name corresponding to the returned user ID. If the result of the judgment is yes, the handle of the found content provider instance can be directly returned to the file migration service 311 through the Activity thread 3221, that is, the following step 807 is executed; if the result of the judgment is no, the content provider 321 needs to be called to create the corresponding content provider, that is, the process of the following steps 808 to 814 is executed.

[0184] It can be understood that the process of Activity management service 322 searching the instance cache pool for whether there is a content provider instance under the main space user name or the privacy space user name corresponding to the returned user ID can be specifically referred to the relevant description in the above step 705, which will not be repeated here.

[0185] 807: The Activity thread 3221 caches the content provider instance found by the Activity management service 322.

[0186] Exemplarily, in the above step 806, if the Activity management service 322 finds the content provider instance under the returned main space user name in the instance cache pool, the Activity thread 3221 can obtain the content provider instance under the main space user name and cache it. After that, the Activity thread 3221 can return the handle of the cached content provider instance under the main space user name to the file migration service 311, that is, after this step 807, the following step 815 can be continued.

[0187] Correspondingly, if the Activity Management Service 322 returns the privacy space user ID, then in the above step 806, if the Activity Management Service 322 finds the content provider instance under the privacy space user name in the instance cache pool, the Activity thread 3221 can also obtain the content provider instance under the privacy space user name and cache it, and then the Activity thread 3221 can return the handle of the cached content provider instance under the privacy space user name to the file migration service 311, that is, the following step 815 can be continued after this step 807. It can be understood that the file migration service 311 can only access files in the privacy space by calling the content provider instance under the privacy space user name. If it is necessary to access files in the main space, it is necessary to obtain the content provider instance under the main space user name.

[0188] 808: The Activity management service 322 determines whether the content provider of the space corresponding to the returned user ID and the caller are in the same process. If the determination result is yes, the following step 809 is continued to be executed; if the determination result is no, the following step 810 is continued to be executed.

[0189] Exemplarily, in the above step 806, if the Activity Management Service 322 does not find the content provider instance under the user name corresponding to the returned main space user ID in the instance cache pool, or does not find the content provider instance under the user name corresponding to the returned privacy space user ID, it is necessary to start the process of creating the content provider, including the Activity Management Service 322 first determining whether the content provider of the space corresponding to the returned user ID and the caller are in the same process. For example, if the returned user ID is the main space user ID, the Activity Management Service 322 determines whether the content provider 321 of the main space and the caller file migration service 311 are in the same process. If the two are in the same process, then the content provider 321 of the main space can directly create the Activity thread 3221 that the content provider returns to the Activity Management Service 322, that is, continue to execute the following step 809; if the two are not in the same process, it is necessary to establish a connection between the content provider 321 of the main space and the file migration service 311, that is, it is necessary to execute the following step 810.

[0190] 809: Activity thread 3221 obtains the content provider created by the content provider of the space corresponding to the returned user ID and instantiates it to obtain the corresponding instance. After executing step 809, Activity thread 3221 can continue to execute the following step 815 to feedback the handle of the content provider instance requested by the caller to the caller.

[0191] Exemplarily, for example, the returned user ID is the main space user ID, and the main space content provider 321 determined in the above step 808 is located in the same process as the caller file migration service 311, then the Activity thread 3221 can obtain the content provider created by the main space content provider 321 on the same process, and instantiate the obtained content provider to obtain the content provider instance of the main space, and then continue to execute the following step 815 to feedback the handle of the content provider instance requested by the caller to the caller.

[0192] 810: The Activity management service 322 establishes a connection between the content provider of the space corresponding to the returned user ID and the caller.

[0193] For example, if the returned user ID is the main space user ID, and the main space content provider 321 and the caller file migration service 311 are not in the same process as determined in step 808, the Activity management service 322 needs to establish a connection between the two, that is, to create the file migration service 311 as a connection object of the main space content provider 321, so as to expose the file data of the main space to the file migration service 311 through the main space content provider 321. No further details will be given here.

[0194] 811: The Activity management service 322 determines whether the content provider of the space corresponding to the returned user ID is in the waiting list for startup. If the determination result is yes, the following step 812 is continued to be executed; if the determination result is no, the following step 813 is continued to be executed.

[0195] Exemplarily, for example, if the returned user ID is the main space user ID, when establishing a connection between the content provider 321 of the main space and the file migration service 311, the Activity management service 322 needs to determine whether the content provider 321 of the main space is in the startup list at this time. If it is in the startup list, the Activity management service 322 can call the Activity thread 3221 to start the content provider to create the corresponding content provider, that is, continue to execute the following step 812; if it is not in the startup list, it is necessary to execute the following step 813 to continue to determine whether the process where the content provider 321 is located is running.

[0196] 812: Activity thread 3221 starts the content provider to create and instantiate the corresponding content provider. After executing step 812, Activity thread 3221 may continue to execute step 815 to feed back the handle of the content provider instance requested by the caller to the caller.

[0197] Exemplarily, for example, if the returned user ID is the main space user ID, in the above step 811, if the Activity management service 322 determines that the content provider 321 of the main space is already in the startup list, then the Activity thread 3221 can directly start the content provider 321 of the main space to create a content provider, and the Activity thread 3221 then instantiates the content provider created by the content provider 321 of the main space. After that, the Activity thread 3221 can continue to execute the following step 815 to feedback the handle of the content provider instance requested by the caller to the caller.

[0198] 813: The Activity management service 322 determines whether the process where the content provider 321 is located is alive. If the determination result is yes, the above step 812 is executed; if the determination result is no, the following step 814 needs to be executed.

[0199] Exemplarily, for example, if the user ID returned is the main space user ID, in the above step 811, if the Activity management service 322 determines that the content provider 321 of the main space is not in the startup list at this time, then the Activity management service 322 needs to obtain whether the process where the content provider 321 of the main space is currently located is still running, that is, whether it is alive. If the process where the content provider 321 of the main space is currently located is still running, for example, when the content provider 321 of the main space is in the same process as other applications at this time, then the Activity thread 3221 can still access the process where the content provider 321 of the main space is located, start the content provider 321 of the main space to create a content provider, that is, continue to execute the above step 812. If the process where the content provider 321 of the main space is currently located has stopped running, then the Activity management service 322 needs to start the process and add the content provider 321 of the main space to the startup list, that is, it needs to execute the following step 814.

[0200] 814: Activity management service 322 starts the process and adds the content provider of the space corresponding to the returned user ID into the list to be started. After this step 814 is executed, Activity thread 3221 can continue to execute the above step 812, start the content provider to create the corresponding content provider and instantiate it.

[0201] Exemplarily, for example, the returned user ID is the main space user ID. In the above step 813, if the Activity management service 322 determines that the process in which the content provider 321 of the main space is currently located has stopped running, it is necessary to start a process to add the content provider 321 of the main space to the startup list. After that, the Activity thread 3221 continues to execute the above step 812, starts the content provider 321 of the main space to create the corresponding content provider and instantiate it, which will not be repeated here.

[0202] 815: Activity thread 3221 returns the handle of the content provider instance requested by the caller to the caller.

[0203] It can be understood that if the above step 803 determines that the corresponding instance request meets the preset response condition, after executing step 804 to return the main space user ID, after the above steps 806 to 815, the main space content provider instance requested by the file migration service 311 can be returned to the file migration service 311, so that the file migration service 311 can access the files in the main space to migrate the specified files from the main space to the privacy space. If the above step 803 determines that the corresponding instance request does not meet the preset response condition, after executing step 805 to return the privacy space user ID, then after the above steps 806 to 815, the Activity thread 3221 returns the privacy space content provider instance to the file migration service 311. In this case, the file migration service 311 cannot access the files in the main space, and the file migration process cannot be completed.

[0204] This application completes the file migration process by redirecting the file migration request of the specified application in the specified space that meets the preset response conditions or specifies the migration permission to the corresponding content provider instance of the content provider request of the space where the file to be migrated is located. The file migration process can be completed under the user-by-user management of the user space file system, meeting the user's file migration needs, with high security, and will not increase the operating burden of the mobile phone 100 system, and the user experience is also good.

[0205] It can be understood that in other embodiments, the mobile phone 100 implements the file migration method of the present application and can also migrate the specified files in the private space to the main space. The relevant interface displayed by the mobile phone 100 during the file migration process can refer to Figures 9a to 9f shown.

[0206] Figures 9a to 9f A schematic diagram of part of the interface displayed by the mobile phone 100 during the process of migrating files in the private space to the main space is shown.

[0207] After the user operates the mobile phone 100 to enter the privacy space, he can operate the mobile phone 100 to open Figure 9a The privacy space management interface 510 is shown. Figure 9a The privacy space management interface 510 shown is Figure 5a The interfaces shown are the same and will not be described again here.

[0208] like Figure 9a As shown, after the user clicks the "privacy space to main space" option 512 on the privacy space management interface 510, the mobile phone 100 can display Figure 9b The operation interface 920 shown is migrated to the main space.

[0209] like Figure 9bAs shown, the operation interface 920 migrated to the main space includes pictures 921, videos 922 and audio 923 that can be migrated. For example, when the user selects picture 921, the mobile phone 100 can display Fig.9c Picture selection interface 930 is shown.

[0210] like Fig.9c As shown, the user can select the picture to be migrated (ie, the specified file) in the picture selection interface 930, and a check mark 931 may be displayed in the lower right corner of the selected picture to indicate that the file is selected. The style of the check mark 931 is shown in FIG. Fig.9c After selecting the picture to be migrated on the picture selection interface 930, the user can click the migration button 932, and the mobile phone 100 can pop up a Fig.9c The migration confirmation box 933 is shown, and the user can further click the confirmation button 934 in the migration confirmation box 933 to complete the migration of the selected image file, and the mobile phone 100 can display Figure 9d Migration completion interface 940 is shown. Fig.9c The upper left corner of the picture selection interface 930 shown may also display the number of files that need to be migrated selected by the user, for example Fig.9c "136 items selected" is shown.

[0211] Continue as Fig.9c As shown, the user can also click the select all button 935 on the picture selection interface 930 to select all the pictures on the picture selection interface 930 (including those not shown in the picture selection interface 930). Fig.9c The picture on the interface shown in the figure) will not be repeated here. Fig.9c After the user clicks the migration button 932, the mobile phone 100 displays a migration confirmation box 933, and the user can also click the cancel button 936 to cancel the migration operation.

[0212] Through the above Figures 9a to 9d The migration process shown in the figure is completed after the migration of the image files selected by the user is completed. Fig.9e As shown, the user clicks the gallery application icon 951 on the main space desktop 950 to open the gallery application in the main space of the mobile phone 100, and the mobile phone 100 runs the gallery application and displays Figure 9f Gallery interface 960 is shown.

[0213] like Figure 9f As shown, the “all photos 3,136” displayed on the gallery interface 560 include Figures 9a to 9d The migration operation completed the migration of 136 images from the private space to the main space.

[0214] Fig.10 According to an embodiment of the present application, a structural schematic diagram of a mobile phone 100 is shown.

[0215] like Fig.10 As shown, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, 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, an acceleration sensor 180E, a fingerprint sensor 180H, a touch sensor 180K, an ambient light sensor 180L, etc.

[0216] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0217] 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 processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0218] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0219] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the above-mentioned memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. In an embodiment of the present application, the processor 110 may call the execution instructions for implementing the file migration method of the present application stored in the memory to implement the file migration method provided in the embodiment of the present application.

[0220] In some embodiments, the processor 110 may include one or more interfaces. The interface 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, etc.

[0221] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to realize the touch function of the mobile phone 100.

[0222] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0223] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0224] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0225] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to realize the shooting function of the mobile phone 100. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the mobile phone 100.

[0226] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0227] The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transfer data between the mobile phone 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0228] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0229] The charging management module 140 is used to receive charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also power the electronic device through the power management module 141 .

[0230] 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 to power the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.

[0231] The wireless communication function of the mobile phone 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.

[0232] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

[0233] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 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.

[0234] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 100. 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, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0235] The mobile phone 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0236] The display screen 194 is used to display images, videos, etc. The 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-LED, Micro-LED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0237] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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 RGB, YUV or other format. In some embodiments, the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0238] 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 mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0239] The internal memory 121 can be used to store computer executable program codes, and the above executable program codes include 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 mobile phone 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 applications and data processing of the mobile phone 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0240] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.

[0241] The audio module 170 is used to convert digital audio information into analog audio signal output, and also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals.

[0242] The speaker 170A, also called a "horn", is used to convert audio electrical signals into sound signals.

[0243] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals.

[0244] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.

[0245] The earphone jack 170D is used to connect a wired earphone.

[0246] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The mobile phone 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the mobile phone 100 detects the intensity of the touch operation according to the pressure sensor 180A. The mobile phone 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0247] The acceleration sensor 180E can detect the magnitude of the acceleration of the mobile phone 100 in various directions (generally three axes). When the mobile phone 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0248] The ambient light sensor 180L is used to sense the ambient light brightness. The mobile phone 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the mobile phone 100 is in a pocket to prevent accidental touches.

[0249] The fingerprint sensor 180H is used to collect fingerprints. The mobile phone 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc. In the embodiment of the present application, the main space and the private space can use different unlocking fingerprints for verification and login to ensure the security of private data in the private space. The user can verify different fingerprints on the mobile phone 100 to enter the main space and the private space respectively.

[0250] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the mobile phone 100, which is different from the position of the display screen 194.

[0251] The key 190 includes a power key, a volume key, etc. The key 190 can be a mechanical key or a touch key. The mobile phone 100 can receive key input and generate key signal input related to the user settings and function control of the mobile phone 100.

[0252] Motor 191 can generate vibration prompts.

[0253] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0254] The SIM card interface 195 is used to connect a SIM card.

[0255] It is understood that references to "one embodiment" or "embodiment" in the specification mean that the specific features, structures, or characteristics described in conjunction with the embodiment are included in at least one exemplary implementation or technology disclosed in the present application. The appearance of the phrase "in one embodiment" in various places in the specification does not necessarily all refer to the same embodiment.

[0256] The present application also discloses a device for performing the operations in the text. The device can be constructed specifically for the required purpose or it can include a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program can be stored in a computer-readable medium, such as, but not limited to, any type of disk, including a floppy disk, an optical disk, a CD-ROM, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an EPROM, an EEPROM, a magnetic or optical card, an application-specific integrated circuit (ASIC) or any type of medium suitable for storing electronic instructions, and each can be coupled to a computer system bus. In addition, the computer mentioned in the specification may include a single processor or may be an architecture involving multiple processors for increased computing power.

[0257] Additionally, the language used in this specification has been primarily selected for readability and instructional purposes and may not have been selected to delineate or limit the disclosed subject matter.Accordingly, this disclosure is intended to illustrate but not to limit the scope of the concepts discussed herein.

Claims

1. A file migration method, applied to an electronic device, wherein the electronic device is provided with a main space, a privacy space and a first application, and the file system of the electronic device is a user space file system, It is characterized in that The file data of the main space and the private space in the user space file system are isolated from each other, and the method includes: Receiving a first access request from a first application to a first type of file in a main space, wherein the space in which the first application is run is a private space; When it is determined that the first application has read permission for the first type of files in the main space, In response to the first access request, the content provider corresponding to the first type of files is redirected from the second content provider in the privacy space to the first content provider in the main space; wherein the first content provider is used for the first application to obtain the first type of files; receiving a first migration request by the first application for a first designated file in the first category of files in the main space, wherein the first migration request is used to request migration of the first designated file from the main space to the private space; In response to the first migration request, the first designated file is migrated from the main space to the private space if it is determined that the first application has read and write permissions for the first type of files in the main space.

2. The method according to claim 1, It is characterized in that The first migration request includes a first file path and a second file path, wherein the first file path is a path for obtaining the first designated file, and the second file path is a path for writing the first designated file; and The first file path points to the main space, and the second file path points to the private space.

3. The method according to claim 2, It is characterized in that The content provider corresponding to the first type of files is redirected from the second content provider of the privacy space to the first content provider of the main space, including: In response to the first access request, returning the identity identification file of the main space user; The first content provider is obtained based on the identity identification file of the main space user, wherein The first content provider is used to provide the first file path.

4. The method according to claim 3, It is characterized in that The step of migrating the first designated file from the main space to the private space includes: Acquire the first designated file from the main space based on the first file path; The acquired first designated file is written into the privacy space based on the second file path.

5. The method according to claim 4, It is characterized in that In the case where the first application is a file migration service, it is determined that the first application has read and write permissions for the first type of files in the main space.

6. The method according to claim 5, It is characterized in that The method further includes: in a case where it is determined that the first application does not have read and write permissions for the first type of files, In response to the first migration request, returning the identity identification file of the privacy space user; A second content provider is obtained based on the identity identification file of the privacy space user, wherein The second content provider cannot provide a path to access the first designated file.

7. The method according to claim 1, It is characterized in that The method further comprises: receiving a second migration request of the first application for a second designated file in the privacy space, wherein the second migration request is used to request migration of the second designated file from the privacy space to the main space; wherein the space in which the first application is running is the privacy space; When it is determined that the first application has read and write permissions for the second specified file, In response to the second migration request, the content provider corresponding to the second designated file is redirected from the fourth content provider in the private space to the third content provider in the main space; wherein, The third content provider is used for the first application to write the second designated file into the main space, so as to migrate the second designated file from the private space to the main space.

8. The method according to claim 7, It is characterized in that The second migration request includes a third file path and a fourth file path, wherein the third file path is an access path of the second designated file, and the fourth file path is a write path of the second designated file; and The third file path points to the private space, and the fourth file path points to the main space.

9. The method according to claim 8, It is characterized in that The content provider corresponding to the second designated file is redirected from the fourth content provider of the privacy space to the third content provider of the main space, including: In response to the second migration request, returning the identity identification file of the primary space user; The third content provider is obtained based on the identity identification file of the main space user, wherein: The third content provider is used to provide the fourth file path.

10. The method according to claim 9, It is characterized in that The step of migrating the second designated file from the private space to the main space includes: Acquire the second designated file from the privacy space based on the third file path; The acquired second designated file is written into the main space based on the fourth file path.

11. The method according to claim 10, It is characterized in that In the case where the first application is a file migration service, it is determined that the first application has read and write permissions for the second designated file.

12. The method according to any one of claims 1 to 11, It is characterized in that The first category of files includes any one of pictures, videos, audios, and contacts.

13. The method according to any one of claims 7 to 11, It is characterized in that The type of the second designated file includes any one of pictures, videos, audios, and contacts.

14. A file migration method, applied to an electronic device, wherein the electronic device is provided with a main space, a privacy space and a first application, and the file system of the electronic device is a user space file system, It is characterized in that The file data of the main space and the private space in the user space file system are isolated from each other, and the method includes: Receiving a first access request from a first application to a first type of file in a privacy space, wherein the space in which the first application is run is a main space; When it is determined that the first application has read permission for the first type of files in the privacy space, In response to the first access request, redirecting the content provider corresponding to the first type of files from the first content provider in the main space to the second content provider in the private space; wherein the second content provider is used for the first application to obtain the first type of files; receiving a second migration request by the first application for a first designated file in the first category of files in the privacy space, wherein the second migration request is used to request migration of the first designated file from the privacy space to the main space; In response to the second migration request, the first designated file is migrated from the private space to the main space if it is determined that the first application has read and write permissions for the first type of files in the private space.

15. The method according to claim 14, It is characterized in that The method further comprises: receiving a second migration request of the first application for a second designated file in the main space, wherein the second migration request is used to request migration of the second designated file from the main space to the private space; wherein the space running the first application is the main space; When it is determined that the first application has read and write permissions for the second specified file, In response to the second migration request, the content provider corresponding to the second designated file is redirected from the third content provider of the main space to the fourth content provider of the main space; wherein, The fourth content provider is used for the first application to write the second designated file into the private space, so as to migrate the second designated file from the main space to the private space.

16. An electronic device, It is characterized in that include: one or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the file migration method described in any one of claims 1 to 15.

17. A computer-readable storage medium, It is characterized in that The storage medium stores instructions, which, when executed on a computer, cause the computer to execute the file migration method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Data migration method and device

    CN105912951A

  • Application container for live migration of mobile applications

    CN107636612A