Method, apparatus, storage medium and computer program product for data cloning

By accessing and packaging stored data through Package Management Service (PMS), the problem of data cloning when terminal devices are replaced is solved, thus achieving effective data migration.

CN115437551BActive Publication Date: 2026-07-10HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2021-06-04
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In existing technologies, when a terminal device is replaced, the stored data cannot be cloned to the new terminal device because the memory card uses a sandbox storage method, and the cloned application cannot directly access the stored data of the old device.

Method used

Access the storage data of the application to be backed up through the Package Management Service (PMS), package it into backup data, and send it to the new terminal device.

Benefits of technology

This technology enables the cloning of data stored on older terminal devices to the corresponding applications on newer terminal devices, thus solving the problem of data migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115437551B_ABST
    Figure CN115437551B_ABST
Patent Text Reader

Abstract

The method, device, storage medium and computer program product for data cloning provided in the embodiments of the present application, the method comprises: a first application sending a data reading instruction to a package management service (PMS), wherein the data reading instruction is used to request access to storage data of a to-be-backed-up application; the PMS accesses the storage data corresponding to the to-be-backed-up application according to the data reading instruction, and packs the storage data into backup data, so as to be acquired by the first application; and the first application sends the backup data to a first terminal device. The PMS can access the storage data of the to-be-backed-up application, thereby completing cloning of application data, and realizing cloning of storage data of an application stored on an old terminal device and needing to be migrated to a new terminal device to a corresponding application of the new terminal device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically to a method, apparatus, storage medium, and software product for data cloning. Background Technology

[0002] With the increasing prevalence of terminal devices, terminal applications such as instant messaging tools, games, and audio / video applications are becoming increasingly diverse. Terminal applications can support real-time interaction of application data such as text, audio, video, and images. The data generated by terminal applications is stored on the local storage card of the terminal device. Furthermore, to enhance data storage security, the storage card employs a sandboxed storage method. That is, data stored by application A can only be accessed by application A; application B cannot directly access the data stored by application A.

[0003] With the rapid development of terminal devices, users are replacing them more frequently. Data stored on applications on older devices is stored on the old device's local memory card. When a user switches to a new device, this data needs to be migrated to the new device to be viewed. However, because the memory card uses a sandboxed storage method, during data cloning, the cloned application cannot directly access the data stored on the old device that needs to be migrated to the new device. Therefore, it's impossible to clone the data from the old device to the corresponding application on the new device. Summary of the Invention

[0004] In view of this, this application provides a method, apparatus, storage medium, and software product for data cloning, in order to solve the problem that existing technologies cannot clone stored data.

[0005] In a first aspect, embodiments of this application provide a method for data cloning, comprising:

[0006] The first application sends a data read instruction to the Package Management Service (PMS), which requests access to the stored data of the application to be backed up.

[0007] The PMS accesses the storage data corresponding to the application to be backed up according to the data reading instruction, and packages the storage data into backup data for the first application to obtain;

[0008] The first application sends the backup data to the first terminal device.

[0009] Preferably, before the first application sends a data read instruction to the PMS, the method further includes:

[0010] The first application establishes a connection with the second application on the first terminal;

[0011] The first application identifies the application to be backed up and sends relevant information about the application to be backed up to the second application.

[0012] Preferably, the first application and the application to be backed up are different applications.

[0013] Preferably, the first application is a cloned application, and the storage data of the application to be backed up is stored in a storage card using a sandbox storage method.

[0014] Preferably, the data reading instruction carries source address information and destination address information of the stored data of the application to be backed up; wherein, the source address information is used to identify the storage location of the stored data; and the destination address information is used to identify the location where the stored data is stored after being packaged into backup data.

[0015] The PMS accesses the storage data corresponding to the application to be backed up according to the data read instruction, and packages the storage data into backup data so that the first application can obtain it, including:

[0016] The PMS accesses the storage data corresponding to the application to be backed up according to the source address information in the data reading instruction, packages the storage data into backup data, and stores the backup data in the storage location indicated by the target address information.

[0017] The first application retrieves the backup data from the storage location indicated by the target address information.

[0018] Secondly, embodiments of this application provide a method for data cloning, including:

[0019] The second application receives backup data sent by the second terminal;

[0020] The second application sends the backup data to the PMS;

[0021] The PMS parses the backup data, obtains the storage data of the application to be backed up, and stores the storage data of the application to be backed up.

[0022] Preferably, before the second application receives the backup data sent by the second terminal, the method further includes:

[0023] The second application establishes a connection with the first application on the second terminal;

[0024] The second application receives relevant information about the application to be backed up from the first application;

[0025] The second application sends the relevant information of the application to be backed up to the PMS.

[0026] Preferably, the second application sending the backup data to the PMS includes:

[0027] The second application determines the source address information and destination address information of the backup data based on the relevant information of the application to be backed up, stores the backup data in the storage location indicated by the source address information, and sends a data recovery command to the PMS; wherein the data recovery command carries the source address information and destination address information of the backup data;

[0028] The PMS obtains the backup data based on the source address information in the data recovery instruction;

[0029] The PMS stores the storage data of the application to be backed up, including:

