Data access method, electronic device, and computer-readable storage medium

By introducing a third application and system backup service with global transaction processing capabilities in electronic devices, a mapping relationship between the target application and the data transmission application is established, which solves the problems of performance degradation and increased power consumption caused by cross-process data copying and achieves efficient data transmission.

CN117785498BActive Publication Date: 2025-10-17HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211145801.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-20
Publication Date
2025-10-17
Estimated Expiration
2042-09-20

AI Technical Summary

Technical Problem

In the prior art, during data transmission, electronic devices require multiple cross-process data copies due to the data isolation mechanism between different applications, resulting in decreased data processing performance and increased system power consumption.

Method used

A mapping relationship between the target application and the data transmission application is established through a third application with global transaction processing capabilities. The handle and URI sharing technology of the system backup service are used to directly access the storage space of the target application, reducing cross-process data copying.

Benefits of technology

The data processing volume and storage resource usage during data transmission are reduced, system power consumption is reduced, and data transmission efficiency and performance are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117785498B_ABST
    Figure CN117785498B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computers, in particular to a data access method, an electronic device and a computer readable storage medium. The electronic device comprises a first electronic device, and the first electronic device comprises a first application, a second application and a third application. The method comprises the following steps: the third application detects an access request of accessing a first storage space of the first application, wherein the first storage space has a first access path; the third application establishes a second access path having a mapping relationship with the first access path in response to the access request; the third application sends the second access path to the second application; and the second application accesses the first storage space of the first application through the second access path. The application can save the data processing amount and the occupied storage resource of the electronic device in the data transmission scene of executing data cloning or data backup, and is beneficial to reducing the system power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a data access method, an electronic device and a computer readable storage medium. BACKGROUND

[0002] With the rapid development of technology, the types of intelligent terminal electronic devices applied in people's life are more and more. For example, according to the classification of device types, these electronic devices can include: mobile phones, tablets, computers, vehicle-mounted devices, smart homes, fitness devices, televisions, large screens, etc. According to different application scenarios, different electronic devices can be applied to office, home, sports, travel, education and other fields. The data stored on different electronic devices will also be updated in the use process. Therefore, in order to provide a good use experience, data transmission processes such as data cloning, data backup and data recovery between electronic devices are often needed to complete the information synchronization between the intelligent terminal devices specified by the user.

[0003] For example, when the user replaces a new device or adds a new device, the user needs to transmit the data (such as application data, pictures or files, etc.) in the old device to the new device to realize the information synchronization between the new device and the old device.

[0004] However, in the operating system carried by each intelligent terminal at present, the backup service provided by different applications and systems will run in their own processes. Due to security needs, the data of the storage space allocated to each process is isolated by the sandbox mechanism. Therefore, in the process of data transmission, the data backup process and the data recovery process need to rely on inter-process communication (IPC) to complete multiple cross-process data copying to realize it. As a result, a large number of data copying processes will bring great challenges to the data processing performance of the electronic device, and a large number of data copying processes will also occupy more memory resources on the new and old electronic devices, and cause the system power consumption to increase. SUMMARY

[0005] Therefore, the embodiments of the present application provide a data access method, an electronic device and a computer readable storage medium, which can be beneficial to save the data processing amount and the storage resources occupied by the electronic device in the process of data access in the data transmission scene such as data cloning or data backup, and beneficial to reduce the system power consumption.

[0006] In a first aspect, an embodiment of the present application provides a data access method applied to a first electronic device, the first electronic device comprising a first application, a second application and a third application, the method comprising: detecting, by the third application, an access request for accessing a first storage space of the first application, wherein the first storage space has a first access path; establishing, by the third application, a second access path having a mapping relationship with the first access path in response to the access request; sending, by the third application, the second access path to the second application; and accessing, by the second application, the first storage space of the first application through the second access path.

[0007] That is, the third application having the global transaction processing capability can obtain a second access path for the second application to access the first storage space corresponding to the first application. The second access path can be obtained by the third application through mapping, for example, by establishing a mapping relationship between the second access path and the first access path of the first storage space. Then, the third application can share the obtained second storage path with the second application in a certain way. The process of the third application sharing the second access path with the second application will be described in detail below, and will not be described here.

[0008] In a data transmission scenario, on the sending device side, the first application can be a third-party application or a system application for providing application data to be transmitted, and the second application can be a data transmission application, such as a cloning application or a backup and recovery application, for sending the application data to be transmitted to the receiving device side. On the receiving device side, the first application can be a third-party application waiting to obtain the application data to be transmitted for installation or running, or a system application waiting to obtain the application data to be transmitted for running, and the second application can be a data transmission application for receiving the application data to be transmitted from the sending device side, which can also write the received data into the storage space corresponding to the first application on the receiving device side. The data transmission application can be a cloning application or a backup and recovery application. The third application can be a backup service provided by the system of the sending device or a backup service provided by the system of the receiving device.

[0009] In a possible implementation of the first aspect, the first electronic device is a sending device, and the first electronic device establishes a communication connection with a second electronic device as a receiving device by running the second application. The method further comprises: sending, by the second application, first data read from the first storage space to the second electronic device.

[0010] That is, when the first electronic device is a sending device in a data transmission scenario, the method provided in the first aspect can further include sending the first data read from the first storage space to a receiving device, i.e., the second electronic device. The first data can be, for example, application data corresponding to the first application installed on the sending device.

[0011] In a possible implementation of the first aspect, the first electronic device is a receiving device, and the first electronic device establishes a communication connection with a third electronic device as a sending device by running a second application. The method further includes: writing, by the second application, second data received from the third electronic device into the accessed first storage space.

[0012] That is, when the first electronic device is a receiving device in a data transmission scenario, the method provided in the first aspect can further include writing second data received from a sending device, i.e., the third electronic device, into a first storage space corresponding to the first application on the receiving device. The second data can be, for example, application data corresponding to the first application to be installed or already installed on the receiving device.

[0013] In a possible implementation of the first aspect, application data of the first application and application data of the second application are isolated from each other.

[0014] It can be understood that, based on the isolation mechanism adopted by some operating systems, application data between different applications is isolated from each other. Only some system applications or system services with global transaction processing capability can process global transactions through a global transaction identifier of the system. For example, a backup service can establish a directory mapping relationship between a storage space corresponding to a third-party application and the system through an application startup service of the system. The directory mapping relationship can be, for example, a mapping relationship between the first access path and the second access path.

[0015] In a possible implementation of the first aspect, detecting, by the third application, an access request for accessing the first storage space of the first application includes: detecting, by the third application, an access request for accessing the first storage space of the first application sent by the second application, where the access request is sent by the second application to the third application in a case where the second application detects an operation request of a user indicating sending the first data of the first application to the second electronic device.

[0016] For example, the third application is a backup service provided by the system of the first electronic device, and the second application is a cloning application. The user operation corresponding to the operation request can be, for example, an operation of clicking to run the cloning application on the first electronic device and then selecting "This is a new device" or "This is an old device".

[0017] In a possible implementation of the first aspect, the third application establishes the second access path having a mapping relationship with the first access path in response to the access request, including: the third application creates a second storage space having the second access path in response to the access request; and the third application establishes a corresponding relationship between the second access path and the first access path by using an application startup service provided by the first electronic device, so that the second access path points to data corresponding to the first access path in the first storage space.

[0018] For example, the third application is a backup service provided by a system of the first electronic device, and the second storage space may, for example, be a first mapping directory created by the backup service. Correspondingly, the second access path may, for example, be an access path in the first mapping directory, and the first access path may, for example, be an access path corresponding to a data packet of application data in a first backup directory corresponding to a target application on the first electronic device. The target application may be a system application or a non-system application, i.e., a third-party application.

[0019] In a possible implementation of the first aspect, the third application sends the second access path to the second application, including: the third application sends a first handle corresponding to the second access path to the second application by using a global identifier, where the first handle is a tool for the third application to access the first storage space through the second access path, and the first handle corresponds to the second access path; and the second application obtains the second access path based on a corresponding relationship between the first handle and the second access path.

[0020] In a possible implementation of the first aspect, the second application accesses the first storage space of the first application through the second access path, including: the second application generates a second handle according to the obtained second access path, where the second handle is a tool for the second application to access the first storage space through the second access path; and the second application calls the generated second handle to access the first storage space of the first application.

[0021] For example, the third application is a backup service provided by a system of the first electronic device, and the first storage space may, for example, be a target application storage space, and the first handle may, for example, be a callable tool for the backup service to open the target application storage space. The backup service may then share a handle for opening the target application storage space in a process of the backup service with the second application, i.e., a cloned application, by using a global identifier.

[0022] Further, the cloned application may determine a corresponding second access path according to the handle in the received global identifier, i.e., an access path corresponding to the handle in the backup service. Based on the access path, the cloned application may generate a new handle corresponding to the access path in a process of the cloned application, to access / open the target application storage space, e.g., the first storage space, through the access path.

[0023] In a possible implementation of the first aspect, the global identifier comprises a uniform resource identifier (URI), and the URI specifically comprises a file information field, which is a mapping string corresponding to the first handle.