[0030] The PMS stores the stored data of the application to be backed up according to the destination address information in the data recovery instruction.

[0031] Preferably, the second application and the application to be backed up are different applications.

[0032] Preferably, the second application is a cloned application, and the storage data of the application to be backed up is stored in a storage card using a sandbox storage method.

[0033] Thirdly, embodiments of this application provide an electronic device, which includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to perform the following steps:

[0034] The first application sends a data read instruction to the PMS, which is used to request access to the stored data of the application to be backed up;

[0035] The PMS accesses the storage data corresponding to the application to be backed up according to the data reading instruction, and packages the storage data into backup data for the first application to obtain;

[0036] The first application sends the backup data to the first terminal device.

[0037] Preferably, before the first application sends a data read instruction to the PMS, the electronic device also performs the following:

[0038] The first application establishes a connection with the second application on the first terminal.

[0039] The first application identifies the application to be backed up and sends relevant information about the application to be backed up to the second application.

[0040] Preferably, the first application and the application to be backed up are different applications.

[0041] Preferably, the first application is a cloned application, and the storage data of the application to be backed up is stored in a storage card using a sandbox storage method.

[0042] Preferably, the data reading instruction carries source address information and destination address information of the stored data of the application to be backed up; wherein, the source address information is used to identify the storage location of the stored data; and the destination address information is used to identify the location where the stored data is stored after being packaged into backup data.

[0043] The PMS accesses the storage data corresponding to the application to be backed up according to the data read instruction, and packages the storage data into backup data so that the first application can obtain it, including:

[0044] The PMS accesses the storage data corresponding to the application to be backed up according to the source address information in the data reading instruction, packages the storage data into backup data, and stores the backup data in the storage location indicated by the target address information.

[0045] The first application retrieves the backup data from the storage location indicated by the target address information.

[0046] Fourthly, embodiments of this application provide an electronic device, which includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to perform the following steps:

[0047] The second application receives backup data sent by the second terminal;

[0048] The second application sends the backup data to the PMS;

[0049] The PMS parses the backup data, obtains the storage data of the application to be backed up, and stores the storage data of the application to be backed up.

[0050] Preferably, before the second application receives the backup data sent by the second terminal, the electronic device also performs:

[0051] The second application establishes a connection with the first application on the second terminal;

[0052] The second application receives relevant information about the application to be backed up from the first application;

[0053] The second application sends the relevant information of the application to be backed up to the PMS.

[0054] Preferably, the second application sending the backup data to the PMS includes:

[0055] The second application determines the source address information and destination address information of the backup data based on the relevant information of the application to be backed up, stores the backup data in the storage location indicated by the source address information, and sends a data recovery command to the PMS; wherein the data recovery command carries the source address information and destination address information of the backup data;

[0056] The PMS obtains the backup data based on the source address information in the data recovery instruction;

[0057] The PMS stores the storage data of the application to be backed up, including:

[0058] The PMS stores the stored data of the application to be backed up according to the destination address information in the data recovery instruction.

[0059] Preferably, the second application and the application to be backed up are different applications.

[0060] Preferably, the second application is a cloned application, and the storage data of the application to be backed up is stored in a storage card using a sandbox storage method.

[0061] Fifthly, embodiments of this application provide a storage medium storing a computer program that, when run on a computer, causes the computer to perform the method described in any of the first aspects above.

[0062] Sixthly, embodiments of this application provide a storage medium storing a computer-readable storage program that, when run on a computer, causes the computer to perform the method described in any of the second aspects above.

[0063] In a seventh aspect, embodiments of this application provide a computer program product, the computer program product including a computer program that, when run on a computer, causes the computer to perform the method described in any of the first aspects above.

[0064] Eighthly, embodiments of this application provide a computer program product comprising a computer program that, when run on a computer, causes the computer to perform the method described in any of the second aspects above.

[0065] The technical solutions proposed in the embodiments of this application can achieve at least the following technical effects:

[0066] PMS can access the storage data of the application to be backed up, thereby cloning the application data and cloning the storage data of the application that needs to be migrated from the old terminal device to the corresponding application on the new terminal device. Attached Figure Description

[0067] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0068] Figure 1 An example diagram of data migration in the prior art provided in this application;

[0069] Figure 2 A flowchart illustrating a data cloning method provided in this application embodiment;

[0070] Figure 3 A flowchart illustrating another data cloning method provided in this application embodiment;

[0071] Figure 4 A flowchart illustrating another data cloning method provided in this application embodiment;

[0072] Figure 5 A flowchart illustrating another data cloning method provided in this application embodiment;

[0073] Figure 6 An example diagram illustrating a data cloning method provided in this application embodiment;

[0074] Figure 7 Example diagram of another data cloning provided in the embodiments of this application;

[0075] Figure 8 A software structure block diagram of an electronic device provided in an embodiment of this application;

[0076] Figure 9 A flowchart illustrating another data cloning method based on a software architecture of an electronic device provided in this application embodiment;

[0077] Figure 10 A software structure block diagram of another electronic device provided in an embodiment of this application;

[0078] Figure 11 A flowchart illustrating a data cloning method based on a software architecture of an electronic device, provided in an embodiment of this application;

[0079] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0080] Figure 13 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation

[0081] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0082] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0083] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0084] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0085] In real-world applications, when users switch devices, they often want to migrate the stored data of applications from the old device to the new one. One feasible solution to this problem is to clone the application to achieve data migration between the old and new devices. For example... Figure 1 As shown, for example, the user needs to replace their terminal device with a mobile phone. During data migration, a cloned app is run on both the old phone 101 and the new phone 102. The cloned app on the old phone 101 retrieves the stored data of other applications, such as application A, and sends the stored data to the cloned app on the new phone 102 via file transfer. The cloned app on the new phone 102 stores the received stored data of application A in the corresponding data storage location for application A. Through the above process, the data migration of application A from the old phone 101 to the new phone 102 is achieved.

[0086] However, in Figure 1In the illustrated embodiment, the storage data of application A is stored on a memory card. Currently, to improve the security of stored data, memory cards all use a sandboxed storage method. That is, the storage data of application A stored on the memory card can only be accessed by application A, and application B is not supported to directly access the storage data of application A. Based on this, when migrating the storage data of application A from the old phone 101 to the new phone 102, since the cloned APP cannot directly access the storage data of application A stored on the memory card, the migration of the storage data of application A from the old phone 101 to application A on the new phone 102 cannot be completed.

[0087] Therefore, this application proposes a novel data cloning method to obtain the stored data of an application to be backed up. Specifically, when it is necessary to send the stored data corresponding to the application to be backed up on the second terminal device to the first terminal device, the first application on the second terminal device sends a data read instruction to the PMS (Package Manager Service). After receiving the data read instruction, the PMS accesses the stored data of the application to be backed up according to the instruction and packages it into backup data for the first application to obtain. The first application then sends the backup data to the first terminal device. In this way, the PMS can access the stored data of the application to be backed up, thereby completing the cloning of the stored data and sending it to the new terminal device, realizing the cloning of the stored data of the application on the old terminal device to the corresponding application on the new terminal device.

[0088] Specifically, in the embodiments of this application, a method for data cloning is proposed. Figure 2 The diagram shown is a flowchart of a data cloning method according to an embodiment of this application. Figure 2 As shown, data cloning methods include:

[0089] Step S201: The first application sends a data read command to the PMS.

[0090] The data read command is used to request access to the stored data of the application to be backed up.

[0091] It should be noted that in this embodiment, the second terminal device is the old terminal device used by the user, and the first terminal device is the new terminal device replaced by the user. This application requires migrating the storage data corresponding to the application in the second terminal device to the corresponding application in the first terminal device.

[0092] It should be noted that the first application is the application in the second terminal device used to migrate the stored data of other applications to be backed up to the first terminal device.

[0093] It should be noted that application storage data refers to the data that the application stores on the terminal device.

[0094] In this embodiment, when a user switches from a second terminal device to a first terminal device, the storage data corresponding to the application on the second terminal device needs to be migrated to the corresponding application on the first terminal device. Since the storage data of the applications on the second terminal device is stored in a sandboxed manner on the memory card, the first application cannot directly access the storage data of other applications to be backed up besides itself. Because the PMS is a local system service primarily responsible for maintaining the system applications' modification and installation locations, installation, deletion, and data information provision, the first application can communicate with the PMS to invoke its relevant functions, enabling the PMS to access the storage data of other applications to be backed up, especially the data in the / sdcard / Android / data area. In other words, the PMS can access the storage data of the system applications, and the first application can obtain the storage data of other applications to be backed up through the PMS. The first application can generate a data read command based on the application to be backed up and send it to the PMS.

[0095] Furthermore, the first application can specify the data access location and the backup data storage location for the PMS. The PMS can directly access and store the data according to the location specified by the first application. At this time, the data read instruction carries the source address information and destination address information of the stored data of the application to be backed up. Among them, the source address information is used to identify the storage location of the stored data. The destination address information is used to identify the location where the stored data is stored after being packaged into backup data.

[0096] In other words, once the application to be backed up is identified, the storage location of its data can be determined, i.e., the source address information can be identified. The destination address is the location where the PMS stores the data of the application to be backed up. The first application can specify this destination address for easy reading. For example, the first application can use the address of the storage location of its corresponding data as the destination address. After determining the source and destination address information, the first application can add the source and destination address information of the application to be backed up's storage data to the data read command and send it to the PMS.

[0097] Alternatively, the first application can choose not to specify the location of the data accessed by the PMS or the storage location of the backup data. Instead, the PMS retrieves the storage location of the backup application's data from the system files based on the application to be backed up. The backup data can be directly fed back to the first application by the PMS or pre-stored on a memory card, from which the first application reads the backup data. For example, the PMS can default to the storage location of the first application's data or retrieve it directly from the system files. In this way, the first application only needs to send a data read command to the PMS.

[0098] In step S202, the PMS accesses the storage data corresponding to the application to be backed up according to the data read instruction, and packages the storage data into backup data so that the first application can obtain it.