[0024] In a possible implementation of the first aspect, the first application comprises a system application or a third-party application, the second application comprises a cloned application, and the third application comprises a backup service provided by the first electronic device.

[0025] In the second aspect, an embodiment of the present application provides a data access apparatus, applied to a first electronic device, the first electronic device comprising a first application and a second application, and the apparatus comprising:

[0026] a backup module, configured to detect an access request of the second application to a first storage space of the first application, wherein the first storage space has a first access path; and in response to the access request, establish a second access path having a mapping relationship with the first access path, and send the second access path to the second application.

[0027] In the third aspect, an embodiment of the present application provides an electronic device, comprising: 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 performs the data access method in the first aspect and various possible implementations of the first aspect.

[0028] In the fourth aspect, an embodiment of the present application provides a computer readable storage medium, characterized in that the storage medium stores instructions, and the instructions, when executed on a computer, cause the computer to perform the data access method in the first aspect and various possible implementations of the first aspect.

[0029] In the fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program / instruction, and the computer program / instruction, when executed by a processor, implements the data access method in the first aspect and various possible implementations of the first aspect.

[0030] In summary, based on the data access method, the electronic device and the computer readable storage medium provided in the embodiments of the present application, the sending device side no longer needs to copy the application data to be transmitted from the storage space of the target application to the storage space of the system backup service, and then from the storage space of the system backup service to the storage space of the data transmission application. Correspondingly, the receiving device side no longer needs to copy the received application data from the storage space of the data transmission application to the storage space of the system backup service, and then from the storage space of the system backup service to the storage space of the target application. Avoiding a large number of data copying processes will bring great challenges to the data processing performance of the electronic device, and also solves the problem of increased system power consumption caused by a large number of data copying. BRIEF DESCRIPTION OF DRAWINGS

[0031] Figure 1a A principle diagram of accessing a storage space through a handle during application program running is shown.

[0032] Figure 1b An application scenario diagram of a data access method provided in the embodiments of the present application is shown.

[0033] Figure 2 A data transmission process diagram is shown.

[0034] Figure 3a A corresponding relationship diagram between handles, access paths and related data of storage spaces to be transmitted of each application program or service in the system of an electronic device provided in the embodiments of the present application is shown.

[0035] Figure 3b A data transmission process diagram provided in the embodiments of the present application is shown.

[0036] Figure 4 An interaction flowchart of a data access method provided in the embodiments of the present application is shown.

[0037] Figure 5 A data backup flowchart of a data access method provided in the embodiments of the present application is shown.

[0038] Figure 6 A diagram showing related operations performed by a data transmission application, a backup service and a target application in an electronic device 100 to achieve data backup during a backup process provided in the embodiments of the present application is shown.

[0039] Figure 7 A directory mapping process from a first backup directory to a first mapping directory completed by an application startup service provided by the system of an electronic device 100 provided in the embodiments of the present application is shown.

[0040] Figure 8Fig. 1 shows a data recovery flowchart of a data access method provided by an embodiment of the present application.

[0041] Figure 9 Fig. 2 shows a schematic diagram of data transmission application, backup service and related operations of target application for realizing data backup, in which an electronic device 200 runs in a backup process, according to an embodiment of the present application.

[0042] Figure 10 Fig. 3 shows a hardware structure schematic diagram of an electronic device 100, according to an embodiment of the present application.

[0043] Figure 11 Fig. 4 shows a system architecture schematic block diagram of an electronic device 100, according to an embodiment of the present application.

[0044] Figure 12 Fig. 5 shows another system architecture schematic block diagram of an electronic device 100, according to an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0046] It should be further declared that the steps in the methods and processes in the embodiments of the present application are numbered for the convenience of reference, rather than limiting the sequence, and if there is a sequence between the steps, the sequence should be based on the literal description.

[0047] In order to facilitate those skilled in the art to understand the solutions in the embodiments of the present application, some concepts and terms involved in the embodiments of the present application will be explained first.

[0048] (1) Inter-Process Communication (IPC) refers to the propagation or exchange of information between different processes. The ways of IPC usually include pipes (including unnamed pipes and named pipes), message queues, semaphores, shared storage, sockets, Streams, etc. Among them, sockets and Streams can support the IPC of two processes on different hosts.

[0049] (2) Sandbox is a virtual system program, which is essentially a running environment that limits the access of application programs to system resources. The environment provided by the sandbox is independent for each running program.

[0050] Linux namespace isolation mechanism provides the basis for the implementation of sandbox technology. After the use of namespace isolation by sandbox technology, the Unix time-sharing operating system, inter-process communication (IPC), file system, process control symbol and other system resources in the host except the kernel are no longer global, but belong to a specific namespace. The resources in each namespace are transparent and invisible to other namespaces. The sandbox achieves resource isolation by using this feature. The processes in different sandboxes belong to different namespaces and are transparent to each other without interference. For example, the process sandbox of WeChat TM , Weibo TM and other third-party applications, as well as the process sandbox of system backup service and the process sandbox of cloned applications are all isolated from each other without interference, and cross-process data exchange can be achieved through IPC technology.

[0051] (3) Uniform Resource Identifier (URI), a computer term, refers to a string used to identify the name of an Internet resource. For example, the access path of an HTML document, an image, a video clip, an application or a directory can be identified by a URI. URI allows users to interact with any resource (including local resources and Internet resources) through a specific protocol. The definition of URI can be determined by a scheme that determines the syntax and related protocols.

[0052] It can be understood that a URI is usually composed of three parts: ① the naming mechanism of the resource; ② the host name where the resource is stored; and ③ the name of the resource itself. For example, for a URI "https: / / blog.csdn.net / qq_32595453 / article / details / 79516787", it can be understood that ① it is a resource that can be accessed through the https protocol; ② the resource is located on the host blog.csdn.net; and ③ the name of the resource itself is " / qq_32595453 / article / details / 79516787".

[0053] (4) A handle is an unsigned integer that represents a memory object, but it does not actually point to the memory object. This is because, in general, user-mode applications cannot obtain the actual address of a memory object. In other words, a handle can be used as an index to find the actual address of the corresponding memory object in a table. This table is the handle table under the corresponding process. It can be understood that each process has a handle table, and the first item in the table is the handle of each process itself. Since there are many memory objects in the system, such as open files, created threads, application windows, etc., the handles in the handle table that point to the actual addresses of these memory objects can include file handles, thread handles, window handles, etc.

[0054] It is understood that in virtual memory-based operating systems, the memory manager frequently moves these memory objects back and forth within memory to meet the needs of various applications. The movement of memory objects means that the access path to these objects will change accordingly. To accommodate these changes in access paths, the electronic device's system assigns a fixed access path to each memory object for each application. This access path describes the corresponding memory object's location within the memory space and can register changes in the location of each memory object within the storage space. However, the access path assigned by the system to each application remains unchanged.

[0055] refer to Figure 1a As shown, the above memory object can be, for example, Figure 1a The application data 1, application data 2, ..., application data n corresponding to a certain application shown in FIG. The access path corresponding to each application data can be Figure 1a Shown are access path 1, access path 2, ..., access path n. Figure 1a The handle 1 shown corresponds to the access path 1 used to access the application data 1. Figure 1a The handle 2 shown corresponds to the access path 2 used to access the application data 2. Figure 1a The handle n shown points to an access path n for accessing application data n.

[0056] Figure 1b According to an embodiment of the present application, a schematic diagram of an application scenario of a data access method is shown.

[0057] like Figure 1b As shown, the scenario includes a mobile phone 100. For example, the mobile phone 100 may be a new device that the user has replaced, or it may be an old device that the user has replaced. The user may click the settings application icon 011 on the desktop 101 of the mobile phone 100 to launch the settings application. In response to the user's operation of launching the settings application, the mobile phone 100 displays the settings interface 102.

[0058] Further, the user can perform a sliding operation on the setting interface 102, such as up-down sliding or left-right sliding, and find the "system and update" function option 021, and click the function option 021. In this way, the mobile phone 100 can display a function interface 103 corresponding to "system and update" in response to the clicking operation. On the function interface 103, the user can click the "mobile phone cloning" function option 031 or the "backup and recovery" function option 032 to perform data cloning, backup or recovery, etc.

[0059] For example, the user clicks the "mobile phone cloning" function option 031 on the function interface 103, and then the user can select "this is an old device" on the cloning interface 104 displayed by the mobile phone 100 to send data, and then the user can select the device to which the data on the mobile phone 100 is to be transmitted according to the prompt, i.e., specify the receiving device. After the user determines the receiving device of the data transmission according to the operation prompt further displayed by the mobile phone 100 and initiates the connection, the mobile phone 100 can establish a communication connection with the receiving device. In the embodiments of the present application, the communication connection can be achieved by establishing a data transmission channel between the data transmission applications running on the mobile phone 100 and the receiving device, which are application programs for realizing cross-device data transmission. The data transmission application can be a device replacement cloning application (referred to as a cloning application) or a cloning function component in a setting application, etc. The data transmission channel can be a channel established based on the Wi-Fi to which the mobile phone 100 and the receiving device are connected, or a channel established based on the Bluetooth connection between the two, etc., which is not limited herein. In this way, the application data, pictures, files, etc. on the mobile phone 100 can be transmitted to the receiving device through the data transmission channel.