[0099] In this embodiment of the application, after receiving the data read instruction, the PMS can access the storage data of the sandbox storage according to the data read instruction, obtain the storage data corresponding to the application to be backed up, and package the storage data into backup data for the first application to obtain.

[0100] Furthermore, PMS can transmit data in the form of tar packages. Therefore, after obtaining the storage data of the application to be backed up, PMS can directly package it into a tar package format for backup data so that the first application can access it.

[0101] Furthermore, when the data read instruction carries the source address information and destination address information of the storage data of the application to be backed up, the PMS accesses the storage data corresponding to the application to be backed up according to the data read instruction, and packages the storage data into backup data so that the first application can obtain the backup data. This includes: the PMS accessing the storage data corresponding to the application to be backed up according to the source address information in the data read instruction, packaging the storage data into backup data, storing the backup data in the storage location indicated by the destination address information; and the first application obtaining the backup data from the storage location indicated by the destination address information.

[0102] That is, the data read instruction carries source address information and destination address information. After receiving the data read instruction, the PMS parses the data read instruction, obtains the source address information and destination address information, accesses the storage data of the application to be backed up according to the source address information, packages the storage data of the application to be backed up into backup data, and stores this backup data in the storage location indicated by the destination address information so that the first application can obtain the backup data from the storage location indicated by the destination address information.

[0103] Alternatively, if the data read command received by the PMS does not carry source and destination address information, the PMS can determine the storage location of the application's data from the system files based on the application to be backed up, and then access the application's storage data. The accessed storage data is packaged into backup data, which can be directly fed back to the first application, or stored at the same location as the first application's storage data, allowing the first application to directly read the backup data from the memory card.

[0104] Step S203: The first application sends the backup data to the first terminal device.

[0105] In this embodiment, since it is necessary to migrate the stored data of the application in the second terminal device to the first terminal device, the first application needs to transfer the backup data to the first terminal device after obtaining it. At this time, the first application can send the backup data to the first terminal device via file transfer.

[0106] Figure 3 The diagram shown is a flowchart of another data cloning method according to an embodiment of this application. Figure 3 As shown, before step S201 above, the procedure further includes:

[0107] Step S204: The first application establishes a connection with the second application of the first terminal.

[0108] Specifically, when migrating the stored data corresponding to the application on the second terminal device to the corresponding application on the first terminal device, a connection needs to be established first. At this time, a connection is established between the first application on the second terminal device and the second application on the first terminal device to facilitate the migration of data from other applications to be backed up.

[0109] It should be noted that the second application is an application with the same function as the first application on the first terminal device. Both are applications used to migrate data of the application to be backed up.

[0110] Step S205: The first application determines the application to be backed up and sends the relevant information of the application to be backed up to the second application.

[0111] Specifically, when migrating application data, users can select the applications that need to be migrated on a second terminal. At this time, the first application can identify the selected application as the one to be backed up. The first application can then send relevant information about the application to be backed up, such as its name and directory information, to the second application, allowing the second application to determine which application to migrate data from.

[0112] Furthermore, the first application mentioned above and the application to be backed up are different applications.

[0113] Furthermore, the first application mentioned above is a cloned application, and the storage data of the application to be backed up is stored in the memory card using a sandbox storage method.

[0114] In this way, the PMS can access the storage data of the application to be backed up, thereby completing the cloning of the storage data and sending the storage data to the new terminal device, thus cloning the storage data of the application on the old terminal device to the corresponding application on the new terminal device.

[0115] Figure 4 The diagram shown is a flowchart of another data cloning method according to an embodiment of this application. Figure 4 As shown, data cloning methods include:

[0116] Step S401: The second application receives the backup data sent by the second terminal.

[0117] Specifically, the first terminal device is the new terminal device that the user has replaced, and the stored data of the application on the second terminal device needs to be migrated to the first terminal device. The first terminal device runs a second application used for migrating the data of the application to be backed up. At this time, the second application can receive backup data sent by the second terminal device. This backup data is the stored data of the application to be backed up.

[0118] Step S402: The second application sends the backup data to the PMS.

[0119] Specifically, since the backup data is packaged in the data format used by PMS for data transmission, the second application cannot parse it. Furthermore, due to the sandboxed storage method of the memory card, the second application cannot directly store the data in the storage location corresponding to the application to be backed up. Therefore, when the second application receives the backup data, it can send the backup data directly to PMS.

[0120] Step S403: PMS parses the backup data, obtains the storage data of the application to be backed up, and stores the storage data of the application to be backed up.

[0121] Specifically, after receiving the backup data sent by the second application, the PMS parses the backup data to obtain the storage data corresponding to the application to be backed up, and then writes this storage data into the storage card of the first terminal.

[0122] Figure 5 The diagram shown is a flowchart of another data cloning method provided in an embodiment of this application. Figure 5 As shown, before step S401 above, the procedure further includes:

[0123] Step S404: The second application establishes a connection with the first application of the second terminal.

[0124] Step S405: The second application receives the relevant information of the application to be backed up sent by the first application.

[0125] Specifically, after the second application establishes a connection with the first application on the second terminal, the first application, after identifying the application to be backed up, sends relevant information about the application to be backed up to the second application, so that the second application can identify the application to be backed up based on the relevant information.