[0060] In other embodiments, the user can also select "this is a new device" on the cloning interface 104 displayed by the mobile phone 100 to receive data, and then the user can select the device from which the data is to be uploaded to the current mobile phone 100 according to the prompt, which is not limited herein.

[0061] Similarly, if the user selects the "backup and recovery" function option 032 on the "system and update" function interface 103 displayed by the mobile phone 100 and selects to backup data to a specified receiving device or to the cloud, the process of sending data on the mobile phone 100 to the receiving device or the cloud can be triggered. If the user selects to restore data to the local, the process of receiving data from other devices or the cloud to the mobile phone 100 can be triggered. The user operation for triggering the data transmission process is not limited herein.

[0062] For the above Figure 1b data transmission scenarios, Figure 2 a data transmission process schematic diagram is shown.

[0063] like Figure 2 As shown, when the application data corresponding to the third-party application 201a installed on device A needs to be transferred to device B, the backup service 202a in the system of device A must first copy the application data from the storage space allocated to the process where the third-party application 201a is located through IPC across processes, and save it in the storage space allocated to the process corresponding to the backup service 202a, that is, Figure 2 The copy ① shown corresponds to the process. The application data may include but is not limited to the application package and the historical operation data generated during the operation of the application.

[0064] It is understood that the storage space allocated to a process in this embodiment of the present application refers to the namespace containing the various data resources that can be accessed by the process running the corresponding program, and is also the independent operating environment of the corresponding process. The above-mentioned application data belongs to the third-party application 201a and is therefore located in the namespace mounted by the third-party application 201a, that is, in the storage space allocated to the process where the third-party application 201a is located.

[0065] Then, the clone application 203a used to realize data transmission across devices copies the application data from the storage space corresponding to the process of the backup service 202a through IPC, and saves it to the storage space corresponding to the process of the clone application 203a. Figure 2 The cloned application 203a on device A then transmits the copied application data to the storage space allocated to the process of the cloned application 203b on device B through the data transmission channel established between the cloned application 203a and the cloned application 203b on device B.

[0066] Then, the process of the backup service 202b on device B further copies the application data from the storage space allocated to the process of the cloned application 203b, that is, Figure 2 The process of the third-party application 201b on device B further copies the application data from the storage space allocated by the backup service 202b process, that is, Figure 2 Thus, after the above four application data copying processes, the process of the third-party application 201b on device B can use the copied application data to update the application package, historical operation data, etc. of the third-party application 201b, thereby achieving data synchronization with the third-party application 201a on device A.

[0067] Obviously, Figure 2The data transmission process shown needs to pass through multiple data copying processes, which brings great challenges to the data processing performance of the electronic device, and also occupies more storage resources of the storage space allocated to each process, and increases the system power consumption.

[0068] To solve the above problems, the embodiments of the present application provide a data access method applied to an electronic device. Specifically, on the sending device side, when responding to the user operation of cloning application data, the data transmission application can directly perform a read operation on the related data in the storage space of the target application. Since the data of the applications are isolated from each other, the related data of the target application cannot be directly provided to the data transmission application, and therefore the target application can share the access path corresponding to the related data through the backup service of the system to the data transmission application. Since the application at the application layer needs to open the storage space to read data through the handle of the access path corresponding to the storage space in the process of the application, the above-mentioned sharing of the access path corresponding to the related data through the backup service of the system to the data transmission application can be realized by sharing the handle in the backup service process to the data transmission application.

[0069] For example, referring to Figure 3a The specific implementation means can be to first map the access path corresponding to the related data in the storage space of the target application into the directory created in the backup service, to form the access path in the backup service for accessing the related data in the storage space of the target application. For example Figure 3a The access path 1 corresponding to the application data 1, the access path 2 corresponding to the application data 2, …, and the access path n corresponding to the application data n are written into the directory of the backup service, which can form the access path ①, the access path ②, …, and the access path n. At this time, the backup service and the target application can use different access paths (for example, the access path ① and the access path 1) of their respective processes to open the related data (for example, the application data 1) in the same storage space. Then, the backup service can share the handle corresponding to each access path in its own process, such as Figure 3a the handle ① corresponding to the access path ①, the handle ② corresponding to the access path ②, and the like, to the data transmission application through the global identifier. Based on the corresponding relationship between each handle and each access path in the backup service, the data transmission application can obtain each access path corresponding to each handle shared by the backup service.

[0070] Further, the data transmission application can establish the corresponding relationship between each handle in its own process and each access path obtained from the backup service, such as Figure 3aThe corresponding relationship between handle I and access path 1, handle II and access path 2, and the like is shown. At this time, the data transmission application can open and read the corresponding application data 1, application data 2, and the like in the target application storage space through handle I, handle II, and the like, and send them to the receiving device. That is, the data transmission application and the backup service can open the same data (for example, application data 1) through the same access path (for example, access path 1) in the respective processes (for example, handle I and handle 1).

[0071] Correspondingly, on the receiving device side, the data transmission application can directly perform a write operation on the storage space of the target application when receiving the application data in response to the user operation. Specifically, when preparing the installation environment of the target application, the target application to be installed or updated can also share the access path corresponding to the required related data with the data transmission application through the backup service of the system. This sharing process can also be achieved by sharing the handle in the backup service process with the data transmission application, for example.

[0072] For example, continuing to refer to Figure 3a Specific implementation means can also be to first establish the mapping relationship between access path 1, access path 2, and the like in the target application and access path 1, access path 2, and the like in the backup service. Then, the backup service can share the handle corresponding to each access path in its own process, for example Figure 3a handle 1 corresponding to access path 1 and handle 2 corresponding to access path 2, and the like, with the data transmission application through a global identifier. Further, the data transmission application can obtain the corresponding access path according to the handle shared from the backup service, and generate a handle corresponding to each access path in its own process, for example, handle I corresponding to access path 1 and handle II corresponding to access path 2. At this time, the data transmission application can open the target application storage space through handle I, handle II, and the like using access path 1, access path 2, and the like in the backup service, and write the corresponding application data 1, application data 2, and the like.

[0073] In some embodiments, the above-mentioned target application related data can be a data package obtained by packaging the application data allowed to be cloned by the target application, for example. The read operation of the data transmission application on the related data of the target application storage space on the sending device side can be implemented by calling the corresponding handle through the read function readdir(), for example. The write operation of the data transmission application on the target application storage space on the receiving device side can be implemented by calling the corresponding handle through the write function writedir(), for example. The global identifier can be a uniform resource identifier (URI), for example. This is not limited herein.

[0074] It can be understood that the above target application can be a system application or a non-system application, i.e., a third-party application. The system application refers to an application program that does not provide an uninstall option in the normal use process, and the non-system application refers to an application program that can be installed or uninstalled according to user demand. The above data transmission application can be, for example, a cloning application or a functional module for cloning data as shown in the above Figure 1b , or a backup and recovery application or a functional module as shown in the above Figure 1b , and the like, which is not limited here.

[0075] Based on the above data access method provided by the embodiments of the present application, the sending device side no longer needs to copy the application data to be transmitted from the storage space of the target application to the storage space of the system backup service, and then from the storage space of the system backup service to the storage space of the data transmission application. Correspondingly, the receiving device side no longer needs to copy the received application data from the storage space of the data transmission application to the storage space of the system backup service, and then from the storage space of the system backup service to the storage space of the target application. In this way, it is beneficial to save the data processing amount and the storage resources occupied by the electronic device in the process of performing data cloning or data backup and other data transmission scenarios for data access, and it is beneficial to reduce the system power consumption.

[0076] In addition, the data access method provided by the embodiments of the present application, by means of directory mapping and sharing global identifier, realizes the process of passing the target application related data access path to the data transmission application, only involves the mapping process of the corresponding access path, the process of sharing the handle through the URI global identifier, and the read / write function calling process based on the handle, and the bandwidth occupied by the transmission process of the application data itself in the sending device or the receiving device is smaller, so the data transmission amount can be reduced, and it is beneficial to improve the data transmission efficiency and performance inside the sending device and the receiving device.

[0077] Figure 3b According to the embodiments of the present application, a data transmission process schematic diagram is shown.

[0078] As Figure 3b shown, taking the target application as a third-party application and the data transmission application as a cloning application as an example. When the application data corresponding to the third-party application 301a installed on the device A needs to be transmitted to the device B, the third-party application 301a of the device A can first package the related application data into a first backup directory. Then the device A can store the configuration file related to the first backup directory, such as the access path of each data packet in the directory, into the access path stored in the first mapping directory corresponding to the backup service 302a, i.e. Figure 3bThe “dynamic directory mapping” process on the device A shown is also a process of writing the access path mapping corresponding to each data packet in the first backup directory into the first mapping directory.

[0079] The first mapping directory is only used to store the access path and does not store any data. Then the backup service 302a in the device A system can use URI sharing technology to share the handle corresponding to the access path of the first mapping directory with the data transmission application through the first mapping directory URI, for example Figure 3b The clone application 303a shown is used to perform operations such as reading or writing on the first mapping directory. Figure 3b The URI sharing process on device A is shown.

[0080] In this way, based on dynamic directory mapping and the above-mentioned URI sharing technology, the solution provided in the embodiment of the present application can effectively avoid multiple data copying processes between third-party applications, backup services and data transmission applications, which is conducive to reducing the amount of data transmission and reducing the storage space occupied by the transmitted data.

[0081] Then, the clone application 303a on device A can transmit the data packet read from the first backup directory to the clone application 303b on device B through the data transmission channel established between the clone application 303b and the clone application 303a on device B.

[0082] Then, the backup service 302b on device B can share the access path of the corresponding second mapping directory with the clone application 303b via URI, and the clone application 303b can write the received data packet into the second mapping directory based on the second mapping directory URI. The second mapping directory can be an empty directory with no content. This process is Figure 3b The URI sharing process on device B is shown. Further, based on the mapping relationship between the second backup directory of the third-party application 301b and the second mapping directory of the backup service 302b, the second backup directory of the third-party application 301b on device B can also write a corresponding mapping data packet, that is, Figure 3b The dynamic directory mapping process on device B is shown. Finally, the third-party application 301b on device B unpacks the data packets in the second backup directory into the corresponding application data storage space, thus completing the transmission of the application data.

[0083] Compare to the above Figure 2 and Figure 3b The data transmission process shown above can be understood. Figure 3bThe data transmission process provided by the embodiments of the present application can ingeniously avoid multiple copying processes of the data to be transmitted in the electronic devices, and provide a sending device of the data to be transmitted and a receiving device of the data to be transmitted, so as to realize the internal data transmission process between the data transmission application and the target application with the cross-device data transmission function by means of the dynamic directory mapping and the URI sharing technology, so that the cross-process data transmission amount is smaller, and the data transmission efficiency is higher.

[0084] It can be understood that the electronic devices used as the sending device or the receiving device in the data access method provided by the embodiments of the present application can include but are not limited to a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a netbook, an augmented reality (AR) \ virtual reality (VR) device, a smart television, a smart watch, a server, a mobile email device, an in-vehicle infotainment device, a portable game console, a portable music player, a reader device, a television embedded with or coupled to one or more processors, or other electronic devices capable of accessing a network.

[0085] Figure 4 An interaction flowchart of a data access method is shown according to an embodiment of the present application. It can be understood that, in order to clearly illustrate the implementation process of the data access method provided by the embodiments of the present application, Figure 4 The execution subject of each step of the flowchart shown is an electronic device 100 and an electronic device 200. The electronic device 100 can be a sending device, for example, the device A in the above Figure 3b The device A shown is an electronic device providing data to be transmitted. The electronic device 200 can be a receiving device, for example, the device B in the above Figure 3b The device B shown is an electronic device receiving data to be transmitted.

[0086] As Figure 4 The interaction flowchart includes the following steps:

[0087] 401: The electronic device 100 and the electronic device 200 establish a communication connection based on the detected connection operation.

[0088] Exemplarily, the electronic device 100 and the electronic device 200 can be connected to the same wireless local area network, for example, connected to the same Wi-Fi, etc. When the electronic device 100 detects a connection operation of a user on the related interface of the data transmission application, the electronic device 100 can establish a connection with the electronic device 200 in response to the operation of the user. For example, the data transmission application can be the cloning application corresponding to the "mobile phone cloning" in the scenario shown in the above Figure 1bThe user clicks "This is a new device" on the cloning interface 104 to display the connection QR code of the mobile phone 100, so as to provide the electronic device 200 with the operation of scanning the code. In other embodiments, the connection operation described above can also be the operation of scanning the connection QR code displayed by the electronic device 200 on the cloning interface 104, which is not limited herein. Further, the data transmission channel between the data transmission applications of the electronic device 100 and the electronic device 200 can be established. Figure 1b The user clicks "This is a new device" on the cloning interface 104 to display the connection QR code of the mobile phone 100, so as to provide the electronic device 200 with the operation of scanning the code. In other embodiments, the connection operation described above can also be the operation of scanning the connection QR code displayed by the electronic device 200 on the cloning interface 104, which is not limited herein. Further, the data transmission channel between the data transmission applications of the electronic device 100 and the electronic device 200 can be established.

[0089] In other embodiments, the process of establishing a communication connection in step 401 can also be initiated by the electronic device 200 detecting the relevant connection operation of the user, which is not limited herein.

[0090] 402: The electronic device 100 detects that the user specifies the target application for cloning.

[0091] For example, after the communication connection between the electronic device 100 and the electronic device 200 is established, the electronic device 100 and / or the electronic device 200 can display a related interface indicating that the connection is successful, or display a related interface prompting the user to select the data to be backed up. The data to be backed up can include application programs, pictures, video files, audio files, etc. selected by the user on the corresponding interface, which is not limited herein. The embodiments of the present application exemplarily describe the execution content of each step by taking the application program selected by the user as an example, which is the target application specified by the user for cloning.

[0092] 403: The electronic device 100 creates a first backup directory in the storage space corresponding to the target application, and packs the application data to be backed up into the first backup directory.

[0093] For example, the electronic device 100 can run the target application in response to the operation of the user specifying the target application, and create a first backup directory in the corresponding allocated storage space through the process of the target application, and pack the application data to be backed up into the first backup directory.

[0094] The process of the electronic device 100 creating a first backup directory in the target application and packing the application data can refer to the related description in steps 501-502 of the flow shown below, which is not repeated herein. Figure 5 The related description in steps 501-502 of the flow shown below, which is not repeated herein.

[0095] 404: The electronic device 100 maps the access path of each data packet in the first backup directory to the access path in the first mapping directory created in the backup service of the system.

[0096] Exemplarily, after the electronic device 100 saves the packaged data packet in the first backup directory based on the target application, the electronic device 100 can control the data packet in the first backup directory to be mapped to the first mapping directory created by the backup service of the system in a manner of directory mapping, for example, the access path of each data packet in the first backup directory is mapped to the access path stored in the first mapping directory of the backup service. The first mapping directory can only store the access path and not store other data. In this way, the backup service or the data transmission application can open the first backup directory in the target application based on the access path in the first mapping directory to read the corresponding data packet.

[0097] The process of completing the directory mapping between the first backup directory and the first mapping directory in the electronic device 100 can be referred to the related description in steps 503-504 of the flow shown in FIG. 5, which will not be repeated here. Figure 5

[0098] 405: The electronic device 100 obtains the access path for accessing the first backup directory based on the handle in the first mapping directory URI, and then opens the first backup directory based on the obtained access path to read the corresponding data packet.

[0099] Exemplarily, the backup service in the electronic device 100 can share the handle corresponding to the access path in the first mapping directory to the data transmission application for transmitting data through the first mapping directory URI, and then the data transmission application can obtain the access path for opening the first backup directory of the target application in the backup service based on the handle in the URI, and then open the first backup directory by using the handle generated in the process of the data transmission application to read the corresponding data packet.

[0100] The process of sharing the URI in the electronic device 100 and reading the data packet based on the URI can be referred to the related description in steps 505-506 of the flow shown in FIG. 5, which will not be repeated here. Figure 5

[0101] 406: The electronic device 100 sends the read data packet to the electronic device 200 based on the established communication connection.

[0102] Exemplarily, the electronic device 100 can send the data packet in the first backup directory read based on the URI to the data transmission application on the currently connected electronic device 200 through the data transmission application. The process of transmitting the data packet between the electronic device 100 and the electronic device 200 through the running data transmission application can be referred to the related description in steps 507 and 508 of the flow shown in FIG. 5, which will not be repeated here. Figure 5 Figure 8 The process of transmitting the data packet between the electronic device 100 and the electronic device 200 through the running data transmission application can be referred to the related description in steps 507 and 508 of the flow shown in FIG. 5, which will not be repeated here.

[0103] ​​​407: The electronic device 200 receives the data packet and acquires the access path in the created second mapping directory.

[0104] Exemplarily, the electronic device 200 can receive the data packet sent by the electronic device 100 through the data transmission application through the data transmission application. And the data transmission application in the electronic device can acquire the corresponding access path in the second mapping directory through the handle carried in the second mapping directory URI shared by the backup service of the system. Wherein, the second mapping directory can be a directory created by the backup service of the system for the installation target application, and the second mapping directory can be an empty directory. It can be understood that each access path in the second mapping directory corresponds to the access path corresponding to each data packet to be written in the second backup directory in the target application. That is, the access based on each access path pair in the second mapping directory can open the second backup directory to write the related data packet.

[0105] The detailed process of the electronic device 200 acquiring the access path of the second mapping directory can be referred to the related description in step 802 of the flow shown in the following Figure 8 The detailed process of the electronic device 200 acquiring the access path of the second mapping directory can be referred to the related description in step 802 of the flow shown in the following