[0126] Step S406: The second application sends the relevant information of the application to be backed up to the PMS.

[0127] Specifically, after identifying the application to be backed up, the second application can send the relevant information of the application to be backed up to the PMS, so that the PMS knows which application to migrate data for. Then, when the backup data is received later, the PMS can store the parsed relevant storage data to the storage location corresponding to the application to be backed up.

[0128] Furthermore, the second application can specify the storage location of the backup data, causing the PMS to store the parsed data at the specified location. In this case, the second application sending the backup data to the PMS includes:

[0129] The second application determines the source and destination address information of the backup data based on the relevant information of the application to be backed up, stores the backup data in the storage location indicated by the source address information, and sends a data recovery command to the PMS. The PMS retrieves the backup data based on the source address information in the data recovery command.

[0130] The PMS stores the stored data of the application to be backed up, including: the PMS stores the stored data of the application to be backed up according to the destination address information in the data recovery instruction.

[0131] The data recovery command contains the source address and destination address information of the backup data.

[0132] Specifically, the second application can store the backup data in a storage location, and the PMS directly retrieves the backup data from that location. In this case, the second application can determine the address of the storage location it can access as the source address; for example, it can determine the storage location on the memory card corresponding to the second application as the storage location for the backup data, and then determine the address of this storage location as the source address. After receiving the relevant information of the application to be backed up, the second application identifies the application and can determine the address of the storage location corresponding to this application as the destination address. In this way, the second application can determine both the source and destination address information. The second application stores the backup data in the location indicated by the source address. A data recovery command is constructed, adding the source and destination address information to it, and then sent to the PMS. After receiving the data recovery command, the PMS can parse it, obtain the source and destination address information from it, retrieve the backup data based on the source address information, parse the backup data to obtain the storage data of the application to be backed up, and store this storage data in the storage location indicated by the destination address information, completing the data migration of the application to be backed up.

[0133] Furthermore, the second application may not specify the destination address of the backup data, but instead determine the backup data storage location according to actual needs. When parsing the storage data of the application to be backed up, the storage data is directly stored in the determined storage location.

[0134] Furthermore, the second application mentioned above is a different application from the application to be backed up.

[0135] Furthermore, the second application mentioned above is a cloned application, and the storage data of the application to be backed up is stored in a storage card using a sandbox storage method.

[0136] In this way, the PMS can parse the received backup data into the storage data of the application to be backed up and store it in the corresponding location, thereby completing the cloning of the storage data and migrating the storage data to the relevant application on the new terminal device, thus realizing the cloning of the storage data of the application on the old terminal device to the corresponding application on the new terminal device.

[0137] Figures 6-7 The diagram shown is an example of data cloning provided in an embodiment of this application. Figure 6As shown in the example, the second terminal device is the user's old mobile phone, and the first terminal device is the new mobile phone the user needs to replace. The user runs cloned applications on both the old and new phones to migrate application-related data from the old phone to the new phone. The applications on the old phone include Notes, Music, Gallery, Voice Recorder, System Settings, Applications & Data, and WeChat chat history (not shown in the diagram). After the cloned application runs on the old phone, it establishes a connection with the cloned application on the new phone, such as establishing a Bluetooth connection or other wireless communication connection. The cloned application displays the applications contained on the old phone so that the user can select which applications' data needs to be migrated. At this time, the user can make selections on the old phone. Assume the user selects Notes, Gallery, Music, System Settings, Applications & Data, and WeChat chat history for data migration on the old phone. The cloned application on the old phone then determines the applications to be backed up based on the user's selection. Data migration can be performed one application at a time. The following explanation uses the data migration of Notes as an example.

[0138] like Figure 7 As shown, the cloned application on the old phone determines that the memo data needs to be migrated. At this point, the cloned application on the old phone sends relevant information about the memo, such as the memo's name and identifier, to the cloned application on the new phone. Upon receiving this information, the cloned application on the new phone knows that data migration is required. The cloned application on the old phone determines the storage address of the memo data (i.e., the source address) and uses the storage location corresponding to the cloned application as the destination address. It adds the source and destination address information to the data read command, generating a data read command. This command is sent to the PMS (Personal Management System) on the old phone. Upon receiving the command, the PMS parses it to obtain the source and destination address information. Based on the source address, it accesses the stored data of the memo and packages it into a tar format data packet (i.e., backup data). This tar format data packet is then stored at the storage location indicated by the destination address. The cloned application retrieves the tar format data packet from the storage location indicated by the destination address and sends it to the cloned application on the new phone.

[0139] The cloned application on the new phone receives a tar format data packet. Since the cloned application is aware that it's migrating memo data, it recognizes that this data packet contains memo-related data. The cloned application stores the received tar format data packet at its corresponding storage location, using this location's address as the source address. It uses the address of the storage location corresponding to the memo's stored data as the destination address. The cloned application adds the source and destination address information to the data recovery command, generates the data recovery command, and sends it to the PMS on the new phone. Upon receiving the data recovery command, the PMS on the new phone parses it to obtain the source and destination address information. Based on the source address information, it retrieves the tar format data packet from the indicated storage location, parses it to obtain the memo's stored data, and stores the memo's stored data at the storage location indicated by the destination address information. In other words, the data is stored at the storage location corresponding to the memo, completing the data migration of the memo from the old phone to the new phone. Data migration for other third-party applications can refer to the above memo data migration method and will not be elaborated upon here.