[0106] 408: The electronic device 200 opens the second backup directory and writes the received data packet based on the mapping relationship between the access paths in the second mapping directory and the second backup directory and the acquired access path.

[0107] Exemplarily, according to the mapping relationship between the second mapping directory and the second backup directory and the acquired access path, the electronic device 200 accesses the second backup directory, and can write the received corresponding data packet in the second backup directory according to the handle acquired by accessing the second backup directory.

[0108] According to the mapping relationship between the access paths and the acquired access path, the process of accessing the second backup directory and writing the received data packet in the second backup directory can be referred to the related description in steps 803-804 of the flow shown in the following Figure 8 The detailed process of the electronic device 200 acquiring the access path of the second mapping directory can be referred to the related description in step 802 of the flow shown in the following

[0109] 409: The electronic device 200 performs data unpacking on the data packet in the second backup directory, and completes the transmission process of the application data related to the target application.

[0110] Exemplarily, after completing the data packet writing into the second backup directory, the electronic device 200 can call the process corresponding to the target application, unpack the data packet in the second backup directory, and save the application data obtained by unpacking to the application data directory under the root directory corresponding to the target application. In this way, in the process of running the target application, the process of the target application can call the application data in the corresponding directory to perform the corresponding task.

[0111] The specific process of data unpacking and restoring application data can be referred to the relevant description in step 805 of the flow shown below Figure 8 The specific process of data unpacking and restoring application data can be referred to the relevant description in step 805 of the flow shown below

[0112] The above Figure 4 The data backup process implemented in the electronic device 100 and the data recovery process implemented in the electronic device 200 in the implementation process of the data access method shown above will be described in detail.

[0113] As an example, Figure 5 According to an embodiment of the present application, a data backup flow diagram of a data access method is shown. It can be understood that Figure 5 The execution subject of each step of the flow shown above can be the data transmission application 110, the backup service 120 and the target application 130 running on the electronic device 100.

[0114] As Figure 5 shown, the flow includes the following steps:

[0115] 501: The target application 130 creates a first backup directory in the corresponding storage space.

[0116] Exemplarily, after detecting that the user operates the target application 130 specified for cloning, the electronic device 100 can run the target application 130 and control the target application 130 to create a first backup directory for backing up related data. The target application 130 can be a third-party application 301a such as WeChat TM application, Weibo TM application, Jingdong TM shopping application, etc. In some other embodiments, the target application 130 can also be a system application, such as a gallery application, a settings application, etc., which is not limited herein. Figure 3b 502: The target application 130 data packs the application data to be backed up, and saves the packed data packet to the first backup directory.

[0117]

[0118] ​Exemplarily, after the target application 130 of the electronic device 100 completes the creation of the first backup directory, it can pack the application data that needs to be backed up and save the corresponding data packets in the first backup directory. Among them, data packaging, in the embodiment of the present application, refers to compressing the directory where the corresponding application data is located or the corresponding data itself into a corresponding data compression package. The format of the data packet obtained by data packaging can be, for example, a ".tar" format. In some embodiments, after using the tar command to pack the directory into a data packet, the data packet can be compressed using the gzip command or the bzip2 command for easy transmission, which will not be elaborated here.

[0119] Figure 6 According to an embodiment of the present application, a schematic diagram of related operations performed by a data transmission application, a backup service, and a target application running on an electronic device 100 to implement data backup during a backup process is shown.

[0120] like Figure 6 As shown, the target application 130 can create a first backup directory "backup" under the root directory " / " created by the system for the target application 130, which is used to store data packets of corresponding application data. Afterwards, the target application 130 can transfer the application data to be transmitted, such as Figure 6 The application package files "files", distributed files "distributedfiles", database "database", etc. shown are packaged into corresponding data packages "files.tar", "distributedfiles.tar", "database.tar", and saved in the first backup directory "backup".

[0121] It is understandable that in other embodiments, the first backup directory created by the target application 130 may also adopt other naming methods different from “backup”, which is not limited here.

[0122] 503: The backup service 120 creates a first mapping directory.

[0123] For example, during the data transmission process, the electronic device 100 needs to start the backup service 120 provided by the operating system. During operation, the backup service 120 can create a first mapping directory for establishing a mapping relationship with the first backup directory of the target application 130 using methods such as dynamic directory mapping. The specific process of establishing the mapping relationship with the first backup directory of the target application 130 will be described in detail in step 504 below and will not be repeated here.

[0124] Refer to the above Figure 6 As shown, the first mapping directory created by the backup service 120 may be, for example, Figure 6The shown directory is "app_n". The backup service 120 can create a mapping directory corresponding to different application programs, and use the mapping directory name corresponding to the application package name of the corresponding application program, for example, "app_1", "app_2", "app_n", etc., which is not limited herein.

[0125] 504: The backup service 120 and the target application 130 complete the mapping of the access path of each data package in the first backup directory to the access path in the first mapping directory through a system call.

[0126] Exemplarily, after the creation of the first mapping directory in the backup service 120 of the electronic device 100 is completed, the target application 130 can map the packaged data package file in the first backup directory to the first mapping directory. This mapping process can be realized through the global transaction processing capability of the application startup service provided by the system of the electronic device 100, or through other ways, for example, through some mapping algorithm, such as bind mounts, etc., which is not limited herein.

[0127] Figure 7 According to the embodiments of the present application, a directory mapping process from the first backup directory to the first mapping directory through the application startup service provided by the system of the electronic device 100 is shown.

[0128] As shown in Figure 7 When the target application 130 is started and runs in the system of the electronic device 100, the process in which the application startup service 140 is located can create a third backup directory corresponding to the target application 130. The backup directory can refer to the third backup directory "backup" in the application startup service 140 shown in Figure 7 Further, the application startup service 140 can perform directory mapping between the parent directory "com.example.app" mounted by the created third backup directory and the root directory " / " of the target application 130 based on the global transaction processing capability possessed by itself. Correspondingly, the application program package file "files", the distributed file "distributedfiles", the database "database" and the like in the target application 130, and the data in the created first backup directory, can be correspondingly mapped to the directory "com.example.app" of the application startup service 140.

[0129] When the backup service 120 starts running, the application startup service 140 can map the data in the third backup directory to the directory "com.example.app" created in the backup service 120. In this way, the directory "com.example.app" in the backup service 120 can be mapped to the data package in the first backup directory "backup" of the target application 130. It can be understood that the directory "com.example.app" in the backup service 120 that completes the directory mapping can be the same as the first backup directory "app_n" created in the backup service 120 as shown in the above Figure 6 In other embodiments, the directory "com.example.app" created in the backup service 120 or the first backup directory "app_n" in the above Figure 6 may also be named as other names, which are not limited herein.

[0130] It can be understood that after the system of the electronic device 100 completes the directory mapping process as shown in the above Figure 7 , the directory "com.example.app" in the backup service 120 and the first backup directory "backup" in the target application 130 are equivalent directories, and the root directory " / " in the target application 130 and the directory "com.example.app" in the application startup service 140 are also equivalent directories. In this way, the operation on the directory "com.example.app" in the backup service 120 can be equivalent to the operation on the first backup directory "backup" in the target application 130.

[0131] 505: The backup service 120 shares the first mapping directory URI with the data transmission application 110.

[0132] Exemplarily, the backup service 120 of the electronic device 100 can generate the first mapping directory URI based on the handle corresponding to each access path in the first mapping directory, and the URI can carry the handle corresponding to each access path in the first mapping directory, for example. As described above, the access path can access the corresponding first backup directory in the target application. Further, the backup service 120 can expose the access node corresponding to the generated first mapping directory URI to the data transmission application 110, so as to share the first mapping directory URI with the data transmission application 110.

[0133] 506: The data transmission application 110 reads the data package in the first backup directory based on the received first mapping directory URI and the mapping relationship between the first mapping directory and the access path in the first backup directory.

[0134] Exemplarily, after receiving the first mapping directory URI shared by the backup service 120, the data transmission application 110 running on the electronic device 100 can use the handle carried in the URI to obtain an access path in the backup service 120 that can access the first backup directory corresponding to the first mapping directory, and then generate a new handle in the process of the data transmission application 110 to access the first backup directory through the access path. Specifically, the data transmission application 110 can determine the access path corresponding to the handle based on the handle obtained from the URI, and then generate a handle that uses the access path to open the first backup directory. Finally, the first backup directory is opened based on the generated handle to read related data.

[0135] Referring to the above Figure 6 As an example, the data transmission application 110 can include a network transmission module 111 and a file operation module 112. The network transmission module 111 can be used for communication between the data transmission application running on the electronic device 200. The file operation module 112 can be used for reading or writing operations on the first mapping directory according to the first mapping directory URI shared by the backup service 120.

[0136] It can be understood that the related data read by the data transmission application 110 from the first backup directory can be the data packet obtained by the target application 130 in step 502 from the application data to be backed up, such as "files.tar", "distributedfiles.tar", "database.tar", etc.

[0137] 507: The data transmission application 110 sends the read data packet to the electronic device 200.

[0138] Exemplarily, the data transmission application 110 can send the read data packet to the data transmission application running on the electronic device 200 through the data transmission channel established between the data transmission application and the data transmission application running on the electronic device 200.

[0139] As an example, referring to the above Figure 6 The data transmission application 110 can communicate with the electronic device 200 based on the network transmission module 111. In other embodiments, the communication mode between the electronic device 100 and the electronic device 200 can also be other modes, such as Bluetooth connection, etc., which are not limited here.

[0140] The process of establishing a communication connection between the electronic device 100 and the electronic device 200 and establishing a data transmission channel between the data transmission applications can be referred to the related description in step 401 above, which will not be repeated here.

[0141] Based on the data backup process of steps 501 to 507, the data transmission application 110 in the electronic device 100 can complete the process of transmitting the application data of the target application 130 to be backed up to the data transmission application 110 without copying the data in the electronic device 100. This is beneficial to reduce the power consumption of the electronic device 100 in processing the data copy and save the system storage space of the electronic device 100, thereby improving the efficiency and performance of the electronic device 100 in processing the data to be transmitted.

[0142] Accordingly, the following describes the specific implementation process of the receiving device for recovering the application data based on the received data packet.

[0143] As an example, Figure 8 According to the embodiment of the present application, a data recovery flowchart of a data access method is shown. It can be understood that Figure 8 The execution subject of each step of the flowchart shown can be the data transmission application 210, the backup service 220, and the target application 230 running in the electronic device 200.

[0144] As Figure 8 The flowchart shown includes the following steps:

[0145] 801: The data transmission application 210 receives the data packet sent by the electronic device 100.

[0146] As an example, the data transmission application 210 running in the electronic device 200 can receive the data packet sent by the connected electronic device 100. The data packet is a data packet packaged from the application data of the target application 130 backed up from the electronic device 100. It can be understood that since the communication connection has been established between the data transmission application 210 running in the electronic device 200 and the data transmission application 110 running in the electronic device 100, and the data transmission channel has been established between them, the above-mentioned data packet can be transmitted by the data transmission application 110 to the data transmission application 210 through the data transmission channel.

[0147] 802: The data transmission application 210 obtains the second mapping directory URI shared by the backup service 220.

[0148] As an example, when preparing the installation environment of the target application 230, the electronic device 200 can run the backup service 220 to create a second mapping directory corresponding to the second backup directory of the target application 230. Further, the backup service 220 can share the URI generated by the handle based on the access path of the second mapping directory to the data transmission application 210 to provide the data transmission application 210 with the access path of the second mapping directory.

[0149] Figure 9According to the embodiment of the present application, a schematic diagram of a data transmission application, a backup service and related operations performed by a target application for realizing data backup, in which the electronic device 200 runs in a backup process, is shown.

[0150] As shown in Figure 9 As shown in FIG. 8, when the electronic device 200 as a receiving device performs recovery of corresponding application data, it needs to prepare an installation environment of the corresponding application program, for example, a root directory “ / ” corresponding to the target application 230, a directory corresponding to storage of each application data, for example, “files”, “distributedfiles”, “database” and the like, and a second backup directory “backup” for saving a data package of the corresponding application data can be created in the system of the electronic device 200. In addition, a second mapping directory “app_n” can also be created in the corresponding space of the backup service 220 of the system of the electronic device 200, and the access path of the directory “app_n” is mapped as the access path of the second backup directory “backup” in the target application 230. Further, the backup service 220 can share the handle corresponding to the access path of the second mapping directory “app_n” to the data transmission application 210 through the URI, so as to provide the data transmission application 210 with the access path in the directory “app_n”.

[0151] Based on this, when the data transmission application 210 running in the electronic device 200 receives the data package sent by the data transmission application 110 running in the electronic device 100, it can write the received data package into the second mapping directory based on the second mapping directory URI. The process of writing a file into the second mapping directory can be referred to the related description in the following step 803, which will not be repeated here.

[0152] 803: The data transmission application 210 acquires the access path corresponding to the writing position of each data package in the second backup directory mapped by the second mapping directory based on the second mapping directory URI.

[0153] Exemplarily, the data transmission application 210 running in the electronic device 200 can determine the access path corresponding to the handle in the second mapping directory according to the handle carried by the acquired second mapping directory URI, and the access path is used to open the first backup service in the target application 230. Further, the data transmission application 210 can generate a new handle based on the access path, so as to write the received data package into the second backup directory.

[0154] Referring to the above Figure 9As shown, as an example, the data transmission application 210 can include a network transmission module 211 and a file operation module 212. The network transmission module 211 can be used to perform the process of receiving the data packet in step 801 described above. The file operation module 212 can be used to perform the process of obtaining the access path corresponding to the second backup directory according to the obtained second mapping directory URI, accessing the second backup directory and writing the data packet file in the second backup directory, and the like in steps 802 to 804 described above. The file written in the second backup directory described above can be the data packet received by the network transmission module 211.

[0155] 804: The data transmission application 210 opens the second backup directory based on the obtained access path and writes the received data packet in the second backup directory.

[0156] As an example, the backup service 220 and the target application 230 running on the electronic device 200 can write the corresponding data packet file in the second backup directory corresponding to the second mapping directory based on the mapping relationship between the second mapping directory and the access path in the second backup directory. The process of establishing the mapping relationship between the second mapping directory and the access path in the second backup directory can be referred to the process described above. Figure 7 As shown and described above, details are not repeated here.

[0157] As described above Figure 9 As shown, as an example, the file operation module 212 of the data transmission application 210 can obtain the access path in the second mapping directory "app_n" based on the URI corresponding to the second mapping directory "app_n" in the backup service 220. Further, the data transmission application 210 can generate a new handle based on the access path, and use the new handle to open the second backup directory "backup" in the target application 230 based on the mapping relationship between the second mapping directory "app_n" and the access path in the second backup directory "backup" in the target application 230, and write the received data packet.

[0158] 805: The target application 230 unpacks the data packet in the second backup directory and restores the application data obtained by unpacking to the corresponding directory.

[0159] As an example, the electronic device 200 can read the data packet in the second backup directory in the storage space corresponding to the target application 230 and perform data unpacking during the process of installing the target application 230 or running the target application 230.

[0160] It can be understood that the above data packing and unpacking is for transmitting discontinuous data, such as the above application data, packing the data into a large continuous buffer, and after receiving, unpacking the data from the continuous buffer.

[0161] Referring to Figure 9 As an example, the target application 230 can write the mapping data in the second backup directory "backup" into the data packet "files.tar", "distributedfiles.tar", "database.tar", and the like for data unpacking. The application data obtained by data unpacking can be saved to the corresponding application data directories "files", "distributedfiles", "database" under the root directory " / ". In this way, in the process of installing and running the target application 230, the target application 230 process can call the application data in these directories when performing corresponding tasks.

[0162] Based on the data recovery process of steps 801 to 805, the electronic device 200 can complete the process of the target application 230 obtaining the required application data from the data transmission application 110 without copying data, and the application data unpacked and recovered to the corresponding directory by the target application 230 can be used for installation or running of the target application 230. This is advantageous to reduce the power consumption of the electronic device 200 for processing data copying, save system storage space of the electronic device 200, and improve the efficiency and performance of processing the data to be transmitted in the electronic device 200.

[0163] In combination with the above Figure 4 , Figure 5 and Figure 8 shown in the flow, it can be understood that the data transmission scheme provided by the embodiments of the present application can effectively reduce the system power consumption of the data sending device and the data receiving device, and occupy less system memory resources, and the required bandwidth for transmitting data is also lower, thus being advantageous to improve the data transmission efficiency and the data transmission performance of the data sending device and the data receiving device.

[0164] Figure 10 According to the embodiments of the present application, a hardware structure schematic diagram of an electronic device 100 is shown. It can be understood that the electronic device 200 interacting with the electronic device 100 to implement the data access method described in the above Figure 4 to Figure 8 example can have the same or different hardware structure as the electronic device 100, and the electronic device 200 can have more or less hardware structures than Figure 10 shown, which is not limited herein.

[0165] The electronic device 100 can include a processor 1010, an external memory interface 1020, an internal memory 1021, a universal serial bus (USB) interface 1030, a charging management module 1040, a power management module 1041, a battery 1042, an antenna 1, an antenna 2, a mobile communication module 1050, a wireless communication module 1060, an audio module 1070, a speaker 1070A, a receiver 1070B, a microphone 1070C, a headset jack 1070D, a sensor module 1080, a key 1090, a motor 1091, an indicator 1092, a camera 1093, a display screen 1094, and a subscriber identification module (SIM) card interface 1095, and the like. The sensor module 1080 can include a pressure sensor 1080A, a gyro sensor 1080B, a barometric sensor 1080C, a magnetic sensor 1080D, an acceleration sensor 1080E, a distance sensor 1080F, a proximity light sensor 1080G, a fingerprint sensor 1080H, a temperature sensor 1080J, a touch sensor 1080K, an ambient light sensor 1080L, a bone conduction sensor 1080M, and the like.

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