[0140] Figure 8 The diagram shows a software structure block diagram of an electronic device according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. 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 framework layer, the Android runtime and system libraries, and the kernel layer. The Android runtime, system libraries, and kernel layer are not shown in the diagram.

[0141] The application layer (Application, App) can include a series of application packages. For example... Figure 8 As shown, the application package can include multimedia information service applications, phonebook applications, and voice call services. Furthermore, the application layer can be divided into three modules: interface, logic, and data (not shown in the diagram). These modules communicate with each other through software interfaces. The interface module is used for information display and user interaction; the logic module is used for information processing; and the data module is used for data storage.

[0142] Specifically, the interface module includes a cloning preparation data UI module, used to obtain the application selected by the user to be backed up and notify the logic module which application needs data migration. The logic module includes a cloning backup execution module and a cloning and PMS interaction module. The framework layer (FWK) provides application programming interfaces (APIs) and programming frameworks for the application layer applications. The application framework layer includes some predefined functions, such as... Figure 8 As shown, the framework layer includes PMS (Package Manager Service). PMS is one of the core services of the Android system, mainly responsible for maintaining the system applications' modification and installation locations, installation, deletion, and data information provision.

[0143] Furthermore, Figure 9 The image shown is based on the above-described embodiment provided in this application. Figure 8 The data cloning method for the software structure of the illustrated electronic device. For example... Figure 9 As shown, when the electronic device is an old terminal device used by the user, the aforementioned electronic device is used to implement the data cloning method corresponding to the old terminal device. Specifically, the clone preparation data UI module, the clone backup execution module, and the clone-PMS interaction module are used to implement steps S201 and S203. That is, the clone preparation data UI module determines the application to be backed up based on the application selected by the user for data migration. After determining the application to be backed up, the clone preparation data UI module can send a notification message to the clone backup execution module to perform data migration for the determined application. The clone backup execution module forwards the received notification message to the clone-PMS interaction module. The clone-PMS interaction module generates a data read instruction and sends it to the PMS in the framework layer. Specifically, when generating the data read instruction, the clone-PMS interaction module adds the source address information and destination address information of the stored data of the application to be backed up to the data read instruction. The PMS in the framework layer is used to implement step S202. In other words, the PMS at the framework layer accesses the storage data of the application to be backed up according to the data read instructions, packages it into backup data, and stores it at the storage location indicated by the destination address information. The cloning and PMS interaction module reads the backup data and sends it to the new terminal device through the cloning preparation data UI module.

[0144] Figure 10The diagram shows a software architecture block diagram of another electronic device provided in an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. 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 framework layer, the Android runtime and system libraries, and the kernel layer. The Android runtime, system libraries, and kernel layer are not shown in the diagram.

[0145] The application layer (Application, App) can include a series of application packages. For example... Figure 10 As shown, the application package can include multimedia information service applications, phonebook applications, and voice call services. Furthermore, the application layer can be divided into three modules: interface, logic, and data (not shown in the diagram). These modules communicate with each other through software interfaces. The interface module is used for information display and user interaction; the logic module is used for information processing; and the data module is used for data storage.

[0146] Specifically, the interface module includes a clone recovery data UI module, used to obtain backup data of the application to be backed up and notify the logic module to restore the backup data. The logic module includes a clone recovery execution module and a clone interaction module with the PMS. The framework layer (FWK) provides application programming interfaces (APIs) and programming frameworks for the application layer applications. The application framework layer includes some predefined functions, such as... Figure 10 As shown, the framework layer includes PMS.

[0147] Figure 11 The image shown is based on the above-described embodiment provided in this application. Figure 10 The data cloning method for the software structure of the illustrated electronic device. For example... Figure 10As shown, when the electronic device is a new terminal device used by the user, the aforementioned electronic device is used to implement a data cloning method corresponding to the new terminal device. Specifically, the clone recovery data UI module, the clone recovery execution module, and the clone-PMS interaction module are used to implement steps S401 and S402. That is, the clone recovery data UI module receives backup data sent by the old terminal device. It sends the backup data to the clone recovery execution module and notifies the clone recovery execution module to restore the backup data. The clone recovery execution module sends the backup data to the clone-PMS interaction module and notifies the clone-PMS interaction module to restore the backup data. The clone-PMS interaction module generates a data recovery command and sends it to the PMS in the framework layer. Specifically, when generating the data recovery command, the clone-PMS interaction module adds the source address information and destination address information of the storage data of the application to be backed up to the data recovery command. The PMS in the framework layer is used to implement step S402. That is, the PMS in the framework layer reads the backup data according to the data recovery command, parses the backup data to obtain the storage data of the application to be backed up, and stores the storage data in the storage location indicated by the destination address information.

[0148] In this way, the PMS can access the storage data of the application to be backed up, thereby completing the cloning of the storage data and sending the storage data to the new terminal device, thus cloning the storage data of the application on the old terminal device to the corresponding application on the new terminal device.

[0149] It is understood that some or all of the steps or operations in the above embodiments are merely examples, and other operations or variations thereof can be performed in the embodiments of this application. Furthermore, the steps may be performed in different orders as presented in the above embodiments, and it is not necessary to perform all the operations in the above embodiments.

[0150] Furthermore, generally speaking, improvements to a technology can be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many improvements to the methodology today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that an improvement to the methodology cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital device themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0151] Therefore, the method flow proposed in the embodiments of this application can be implemented in hardware, for example, by using a controller to control the touch screen to implement the method flow proposed in the embodiments of this application.

[0152] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0153] Corresponding to the above embodiments, this application also provides an electronic device. Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 800 may include a processor 801, a memory 802, and a communication unit 803. These components communicate through one or more buses. Those skilled in the art will understand that the structure of the server shown in the figure does not constitute a limitation on the embodiment of the present invention. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0154] The communication unit 803 is used to establish a communication channel, enabling the storage device to communicate with other devices. It can receive user data sent by other devices or send user data to other devices.

[0155] The processor 801 serves as the control center of the storage device, connecting various parts of the electronic device via various interfaces and lines. It executes software programs and / or modules stored in the memory 802, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 801 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.

[0156] The memory 802 is used to store the execution instructions of the processor 801. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0157] When the execution instructions in memory 802 are executed by processor 801, the electronic device 800 is able to perform operations. Figure 3 The steps in the illustrated embodiments may be some or all. For details, please refer to the above embodiments, which will not be repeated here.

[0158] Corresponding to the above embodiments, this application also provides another electronic device. Figure 13 This is a schematic diagram of another electronic device provided in an embodiment of the present invention. The electronic device 900 may include a processor 901, a memory 902, and a communication unit 903. These components communicate through one or more buses. Those skilled in the art will understand that the structure of the server shown in the figure does not constitute a limitation on the embodiments of the present invention. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0159] The communication unit 903 is used to establish a communication channel, enabling the storage device to communicate with other devices. It can receive user data sent by other devices or send user data to other devices.

[0160] The processor 901 serves as the control center of the storage device, connecting various parts of the electronic device via various interfaces and lines. It executes software programs and / or modules stored in the memory 902, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 901 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.

[0161] The memory 902 is used to store the execution instructions of the processor 901. The memory 902 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0162] When the execution instructions in memory 902 are executed by processor 901, the electronic device 900 is able to perform operations. Figure 5 The steps in the illustrated embodiments may be some or all. For details, please refer to the above embodiments, which will not be repeated here.

[0163] This application also provides a computer storage medium, wherein the computer storage medium may store a computer program, which, when run on a computer, causes the computer to execute some or all of the steps performed by the second terminal device in the data cloning method provided in the embodiments of this application. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0164] This application also provides a computer storage medium, wherein the computer storage medium may store a computer program, which, when run on a computer, causes the computer to execute some or all of the steps performed by the first terminal device in the data cloning method provided in the embodiments of this application. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0165] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform the steps executed by the second terminal device in the data cloning method provided in the embodiments of this application.

[0166] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform the steps executed by the first terminal device in the data cloning method provided in the embodiments of this application.

[0167] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present invention.

[0168] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the device embodiments and terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.

Claims

1. A method for data cloning, characterized in that, It is applied to a second terminal device, which includes a first application, a package management service (PMS), and an application to be backed up. The first application and the application to be backed up are different applications; The data of the application to be backed up is stored in the second terminal device using a sandbox storage method; The method includes: The first application establishes a connection with the second application on the first terminal device; The first application determines the application to be backed up and sends relevant information about the application to be backed up to the second application. The relevant information is used to instruct the storage data of the application to be backed up to be migrated from the second terminal device to the first terminal device. The first application sends a data read instruction to the PMS, the data read instruction being used to request access to the storage data of the application to be backed up; The PMS accesses the storage data corresponding to the application to be backed up according to the data reading instruction, and packages the storage data into backup data for the first application to obtain; The first application sends the backup data to a second application on the first terminal device, wherein the first terminal device and the second terminal device are different mobile phones; Both the first application and the second application are cloned applications; The cloned application is an application used to migrate the stored data of the application to be backed up from the second terminal device to the first terminal device.

2. The method according to claim 1, characterized in that, The data of the application to be backed up is stored on the memory card using a sandbox storage method.

3. The method according to claim 1, characterized in that, The data reading instruction carries source address information and destination address information of the stored data of the application to be backed up; wherein, the source address information is used to identify the storage location of the stored data; and the destination address information is used to identify the location where the stored data is stored after being packaged into backup data. The PMS accesses the storage data corresponding to the application to be backed up according to the data read instruction, and packages the storage data into backup data so that the first application can obtain it, including: The PMS accesses the storage data corresponding to the application to be backed up according to the source address information in the data reading instruction, packages the storage data into backup data, and stores the backup data in the storage location indicated by the destination address information. The first application retrieves the backup data from the storage location indicated by the destination address information.