[0167] The processor 1010 can include one or more processing units, for example: the processor 1010 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), and the like. Different processing units can be independent devices, or can be integrated in one or more processors.

[0168] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.

[0169] In the embodiment of the present application, the processor 1010 of the electronic device 100 can implement the above-mentioned Figure 5 In each step of the process shown, the processor of the electronic device 200 can also implement the above steps through the controller control Figure 8 Each step in the process shown completes the implementation process of the data access method provided in the embodiment of the present application.

[0170] Processor 1010 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 1010 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 1010. If processor 1010 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 1010 latency, and thus improves system efficiency.

[0171] In some embodiments, the processor 1010 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0172] The USB interface 1030 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a MicroUSB interface, a USB Type-C interface, or the like. The USB interface 1030 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as AR devices.

[0173] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.

[0174] The charging management module 1040 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 1040 can receive charging input from a wired charger through the USB interface 1030. In some wireless charging embodiments, the charging management module 1040 can receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 1040 can charge the battery 1042 and supply power to the electronic device through the power management module 1041.

[0175] The power management module 1041 is configured to connect the battery 1042, the charging management module 1040, and the processor 1010. The power management module 1041 receives input from the battery 1042 and / or the charging management module 1040 to supply power to the processor 1010, the internal memory 1021, the display screen 1094, the camera 1093, and the wireless communication module 1060. The power management module 1041 can also be configured to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 1041 can also be arranged in the processor 1010. In some other embodiments, the power management module 1041 and the charging management module 1040 can also be arranged in the same device.

[0176] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 1050, the wireless communication module 1060, the modem processor, and the baseband processor.

[0177] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0178] The mobile communication module 1050 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The wireless communication module 1060 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100.

[0179] In some embodiments, the antenna 1 of the electronic device 100 and the mobile communication module 1050 are coupled, and the antenna 2 and the wireless communication module 1060 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The above-mentioned wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The above-mentioned GNSS can include global positioning system (GPS), global navigation satellite system (GLONASS), beidu navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0180] The electronic device 100 can implement a display function through a GPU, a display 1094, and an application processor, etc. The GPU is a microprocessor for image processing, connected to the display 1094 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 1010 can include one or more GPUs that execute program instructions to generate or change display information. The display 1094 is used to display images, videos, etc.

[0181] The electronic device 100 can implement a photographing function through an ISP, a camera 1093, a video codec, a GPU, a display 1094, and an application processor, etc. The ISP is used to process data fed back by the camera 1093. The camera 1093 is used to capture still images or videos.

[0182] The external memory interface 1020 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 1010 through the external memory interface 1020 to implement a data storage function. For example, files such as music, videos, etc. are saved in the external memory card.

[0183] The internal memory 1021 can be used to store computer executable program codes including instructions. The internal memory 1021 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data created during use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 1021 can include a high-speed random access memory, and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 1010 executes various function applications and data processing of the electronic device 100 by running instructions stored in the internal memory 1021 and / or instructions stored in a memory disposed in the processor.

[0184] The electronic device 100 can implement an audio function through an audio module 1070, a speaker 1070A, a receiver 1070B, a microphone 1070C, an earphone interface 1070D, and an application processor, etc. For example, music playing, recording, etc.

[0185] The pressure sensor 1080A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 1080A can be disposed on the display screen 1094. The pressure sensor 1080A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 1080A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 1094, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 1080A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 1080A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view a short message is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.

[0186] The gyroscope sensor 1080B can be configured to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 1080B. The gyroscope sensor 1080B can be used for anti-shake photography. For example, when the shutter is pressed, the gyroscope sensor 1080B detects the angle of shaking of the electronic device 100, calculates the distance that needs to be compensated by the lens module based on the angle, and lets the lens offset the shaking of the electronic device 100 by reverse movement to achieve anti-shake. The gyroscope sensor 1080B can also be used for navigation and motion sensing game scenarios.

[0187] The acceleration sensor 1080E can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the acceleration sensor 1080E can detect the magnitude and direction of gravity. The acceleration sensor 1080E can also be used to identify the posture of the electronic device, and can be applied to switching between landscape and portrait modes, pedometers, etc.

[0188] The distance sensor 1080F is configured to measure distance. The electronic device 100 can measure distance by infrared or laser. In some embodiments, when a scene is photographed, the electronic device 100 can measure distance by the distance sensor 1080F to achieve fast focusing.

[0189] The fingerprint sensor 1080H is configured to collect a fingerprint. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering calls, etc.

[0190] Touch sensor 1080K, also called "touch device". Touch sensor 1080K can be disposed on display screen 1094, and touch screen, also called "touch screen", is composed of touch sensor 1080K and display screen 1094. Touch sensor 1080K is used to detect touch operation acting on or near it. Touch sensor can transmit detected touch operation to application processor to determine touch event type. Visual output related to touch operation can be provided through display screen 1094. In other embodiments, touch sensor 1080K can also be disposed on the surface of electronic device 100, which is different from the position of display screen 1094.

[0191] Keys 1090 include power-on key, volume key, etc. Keys 1090 can be mechanical keys. They can also be touch keys. Electronic device 100 can receive key input and generate key signal input related to user settings and function control of electronic device 100.

[0192] Motor 1091 can generate vibration prompt. Motor 1091 can be used for incoming call vibration prompt, and also can be used for touch vibration feedback.

[0193] Indicator 1092 can be an indicator light, which can be used to indicate charging state, power change, and also can be used to indicate messages, missed calls, notifications, etc.

[0194] SIM card interface 1095 is used to connect SIM card. SIM card can be inserted into or pulled out of SIM card interface 1095 to realize contact and separation with electronic device 100.

[0195] Figure 11 According to an embodiment of the present application, a system architecture schematic block diagram of electronic device 100 is shown. It can be understood that, in the embodiment of the present application, electronic device 100 interacts to realize the above-mentioned Figure 4 to Figure 8 Electronic device 200 described in the example of the data access method can also have the same or different software structure as electronic device 100. Electronic device 200 can have more or less software structure than that shown in the example, which is not limited herein. Figure 10

[0196] The system architecture of electronic device 100 can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. In the embodiment of the present application, the Android system with layered architecture is taken as an example to illustrate the system architecture of electronic device 100.

[0197] ​It is appreciated that the layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and the system library, and the kernel layer.

[0198] As shown in Figure 11 The application layer can include a series of application packages. The application packages can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, settings, music, short message, etc.

[0199] The application framework layer provides application programming interface (API) and programming framework for the applications of the application layer. The application framework layer includes some pre-defined functions.

[0200] The application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, and backup service and application startup service, etc.

[0201] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and take screenshots, etc.

[0202] The content provider is used to store and obtain data, and make the data accessible to the application. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc.

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

[0204] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of call state (including call connection, call hang-up, etc.).

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

[0206] The notification manager enables an application to display notification information in the status bar, which can be used to convey a message of the notification type, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify a successful connection, message reminders, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the system top status bar, such as a notification of a background running application, and can also be a notification in the form of a dialog window appearing on the screen. For example, a text information prompt in the status bar, a prompt sound, an electronic device vibration, a flashing indicator light, etc.

[0207] The application startup service is used to manage each application program installed on the system of the electronic device 100, including system applications and third-party applications. In the embodiments of the present application, when the target application needs to be backed up and run, the application startup service can manage the namespace, map the application backup directory of the global mount namespace to the first backup directory of the target application mount namespace, and map the application backup directory of the global mount namespace to the first mapping directory of the backup service mount namespace, so that the first backup directory of the target application mount namespace is equivalent to the first mapping directory of the backup service mount namespace, and dynamic directory mapping sharing is achieved. The mapping process of the dynamic directory can be implemented by using a bind mounts algorithm, for example.

[0208] The backup service (Recovery) is an Android mobile phone backup function, which refers to a system service capability that can modify the data or system inside the electronic device such as a mobile phone. TM In the embodiments of the present application, for the data of the third-party application or other target application that needs to be backed up or restored, the data transmission application needs to obtain the access path of the target application related data access path by means of the global transaction processing capability of the backup service of the system, and then access the target application related data access path to read or write corresponding data to the corresponding storage space of the data transmission application.

[0209] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0210] The core library includes two parts: one part is the function function called by the java language, and the other part is the core library of Android.

[0211] The application program layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application program layer and the application framework layer into binary files. The virtual machine is used to manage the object lifecycle, stack management, thread management, security and exception management, and garbage collection.

[0212] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

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

[0214] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0215] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0216] A 2D graphics engine is a drawing engine for 2D drawings.

[0217] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0218] Figure 12 According to the embodiment of the present application, a schematic block diagram of the system architecture of another electronic device 100 is shown. It can be understood that in the embodiment of the present application, the above-mentioned Figure 4 to Figure 8 The electronic device 200 of the data access method described in the example may also have the same or different software structure as the electronic device 100. The electronic device 200 may have a software structure that is different from the software structure of the electronic device 100. Figure 10 The software structures shown may be more or less, and are not limited thereto.