4. A method for data cloning, characterized in that, It is applied to a first terminal device, which includes a second application, a PMS, and an application to be backed up. The second application is a different application from the application to be backed up; The method includes: The second application establishes a connection with the first application on the second terminal device; The second application receives relevant information about the application to be backed up sent by the first application. The relevant information is used to instruct the storage data of the application to be backed up to be migrated from the second terminal device to the first terminal device. The second application sends the relevant information of the application to be backed up to the PMS; The second application receives backup data sent by the first application of the second terminal device, wherein the first terminal device and the second terminal device are different mobile phones; The second application sends the backup data to the PMS; The PMS parses the backup data, obtains the storage data of the application to be backed up, and stores the storage data of the application to be backed up in the first terminal device using a sandbox storage method. Both the first application and the second application are cloned applications; The cloned application is an application used to migrate the stored data of the application to be backed up from the second terminal device to the first terminal device.

5. The method according to claim 4, characterized in that, The second application sends the backup data to the PMS including: The second application determines the source address information and destination address information of the backup data based on the relevant information of the application to be backed up, stores the backup data in the storage location indicated by the source address information, and sends a data recovery command to the PMS; wherein the data recovery command carries the source address information and destination address information of the backup data; The PMS obtains the backup data based on the source address information in the data recovery instruction; The PMS stores the storage data of the application to be backed up, including: The PMS stores the stored data of the application to be backed up according to the destination address information in the data recovery instruction.

6. The method according to claim 4, characterized in that, The data of the application to be backed up is stored on the memory card using a sandbox storage method.

7. A second terminal device, characterized in that, The second terminal device includes a first application, a PMS, and an application to be backed up; The first application and the application to be backed up are different applications; The data of the application to be backed up is stored in the second terminal device using a sandbox storage method; The second terminal device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the second terminal device is triggered to perform the following steps: The first application establishes a connection with the second application on the first terminal device; The first application determines the application to be backed up and sends relevant information about the application to be backed up to the second application. The relevant information is used to instruct the storage data of the application to be backed up to be migrated from the second terminal device to the first terminal device. The first application sends a data read instruction to the PMS, the data read instruction being used to request access to the storage data of the application to be backed up; The PMS accesses the storage data corresponding to the application to be backed up according to the data reading instruction, and packages the storage data into backup data for the first application to obtain; The first application sends the backup data to a second application on the first terminal device, wherein the first terminal device and the second terminal device are different mobile phones; Both the first application and the second application are cloned applications; The cloned application is an application used to migrate the stored data of the application to be backed up from the second terminal device to the first terminal device.

8. The second terminal device according to claim 7, characterized in that, The data of the application to be backed up is stored on the memory card using a sandbox storage method.

9. The second terminal device according to claim 7, characterized in that, The data reading instruction carries source address information and destination address information of the stored data of the application to be backed up; wherein, the source address information is used to identify the storage location of the stored data; and the destination address information is used to identify the location where the stored data is stored after being packaged into backup data. The PMS accesses the storage data corresponding to the application to be backed up according to the data read instruction, and packages the storage data into backup data so that the first application can obtain it, including: The PMS accesses the storage data corresponding to the application to be backed up according to the source address information in the data reading instruction, packages the storage data into backup data, and stores the backup data in the storage location indicated by the destination address information. The first application retrieves the backup data from the storage location indicated by the destination address information.

10. A first terminal device, characterized in that, The first terminal device includes a second application, a PMS, and an application to be backed up; The second application is a different application from the application to be backed up; The first terminal device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the first terminal device is triggered to perform the following steps: The second application establishes a connection with the first application on the second terminal device; The second application receives relevant information about the application to be backed up sent by the first application. The relevant information is used to instruct the storage data of the application to be backed up to be migrated from the second terminal device to the first terminal device. The second application sends the relevant information of the application to be backed up to the PMS; The second application receives backup data sent by the first application of the second terminal device, wherein the first terminal device and the second terminal device are different mobile phones; The second application sends the backup data to the PMS; The PMS parses the backup data, obtains the storage data of the application to be backed up, and stores the storage data of the application to be backed up in the first terminal device using a sandbox storage method. Both the first application and the second application are cloned applications; The cloned application is an application used to migrate the stored data of the application to be backed up from the second terminal device to the first terminal device.

11. The first terminal device according to claim 10, characterized in that, The second application sends the backup data to the PMS including: The second application determines the source address information and destination address information of the backup data based on the relevant information of the application to be backed up, stores the backup data in the storage location indicated by the source address information, and sends a data recovery command to the PMS; wherein the data recovery command carries the source address information and destination address information of the backup data; The PMS obtains the backup data based on the source address information in the data recovery instruction; The PMS stores the storage data of the application to be backed up, including: The PMS stores the stored data of the application to be backed up according to the destination address information in the data recovery instruction.

12. The first terminal device according to claim 10, characterized in that, The data of the application to be backed up is stored on the memory card using a sandbox storage method.

13. A storage medium, characterized in that, The storage medium stores a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-3.

14. A storage medium, characterized in that, The storage medium stores a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 4-6.

15. A computer program product, characterized in that, The computer program product includes a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-3.

16. A computer program product, characterized in that, The computer program product includes a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 4-6.