[0219] like Figure 12 As shown, the electronic device 100 adopts a distributed system architecture. The distributed system architecture includes an application layer, an application framework layer, a system service layer and a kernel layer. It can be understood that Figure 12 The distributed operating system shown can be, for example, HarmonyOS TM ).

[0220] The application layer may include a series of application packages, which may include applications such as the launcher, settings, and music, and may also include calendar, WLAN, Bluetooth, camera, gallery, call, map, video, etc., without limitation.

[0221] The application framework layer provides a distributed framework and a light device agent service for the application layer. The distributed framework includes remote installation, remote startup, migration management, remote invocation, distributed system service management, and FA association management, and other functional frameworks for realizing intercommunication (including startup, invocation, and migration) within and between systems, and application programming interfaces (APIs) corresponding to the frameworks.

[0222] The system service layer is the core of the distributed operating system, and the system service layer provides services for the application programs in the application layer and the SDK through the application framework layer. The system service layer can include an application startup service, a backup service, and a distributed soft bus.

[0223] The application startup service is configured to manage each application program installed on the system of the electronic device 100, including system applications and third-party applications. In the embodiments of the present application, when a target application needs to be backed up and run, the application startup service can map the application backup directory of the global mounting namespace to the first backup directory of the target application mounting namespace through namespace management, and map the access path of the application backup directory of the global mounting namespace to the first mapping directory of the backup service mounting namespace, so that the access paths of each data packet in the first backup directory of the target application mounting namespace are equivalent to the access paths in the first mapping directory of the backup service mounting namespace, and dynamic directory mapping is realized. The dynamic directory mapping process can be implemented by using a bind mounts algorithm or the like.

[0224] The backup service (Recovery) is an Android mobile phone backup function, which refers to a system service capability that can modify the data or system inside a mobile phone or other electronic device of an application distributed operating system. In the embodiments of the present application, for the data of a third-party application or other target application that needs to be backed up or restored, the data transmission application needs to obtain the access path of the target application related data access path by means of the global transaction processing capability of the backup service of the system, and then access the target application related data access path to read or write the corresponding data to the storage space corresponding to the data transmission application.

[0225] As an example structure of the underlying network, the distributed soft bus is used to transmit display data and the like flowing between the user's commonly used central control device and the user's currently used central control device, that is, to realize a Harmony distributed flow. For understanding of the function of the distributed soft bus, reference can be made to the computer hardware bus. For example, the distributed soft bus is a "intangible" bus built between 1+8+N devices (1 is a mobile phone; 8 represents a car machine, a sound box, a headset, a watch, a bracelet, a tablet, a large screen, a personal computer (PC), an augmented reality (AR), a virtual reality (VR); and N generally refers to other Internet of Things (IOT) devices), which has the characteristics of automatic discovery, instant use, ad hoc networking (heterogeneous network networking), high bandwidth, low latency, reliability, and the like. That is, through the distributed soft bus technology, the above-mentioned central control devices can not only share all data, but also can realize instant interconnection with any device in the same local network or connected through Bluetooth. In addition, the distributed soft bus can also share files between heterogeneous networks such as Bluetooth and Wireless-Fidelity (WiFi) (for example, receiving files through Bluetooth on one side and transmitting files through WiFi on the other side).

[0226] The kernel layer is between hardware and software. The kernel layer of the distributed operating system includes a kernel subsystem and a driver subsystem. The kernel subsystem is between the distributed operating system, which can adopt a multi-kernel design, so the kernel subsystem supports selecting appropriate OS kernels for different resource-constrained devices, for example, in the embodiments of the present application, Lite OS can be selected for the central control device.

[0227] The kernel abstract layer (KAL) on the kernel subsystem provides basic kernel capabilities to the upper layer by shielding the differences between multiple kernels, including process / thread management, memory management, file system, network management, and peripheral management.

[0228] The driver framework provided by the driver subsystem is the basis for the hardware ecological openness of the distributed system, which provides unified peripheral access capabilities and driver development and management framework. The kernel layer at least includes display drivers, camera drivers, audio drivers, and sensor drivers.

[0229] It can be understood that in some embodiments of the present application, a data access apparatus can also be provided, which is applied in the electronic device 100 or the electronic device 200. The electronic device 100 or the electronic device 200 can include a first application and a second application. The electronic device 100 can be a sending device, and the electronic device 200 can be a receiving device. The first application can be the target application, and the second application can be the data transmission application.

[0230] The data access apparatus can include a backup module configured to detect an access request of the second application to a first storage space of the first application, wherein the first storage space has a first access path; and in response to the access request, establish a second access path having a mapping relationship with the first access path, and send the second access path to the second application. If the data access apparatus is applied to the electronic device 100, the second application can send the first data read by accessing the first storage space to the electronic device 200 as the receiving device. If the data access apparatus is applied to the electronic device 200, the second application can write the second data received from the electronic device 100 as the sending device to the accessed first storage space.

[0231] Reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one example embodiment disclosed in the specification. The appearance of the phrase "in one embodiment" in various places in the specification does not necessarily refer to the same embodiment.

[0232] The disclosure of the present application also relates to an apparatus for performing operations in text. The apparatus can be specially constructed for the required purposes, or it can comprise 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 floppy disks, optical disks, CD-ROMs, magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, application specific integrated circuits (ASICs), or any type of media suitable for storing electronic instructions, and each can be coupled to a computer system bus. Furthermore, the computers mentioned in the specification can include a single processor or can be architectures involving multiple processors related by a bus.

[0233] In addition, the language used in the specification has been principally selected for readability and instructional purposes and can not have been selected to delineate or circumscribe the disclosed subject matter. Accordingly, the present application embodiments are intended to be illustrative, not limiting, of the scope of the concepts discussed herein.

Claims

1. A data access method, applied to a first electronic device, characterized in that: The first electronic device includes a first application, a second application, and a third application, and the method includes: A third application detects an access request to access a first storage space of the first application, wherein the first storage space has a first access path; In response to the access request, the third application establishes a second access path having a mapping relationship with the first access path; The third application sends the second access path to the second application; The second application accesses the first storage space of the first application through the second access path; The first electronic device is a sending device, and establishes a communication connection with a second electronic device as a receiving device by running the second application. The second application sends the first data read by accessing the first storage space to the second electronic device.

2. The method according to claim 1, characterized in that The first electronic device is a receiving device, and the first electronic device establishes a communication connection with a third electronic device as a sending device by running the second application. The method further includes: The second application writes the second data received from the third electronic device into the accessed first storage space.

3. The method according to claim 1, characterized in that The application data of the first application and the application data of the second application are isolated from each other.

4. The method according to claim 1, wherein The third application detects an access request to the first storage space of the first application, including: The third application detects an access request from the second application to access the first storage space of the first application, wherein the access request is a request sent by the second application to the third application when it detects an operation request from the user to send the first data of the first application to the second electronic device.

5. The method according to claim 1, wherein The third application establishes, in response to the access request, a second access path having a mapping relationship with the first access path, including: The third application creates a second storage space having a second access path in response to the access request; The third application uses the application startup service provided by the first electronic device to establish a correspondence between the second access path and the first access path, so that the second access path points to the data corresponding to the first access path in the first storage space.

6. The method according to claim 5, characterized in that The third application sending the second access path to the second application includes: The third application sends the first handle corresponding to the second access path to the second application through the global identifier, wherein the first handle serves as a tool for the third application to access the first storage space through the second access path, and the first handle corresponds to the second access path; The second application obtains the second access path based on the correspondence between the first handle and the second access path.

7. The method according to claim 6, characterized in that The second application accessing the first storage space of the first application through the second access path includes: The second application generates a second handle according to the acquired second access path, wherein the second handle is a tool for the second application to access the first storage space through the second access path; The second application calls the generated second handle to access the first storage space of the first application.

8. The method according to claim 6, characterized in that The global identifier includes a uniform resource identifier (URI), wherein the URI specifically includes a file information field, and the file information field is a mapping string corresponding to the first handle.

9. The method according to any one of claims 1 to 8, characterized in that The first application includes a system application or a third-party application, the second application includes a clone application, and the third application includes a backup service provided by the first electronic device.

10. A data access device, applied to a first electronic device, wherein the first electronic device includes a first application and a second application, characterized in that: The device comprises: a backup module, configured to detect an access request from the second application to a first storage space of the first application, wherein the first storage space has a first access path; and, in response to the access request, establish a second access path having a mapping relationship with the first access path, and send the second access path to the second application; The second access path is used to access the first storage space of the first application. The first electronic device is a sending device, and the first electronic device establishes a communication connection with a second electronic device as a receiving device by running the second application. The second application is used to send the first data read by accessing the first storage space to the second electronic device.

11. An electronic device, 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 data access method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that The storage medium stores instructions, which, when executed on a computer, cause the computer to execute the data access method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • File sharing method and terminal device

    CN113672576A