WO2021254214A1 - Migration method and apparatus for android application program - Google Patents

Migration method and apparatus for android application program Download PDF

Info

Publication number
WO2021254214A1
WO2021254214A1 PCT/CN2021/098909 CN2021098909W WO2021254214A1 WO 2021254214 A1 WO2021254214 A1 WO 2021254214A1 CN 2021098909 W CN2021098909 W CN 2021098909W WO 2021254214 A1 WO2021254214 A1 WO 2021254214A1
Authority
WO
WIPO (PCT)
Prior art keywords
android application
resource information
binder
ashmem
information
Prior art date
Application number
PCT/CN2021/098909
Other languages
French (fr)
Chinese (zh)
Inventor
王创
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021254214A1 publication Critical patent/WO2021254214A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5066Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs

Definitions

  • This application relates to the technical field of operating systems, and in particular to a method and device for migrating Android applications.
  • Cloudphone has also begun to enter people's lives.
  • the applications in the cloud mobile phone can all be deployed in the cloud computing node, and the cloud computing node provides the computing resources required by the application. In this way, problems such as heat generation and fast power consumption of the physical mobile phone can be effectively avoided.
  • applications need to be migrated from the current cloud computing node to other cloud computing nodes. For example, if a user wants an application to use higher-configuration hardware resources than the current cloud computing node, then the application needs to be migrated to In the cloud computing node that meets the needs of users.
  • Commonly used application migration tools such as the Checkpoint/Restore In Userspace (CRIU) tool, can export the basic resource information of the application running on the Linux system to generate the resource information collection of the application, and In the new cloud computing node, according to the derived resource information set of the application, the basic resources of the application are restored to complete the migration of the application.
  • the basic resource information may include process information, memory information, file information, etc. corresponding to the application program.
  • the applications running in the cloud computing nodes are Android applications.
  • the Android system includes two basic services, Anonymous shared memory (Ahmem) service and Inter-process communication (Binder) service. Android applications need to use these two services when running, and will generate corresponding Ashmem resource information and Binder resource information.
  • Using the above CRIU tool can only export and restore the basic resource information of the application, but cannot export and restore the Ashmem resource information and Binder resource information corresponding to the application, that is, it is impossible to realize the migration of the Android application.
  • the embodiment of the application provides a method and device for Android application migration, which can export and restore the resources of the Android application program under the Android system in the computing node, so as to realize the migration of the Android application program.
  • the technical solution is as follows:
  • a method for exporting resources of an Android application is provided.
  • the method is applied to the original computing node.
  • the method includes:
  • the resource information collection of the first Android application is sent to the target computing node, so that the target computing node restores the basic resources of the first Android application based on the first basic resource information, and calls the second Ashmem kernel driver based on the first Ashmem Resource information, restore the Ashmem resource of the first Android application, call the second Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
  • the computing node may be a server, a virtual machine, or the like.
  • An Android application export recovery tool can be installed in the computing node.
  • the original computing node can export the basic resource information of the first Android application through the basic resource management module in the Android application export recovery tool and write it into the resource information collection of the first Android application.
  • the exported basic resource information of the first Android application may include process information, file information, memory information, etc. of the first Android application. It is also possible to use the Ashmem resource management module in the Android application export recovery tool to call the Ashmem kernel driver in the kernel driver module to export the Ashmem resource information and write it into the resource information collection of the first Android application.
  • Ashmem resource information may include target shared memory information and shared file information shared by multiple processes of the first Android application. It is also possible to call the Binder kernel driver in the kernel driver module through the Binder resource management module, export the Binder resource information and write it into the resource information collection of the first Android application.
  • the Binder resource information may include communication connection information between the client process of the first Android application and the server process of the target application.
  • the original computing node After the original computing node writes the basic resource information, Ashmem resource information, and Binder resource information of the first Android application into the resource information collection of the first Android application, it can send the resource information of the first Android application and Target computing node.
  • the destination computing node exports the recovery tool through the Android application, restores the basic resources of the first Android application based on the first basic resource information, calls the second Ashmem kernel driver, and restores the first Android application based on the first Ashmem resource information Call the second Binder kernel driver to restore the Binder resource of the first Android application based on the first Binder resource information.
  • the basic resource information, Ashmem resource information, and Binder resource information of the Android application under the Android system can be exported, and the target computing node restores the above-exported resources to realize the migration of the Android application .
  • the method further includes:
  • the first Android application program It is detected whether the first Android application program generates new basic resource information, and if it is detected that the first Android application program generates new basic resource information, then the newly generated basic resource information is derived. It is detected whether the first Android application program generates new Ashmem resource information, and if it is detected that the first Android application program generates new Ashmem resource information, then the newly generated Ashmem resource information is derived. It is detected whether the first Android application program generates new Binder resource information, and if it is detected that the first Android application program generates new Binder resource information, then the newly generated Binder resource information is derived. Generate a new resource information set of the first Android application that includes the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information. Send the newly added resource information set of the first Android application to the destination computing node.
  • the Android application export recovery tool in the original computing node exports the basic resource information and Ashmem resource of the first Android application for the first time.
  • an Android application program migration method is provided, which is applied to a target computing node, and the method includes:
  • the resource set of the first Android application includes the first basic resource information of the first Android application, the first Ashmem resource information, and the first resource information of the first Android application.
  • a Binder resource information Based on the first basic resource information, the basic resource of the first Android application is restored. Call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Invoke the Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
  • the Android application export recovery tool is also installed in the destination computing node. After the destination computing node receives the basic resource information set of the first Android application sent by the original computing node, it may The recovery tool is exported through the Android application, and the basic resources of the first Android application are restored based on the first basic resource information. Call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
  • the first basic resource information includes process information and file information of the first Android application
  • the restoring the basic resources of the first Android application based on the first basic resource information includes:
  • a process corresponding to the process information is created.
  • a file corresponding to the file information is created in the file system.
  • the process information may include a process identification ID, a process status, etc.
  • the file information may include a file name, a file descriptor, read and write permissions, and the like.
  • the basic resource management module in the Android application export recovery tool can create a process based on the process information and configure the process status.
  • the aforementioned basic resource management module can create a process corresponding to the process information based on the process information, and create a file corresponding to the file information in the file system based on the file information.
  • the first Ashmem resource information includes target memory information of a shared memory shared by multiple processes of the first Android application and target file information of a shared file
  • the target memory information includes the The attribute information and storage data of the shared memory shared by multiple target processes
  • the file corresponding to the file information includes the target shared file corresponding to the target file information.
  • the restoring the Ashmem resource of the first Android application based on the first Ashmem resource information includes:
  • the first Binder resource information includes communication connection information between the client process of the first Android application and the server process of the second Android application, and the process information The corresponding process includes the client process of the first Android application;
  • the restoring the Binder resource of the first Android application based on the first Binder resource information includes:
  • a communication connection between the client process and the server process of the second Android application in the target computing node is established.
  • the Binder resource information of the first Android application may include communication connection information between the client process of the first Android application and the server process of the first Android application.
  • the connection information may include basic data of the Binder client structure (binder_ref) of the client process of the first Android application and identification information of the Binder server structure (binder_node) of the server process of the third Android application.
  • the Android application export recovery tool can call the Binder kernel driver in the kernel driver module through the Binder resource management module, and find the corresponding second Android application in the computing node according to the identification information of the above-mentioned Binder server structure (binder_node) And then establish a communication connection between the client process of the first Android application and the server process of the second Android application.
  • a method for restoring a snapshot of an Android application program is provided.
  • the method is applied to a computing node, and the method includes:
  • Receive the snapshot restoration instruction at the first moment of the first Android application Acquire a stored snapshot of the first Android application corresponding to the first moment, where the snapshot of the first Android application includes first basic resource information of the first Android application, first Ashmem resource information, and The first Binder resource information. Based on the first basic resource information, the basic resource of the first Android application is restored. Call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Invoke the Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
  • the computing node may store a snapshot generated at least one moment of the first Android application.
  • the user can specify a snapshot at a moment in the stored snapshots of the first Android application, and use the snapshot to restore the snapshot of the first Android application.
  • the process of using the snapshot to restore the Android application is the same as the process of restoring the basic resources of the Android application during the migration of the Android application in the second aspect above.
  • the snapshot here is the same as that in the first aspect above.
  • the resource information collection includes basic resource information of Android applications, Ashmem resource information, and Binder resource information.
  • the method further includes:
  • receiving a snapshot generation instruction for the first Android application Derive the first basic resource information.
  • Invoke the Ashmem kernel driver to export the first Ashmem resource information.
  • Invoke the Binder kernel driver to export the first Binder resource information.
  • a snapshot of the first Android application program including the first basic resource information, the first Ashmem resource information, and the first Binder resource information is generated. Correspondingly store the snapshot of the first Android application and the first moment.
  • the user in order to restore the first Android application in time when there is a problem in the first Android application, the user generates the first Android application through the computing node at least at a specified time.
  • a snapshot of the application program, and the generated snapshot of the first Android application program is correspondingly stored with the first moment when the snapshot is generated.
  • a device for migrating an Android application program is provided.
  • the device is applied to a target computing node, and the device includes:
  • the acquiring module is configured to acquire the resource set of the first Android application sent by the original computing node, wherein the resource set of the first Android application includes the first basic resource information of the first Android application, and the first basic resource information of the first Android application. Ashmem resource information and first Binder resource information; basic resource management module, used to export the first basic resource information of the first Android application;
  • the Ashmem resource management module is used to call the first anonymous shared memory Ashmem kernel driver to export the first Ashmem resource information corresponding to the first Android application;
  • the Binder resource management module is used to call the first inter-process communication Binder kernel driver to export the first Binder resource information corresponding to the first Android application;
  • a generating module configured to generate a resource information set of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
  • the sending module is configured to send the resource information collection of the first Android application to a target computing node, so that the target computing node restores the basic resources of the first Android application based on the first basic resource information, and calls
  • the second Ashmem kernel driver restores the Ashmem resource of the first Android application based on the first Ashmem resource information, calls the second Binder kernel driver, and restores the first Binder resource information based on the first Binder resource information. Binder resources for Android applications.
  • the sending module is further configured to send the resource information collection of the first Android application to the first computing node;
  • the basic resource management module is also used to detect whether the first Android application generates new basic resource information, and if it is detected that the first Android application generates new basic resource information, export the newly generated basic resource information;
  • the Ashmem resource management module is also used to detect whether the first Android application generates new Ashmem resource information, and if it is detected that the first Android application generates new Ashmem resource information, export the newly generated Ashmem resource information;
  • the Binder resource management module is also used to detect whether the first Android application generates new Binder resource information, and if it is detected that the first Android application generates new Binder resource information, export the newly generated Binder resource information;
  • the generating module is further configured to generate a new resource information set of the first Android application including the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information;
  • the sending module is further configured to send the newly added resource information set of the first Android application to the destination computing node.
  • a device for migrating an Android application program is provided.
  • the device is applied to a target computing node, and the device includes:
  • the acquiring module is configured to acquire the resource set of the first Android application sent by the original computing node, wherein the resource set of the first Android application includes the first basic resource information of the first Android application, and the first basic resource information of the first Android application. Ashmem resource information and first Binder resource information;
  • a basic resource management module configured to restore the basic resources of the first Android application based on the first basic resource information
  • the Ashmem resource management module is used to call the Ashmem kernel driver and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
  • the Binder resource management module is used to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
  • the first basic resource information includes process information and file information of the first Android application
  • the basic resource management module is used for:
  • a file corresponding to the file information is created in the file system.
  • the first Ashmem resource information includes target memory information of a shared memory shared by multiple processes of the first Android application program and target file information of a shared file, and the target memory information includes Attribute information and storage data of the shared memory shared by the multiple target processes, and the file corresponding to the file information includes the target shared file corresponding to the target file information;
  • the Ashmem resource management module is used for:
  • the storage data is written into the target shared memory and used as the file content data of the target shared file.
  • the first Binder resource information includes communication connection information between the client process of the first Android application and the server process of the second Android application, and the process information The corresponding process includes the client process of the first Android application;
  • the Binder resource management module is used to:
  • a communication connection between the client process and the server process of the second Android application in the target computing node is established.
  • a device for restoring a snapshot of an Android application program is provided.
  • the method is applied to a computing node, and the device includes:
  • the receiving module is used to receive the snapshot restoration instruction at the first moment of the first Android application
  • the acquiring module is configured to acquire a stored snapshot of the first Android application corresponding to the first moment, wherein the snapshot of the first Android application includes the first basic resource information and the first Android application of the first Android application. -Ashmem resource information and the first Binder resource information;
  • a basic resource management module configured to restore the basic resources of the first Android application based on the first basic resource information
  • the Ashmem resource management module is used to call the Ashmem kernel driver and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
  • the Binder resource management module is used to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
  • the receiving module is further configured to:
  • the basic resource management module is also used to export the first basic resource information
  • the Ashmem resource management module is further configured to call the Ashmem kernel driver to export the first Ashmem resource information
  • the Binder resource management module is further configured to call the Binder kernel driver to export the first Binder resource information
  • the device further includes a generating module, configured to generate a snapshot of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
  • the device further includes a storage module for storing the snapshot of the first Android application program and the first moment in correspondence.
  • a computing node in a seventh aspect, includes a processor and a memory, and at least one instruction is stored in the memory. The instruction is loaded and executed by the processor to implement the above-mentioned first aspect.
  • the operations performed by the Android application migration method described above, or the operations performed by the Android application migration method described in the second aspect described above, or the Android application snapshot restoration method described in the third aspect described above The action performed.
  • a computer-readable storage medium is provided, and at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the Android application migration method as described in the first aspect above
  • the operations performed are either the operations performed by the Android application migration method described in the second aspect described above, or the operations performed by the Android application snapshot restoration method described in the third aspect described above.
  • a computer program product containing instructions when the computer program product runs on a vehicle lane change trend recognition device, the computing node is caused to execute the Android application migration as described in the first aspect above , Or execute the Android application migration method as described in the second aspect above, or execute the Android application snapshot restoration method as described in the third aspect above.
  • the technical solutions provided by the embodiments of the present application can export not only basic resource information of the Android application, but also Ashmem resource information and Binder resource information unique to the Android application.
  • the destination computing node can restore the basic resources, Ashmem resources, and Binder resources of the Android application to Realize the migration of Android applications.
  • FIG. 1 is a schematic diagram of a migration scenario of an Android application provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a snapshot restoration scene of an Android application provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an Android application export recovery tool provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the principle of an Ashmem service provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the principle of a Binder service provided by an embodiment of the present application.
  • FIG. 6 is a flowchart of a method for migrating an Android application provided by an embodiment of the present application
  • FIG. 7 is a schematic diagram of a quick startup scenario of an Android application provided by an embodiment of the present application.
  • FIG. 8 is a flowchart of a method for restoring an Android application program snapshot provided by an embodiment of the present application
  • FIG. 9 is a schematic structural diagram of an Android application program migration device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an Android application program migration device provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a device for restoring an Android application program snapshot provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a computing node provided by an embodiment of the present application.
  • the embodiments of the present application provide a method and device for migrating an Android application program.
  • the method can be implemented by an original computing node and a destination computing node that are installed with an Android application export recovery tool. Both the original computing node and the destination computing node may be servers, virtual machines, and so on.
  • this method can be applied to the scenario of Android application migration.
  • the original computing node installed with the Android application export recovery tool can export the basic resource information, Ashmem resource information and Binder resource information of the first Android application through the Android application export recovery tool and write it into the resource information collection. It is sent to the destination computing node that also has the Android application export recovery tool installed, and the destination computing node restores the first Android application.
  • this method can also be applied in the scenario where an Android application is quickly started.
  • Deploying the Android application migration tool and the Android application export recovery tool can be installed in the original computing node with multiple Android applications.
  • the original computing node can export the recovery tool through the Android application, and the export needs to be quickly started in the target computing node
  • the resource information of the first Android application (Android application 2 in FIG. 2) is collected and sent to the startup resource storage device for storage.
  • the target computing node can obtain the resource information collection of the first Android application that needs to be started quickly in the startup resource storage device, and restore the target Android application through the Android application export recovery tool, so as to realize the correctness in the target computing node. Quick launch of the first Android application.
  • the Android application export recovery tool installed in the aforementioned computing node may be a software tool, as shown in FIG. 3, the Android application export recovery tool may include three modules: an external interface gateway module, a resource management module, and a kernel driver module. Among them, the external interface gateway module and the resource management module run in the user space, and the kernel driver module runs in the kernel space.
  • the external interface gateway module is used to provide external interfaces of the Android application export recovery tool, such as a command line interface, a HyperText Transfer Protocol (HTTP) interface, and so on.
  • the resource management module includes a basic resource management module, an anonymous shared memory (Ahmem) resource management module, and an inter-process communication (Binder) module.
  • the kernel drive module includes Ashmem kernel drive module and Binder kernel drive module.
  • the basic resource management module is used to export and restore basic resource information of the Android application.
  • the Ashmem resource management module is used to call the Ashmem kernel driver in the kernel driver module to realize the export and recovery of Ashmem resource information.
  • the Binder resource management module is used to call the Binder kernel driver in the kernel driver module to realize the export and recovery of Binder resource information.
  • the target Android application includes process A and process B, and process A and process B respectively correspond to file descriptor tables (fdt).
  • the file system (file sytem) includes files corresponding to each process, and the Ashmem module is a shared memory module.
  • the file descriptor table corresponding to process A and process B respectively contains a file descriptor pointing to the same file fileN in the file system, and the file content data of fileN is stored in Ashmem
  • the target shared memory in the module is a shared memory module.
  • the Android application A includes a client process
  • the Android application B includes a server process.
  • the client process in Android application A is in the Binder module "BinderA" in the kernel space.
  • the BinderA includes a Binder process structure (binder_proc), a Binder client structure (binder_ref), and a Binder thread information structure (binder_thread).
  • the server process in Android application B has a Binder module "BinderB" in the kernel space.
  • the BinderB includes binder_proc, binder_thread and Binder server structure (binder_node). If you want to establish a communication connection between the client process of Android application A and the server process of Android application B, you need to make the node in the binder_ref of the client process point to the binder_node of the server process.
  • Fig. 6 is a flowchart of a method for migrating an Android application provided by an embodiment of the present application.
  • the processing flow of the method may include the following steps:
  • Step 601 The original computing node derives the first basic resource information of the first Android application.
  • an Android application export recovery tool can be deployed in the original computing node.
  • the resource migration instruction for the first Android application can be sent to the Android application export recovery tool.
  • the resource migration instruction can be in the form of command line, HTTP request, etc.
  • the Android application export recovery tool After the Android application export recovery tool receives the resource migration instruction for the first Android application through the external interface gateway, it can export the basic resource information of the first Android application through the basic resource management module.
  • the exported basic resource information of the first Android application may include process information, file information, memory information, etc. of the first Android application.
  • the process information may include process identification (ID), process status, etc.
  • the file information may include file size, file read and write permissions, file modification time, etc.
  • memory information may include a list of used memory areas and used memory Storage data, etc.
  • Step 602 The original computing node calls the first Ashmem kernel driver to export the first Ashmem resource information of the first Android application.
  • Ashmem resource information may include target shared memory information and shared file information shared by multiple processes of the first Android application.
  • the target shared memory information includes the attributes and storage data of the shared memory
  • the shared file information includes the name, size, and file descriptor of the shared file.
  • Step 603 The original computing node calls the first Binder kernel driver to export the first Binder resource information of the first Android application.
  • the Android application export recovery tool after the Android application export recovery tool receives the resource export instruction for the first Android application, it can also call the Binder kernel driver in the kernel driver module through the Binder resource management module to export Binder resource information.
  • the Binder resource information may include communication connection information between the client process of the first Android application and the server process of the second Android application.
  • the communication connection information may include the binder_ref of the client process of the first Android application and the identification information of the binder_node of the server process in the second Android application.
  • the communication connection information is used to indicate the client process of the first Android application. There is a connection relationship between the binder_ref of the second Android application and the binder_node of the server process in the second Android application.
  • Step 604 The original computing node generates a first Android application resource set including the first basic resource information, the first Ashmem resource information, and the first Binder resource information.
  • the derived first basic resource information, first Ashmem resource information, and first Binder resource information may be written into the resource collection of the first Android application.
  • Step 605 The original computing node sends the resource information collection of the first Android application to the destination computing node.
  • the user can specify that the first Android application needs to be migrated to the destination computing node. Then, after the original computing node generates the resource information collection of the first Android application, the resource information collection of the first Android application can be sent To the destination computing node.
  • Step 606 The destination computing node obtains the resource information set of the first Android application sent by the original computing node.
  • Step 607 The destination computing node restores the basic resources of the first Android application based on the first basic resource information.
  • the Android application export recovery tool is also installed in the destination computing node. After obtaining the resource information collection of the first Android application sent by the original computing node, the destination computing node can export the recovery tool to the first Android application through the Android application. An Android application to restore. The following describes the recovery of the basic resources, Ashmem resources and Binder resources of the first Android application through the Android application export recovery tool:
  • the basic resource management module based on the first basic resource information of the first Android application, the basic resources of the first Android application are restored.
  • the basic resource information of the first Android application includes process information, file information, memory information, etc. of the first Android application.
  • process information can include process identification ID, process status, etc.
  • file information can include file name, file read and write permissions, file modification time, file descriptors, etc.
  • memory information can include a list of used memory areas, and information in used memory. Store data, etc.
  • the basic resource management module can create a corresponding process based on the process information and set the process status. You can also create a used memory area list based on the memory information, and write the corresponding storage data in the corresponding memory area. You can also create corresponding files in the file system (File System) based on file information, and configure file attributes such as file read and write permissions, file modification time, etc. You can also create a file descriptor table of the corresponding process, and set it in the file descriptor table. The newly created file corresponds to the file descriptor in the corresponding file information.
  • File system File System
  • the Ashmem resource information of the first Android application program may include target memory information of a shared memory shared by multiple processes of the first Android application program and target file information of a shared file.
  • the target memory information includes the size of the shared memory shared by the multiple processes, read and write permissions, storage data, etc.
  • the target file information includes the name of the shared file, file descriptors, and so on.
  • the Ashmem kernel driver can create a target shared memory according to the size of the shared memory shared by multiple processes in the target memory information, configure its read and write permissions, and write the stored data into the created target shared memory. Then use the stored data in the target shared memory as the content data of the target shared file. Completed Ashmem resource restoration of the first Android application.
  • the Binder kernel driver in the kernel driver module is called through the Binder resource management module, and the Binder resource of the first Android application is restored based on the second Binder resource information.
  • the Binder resource information of the first Android application may include communication connection information between the client process of the first Android application and the server process of the first Android application.
  • the communication connection information may include the information of the first Android application.
  • the Binder resource information may also include configuration information, such as the basic data of the binder_proc and the basic data of the binder_thread of the client process of the second Android application. It can also include communication data between the client process and the server process.
  • the client process of the first Android application here has been created when the above-mentioned basic resources are restored.
  • the second Android application program is usually a public application program, and the second Android application program needs to be installed in both the original computing node and the destination computing node.
  • the Binder kernel driver can create the binder_proc, binder_thread, and binder_ref of the client process of the first Android application in the computing node according to the above configuration information. Then, according to the identification information of the binder_node of the server process of the second Android application in the communication connection information, search for the server process of the second Android application, and make the node in the binder_ref of the client process of the first Android application point to the search The binder_node of the server process of the second Android application to realize the communication connection between the client process of the first Android application and the server of the second Android application.
  • the original computing node may send the resource collection of the first Android application to the destination computing node, and the destination computing node will receive the first Android application based on the received first Android application.
  • the resource collection of the application restores the first Android application.
  • the first Android application program may still be running in the original computing node, and the original computing node may detect whether the first Android application program generates new resource information according to a preset detection period.
  • the processing can be as follows:
  • Binder resource management module of the Android application export recovery tool Use the Binder resource management module of the Android application export recovery tool to detect whether the first Android application generates new Binder resource information. If it is detected that the first Android application generates new Binder resource information, export the newly generated Binder resource information .
  • the newly generated basic resource information of the first Android application, the newly generated Ashmem resource information, and the newly generated Binder resource information are detected in the original computing node. If the total amount is greater than the preset threshold, the running of the first Android application in the original computing node is stopped.
  • multiple Android applications including the first Android application can be installed in the computing node, and the first Android application needs to run in an independent computing node, then the computing node
  • the node can export the basic resource information, Ashmem resource information, and Binder resource information of the first Android application through the Android application export recovery tool, and write them into the resource information collection of the first Android application. Then, stop running the first Android application in the original computing node, and send it to the startup resource storage device for storage.
  • the destination computing node of the first Android application to be run may, after receiving the instruction to quickly start the first Android application, obtain the resource information set of the first Android application from the startup resource storage device, and execute the step 707 described above.
  • the restoration of the basic resources, Ashmem resources, and Binder resources of the first Android application program completes the quick start of the first Android application program in the target computing node.
  • Ashmem resource information and Binder resource information unique to the Android application can also be exported.
  • the destination computing node can restore the basic resources, Ashmem resources, and Binder resources of the Android application to Realize the migration of Android applications.
  • the embodiment of the present application also provides a method for restoring a snapshot of an Android application program.
  • the method can be implemented by a computing node installed with a tool for exporting and restoring an Android application program.
  • this method can be applied to the scenario of Android application snapshot recovery.
  • the computing node installed with the Android application migration tool can export the basic resource information, Ashmem resource information, and Binder resource information of the first Android application at least at one specified time through the Android application migration tool, and write it into the first Android application.
  • the snapshot When there is a problem with the Android application, a snapshot of the first Android application exported at a certain moment can be obtained as needed, and the first Android application can be restored through the Android application export recovery tool.
  • Fig. 8 is a flowchart of a method for migrating an Android application provided by an embodiment of the present application.
  • the processing flow of the method may include the following steps:
  • Step 801 Receive a snapshot restoration instruction at the first moment of the first Android application.
  • the computing node may store a snapshot generated at least one moment of the first Android application.
  • the user can send a snapshot restoration instruction of the first moment of the first application to the computing node.
  • Step 802 Obtain a stored snapshot of the first Android application corresponding to the first moment.
  • the snapshot of the first Android application program includes the first basic resource information of the first Android application program, the first Ashmem resource information, and the first Binder resource information.
  • Step 803 Based on the first basic resource information, restore the basic resources of the first Android application, call the Ashmem kernel driver, based on the first Ashmem resource information, restore the Ashmem resource of the first Android application, call the Binder kernel driver, based on The first Binder resource information restores the Binder resource of the first Android application.
  • the computing node restores the first Android application based on a snapshot of the first Android application at a certain moment, which is the same as in the above step 607, the destination computing node is based on the first Android application.
  • the method for restoring the first Android application program in the resource information collection of is the same, and will not be repeated here.
  • the user can generate and store a snapshot of the first Android application program through the computing node at at least one designated moment, so as to use it when a problem occurs with the first Android application program.
  • the processing can be as follows: at the first moment, a snapshot generation instruction for the first Android application is received. Export the first basic resource information. Call the Ashmem kernel driver to export the first Ashmem resource information. Call the Binder kernel driver to export the first Binder resource information. A snapshot of the first Android application program including the first basic resource information, the first Ashmem resource information, and the first Binder resource information is generated. The snapshot of the first Android application program is correspondingly stored with the first moment.
  • an embodiment of the present application also provides a device for migrating an Android application program.
  • the device can be applied to a computing node. As shown in FIG. 9, the device includes:
  • the basic resource management module 910 is used to export the first basic resource information of the first Android application. Specifically, the function of deriving basic resource information in the above step 601 and other implicit steps can be realized.
  • the Ashmem resource management module 920 is used for the first Ashmem kernel driver to export the first Ashmem resource information corresponding to the first Android application. Specifically, the Ashmem resource information derivation function in step 602 above can be implemented, as well as other implicit steps.
  • the Binder resource management module 930 is configured to call the first Binder kernel driver and export the first Binder resource information corresponding to the first Android application. Specifically, the Binder resource information derivation function in step 603 above can be implemented, as well as other implicit steps.
  • the generating module 940 is configured to generate a resource information set of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information. Specifically, the generating function in step 604 and other implicit steps can be realized.
  • the sending module 950 is configured to send the resource information collection of the first Android application to a target computing node, so that the target computing node restores the basic resources of the first Android application based on the first basic resource information, Call the second Ashmem kernel driver, restore the Ashmem resource of the first Android application based on the first Ashmem resource information, call the second Binder kernel driver, and restore the first Binder resource information based on the first Binder resource information.
  • a Binder resource of an Android application Specifically, the sending function in the above step 605 and other implicit steps can be realized.
  • the sending module 950 is further configured to send the resource information collection of the first Android application to the first computing node;
  • the basic resource management module is also used to detect whether the first Android application generates new basic resource information, and if it is detected that the first Android application generates new basic resource information, export the newly generated basic resource information;
  • the Ashmem resource management module 920 is also used to detect whether the first Android application generates new Ashmem resource information, and if it is detected that the first Android application generates new Ashmem resource information, export the newly generated Ashmem Resource information;
  • the Binder resource management module 930 is also used to detect whether the first Android application generates new Binder resource information, and if it is detected that the first Android application generates new Binder resource information, then export the newly generated Binder Resource information;
  • the generating module 940 is further configured to generate a new resource information set of the first Android application including the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information;
  • the sending module 950 is further configured to send the newly added resource information set of the first Android application to the destination computing node.
  • the device for migrating an Android application provided in the above embodiment only uses the division of the above functional modules for illustration when the Android application is migrated. In actual applications, the above functional assignments can be assigned differently according to needs.
  • the function module is completed, that is, the internal structure of the original computing node is divided into different function modules to complete all or part of the functions described above.
  • the device for migrating an Android application program provided in the foregoing embodiment belongs to the same concept as the method embodiment of the Android application program migration. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
  • an embodiment of the present application also provides a device for migrating an Android application program.
  • the device can be applied to a computing node. As shown in FIG. 10, the device includes:
  • the acquiring module 1010 is configured to acquire the resource set of the first Android application sent by the original computing node, where the resource set of the first Android application includes the first basic resource information of the first Android application and the first basic resource information of the first Android application.
  • One Ashmem resource information and the first Binder resource information can be implemented.
  • the basic resource management module 1020 is configured to restore the basic resources of the first Android application based on the first basic resource information. Specifically, the basic resource recovery function in step 607 and other implicit steps can be implemented.
  • the Ashmem resource management module 1030 is configured to call the Ashmem kernel driver and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Specifically, the Ashmem resource recovery function in step 607 above can be implemented, as well as other implicit steps.
  • the Binder resource management module 1040 is configured to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information. Specifically, the Binder resource recovery function in step 607 and other implicit steps can be implemented.
  • the first basic resource information includes process information and file information of the first Android application
  • the basic resource management module 1020 is used to:
  • a file corresponding to the file information is created in the file system.
  • the first Ashmem resource information includes target memory information of a shared memory shared by multiple processes of the first Android application program and target file information of a shared file, and the target memory information includes Attribute information and storage data of the shared memory shared by the multiple target processes, and the file corresponding to the file information includes the target shared file corresponding to the target file information;
  • the Ashmem resource management module 1030 is used to:
  • the storage data is written into the target shared memory and used as the file content data of the target shared file.
  • the first Binder resource information includes communication connection information between the client process of the first Android application and the server process of the second Android application, and the process information The corresponding process includes the client process of the first Android application;
  • the Binder resource management module 1040 is used to:
  • a communication connection between the client process and the server process of the second Android application in the target computing node is established.
  • the device for migrating an Android application provided in the above embodiment only uses the division of the above functional modules for illustration when the Android application is migrated. In actual applications, the above functional assignments can be assigned differently according to needs.
  • the function module is completed, that is, the internal structure of the target computing node is divided into different function modules to complete all or part of the functions described above.
  • the device for migrating an Android application program provided in the foregoing embodiment belongs to the same concept as the method embodiment of the Android application program migration. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
  • an embodiment of the present application also provides a device for restoring a snapshot of an Android application program.
  • the device can be applied to a computing node. As shown in FIG. 11, the device includes:
  • the receiving module 1110 is configured to receive a snapshot restoration instruction at the first moment of the first Android application
  • the obtaining module 1120 is configured to obtain a stored snapshot of the first Android application corresponding to the first moment, wherein the snapshot of the first Android application includes the first basic resource information of the first Android application, The first Ashmem resource information and the first Binder resource information;
  • the basic resource management module 1130 is configured to restore the basic resources of the first Android application based on the first basic resource information
  • the Ashmem resource management module 1140 is configured to call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
  • the Binder resource management module 1150 is configured to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
  • the receiving module 1110 is further configured to:
  • the basic resource management module 1130 is further configured to export the first basic resource information
  • the Ashmem resource management module 1140 is also used to call the Ashmem kernel driver to export the first Ashmem resource information
  • the Binder resource management module 1150 is further configured to call the Binder kernel driver to export the first Binder resource information
  • the device further includes a generating module, configured to generate a snapshot of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
  • the device further includes a storage module for storing the snapshot of the first Android application program and the first moment in correspondence.
  • the device for restoring an Android application snapshot provided in the above embodiment only uses the division of the above functional modules for illustration when the Android application snapshot is restored. In actual applications, the above functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the computing node is divided into different functional modules to complete all or part of the functions described above.
  • the device for restoring a snapshot of an Android application program provided in the foregoing embodiment belongs to the same concept as the method embodiment for restoring a snapshot of an Android application program. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
  • FIG. 12 is a schematic diagram of a computing node 1200 provided by an embodiment of the present application.
  • the computing node may include a processor 1201 and a memory 1202.
  • the processor 1201 may be a central processing unit (CPU).
  • the processor 1201 may refer to one processor, or may include multiple processors.
  • the memory 1202 may include volatile memory, such as random access memory (RAM); the memory may also include non-volatile memory, such as read-only memory (ROM), flash memory, and the like.
  • the memory may also include a combination of the above-mentioned types of memory.
  • the memory 1202 may refer to one memory, or may include multiple memories.
  • the memory 1202 stores computer-readable instructions, and the computer-readable instructions can be executed by the processor 1201 to implement the Android application program migration or snapshot restoration method provided in the foregoing embodiments.
  • the computer program product includes one or more computer instructions, and when the computer program instructions are loaded and executed on a device, the processes or functions described in the embodiments of the present application are generated in whole or in part.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by the device or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a digital video disk (Digital Video Disk, DVD), etc.), or a semiconductor medium (such as a solid state hard disk, etc.).

Abstract

A migration method and apparatus for an Android application program, which belong to the technical field of operating systems. The method comprises: exporting basic resource information of an Android application program; calling an Ashmem kernel driver to export Ashmem resource information of the Android application program; calling a Binder kernel driver to export Binder resource information of the Android application program; generating a resource information set of the Android application program that comprises all the types of exported resource information; and sending the resource information set of the Android application program to a destination computing node, so that the destination computing node realizes the restoration of the Android application program on the basis of the resource information set of the Android application program. By means of the method, the export and restoration of basic resource information, Ashmem resource information and Binder resource information of an Android application program under an Android system can be realized, so as to realize the migration of the Android application program.

Description

安卓应用程序迁移的方法和装置Method and device for Android application program migration
本申请要求于2020年06月20日提交的申请号为202010569613.2、发明名称为“安卓应用程序迁移的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed on June 20, 2020 with the application number 202010569613.2 and the title of the invention "Method and Apparatus for Migrating Android Application Programs", the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请涉及操作系统技术领域,特别涉及一种安卓应用程序迁移的方法和装置。This application relates to the technical field of operating systems, and in particular to a method and device for migrating Android applications.
背景技术Background technique
随着网络技术的不断发展,云手机(Cloudphone)也开始进入人们的生活。云手机中的应用程序均可以部署在云计算节点中,由云计算节点提供应用程序所需的计算资源,这样,可以有效避免物理手机的发热、耗电快等问题。在一些情况下,应用程序需要由当前的云计算节点迁移到其他云计算节点中,例如,用户希望某应用程序使用比当前云计算节点更高配置的硬件资源,则需要将该应用程序迁移到满足用户需求的云计算节点中。With the continuous development of network technology, Cloudphone has also begun to enter people's lives. The applications in the cloud mobile phone can all be deployed in the cloud computing node, and the cloud computing node provides the computing resources required by the application. In this way, problems such as heat generation and fast power consumption of the physical mobile phone can be effectively avoided. In some cases, applications need to be migrated from the current cloud computing node to other cloud computing nodes. For example, if a user wants an application to use higher-configuration hardware resources than the current cloud computing node, then the application needs to be migrated to In the cloud computing node that meets the needs of users.
常用的应用程序迁移工具,如用户态导出恢复(Checkpoint/Restore In Userspace,CRIU)工具,可以对运行在Linux系统中的应用程序的基础资源信息进行导出,生成该应用程序的资源信息集合,并在新的云计算节点中根据导出的该应用程序的资源信息集合,对该应用程序的基础资源进行恢复,以完成对该应用程序的迁移。其中,基础资源信息可以包括应用程序对应的进程信息、内存信息、文件信息等。Commonly used application migration tools, such as the Checkpoint/Restore In Userspace (CRIU) tool, can export the basic resource information of the application running on the Linux system to generate the resource information collection of the application, and In the new cloud computing node, according to the derived resource information set of the application, the basic resources of the application are restored to complete the migration of the application. Among them, the basic resource information may include process information, memory information, file information, etc. corresponding to the application program.
然而,目前云手机以安卓(Android)系统为主,即在云计算节点中运行的应用程序为安卓应用程序。安卓系统中包括有两种基础服务,匿名共享内存(Anonymous shared memory,Ashmem)服务和进程间通信(Binder)服务。安卓应用程序在运行时需要使用这两种服务,并会产生相应的Ashmem资源信息和Binder资源信息。采用上述CRIU工具只能对应用程序的基础资源信息进行导出和恢复,而无法对应用程序对应的Ashmem资源信息和Binder资源信息进行导出和恢复,也即是无法实现对安卓应用程序的迁移。However, currently cloud mobile phones are mainly based on the Android system, that is, the applications running in the cloud computing nodes are Android applications. The Android system includes two basic services, Anonymous shared memory (Ahmem) service and Inter-process communication (Binder) service. Android applications need to use these two services when running, and will generate corresponding Ashmem resource information and Binder resource information. Using the above CRIU tool can only export and restore the basic resource information of the application, but cannot export and restore the Ashmem resource information and Binder resource information corresponding to the application, that is, it is impossible to realize the migration of the Android application.
发明内容Summary of the invention
本申请实施例提供了一种安卓应用程序迁移的方法和装置,可以将计算节点中的安卓系统下的安卓应用程序的资源进行导出和恢复,以实现对安卓应用程序的迁移。所述技术方案如下:The embodiment of the application provides a method and device for Android application migration, which can export and restore the resources of the Android application program under the Android system in the computing node, so as to realize the migration of the Android application program. The technical solution is as follows:
第一方面,提供了一种安卓应用程序的资源导出的方法,方法应用于原计算节点,该方法包括:In the first aspect, a method for exporting resources of an Android application is provided. The method is applied to the original computing node. The method includes:
导出第一安卓应用程序的第一基础资源信息。调用第一匿名共享内存Ashmem内核驱动程序,导出第一安卓应用程序的第一Ashmem资源信息。调用第一进程间通信Binder内核驱动程序,导出第一安卓应用程序的第一Binder资源信息。生成包括第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息的第一安卓应用程序的资源信息集合。将第一安卓应用程序的资源信息集合发送至目的计算节点,以使目的计算节点基于第一基础资源信息, 恢复第一安卓应用程序的基础资源,调用第二Ashmem内核驱动程序,基于第一Ashmem资源信息,恢复第一安卓应用程序的Ashmem资源,调用第二Binder内核驱动程序,基于第一Binder资源信息,恢复第一安卓应用程序的Binder资源。Export the first basic resource information of the first Android application. Call the first anonymous shared memory Ashmem kernel driver to export the first Ashmem resource information of the first Android application. Call the first inter-process communication Binder kernel driver to export the first Binder resource information of the first Android application. Generate the resource information set of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information. The resource information collection of the first Android application is sent to the target computing node, so that the target computing node restores the basic resources of the first Android application based on the first basic resource information, and calls the second Ashmem kernel driver based on the first Ashmem Resource information, restore the Ashmem resource of the first Android application, call the second Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
在本申请实施例提供的方案中,计算节点可以为服务器、虚拟机等。在计算节点中可以安装有安卓应用程序导出恢复工具。原计算节点可以通过安卓应用程序导出恢复工具中的基础资源管理模块对第一安卓应用程序的基础资源信息进行导出并写入第一安卓应用程序的资源信息集合中。导出的第一安卓应用程序的基础资源信息可以包括有该第一安卓应用程序的进程信息、文件信息、内存信息等。还可以通过安卓应用程序导出恢复工具中的Ashmem资源管理模块调用内核驱动模块中的Ashmem内核驱动程序,对Ashmem资源信息进行导出并写入第一安卓应用程序的资源信息集合中。Ashmem资源信息可以包括第一安卓应用程序的多个进程共享的目标共享内存信息和共享文件信息。还可以通过Binder资源管理模块调用内核驱动模块中的Binder内核驱动程序,对Binder资源信息进行导出并写入第一安卓应用程序的资源信息集合中。Binder资源信息可以包括第一安卓应用程序的客户端进程和目标应用程序的服务端进程之间的通信连接信息。In the solution provided by the embodiment of the present application, the computing node may be a server, a virtual machine, or the like. An Android application export recovery tool can be installed in the computing node. The original computing node can export the basic resource information of the first Android application through the basic resource management module in the Android application export recovery tool and write it into the resource information collection of the first Android application. The exported basic resource information of the first Android application may include process information, file information, memory information, etc. of the first Android application. It is also possible to use the Ashmem resource management module in the Android application export recovery tool to call the Ashmem kernel driver in the kernel driver module to export the Ashmem resource information and write it into the resource information collection of the first Android application. Ashmem resource information may include target shared memory information and shared file information shared by multiple processes of the first Android application. It is also possible to call the Binder kernel driver in the kernel driver module through the Binder resource management module, export the Binder resource information and write it into the resource information collection of the first Android application. The Binder resource information may include communication connection information between the client process of the first Android application and the server process of the target application.
原计算节点在将第一安卓应用程序的基础资源信息、Ashmem资源信息和Binder资源信息写入第一安卓应用程序的资源信息集合中后,可以将该第一安卓应用程序的资源信息和发送至目标计算节点。由目的计算节点通过安卓应用程序导出恢复工具,基于第一基础资源信息,恢复第一安卓应用程序的基础资源,调用第二Ashmem内核驱动程序,基于第一Ashmem资源信息,恢复第一安卓应用程序的Ashmem资源,调用第二Binder内核驱动程序,基于第一Binder资源信息,恢复第一安卓应用程序的Binder资源。After the original computing node writes the basic resource information, Ashmem resource information, and Binder resource information of the first Android application into the resource information collection of the first Android application, it can send the resource information of the first Android application and Target computing node. The destination computing node exports the recovery tool through the Android application, restores the basic resources of the first Android application based on the first basic resource information, calls the second Ashmem kernel driver, and restores the first Android application based on the first Ashmem resource information Call the second Binder kernel driver to restore the Binder resource of the first Android application based on the first Binder resource information.
通过本方案可以实现对安卓系统下的安卓应用程序的基础资源信息、Ashmem资源信息和Binder资源信息的导出,并由目标计算节点对以上导出的各资源进行恢复,以实现对安卓应用程序的迁移。Through this solution, the basic resource information, Ashmem resource information, and Binder resource information of the Android application under the Android system can be exported, and the target computing node restores the above-exported resources to realize the migration of the Android application .
在一种可能的实现方式中,所述方法还包括:In a possible implementation manner, the method further includes:
检测所述第一安卓应用程序是否生成新的基础资源信息,如果检测到所述第一安卓应用程序生成新的基础资源信息,则导出新生成的基础资源信息。检测所述第一安卓应用程序是否生成新的Ashmem资源信息,如果检测到所述第一安卓应用程序生成新的Ashmem资源信息,则导出新生成的Ashmem资源信息。检测所述第一安卓应用程序是否生成新的Binder资源信息,如果检测到所述第一安卓应用程序生成新的Binder资源信息,则导出新生成的Binder资源信息。生成包括所述新生成的基础资源信息、所述新生成的Ashmem资源信息和所述新生成的Binder资源信息的第一安卓应用程序的新增资源信息集合。将所述第一安卓应用程序的新增资源信息集合发送至目的计算节点。It is detected whether the first Android application program generates new basic resource information, and if it is detected that the first Android application program generates new basic resource information, then the newly generated basic resource information is derived. It is detected whether the first Android application program generates new Ashmem resource information, and if it is detected that the first Android application program generates new Ashmem resource information, then the newly generated Ashmem resource information is derived. It is detected whether the first Android application program generates new Binder resource information, and if it is detected that the first Android application program generates new Binder resource information, then the newly generated Binder resource information is derived. Generate a new resource information set of the first Android application that includes the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information. Send the newly added resource information set of the first Android application to the destination computing node.
在本申请实施例所示的方案中,在对第一安卓应用程序热迁移的场景下,原计算节点中的安卓应用程序导出恢复工具在首次导出第一安卓应用程序的基础资源信息、Ashmem资源信息以及Binder资源信息后,还可以按照预设周期检测该第一安卓应用程序在原计算节点中是否有新生成的资源信息,如果有新生成的资源信息,则将新生成的资源信息导出写入第一安卓应用程序的新增资源信息集合中。如果检测到该第一安卓应用程序在原计算节点中的新生成的资源信息总量大于预设阈值,则可以停止该第一安卓应用程序在原计算节点中的运行。In the solution shown in the embodiment of the present application, in the scenario of hot migration of the first Android application, the Android application export recovery tool in the original computing node exports the basic resource information and Ashmem resource of the first Android application for the first time. After the information and Binder resource information, you can also check whether the first Android application has newly generated resource information in the original computing node according to the preset period. If there is newly generated resource information, export the newly generated resource information to write In the new resource information collection of the first Android application. If it is detected that the total amount of newly generated resource information of the first Android application in the original computing node is greater than the preset threshold, the running of the first Android application in the original computing node may be stopped.
通过本方案可以实现安卓应用程序从原计算节点到目的计算节点的热迁移。Through this solution, the hot migration of Android applications from the original computing node to the destination computing node can be realized.
第二方面,提供了一种安卓应用程序迁移的方法,方法应用于目的计算节点,该方法包括:In a second aspect, an Android application program migration method is provided, which is applied to a target computing node, and the method includes:
获取原计算节点发送的第一安卓应用程序的资源集合,其中,所述第一安卓应用程序的资源集合中包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息。基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源。调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源。调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。Acquire the resource set of the first Android application sent by the original computing node, where the resource set of the first Android application includes the first basic resource information of the first Android application, the first Ashmem resource information, and the first resource information of the first Android application. A Binder resource information. Based on the first basic resource information, the basic resource of the first Android application is restored. Call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Invoke the Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
在本申请实施例所示的方案中,在目的计算节点中也安装有安卓应用程序导出恢复工具,目的计算节点在接收到原计算节点发送的第一安卓应用程序的基础资源信息集合后,可以通过该安卓应用程序导出恢复工具,基于第一基础资源信息,恢复第一安卓应用程序的基础资源。调用Ashmem内核驱动程序,基第一Ashmem资源信息,恢复第一安卓应用程序的Ashmem资源。调用Binder内核驱动程序,基于第一Binder资源信息,恢复第一安卓应用程序的Binder资源。In the solution shown in the embodiment of the present application, the Android application export recovery tool is also installed in the destination computing node. After the destination computing node receives the basic resource information set of the first Android application sent by the original computing node, it may The recovery tool is exported through the Android application, and the basic resources of the first Android application are restored based on the first basic resource information. Call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
在一种可能的实现方式中,所述第一基础资源信息中包括所述第一安卓应用程序的进程信息和文件信息;In a possible implementation manner, the first basic resource information includes process information and file information of the first Android application;
所述基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源,包括:The restoring the basic resources of the first Android application based on the first basic resource information includes:
基于所述进程信息,创建所述进程信息对应的进程。基于所述文件信息,在文件系统中创建所述文件信息对应的文件。Based on the process information, a process corresponding to the process information is created. Based on the file information, a file corresponding to the file information is created in the file system.
在本申请实施例所示的方案中,进程信息可以包括进程标识ID、进程状态等,文件信息可以包括文件名称、文件描述符、读写权限等。安卓应用程序导出恢复工具中的基础资源管理模块,可以根据进程信息创建进程,并配置进程状态。上述基础资源管理模块,可以基于进程信息,创建进程信息对应的进程,基于文件信息,在文件系统中创建文件信息对应的文件。In the solution shown in the embodiment of the present application, the process information may include a process identification ID, a process status, etc., and the file information may include a file name, a file descriptor, read and write permissions, and the like. The basic resource management module in the Android application export recovery tool can create a process based on the process information and configure the process status. The aforementioned basic resource management module can create a process corresponding to the process information based on the process information, and create a file corresponding to the file information in the file system based on the file information.
在一种可能的实现方式中,第一Ashmem资源信息包括所述第一安卓应用程序的多个进程共享的共享内存的目标内存信息和共享文件的目标文件信息,所述目标内存信息包括所述多个目标进程共享的共享内存的属性信息和存储数据,所述文件信息对应的文件包括所述目标文件信息对应的目标共享文件。In a possible implementation manner, the first Ashmem resource information includes target memory information of a shared memory shared by multiple processes of the first Android application and target file information of a shared file, and the target memory information includes the The attribute information and storage data of the shared memory shared by multiple target processes, and the file corresponding to the file information includes the target shared file corresponding to the target file information.
所述基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源,包括:The restoring the Ashmem resource of the first Android application based on the first Ashmem resource information includes:
基于目标内存信息,创建目标共享内存,并基于属性信息,配置目标共享内存。将存储数据写入目标共享内存,并作为目标共享文件的文件内容数据。Create the target shared memory based on the target memory information, and configure the target shared memory based on the attribute information. Write the stored data into the target shared memory and use it as the file content data of the target shared file.
在本申请实施例所示的方案中,第一安卓应用程序的Ashmem资源信息可以包括第一安卓应用程序的多个进程共享的共享内存的目标内存信息和共享文件的目标文件信息。其中,目标内存信息中包括上述多个进程共享的共享内存的大小、读写权限、存储数据等,目标文件信息包括共享文件的名称、文件描述符等。安卓应用程序导出恢复工具,可以通过Ashmem资源管理模块调用内核驱动模块中的Ashmem内核驱动程序,基于目标内存信息,创建目标共享内存,并基于属性信息,配置目标共享内存,还可以将存储数据写入目标共享内存,并 作为目标共享文件的文件内容数据。In the solution shown in the embodiment of the present application, the Ashmem resource information of the first Android application may include target memory information of the shared memory shared by multiple processes of the first Android application and target file information of the shared file. Among them, the target memory information includes the size of the shared memory shared by the multiple processes, read and write permissions, storage data, etc., and the target file information includes the name of the shared file, file descriptors, and so on. The Android application export recovery tool can call the Ashmem kernel driver in the kernel driver module through the Ashmem resource management module, create a target shared memory based on the target memory information, configure the target shared memory based on the attribute information, and write the stored data Enter the target shared memory and serve as the file content data of the target shared file.
在一种可能的实现方式中,所述第一Binder资源信息中包括所述第一安卓应用程序的客户端进程和第二安卓应用程序的服务端进程之间的通信连接信息,所述进程信息对应的进程包括所述第一安卓应用程序的客户端进程;In a possible implementation manner, the first Binder resource information includes communication connection information between the client process of the first Android application and the server process of the second Android application, and the process information The corresponding process includes the client process of the first Android application;
所述基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源,包括:The restoring the Binder resource of the first Android application based on the first Binder resource information includes:
基于所述通信连接信息,建立所述客户端进程和所述目的计算节点中所述第二安卓应用程序的服务端进程之间的通信连接。Based on the communication connection information, a communication connection between the client process and the server process of the second Android application in the target computing node is established.
在本申请实施例所示的方案中,第一安卓应用程序的Binder资源信息可以包括第一安卓应用程序的客户端进程和第一安卓应用程序的服务端进程之间的通信连接信息,该通信连接信息中可以包括第一安卓应用程序的客户端进程的Binder客户端结构体(binder_ref)的基础数据和第三安卓应用程序的服务端进程的Binder服务端结构体(binder_node)的标识信息。安卓应用程序导出恢复工具可以通过Binder资源管理模块调用内核驱动模块中的Binder内核驱动程序,根据上述Binder服务端结构体(binder_node)的标识信息,在本计算节点中查找对应的第二安卓应用程序的服务端进程,进而建立第一安卓应用程序的客户端进程和第二安卓应用程序的服务端进程的通信连接。In the solution shown in the embodiment of the present application, the Binder resource information of the first Android application may include communication connection information between the client process of the first Android application and the server process of the first Android application. The connection information may include basic data of the Binder client structure (binder_ref) of the client process of the first Android application and identification information of the Binder server structure (binder_node) of the server process of the third Android application. The Android application export recovery tool can call the Binder kernel driver in the kernel driver module through the Binder resource management module, and find the corresponding second Android application in the computing node according to the identification information of the above-mentioned Binder server structure (binder_node) And then establish a communication connection between the client process of the first Android application and the server process of the second Android application.
第三方面,提供了一种安卓应用程序快照恢复的方法,所述方法应用于计算节点,所述方法包括:In a third aspect, a method for restoring a snapshot of an Android application program is provided. The method is applied to a computing node, and the method includes:
接收对第一安卓应用程序的第一时刻的快照恢复指令。获取存储的所述第一时刻对应的第一安卓应用程序的快照,其中,所述第一安卓应用程序的快照包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息。基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源。调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源。调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。Receive the snapshot restoration instruction at the first moment of the first Android application. Acquire a stored snapshot of the first Android application corresponding to the first moment, where the snapshot of the first Android application includes first basic resource information of the first Android application, first Ashmem resource information, and The first Binder resource information. Based on the first basic resource information, the basic resource of the first Android application is restored. Call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Invoke the Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
在本申请实施例所示的方案中,计算节点可以存储有第一安卓应用程序的至少一个时刻生成的快照。在第一安卓应用程序运行出现问题时,用户可以在存储的第一安卓应用程序的快照中,指定一个时刻的快照,使用该快照对第一安卓应用程序进行快照恢复。在使用快照对安卓应用程序进行恢复的过程,和上述第二方面中在安卓应用程序迁移过程中,对安卓应用程序的基础资源进行恢复的处理相同,此处的快照和上述第一方面中的资源信息集合中均包括有安卓应用程序的基础资源信息、Ashmem资源信息和Binder资源信息。In the solution shown in the embodiment of the present application, the computing node may store a snapshot generated at least one moment of the first Android application. When a problem occurs in the operation of the first Android application, the user can specify a snapshot at a moment in the stored snapshots of the first Android application, and use the snapshot to restore the snapshot of the first Android application. The process of using the snapshot to restore the Android application is the same as the process of restoring the basic resources of the Android application during the migration of the Android application in the second aspect above. The snapshot here is the same as that in the first aspect above. The resource information collection includes basic resource information of Android applications, Ashmem resource information, and Binder resource information.
在一种可能的实现方式中,所述方法还包括:In a possible implementation manner, the method further includes:
在所述第一时刻,接收对所述第一安卓应用程序的快照生成指令。导出所述第一基础资源信息。调用所述Ashmem内核驱动程序,导出所述第一Ashmem资源信息。调用所述Binder内核驱动程序,导出所述第一Binder资源信息。生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的快照。将所述第一安卓应用程序的快照和所述第一时刻对应存储。At the first moment, receiving a snapshot generation instruction for the first Android application. Derive the first basic resource information. Invoke the Ashmem kernel driver to export the first Ashmem resource information. Invoke the Binder kernel driver to export the first Binder resource information. A snapshot of the first Android application program including the first basic resource information, the first Ashmem resource information, and the first Binder resource information is generated. Correspondingly store the snapshot of the first Android application and the first moment.
在本申请实施例所示的方案中,为了后续在第一安卓应用程序可出现问题时,可以及时对第一安卓应用程序进行恢复,用户在指定的至少一个时刻,通过计算节点生成第一安卓应用程序的快照,并将生成的第一安卓应用程序的快照和生成该快照的第一时刻对应存储。In the solution shown in the embodiment of the present application, in order to restore the first Android application in time when there is a problem in the first Android application, the user generates the first Android application through the computing node at least at a specified time. A snapshot of the application program, and the generated snapshot of the first Android application program is correspondingly stored with the first moment when the snapshot is generated.
第四方面,提供了一种安卓应用程序迁移的装置,所述装置应用于目的计算节点,所述装置包括:In a fourth aspect, a device for migrating an Android application program is provided. The device is applied to a target computing node, and the device includes:
获取模块,用于获取原计算节点发送的第一安卓应用程序的资源集合,其中,所述第一安卓应用程序的资源集合中包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息;基础资源管理模块,用于导出第一安卓应用程序的第一基础资源信息;The acquiring module is configured to acquire the resource set of the first Android application sent by the original computing node, wherein the resource set of the first Android application includes the first basic resource information of the first Android application, and the first basic resource information of the first Android application. Ashmem resource information and first Binder resource information; basic resource management module, used to export the first basic resource information of the first Android application;
Ashmem资源管理模块,用于调用第一匿名共享内存Ashmem内核驱动程序,导出所述第一安卓应用程序对应的第一Ashmem资源信息;The Ashmem resource management module is used to call the first anonymous shared memory Ashmem kernel driver to export the first Ashmem resource information corresponding to the first Android application;
Binder资源管理模块,用于调用第一进程间通信Binder内核驱动程序,导出所述第一安卓应用程序对应的第一Binder资源信息;The Binder resource management module is used to call the first inter-process communication Binder kernel driver to export the first Binder resource information corresponding to the first Android application;
生成模块,用于生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的资源信息集合;A generating module, configured to generate a resource information set of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
发送模块,用于将所述第一安卓应用程序的资源信息集合发送至目的计算节点,以使所述目的计算节点基于所述第一基础资源信息,恢复第一安卓应用程序的基础资源,调用第二Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源,调用第二Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。The sending module is configured to send the resource information collection of the first Android application to a target computing node, so that the target computing node restores the basic resources of the first Android application based on the first basic resource information, and calls The second Ashmem kernel driver restores the Ashmem resource of the first Android application based on the first Ashmem resource information, calls the second Binder kernel driver, and restores the first Binder resource information based on the first Binder resource information. Binder resources for Android applications.
在一种可能的实现方式中,所述发送模块,还用于将所述第一安卓应用程序的资源信息集合发送至第一计算节点;In a possible implementation manner, the sending module is further configured to send the resource information collection of the first Android application to the first computing node;
所述基础资源管理模块,还用于检测所述第一安卓应用程序是否生成新的基础资源信息,如果检测到所述第一安卓应用程序生成新的基础资源信息,则导出新生成的基础资源信息;The basic resource management module is also used to detect whether the first Android application generates new basic resource information, and if it is detected that the first Android application generates new basic resource information, export the newly generated basic resource information;
所述Ashmem资源管理模块,还用于检测所述第一安卓应用程序是否生成新的Ashmem资源信息,如果检测到所述第一安卓应用程序生成新的Ashmem资源信息,则导出新生成的Ashmem资源信息;The Ashmem resource management module is also used to detect whether the first Android application generates new Ashmem resource information, and if it is detected that the first Android application generates new Ashmem resource information, export the newly generated Ashmem resource information;
所述Binder资源管理模块,还用于检测所述第一安卓应用程序是否生成新的Binder资源信息,如果检测到所述第一安卓应用程序生成新的Binder资源信息,则导出新生成的Binder资源信息;The Binder resource management module is also used to detect whether the first Android application generates new Binder resource information, and if it is detected that the first Android application generates new Binder resource information, export the newly generated Binder resource information;
所述生成模块,还用于生成包括所述新生成的基础资源信息、所述新生成的Ashmem资源信息和所述新生成的Binder资源信息的第一安卓应用程序的新增资源信息集合;The generating module is further configured to generate a new resource information set of the first Android application including the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information;
所述发送模块,还用于将所述第一安卓应用程序的新增资源信息集合发送至所述目的计算节点。The sending module is further configured to send the newly added resource information set of the first Android application to the destination computing node.
第五方面,提供了一种安卓应用程序迁移的装置,所述装置应用于目的计算节点,所述装置包括:In a fifth aspect, a device for migrating an Android application program is provided. The device is applied to a target computing node, and the device includes:
获取模块,用于获取原计算节点发送的第一安卓应用程序的资源集合,其中,所述第一安卓应用程序的资源集合中包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息;The acquiring module is configured to acquire the resource set of the first Android application sent by the original computing node, wherein the resource set of the first Android application includes the first basic resource information of the first Android application, and the first basic resource information of the first Android application. Ashmem resource information and first Binder resource information;
基础资源管理模块,用于基于所述第一基础资源信息,恢复所述第一安卓应用程序的基 础资源;A basic resource management module, configured to restore the basic resources of the first Android application based on the first basic resource information;
Ashmem资源管理模块,用于调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源;The Ashmem resource management module is used to call the Ashmem kernel driver and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
Binder资源管理模块,用于调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。The Binder resource management module is used to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
在一种可能的实现方式中,所述第一基础资源信息中包括所述第一安卓应用程序的进程信息和文件信息;In a possible implementation manner, the first basic resource information includes process information and file information of the first Android application;
所述基础资源管理模块,用于:The basic resource management module is used for:
基于所述进程信息,创建所述进程信息对应的进程;Based on the process information, creating a process corresponding to the process information;
基于所述文件信息,在文件系统中创建所述文件信息对应的文件。Based on the file information, a file corresponding to the file information is created in the file system.
在一种可能的实现方式中,所述第一Ashmem资源信息包括所述第一安卓应用程序的多个进程共享的共享内存的目标内存信息和共享文件的目标文件信息,所述目标内存信息包括所述多个目标进程共享的共享内存的属性信息和存储数据,所述文件信息对应的文件包括所述目标文件信息对应的目标共享文件;In a possible implementation manner, the first Ashmem resource information includes target memory information of a shared memory shared by multiple processes of the first Android application program and target file information of a shared file, and the target memory information includes Attribute information and storage data of the shared memory shared by the multiple target processes, and the file corresponding to the file information includes the target shared file corresponding to the target file information;
所述Ashmem资源管理模块,用于:The Ashmem resource management module is used for:
基于所述目标内存信息,创建目标共享内存,并基于所述属性信息,配置所述目标共享内存;Create a target shared memory based on the target memory information, and configure the target shared memory based on the attribute information;
将所述存储数据写入所述目标共享内存,并作为所述目标共享文件的文件内容数据。The storage data is written into the target shared memory and used as the file content data of the target shared file.
在一种可能的实现方式中,所述第一Binder资源信息中包括所述第一安卓应用程序的客户端进程和第二安卓应用程序的服务端进程之间的通信连接信息,所述进程信息对应的进程包括所述第一安卓应用程序的客户端进程;In a possible implementation manner, the first Binder resource information includes communication connection information between the client process of the first Android application and the server process of the second Android application, and the process information The corresponding process includes the client process of the first Android application;
所述Binder资源管理模块,用于:The Binder resource management module is used to:
基于所述通信连接信息,建立所述客户端进程和所述目的计算节点中所述第二安卓应用程序的服务端进程之间的通信连接。Based on the communication connection information, a communication connection between the client process and the server process of the second Android application in the target computing node is established.
第六方面,提供了一种安卓应用程序快照恢复的装置,所述方法应用于计算节点,所述装置包括:In a sixth aspect, a device for restoring a snapshot of an Android application program is provided. The method is applied to a computing node, and the device includes:
接收模块,用于接收对第一安卓应用程序的第一时刻的快照恢复指令;The receiving module is used to receive the snapshot restoration instruction at the first moment of the first Android application;
获取模块,用于获取存储的所述第一时刻对应的第一安卓应用程序的快照,其中,所述第一安卓应用程序的快照包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息;The acquiring module is configured to acquire a stored snapshot of the first Android application corresponding to the first moment, wherein the snapshot of the first Android application includes the first basic resource information and the first Android application of the first Android application. -Ashmem resource information and the first Binder resource information;
基础资源管理模块,用于基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源;A basic resource management module, configured to restore the basic resources of the first Android application based on the first basic resource information;
Ashmem资源管理模块,用于调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源;The Ashmem resource management module is used to call the Ashmem kernel driver and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
Binder资源管理模块,用于调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。The Binder resource management module is used to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
在一种可能的实现方式中,所述接收模块还用于:In a possible implementation manner, the receiving module is further configured to:
在所述第一时刻,接收对所述第一安卓应用程序的快照生成指令;At the first moment, receiving a snapshot generation instruction for the first Android application;
所述基础资源管理模块,还用于导出所述第一基础资源信息;The basic resource management module is also used to export the first basic resource information;
所述Ashmem资源管理模块,还用于调用所述Ashmem内核驱动程序,导出所述第一Ashmem资源信息;The Ashmem resource management module is further configured to call the Ashmem kernel driver to export the first Ashmem resource information;
所述Binder资源管理模块,还用于调用所述Binder内核驱动程序,导出所述第一Binder资源信息;The Binder resource management module is further configured to call the Binder kernel driver to export the first Binder resource information;
所述装置还包括生成模块,用于生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的快照;The device further includes a generating module, configured to generate a snapshot of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
所述装置还包括存储模块,用于将所述第一安卓应用程序的快照和所述第一时刻对应存储。The device further includes a storage module for storing the snapshot of the first Android application program and the first moment in correspondence.
第七方面,提供了一种计算节点,所述计算节点包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如上述第一方面所述的安卓应用程序迁移的方法所执行的操作,或实现如上述第二方面所述的安卓应用程序迁移的方法所执行的操作,或者实现上述第三方面所述的安卓应用程序快照恢复的方法所执行的操作。In a seventh aspect, a computing node is provided. The computing node includes a processor and a memory, and at least one instruction is stored in the memory. The instruction is loaded and executed by the processor to implement the above-mentioned first aspect. The operations performed by the Android application migration method described above, or the operations performed by the Android application migration method described in the second aspect described above, or the Android application snapshot restoration method described in the third aspect described above The action performed.
第八方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如上述第一方面所述的安卓应用程序迁移的方法所执行的操作,或实现如上述第二方面所述的安卓应用程序迁移的方法所执行的操作,或者实现上述第三方面所述的安卓应用程序快照恢复的方法所执行的操作。In an eighth aspect, a computer-readable storage medium is provided, and at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the Android application migration method as described in the first aspect above The operations performed are either the operations performed by the Android application migration method described in the second aspect described above, or the operations performed by the Android application snapshot restoration method described in the third aspect described above.
第九方面,提供了一种包含指令的计算机程序产品,当所述计算机程序产品在车辆变道趋势识别设备上运行时,使得所述计算节点执行如上述第一方面所述的安卓应用程序迁移的方法,或执行如上述第二方面所述的安卓应用程序迁移的方法,或者执行上述第三方面所述的安卓应用程序快照恢复的方法。In a ninth aspect, a computer program product containing instructions is provided, when the computer program product runs on a vehicle lane change trend recognition device, the computing node is caused to execute the Android application migration as described in the first aspect above , Or execute the Android application migration method as described in the second aspect above, or execute the Android application snapshot restoration method as described in the third aspect above.
本申请实施例提供的技术方案带来的有益效果是:The beneficial effects brought about by the technical solutions provided by the embodiments of this application are:
本申请实施例所提供的技术方案,除了可以导出安卓应用程序的基础资源信息外,还可以导出安卓应用程序所独有的Ashmem资源信息和Binder资源信息。此外,在生成包括各资源信息的资源信息集合后,将安卓应用程序的资源信息集合发送至目的计算节点后,目的计算节点可以对安卓应用程序的基础资源、Ashmem资源和Binder资源进行恢复,以实现对安卓应用程序的迁移。The technical solutions provided by the embodiments of the present application can export not only basic resource information of the Android application, but also Ashmem resource information and Binder resource information unique to the Android application. In addition, after the resource information set including the resource information is generated, and the resource information set of the Android application is sent to the destination computing node, the destination computing node can restore the basic resources, Ashmem resources, and Binder resources of the Android application to Realize the migration of Android applications.
附图说明Description of the drawings
图1是本申请实施例提供的一种安卓应用程序的迁移场景示意图;FIG. 1 is a schematic diagram of a migration scenario of an Android application provided by an embodiment of the present application;
图2是本申请实施例提供的一种安卓应用程序的快照恢复场景示意图;FIG. 2 is a schematic diagram of a snapshot restoration scene of an Android application provided by an embodiment of the present application;
图3是本申请实施例提供的一种安卓应用程序导出恢复工具的结构示意图;3 is a schematic structural diagram of an Android application export recovery tool provided by an embodiment of the present application;
图4是本申请实施例提供的一种Ashmem服务原理示意图;FIG. 4 is a schematic diagram of the principle of an Ashmem service provided by an embodiment of the present application;
图5是本申请实施例提供的一种Binder服务原理示意图;FIG. 5 is a schematic diagram of the principle of a Binder service provided by an embodiment of the present application;
图6是本申请实施例提供的一种安卓应用程序迁移的方法流程图;FIG. 6 is a flowchart of a method for migrating an Android application provided by an embodiment of the present application;
图7是本申请实施例提供的一种安卓应用程序的快速启动场景示意图;FIG. 7 is a schematic diagram of a quick startup scenario of an Android application provided by an embodiment of the present application;
图8是本申请实施例提供的一种安卓应用程序快照恢复的方法流程图;FIG. 8 is a flowchart of a method for restoring an Android application program snapshot provided by an embodiment of the present application;
图9是本申请实施例提供的一种安卓应用程序迁移的装置的结构示意图;FIG. 9 is a schematic structural diagram of an Android application program migration device provided by an embodiment of the present application;
图10是本申请实施例提供的一种安卓应用程序迁移的装置的结构示意图;FIG. 10 is a schematic structural diagram of an Android application program migration device provided by an embodiment of the present application;
图11是本申请实施例提供的一种安卓应用程序快照恢复的装置的结构示意图;FIG. 11 is a schematic structural diagram of a device for restoring an Android application program snapshot provided by an embodiment of the present application;
图12是本申请实施例提供的一种计算节点的结构示意图。FIG. 12 is a schematic structural diagram of a computing node provided by an embodiment of the present application.
具体实施方式detailed description
本申请实施例提供了一种安卓应用程序迁移的方法和装置,该方法可以由安装有安卓应用程序导出恢复工具的原计算节点和目的计算节点实现。原计算节点和目的计算节点均可以为服务器、虚拟机等。The embodiments of the present application provide a method and device for migrating an Android application program. The method can be implemented by an original computing node and a destination computing node that are installed with an Android application export recovery tool. Both the original computing node and the destination computing node may be servers, virtual machines, and so on.
如图1所示,该方法可以应用于安卓应用程序迁移的场景。安装有安卓应用程序导出恢复工具的原计算节点,可以通过安卓应用程序导出恢复工具将第一安卓应用程序的基础资源信息、Ashmem资源信息和Binder资源信息导出,写入资源信息集合。并发送至同样安装有安卓应用程序导出恢复工具的目的计算节点,由目的计算节点对第一安卓应用程序进行恢复。As shown in Figure 1, this method can be applied to the scenario of Android application migration. The original computing node installed with the Android application export recovery tool can export the basic resource information, Ashmem resource information and Binder resource information of the first Android application through the Android application export recovery tool and write it into the resource information collection. It is sent to the destination computing node that also has the Android application export recovery tool installed, and the destination computing node restores the first Android application.
如图2所示,该方法还可以应用于在安卓应用程序快速启动场景下,。部署安装有安卓应用程序迁移工具安卓应用程序导出恢复工具的原计算节点中可以安装有多个安卓应用程序,该原计算节点可以通过安卓应用程序导出恢复工具,导出需要在目标计算节点中快速启动的第一安卓应用程序(如图2中的安卓应用程序2)的资源信息集合,并发送至启动资源存储设备进行存储。目的计算节点可以在启动资源存储设备中获取上述需要快速启动的第一安卓应用程序的资源信息集合,并通过安卓应用程序导出恢复工具对目的安卓应用程序进行恢复,以实现在目标计算节点中对第一安卓应用程序的快速启动。As shown in Fig. 2, this method can also be applied in the scenario where an Android application is quickly started. Deploying the Android application migration tool and the Android application export recovery tool can be installed in the original computing node with multiple Android applications. The original computing node can export the recovery tool through the Android application, and the export needs to be quickly started in the target computing node The resource information of the first Android application (Android application 2 in FIG. 2) is collected and sent to the startup resource storage device for storage. The target computing node can obtain the resource information collection of the first Android application that needs to be started quickly in the startup resource storage device, and restore the target Android application through the Android application export recovery tool, so as to realize the correctness in the target computing node. Quick launch of the first Android application.
上述计算节点中安装的安卓应用程序导出恢复工具可以为一个软件工具,如图3所示,该安卓应用程序导出恢复工具可以包括有对外接口网关模块、资源管理模块和内核驱动模块三个模块。其中,对外接口网关模块、资源管理模块运行在用户空间,内核驱动模块运行在内核空间。对外接口网关模块用于提供该安卓应用程序导出恢复工具的对外接口,如命令行接口、超文本传输协议(Hyper Text Transfer Protocol,HTTP)接口等。资源管理模块中包括有基础资源管理模块、匿名共享内存(Anonymous shared memory,Ashmem)资源管理模块和进程间通信(Binder)模块。内核驱动模块中包括Ashmem内核驱动模块和Binder内核驱动模块。其中,基础资源管理模块用于对安卓应用程序的基础资源信息进行导出和恢复。Ashmem资源管理模块用于调用内核驱动模块中的Ashmem内核驱动程序以实现对Ashmem资源信息的导出和恢复。Binder资源管理模块用于调用内核驱动模块中的Binder内核驱动程序以实现对Binder资源信息的导出和恢复。The Android application export recovery tool installed in the aforementioned computing node may be a software tool, as shown in FIG. 3, the Android application export recovery tool may include three modules: an external interface gateway module, a resource management module, and a kernel driver module. Among them, the external interface gateway module and the resource management module run in the user space, and the kernel driver module runs in the kernel space. The external interface gateway module is used to provide external interfaces of the Android application export recovery tool, such as a command line interface, a HyperText Transfer Protocol (HTTP) interface, and so on. The resource management module includes a basic resource management module, an anonymous shared memory (Ahmem) resource management module, and an inter-process communication (Binder) module. The kernel drive module includes Ashmem kernel drive module and Binder kernel drive module. Among them, the basic resource management module is used to export and restore basic resource information of the Android application. The Ashmem resource management module is used to call the Ashmem kernel driver in the kernel driver module to realize the export and recovery of Ashmem resource information. The Binder resource management module is used to call the Binder kernel driver in the kernel driver module to realize the export and recovery of Binder resource information.
为了便于对本申请的理解,下面对本申请中的部分技术术语进行解释说明。In order to facilitate the understanding of this application, some technical terms in this application are explained below.
一、Ashmem服务1. Ashmem service
如图4所示,目标安卓应用程序包括进程A和进程B,进程A和进程B分别对应有文件描述符表(fdt)。在文件系统(file sytem)中包括有各进程对应的文件,Ashmem模块为共享内存模块。在进程A和进程B存在共享内存的情况下,进程A和进程B分别对应的文件描述符表中包含有指向文件系统中的同一文件fileN的文件描述符,而fileN的文件内容数据存 储在Ashmem模块中的目标共享内存中。As shown in Figure 4, the target Android application includes process A and process B, and process A and process B respectively correspond to file descriptor tables (fdt). The file system (file sytem) includes files corresponding to each process, and the Ashmem module is a shared memory module. In the case that process A and process B have shared memory, the file descriptor table corresponding to process A and process B respectively contains a file descriptor pointing to the same file fileN in the file system, and the file content data of fileN is stored in Ashmem The target shared memory in the module.
二、Binder服务Two, Binder service
如图5所示,安卓应用程序A中包括客户端进程,安卓应用程序B中包括有服务端进程。安卓应用程序A中的客户端进程在内核空间中的Binder模块“BinderA”。该BinderA包括Binder进程结构体(binder_proc)、Binder客户端结构体(binder_ref)和Binder线程信息结构体(binder_thread)。安卓应用程序B中的服务端进程在内核空间中有Binder模块“BinderB”。该BinderB包括binder_proc、binder_thread和Binder服务端结构体(binder_node)。如果要建立安卓应用程序A中的客户端进程和安卓应用程序B的服务端进程之间的通信连接,则需要使客户端进程的binder_ref中的节点指向服务端进程的binder_node。As shown in Figure 5, the Android application A includes a client process, and the Android application B includes a server process. The client process in Android application A is in the Binder module "BinderA" in the kernel space. The BinderA includes a Binder process structure (binder_proc), a Binder client structure (binder_ref), and a Binder thread information structure (binder_thread). The server process in Android application B has a Binder module "BinderB" in the kernel space. The BinderB includes binder_proc, binder_thread and Binder server structure (binder_node). If you want to establish a communication connection between the client process of Android application A and the server process of Android application B, you need to make the node in the binder_ref of the client process point to the binder_node of the server process.
如图6所示是本申请实施例提供的一种安卓应用程序迁移的方法流程图。该方法的处理流程可以包括如下步骤:Fig. 6 is a flowchart of a method for migrating an Android application provided by an embodiment of the present application. The processing flow of the method may include the following steps:
步骤601、原计算节点导出第一安卓应用程序的第一基础资源信息。Step 601: The original computing node derives the first basic resource information of the first Android application.
在实施中,原计算节点中可以部署有安卓应用程序导出恢复工具,在需要将第一安卓应用程序进行迁移时,可以向该安卓应用程序导出恢复工具发送对第一安卓应用程序的资源迁移指令,该资源迁移指令可以为命令行形式、HTTP请求形式等。In implementation, an Android application export recovery tool can be deployed in the original computing node. When the first Android application needs to be migrated, the resource migration instruction for the first Android application can be sent to the Android application export recovery tool. , The resource migration instruction can be in the form of command line, HTTP request, etc.
安卓应用程序导出恢复工具通过对外接口网关接收该对第一安卓应用程序的资源迁移指令后,可以通过基础资源管理模块对第一安卓应用程序的基础资源信息进行导出。导出的第一安卓应用程序的基础资源信息可以包括有该第一安卓应用程序的进程信息、文件信息、内存信息等。其中,进程信息可以包括进程标识(Identity document,ID)、进程状态等,文件信息可以包括文件大小、文件读写权限、文件修改时间等,内存信息可以包括已使用内存区域列表、已使用内存中的存储数据等。After the Android application export recovery tool receives the resource migration instruction for the first Android application through the external interface gateway, it can export the basic resource information of the first Android application through the basic resource management module. The exported basic resource information of the first Android application may include process information, file information, memory information, etc. of the first Android application. Among them, the process information may include process identification (ID), process status, etc. The file information may include file size, file read and write permissions, file modification time, etc., and memory information may include a list of used memory areas and used memory Storage data, etc.
步骤602、原计算节点调用第一Ashmem内核驱动程序,导出第一安卓应用程序的第一Ashmem资源信息。Step 602: The original computing node calls the first Ashmem kernel driver to export the first Ashmem resource information of the first Android application.
在实施中,安卓应用程序导出恢复工具在接收到对第一安卓应用程序的资源迁移指令后,还可以通过Ashmem资源管理模块调用内核驱动模块中的第一Ashmem内核驱动程序,对Ashmem资源信息进行导出。Ashmem资源信息可以包括第一安卓应用程序的多个进程共享的目标共享内存信息和共享文件信息。其中,目标共享内存信息中包括共享内存的属性、存储数据等,共享文件信息包括共享文件的名称、大小、文件描述符等。In implementation, after the Android application export recovery tool receives the resource migration instruction for the first Android application, it can also call the first Ashmem kernel driver in the kernel driver module through the Ashmem resource management module to perform operations on the Ashmem resource information. Export. Ashmem resource information may include target shared memory information and shared file information shared by multiple processes of the first Android application. Among them, the target shared memory information includes the attributes and storage data of the shared memory, and the shared file information includes the name, size, and file descriptor of the shared file.
步骤603、原计算节点调用第一Binder内核驱动程序,导出第一安卓应用程序的第一Binder资源信息。Step 603: The original computing node calls the first Binder kernel driver to export the first Binder resource information of the first Android application.
在实施中,安卓应用程序导出恢复工具在接收到对第一安卓应用程序的资源导出指令后,还可以通过Binder资源管理模块调用内核驱动模块中的Binder内核驱动程序,对Binder资源信息进行导出。Binder资源信息可以包括第一安卓应用程序的客户端进程和第二安卓应用程序的服务端进程之间的通信连接信息。该通信连接信息中可以包括第一安卓应用程序的客户端进程的binder_ref和第二安卓应用程序中服务端进程的binder_node的标识信息,该通信连接信息用于指示第一安卓应用程序的客户端进程的binder_ref和第二安卓应用程序中服务端进程的binder_node存在连接关系。In implementation, after the Android application export recovery tool receives the resource export instruction for the first Android application, it can also call the Binder kernel driver in the kernel driver module through the Binder resource management module to export Binder resource information. The Binder resource information may include communication connection information between the client process of the first Android application and the server process of the second Android application. The communication connection information may include the binder_ref of the client process of the first Android application and the identification information of the binder_node of the server process in the second Android application. The communication connection information is used to indicate the client process of the first Android application. There is a connection relationship between the binder_ref of the second Android application and the binder_node of the server process in the second Android application.
步骤604、原计算节点生成包括第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息的第一安卓应用程序的资源集合。Step 604: The original computing node generates a first Android application resource set including the first basic resource information, the first Ashmem resource information, and the first Binder resource information.
在实施中,可以将导出的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息写入第一安卓应用程序的资源集合中。In implementation, the derived first basic resource information, first Ashmem resource information, and first Binder resource information may be written into the resource collection of the first Android application.
步骤605、原计算节点将第一安卓应用程序的资源信息集合发送至目的计算节点。Step 605: The original computing node sends the resource information collection of the first Android application to the destination computing node.
在实施中,用户可以指定需要将第一安卓应用程序迁移到目的计算节点,那么,当原计算节点生成第一安卓应用程序的资源信息集合后,可以将第一安卓应用程序的资源信息集合发送至目的计算节点。In implementation, the user can specify that the first Android application needs to be migrated to the destination computing node. Then, after the original computing node generates the resource information collection of the first Android application, the resource information collection of the first Android application can be sent To the destination computing node.
步骤606、目的计算节点获取原计算节点发送的第一安卓应用程序的资源信息集合。Step 606: The destination computing node obtains the resource information set of the first Android application sent by the original computing node.
步骤607、目的计算节点基于第一基础资源信息,恢复第一安卓应用程序的基础资源。调用第二Ashmem内核驱动程序,基于第一Ashmem资源信息,恢复第一安卓应用程序的Ashmem资源。调用第二Binder内核驱动程序,基于第一Binder资源信息,恢复第一安卓应用程序的Binder资源。Step 607: The destination computing node restores the basic resources of the first Android application based on the first basic resource information. Call the second Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Call the second Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
在实施中,目的计算节点中同样安装有安卓应用程序导出恢复工具,在获取到原计算节点发送的第一安卓应用程序的资源信息集合后,目的计算节点可以通过安卓应用程序导出恢复工具对第一安卓应用程进行恢复。下面对于通过安卓应用程序导出恢复工具实现对第一安卓应用程序的基础资源、Ashmem资源和Binder资源的恢复分别进行说明:In the implementation, the Android application export recovery tool is also installed in the destination computing node. After obtaining the resource information collection of the first Android application sent by the original computing node, the destination computing node can export the recovery tool to the first Android application through the Android application. An Android application to restore. The following describes the recovery of the basic resources, Ashmem resources and Binder resources of the first Android application through the Android application export recovery tool:
一、第一安卓应用程序的基础资源的恢复。1. The restoration of the basic resources of the first Android application.
通过基础资源管理模块,基于第一安卓应用程序的第一基础资源信息,恢复第一安卓应用程序的基础资源。Through the basic resource management module, based on the first basic resource information of the first Android application, the basic resources of the first Android application are restored.
在第一安卓应用程序的基础资源信息中包括第一安卓应用程序的进程信息、文件信息、内存信息等。其中,进程信息可以包括进程标识ID、进程状态等,文件信息可以包括文件名称、文件读写权限、文件修改时间、文件描述符等,内存信息可以包括已使用内存区域列表、已使用内存中的存储数据等。The basic resource information of the first Android application includes process information, file information, memory information, etc. of the first Android application. Among them, process information can include process identification ID, process status, etc., file information can include file name, file read and write permissions, file modification time, file descriptors, etc., memory information can include a list of used memory areas, and information in used memory. Store data, etc.
基础资源管理模块可以根据进程信息创建相应进程,设置进程状态。还可以根据内存信息创建已使用内存区域列表,在相应内存区域写入对应的存储数据。还可以根据文件信息,在文件系统(File System)中创建相应文件,并配置文件读写权限、文件修改时间等文件属性,还可以创建相应进程的文件描述符表,并在该文件描述符表中将新创建的文件和相应文件信息中的文件描述符相对应。The basic resource management module can create a corresponding process based on the process information and set the process status. You can also create a used memory area list based on the memory information, and write the corresponding storage data in the corresponding memory area. You can also create corresponding files in the file system (File System) based on file information, and configure file attributes such as file read and write permissions, file modification time, etc. You can also create a file descriptor table of the corresponding process, and set it in the file descriptor table. The newly created file corresponds to the file descriptor in the corresponding file information.
二、第一安卓应用程序的Ashmem资源恢复。2. Ashmem resource recovery of the first Android application.
通过Ashmem资源管理模块调用内核驱动模块中的Ashmem内核驱动程序,基于第二Ashmem资源信息,恢复第二安卓应用程序的Ashmem资源。Call the Ashmem kernel driver in the kernel driver module through the Ashmem resource management module, and restore the Ashmem resource of the second Android application based on the second Ashmem resource information.
第一安卓应用程序的Ashmem资源信息可以包括第一安卓应用程序的多个进程共享的共享内存的目标内存信息和共享文件的目标文件信息。其中,目标内存信息中包括上述多个进程共享的共享内存的大小、读写权限、存储数据等,目标文件信息包括共享文件的名称、文件描述符等。The Ashmem resource information of the first Android application program may include target memory information of a shared memory shared by multiple processes of the first Android application program and target file information of a shared file. Among them, the target memory information includes the size of the shared memory shared by the multiple processes, read and write permissions, storage data, etc., and the target file information includes the name of the shared file, file descriptors, and so on.
此处需要说明的是,此处的第一安卓应用程序的多个进程已经在上述基础资源恢复时创建完成。该目标文件信息对应的目标共享文件也已经在上述基础资源恢复时创建完成。It should be noted here that the multiple processes of the first Android application here have been created when the above-mentioned basic resources are restored. The target shared file corresponding to the target file information has also been created when the above-mentioned basic resource is restored.
Ashmem内核驱动程序可以按照目标内存信息中的多个进程共享的共享内存的大小,创建目标共享内存,并配置其读写权限,将存储数据写入到创建的目标共享内存中。再将目标共享内存中的存储数据作为目标共享文件的内容数据。完成第一安卓应用程序的Ashmem资 源恢复。The Ashmem kernel driver can create a target shared memory according to the size of the shared memory shared by multiple processes in the target memory information, configure its read and write permissions, and write the stored data into the created target shared memory. Then use the stored data in the target shared memory as the content data of the target shared file. Completed Ashmem resource restoration of the first Android application.
三、第一安卓应用程序的Binder资源恢复。3. Binder resource recovery of the first Android application.
通过Binder资源管理模块调用内核驱动模块中的Binder内核驱动程序,基于第二Binder资源信息,恢复第一安卓应用程序的Binder资源。The Binder kernel driver in the kernel driver module is called through the Binder resource management module, and the Binder resource of the first Android application is restored based on the second Binder resource information.
第一安卓应用程序的Binder资源信息可以包括第一安卓应用程序的客户端进程和第一安卓应用程序的服务端进程之间的通信连接信息,该通信连接信息中可以包括第一安卓应用程序的客户端进程的binder_ref的基础数据和第二安卓应用程序的服务端进程的binder_node的标识信息。此外,Binder资源信息还可以包括配置信息,如第二安卓应用程序的客户端进程的binder_proc的基础数据、binder_thread的基础数据。还可以包括该客户端进程和服务端进程之间的通信数据等。The Binder resource information of the first Android application may include communication connection information between the client process of the first Android application and the server process of the first Android application. The communication connection information may include the information of the first Android application. The basic data of the binder_ref of the client process and the identification information of the binder_node of the server process of the second Android application. In addition, the Binder resource information may also include configuration information, such as the basic data of the binder_proc and the basic data of the binder_thread of the client process of the second Android application. It can also include communication data between the client process and the server process.
此处需要说明的是,此处的第一安卓应用程序的客户端进程已经在上述基础资源恢复时创建完成。第二安卓应用程序通常为公共类应用程序,且该第二安卓应用程序既要安装在原计算节点中,也要安装在目的计算节点中。It should be noted here that the client process of the first Android application here has been created when the above-mentioned basic resources are restored. The second Android application program is usually a public application program, and the second Android application program needs to be installed in both the original computing node and the destination computing node.
Binder内核驱动程序可以根据上述配置信息,在本计算节点中创建该第一安卓应用程序的客户端进程的binder_proc、binder_thread、binder_ref。然后,根据通信连接信息中第二安卓应用程序的服务端进程的binder_node的标识信息,查找第二安卓应用程序的服务端进程,并使第一安卓应用程序的客户端进程的binder_ref中节点指向查找到的第二安卓应用程序的服务端进程的binder_node,以实现第一安卓应用程序的客户端进程和第二安卓应用程序的服务端之间的通信连接。The Binder kernel driver can create the binder_proc, binder_thread, and binder_ref of the client process of the first Android application in the computing node according to the above configuration information. Then, according to the identification information of the binder_node of the server process of the second Android application in the communication connection information, search for the server process of the second Android application, and make the node in the binder_ref of the client process of the first Android application point to the search The binder_node of the server process of the second Android application to realize the communication connection between the client process of the first Android application and the server of the second Android application.
在一种可能的实现方式中,在安卓应用程序的热迁移场景下,原计算节点可以将该第一安卓应用程序的资源集合发送至目的计算节点,由目的计算节点根据接收到的第一安卓应用程序的资源集合对第一安卓应用程序进行恢复。在此场景下,第一安卓应用程序在原计算节点中还可以处于运行状态,则原计算节点可以按照预设检测周期,检测第一安卓应用程序是否产生新的资源信息。相应的,处理可以如下:In a possible implementation manner, in a live migration scenario of an Android application, the original computing node may send the resource collection of the first Android application to the destination computing node, and the destination computing node will receive the first Android application based on the received first Android application. The resource collection of the application restores the first Android application. In this scenario, the first Android application program may still be running in the original computing node, and the original computing node may detect whether the first Android application program generates new resource information according to a preset detection period. Correspondingly, the processing can be as follows:
通过安卓应用程序导出恢复工具的基础资源管理模块,检测第一安卓应用程序是否生成新的基础资源信息,如果检测到第一安卓应用程序生成新的基础资源信息,则导出新生成的基础资源信息。Export the basic resource management module of the recovery tool through the Android application to detect whether the first Android application generates new basic resource information, and if it detects that the first Android application generates new basic resource information, export the newly generated basic resource information .
通过安卓应用程序导出恢复工具的Ashmem资源管理模块,检测第一安卓应用程序是否生成新的基础资源信息,如果检测到第一安卓应用程序生成新的基础资源信息,则导出新生成的基础资源信息导出。Export the Ashmem resource management module of the recovery tool through the Android application to detect whether the first Android application generates new basic resource information, and if it detects that the first Android application generates new basic resource information, export the newly generated basic resource information Export.
通过安卓应用程序导出恢复工具的Binder资源管理模块,检测第一安卓应用程序是否生成新的Binder资源信息,如果检测到第一安卓应用程序生成新的Binder资源信息,则导出新生成的Binder资源信息。Use the Binder resource management module of the Android application export recovery tool to detect whether the first Android application generates new Binder resource information. If it is detected that the first Android application generates new Binder resource information, export the newly generated Binder resource information .
生成包括新生成的基础资源信息、新生成的Ashmem资源信息和新生成的Binder资源信息的第一安卓应用程序的新增资源集合并将第一安卓应用程序的新增资源集合发送至目的计算节点。Generate the new resource set of the first Android application including the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information, and send the new resource set of the first Android application to the destination computing node .
此外,如果在第一安卓应用程序迁移到目的计算节点后,在原计算节点中检测到的第一安卓应用程序的新生成的基础资源信息、新生成的Ashmem资源信息和新生成的Binder资源信息的总量大于预设阈值则停止第一安卓应用程序在原计算节点中的运行。In addition, if after the first Android application is migrated to the destination computing node, the newly generated basic resource information of the first Android application, the newly generated Ashmem resource information, and the newly generated Binder resource information are detected in the original computing node. If the total amount is greater than the preset threshold, the running of the first Android application in the original computing node is stopped.
在一种可能的实现方式中,在本计算节点中可以安装有包括第一安卓应用程序在内的多个安卓应用程序,而第一安卓应用程序需要在独立的计算节点中运行,则本计算节点可以通过安卓应用程序导出恢复工具导出该第一安卓应用程序的基础资源信息、Ashmem资源信息和Binder资源信息,写入第一安卓应用程序的资源信息集合。然后,在原计算节点中停止运行该第一安卓应用程序,并发送至启动资源存储设备中进行存储。待运行第一安卓应用程序的目的计算节点可以在接收到对第一安卓应用程序快速启动的指令后,向启动资源存储设备获取第一安卓应用程序的资源信息集合,并执行按照上述步骤707中对第一安卓应用程序的基础资源、Ashmem资源以及Binder资源的恢复,完成第一安卓应用程序在目的计算节点中的快速启动。In a possible implementation manner, multiple Android applications including the first Android application can be installed in the computing node, and the first Android application needs to run in an independent computing node, then the computing node The node can export the basic resource information, Ashmem resource information, and Binder resource information of the first Android application through the Android application export recovery tool, and write them into the resource information collection of the first Android application. Then, stop running the first Android application in the original computing node, and send it to the startup resource storage device for storage. The destination computing node of the first Android application to be run may, after receiving the instruction to quickly start the first Android application, obtain the resource information set of the first Android application from the startup resource storage device, and execute the step 707 described above. The restoration of the basic resources, Ashmem resources, and Binder resources of the first Android application program completes the quick start of the first Android application program in the target computing node.
本申请实施例中,除了可以导出安卓应用程序的基础资源信息外,还可以导出安卓应用程序所独有的Ashmem资源信息和Binder资源信息。此外,在生成包括各资源信息的资源信息集合后,将安卓应用程序的资源信息集合发送至目的计算节点后,目的计算节点可以对安卓应用程序的基础资源、Ashmem资源和Binder资源进行恢复,以实现对安卓应用程序的迁移。In the embodiments of the present application, in addition to the basic resource information of the Android application, Ashmem resource information and Binder resource information unique to the Android application can also be exported. In addition, after the resource information set including the resource information is generated, and the resource information set of the Android application is sent to the destination computing node, the destination computing node can restore the basic resources, Ashmem resources, and Binder resources of the Android application to Realize the migration of Android applications.
本申请实施例还提供了一种安卓应用程序快照恢复的方法,该方法可以由安装有安卓应用程序导出恢复工具的计算节点实现。The embodiment of the present application also provides a method for restoring a snapshot of an Android application program. The method can be implemented by a computing node installed with a tool for exporting and restoring an Android application program.
如图7所示,该方法可以应用于安卓应用程序快照恢复的场景。安装有安卓应用程序迁移工具的计算节点,可以通过安卓应用程序迁移工具在至少一个指定时刻将第一安卓应用程序的基础资源信息、Ashmem资源信息和Binder资源信息导出,写入第一安卓应用程序的快照中。在安卓应用程序出现问题时,可以根据需要,获取某一时刻导出的第一安卓应用程序的快照,并通过安卓应用程序导出恢复工具进行第一安卓应用程序的恢复。As shown in Figure 7, this method can be applied to the scenario of Android application snapshot recovery. The computing node installed with the Android application migration tool can export the basic resource information, Ashmem resource information, and Binder resource information of the first Android application at least at one specified time through the Android application migration tool, and write it into the first Android application. In the snapshot. When there is a problem with the Android application, a snapshot of the first Android application exported at a certain moment can be obtained as needed, and the first Android application can be restored through the Android application export recovery tool.
如图8所示是本申请实施例提供的一种安卓应用程序迁移的方法流程图。该方法的处理流程可以包括如下步骤:Fig. 8 is a flowchart of a method for migrating an Android application provided by an embodiment of the present application. The processing flow of the method may include the following steps:
步骤801、接收对第一安卓应用程序的第一时刻的快照恢复指令。Step 801: Receive a snapshot restoration instruction at the first moment of the first Android application.
在实施中,计算节点可以存储有第一安卓应用程序的至少一个时刻生成的快照。在第一安卓应用程序运行出现问题时,用户可以向计算节点发送对第一应用程序的第一时刻的快照恢复指令。In an implementation, the computing node may store a snapshot generated at least one moment of the first Android application. When a problem occurs in the running of the first Android application, the user can send a snapshot restoration instruction of the first moment of the first application to the computing node.
步骤802、获取存储的第一时刻对应的第一安卓应用程序的快照。Step 802: Obtain a stored snapshot of the first Android application corresponding to the first moment.
其中,第一安卓应用程序的快照包括第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息。Wherein, the snapshot of the first Android application program includes the first basic resource information of the first Android application program, the first Ashmem resource information, and the first Binder resource information.
步骤803、基于第一基础资源信息,恢复第一安卓应用程序的基础资源,调用Ashmem内核驱动程序,基于第一Ashmem资源信息,恢复第一安卓应用程序的Ashmem资源,调用Binder内核驱动程序,基于第一Binder资源信息,恢复第一安卓应用程序的Binder资源。Step 803: Based on the first basic resource information, restore the basic resources of the first Android application, call the Ashmem kernel driver, based on the first Ashmem resource information, restore the Ashmem resource of the first Android application, call the Binder kernel driver, based on The first Binder resource information restores the Binder resource of the first Android application.
需要说明的是,在该步骤803中,计算节点基于第一安卓应用程序某一刻的快照对第一安卓应用程序进行恢复的实现方式,与上述步骤607中,目的计算节点根据第一安卓应用程序的资源信息集合对第一安卓应用程序进行恢复的方法相同,在此不再赘述。It should be noted that in this step 803, the computing node restores the first Android application based on a snapshot of the first Android application at a certain moment, which is the same as in the above step 607, the destination computing node is based on the first Android application. The method for restoring the first Android application program in the resource information collection of is the same, and will not be repeated here.
在一种可能的实现方式中,用户可以在至少一个指定时刻,通过计算节点生成第一安卓应用程序的快照并进行存储,以便在第一安卓应用程序出现问题时使用。相应的,处理可以 如下:在第一时刻,接收对第一安卓应用程序的快照生成指令。导出第一基础资源信息。调用Ashmem内核驱动程序,导出第一Ashmem资源信息。调用Binder内核驱动程序,导出第一Binder资源信息。生成包括第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息的所述第一安卓应用程序的快照。将第一安卓应用程序的快照和第一时刻对应存储。In a possible implementation manner, the user can generate and store a snapshot of the first Android application program through the computing node at at least one designated moment, so as to use it when a problem occurs with the first Android application program. Correspondingly, the processing can be as follows: at the first moment, a snapshot generation instruction for the first Android application is received. Export the first basic resource information. Call the Ashmem kernel driver to export the first Ashmem resource information. Call the Binder kernel driver to export the first Binder resource information. A snapshot of the first Android application program including the first basic resource information, the first Ashmem resource information, and the first Binder resource information is generated. The snapshot of the first Android application program is correspondingly stored with the first moment.
基于相同的技术构思,本申请实施例还提供了一种安卓应用程序迁移的装置,该装置可以应用于计算节点中,如图9所示,该装置包括:Based on the same technical concept, an embodiment of the present application also provides a device for migrating an Android application program. The device can be applied to a computing node. As shown in FIG. 9, the device includes:
基础资源管理模块910,用于导出第一安卓应用程序的第一基础资源信息。具体可以实现上述步骤601中的基础资源信息导出功能,以及其他隐含步骤。The basic resource management module 910 is used to export the first basic resource information of the first Android application. Specifically, the function of deriving basic resource information in the above step 601 and other implicit steps can be realized.
Ashmem资源管理模块920,用于第一Ashmem内核驱动程序,导出所述第一安卓应用程序对应的第一Ashmem资源信息。具体可以实现上述步骤602中的Ashmem资源信息导出功能,以及其他隐含步骤。The Ashmem resource management module 920 is used for the first Ashmem kernel driver to export the first Ashmem resource information corresponding to the first Android application. Specifically, the Ashmem resource information derivation function in step 602 above can be implemented, as well as other implicit steps.
Binder资源管理模块930,用于调用第一Binder内核驱动程序,导出所述第一安卓应用程序对应的第一Binder资源信息。具体可以实现上述步骤603中的Binder资源信息导出功能,以及其他隐含步骤。The Binder resource management module 930 is configured to call the first Binder kernel driver and export the first Binder resource information corresponding to the first Android application. Specifically, the Binder resource information derivation function in step 603 above can be implemented, as well as other implicit steps.
生成模块940,用于生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的资源信息集合。具体可以实现上述步骤604中的生成功能,以及其他隐含步骤。The generating module 940 is configured to generate a resource information set of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information. Specifically, the generating function in step 604 and other implicit steps can be realized.
发送模块950,用于将所述第一安卓应用程序的资源信息集合发送至目的计算节点,以使所述目的计算节点基于所述第一基础资源信息,恢复第一安卓应用程序的基础资源,调用第二Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源,调用第二Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。具体可以实现上述步骤605中的发送功能,以及其他隐含步骤。The sending module 950 is configured to send the resource information collection of the first Android application to a target computing node, so that the target computing node restores the basic resources of the first Android application based on the first basic resource information, Call the second Ashmem kernel driver, restore the Ashmem resource of the first Android application based on the first Ashmem resource information, call the second Binder kernel driver, and restore the first Binder resource information based on the first Binder resource information. A Binder resource of an Android application. Specifically, the sending function in the above step 605 and other implicit steps can be realized.
在一种可能的实现方式中,所述发送模块950,还用于将所述第一安卓应用程序的资源信息集合发送至第一计算节点;In a possible implementation, the sending module 950 is further configured to send the resource information collection of the first Android application to the first computing node;
所述基础资源管理模块,还用于检测所述第一安卓应用程序是否生成新的基础资源信息,如果检测到所述第一安卓应用程序生成新的基础资源信息,则导出新生成的基础资源信息;The basic resource management module is also used to detect whether the first Android application generates new basic resource information, and if it is detected that the first Android application generates new basic resource information, export the newly generated basic resource information;
所述Ashmem资源管理模块920,还用于检测所述第一安卓应用程序是否生成新的Ashmem资源信息,如果检测到所述第一安卓应用程序生成新的Ashmem资源信息,则导出新生成的Ashmem资源信息;The Ashmem resource management module 920 is also used to detect whether the first Android application generates new Ashmem resource information, and if it is detected that the first Android application generates new Ashmem resource information, export the newly generated Ashmem Resource information;
所述Binder资源管理模块930,还用于检测所述第一安卓应用程序是否生成新的Binder资源信息,如果检测到所述第一安卓应用程序生成新的Binder资源信息,则导出新生成的Binder资源信息;The Binder resource management module 930 is also used to detect whether the first Android application generates new Binder resource information, and if it is detected that the first Android application generates new Binder resource information, then export the newly generated Binder Resource information;
所述生成模块940,还用于生成包括所述新生成的基础资源信息、所述新生成的Ashmem资源信息和所述新生成的Binder资源信息的第一安卓应用程序的新增资源信息集合;The generating module 940 is further configured to generate a new resource information set of the first Android application including the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information;
所述发送模块950,还用于将所述第一安卓应用程序的新增资源信息集合发送至所述目的计算节点。The sending module 950 is further configured to send the newly added resource information set of the first Android application to the destination computing node.
还需要说明的是,上述实施例提供的安卓应用程序迁移的装置在安卓应用程序迁移时, 仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将原计算节点的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的安卓应用程序迁移的装置与安卓应用程序迁移的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should also be noted that the device for migrating an Android application provided in the above embodiment only uses the division of the above functional modules for illustration when the Android application is migrated. In actual applications, the above functional assignments can be assigned differently according to needs. The function module is completed, that is, the internal structure of the original computing node is divided into different function modules to complete all or part of the functions described above. In addition, the device for migrating an Android application program provided in the foregoing embodiment belongs to the same concept as the method embodiment of the Android application program migration. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
基于相同的技术构思,本申请实施例还提供了一种安卓应用程序迁移的装置,该装置可以应用于计算节点中,如图10所示,该装置包括:Based on the same technical concept, an embodiment of the present application also provides a device for migrating an Android application program. The device can be applied to a computing node. As shown in FIG. 10, the device includes:
获取模块1010,用于获取原计算节点发送的第一安卓应用程序的资源集合,其中,所述第一安卓应用程序的资源集合中包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息。具体可以实现上述步骤606中的获取功能,以及其他隐含步骤。The acquiring module 1010 is configured to acquire the resource set of the first Android application sent by the original computing node, where the resource set of the first Android application includes the first basic resource information of the first Android application and the first basic resource information of the first Android application. One Ashmem resource information and the first Binder resource information. Specifically, the acquisition function in step 606 above and other implicit steps can be implemented.
基础资源管理模块1020,用于基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源。具体可以实现上述步骤607中的基础资源恢复功能,以及其他隐含步骤。The basic resource management module 1020 is configured to restore the basic resources of the first Android application based on the first basic resource information. Specifically, the basic resource recovery function in step 607 and other implicit steps can be implemented.
Ashmem资源管理模块1030,用于调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源。具体可以实现上述步骤607中的Ashmem资源恢复功能,以及其他隐含步骤。The Ashmem resource management module 1030 is configured to call the Ashmem kernel driver and restore the Ashmem resource of the first Android application based on the first Ashmem resource information. Specifically, the Ashmem resource recovery function in step 607 above can be implemented, as well as other implicit steps.
Binder资源管理模块1040,用于调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。具体可以实现上述步骤607中的Binder资源恢复功能,以及其他隐含步骤。The Binder resource management module 1040 is configured to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information. Specifically, the Binder resource recovery function in step 607 and other implicit steps can be implemented.
在一种可能的实现方式中,所述第一基础资源信息中包括所述第一安卓应用程序的进程信息和文件信息;In a possible implementation manner, the first basic resource information includes process information and file information of the first Android application;
所述基础资源管理模块1020,用于:The basic resource management module 1020 is used to:
基于所述进程信息,创建所述进程信息对应的进程;Based on the process information, creating a process corresponding to the process information;
基于所述文件信息,在文件系统中创建所述文件信息对应的文件。Based on the file information, a file corresponding to the file information is created in the file system.
在一种可能的实现方式中,所述第一Ashmem资源信息包括所述第一安卓应用程序的多个进程共享的共享内存的目标内存信息和共享文件的目标文件信息,所述目标内存信息包括所述多个目标进程共享的共享内存的属性信息和存储数据,所述文件信息对应的文件包括所述目标文件信息对应的目标共享文件;In a possible implementation manner, the first Ashmem resource information includes target memory information of a shared memory shared by multiple processes of the first Android application program and target file information of a shared file, and the target memory information includes Attribute information and storage data of the shared memory shared by the multiple target processes, and the file corresponding to the file information includes the target shared file corresponding to the target file information;
所述Ashmem资源管理模块1030,用于:The Ashmem resource management module 1030 is used to:
基于所述目标内存信息,创建目标共享内存,并基于所述属性信息,配置所述目标共享内存;Create a target shared memory based on the target memory information, and configure the target shared memory based on the attribute information;
将所述存储数据写入所述目标共享内存,并作为所述目标共享文件的文件内容数据。The storage data is written into the target shared memory and used as the file content data of the target shared file.
在一种可能的实现方式中,所述第一Binder资源信息中包括所述第一安卓应用程序的客户端进程和第二安卓应用程序的服务端进程之间的通信连接信息,所述进程信息对应的进程包括所述第一安卓应用程序的客户端进程;In a possible implementation manner, the first Binder resource information includes communication connection information between the client process of the first Android application and the server process of the second Android application, and the process information The corresponding process includes the client process of the first Android application;
所述Binder资源管理模块1040,用于:The Binder resource management module 1040 is used to:
基于所述通信连接信息,建立所述客户端进程和所述目的计算节点中所述第二安卓应用程序的服务端进程之间的通信连接。Based on the communication connection information, a communication connection between the client process and the server process of the second Android application in the target computing node is established.
还需要说明的是,上述实施例提供的安卓应用程序迁移的装置在安卓应用程序迁移时, 仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将目的计算节点的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的安卓应用程序迁移的装置与安卓应用程序迁移的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should also be noted that the device for migrating an Android application provided in the above embodiment only uses the division of the above functional modules for illustration when the Android application is migrated. In actual applications, the above functional assignments can be assigned differently according to needs. The function module is completed, that is, the internal structure of the target computing node is divided into different function modules to complete all or part of the functions described above. In addition, the device for migrating an Android application program provided in the foregoing embodiment belongs to the same concept as the method embodiment of the Android application program migration. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
基于相同的技术构思,本申请实施例还提供了一种安卓应用程序快照恢复的装置,该装置可以应用于计算节点中,如图11所示,该装置包括:Based on the same technical concept, an embodiment of the present application also provides a device for restoring a snapshot of an Android application program. The device can be applied to a computing node. As shown in FIG. 11, the device includes:
接收模块1110,用于接收对第一安卓应用程序的第一时刻的快照恢复指令;The receiving module 1110 is configured to receive a snapshot restoration instruction at the first moment of the first Android application;
获取模块1120,用于获取存储的所述第一时刻对应的第一安卓应用程序的快照,其中,所述第一安卓应用程序的快照包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息;The obtaining module 1120 is configured to obtain a stored snapshot of the first Android application corresponding to the first moment, wherein the snapshot of the first Android application includes the first basic resource information of the first Android application, The first Ashmem resource information and the first Binder resource information;
基础资源管理模块1130,用于基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源;The basic resource management module 1130 is configured to restore the basic resources of the first Android application based on the first basic resource information;
Ashmem资源管理模块1140,用于调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源;The Ashmem resource management module 1140 is configured to call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
Binder资源管理模块1150,用于调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。The Binder resource management module 1150 is configured to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
在一种可能的实现方式中,所述接收模块1110还用于:In a possible implementation manner, the receiving module 1110 is further configured to:
在所述第一时刻,接收对所述第一安卓应用程序的快照生成指令;At the first moment, receiving a snapshot generation instruction for the first Android application;
所述基础资源管理模块1130,还用于导出所述第一基础资源信息;The basic resource management module 1130 is further configured to export the first basic resource information;
所述Ashmem资源管理模块1140,还用于调用所述Ashmem内核驱动程序,导出所述第一Ashmem资源信息;The Ashmem resource management module 1140 is also used to call the Ashmem kernel driver to export the first Ashmem resource information;
所述Binder资源管理模块1150,还用于调用所述Binder内核驱动程序,导出所述第一Binder资源信息;The Binder resource management module 1150 is further configured to call the Binder kernel driver to export the first Binder resource information;
所述装置还包括生成模块,用于生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的快照;The device further includes a generating module, configured to generate a snapshot of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
所述装置还包括存储模块,用于将所述第一安卓应用程序的快照和所述第一时刻对应存储。The device further includes a storage module for storing the snapshot of the first Android application program and the first moment in correspondence.
还需要说明的是,上述实施例提供的安卓应用程序快照恢复的装置在安卓应用程序快照恢复时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将计算节点的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的安卓应用程序快照恢复的装置与安卓应用程序快照恢复的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should also be noted that the device for restoring an Android application snapshot provided in the above embodiment only uses the division of the above functional modules for illustration when the Android application snapshot is restored. In actual applications, the above functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the computing node is divided into different functional modules to complete all or part of the functions described above. In addition, the device for restoring a snapshot of an Android application program provided in the foregoing embodiment belongs to the same concept as the method embodiment for restoring a snapshot of an Android application program. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
如图12所示是本申请实施例提供的一种计算节点1200的示意图。在图12中,计算节点可以包括有处理器1201和存储器1202。处理器1201可以是中央处理器(central processing unit,CPU)。处理器1201可以是指一个处理器,也可以包括多个处理器。存储器1202可以包括易失性存储器,例如随机存取存储器(random access memory,RAM);存储器也可以包 括非易失性存储器,例如只读存储器(read-only memory,ROM),快闪存储器等。存储器还可以包括上述种类的存储器的组合。存储器1202可以是指一个存储器,也可以包括多个存储器。存储器1202中存储有计算机可读指令,该计算机可读指令可以由处理器1201执行,以实现上述实施例提供的安卓应用程序迁移或者快照恢复的方法。FIG. 12 is a schematic diagram of a computing node 1200 provided by an embodiment of the present application. In FIG. 12, the computing node may include a processor 1201 and a memory 1202. The processor 1201 may be a central processing unit (CPU). The processor 1201 may refer to one processor, or may include multiple processors. The memory 1202 may include volatile memory, such as random access memory (RAM); the memory may also include non-volatile memory, such as read-only memory (ROM), flash memory, and the like. The memory may also include a combination of the above-mentioned types of memory. The memory 1202 may refer to one memory, or may include multiple memories. The memory 1202 stores computer-readable instructions, and the computer-readable instructions can be executed by the processor 1201 to implement the Android application program migration or snapshot restoration method provided in the foregoing embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现,当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令,在设备上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴光缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是设备能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(如软盘、硬盘和磁带等),也可以是光介质(如数字视盘(Digital Video Disk,DVD)等),或者半导体介质(如固态硬盘等)。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof, and when implemented in software, it may be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions, and when the computer program instructions are loaded and executed on a device, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website site, computer, server or data center via wired (such as coaxial optical cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by the device or a data storage device such as a server or data center integrated with one or more available media. The usable medium may be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a digital video disk (Digital Video Disk, DVD), etc.), or a semiconductor medium (such as a solid state hard disk, etc.).
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the foregoing embodiments can be implemented by hardware, or by a program instructing relevant hardware to be completed. The program can be stored in a computer-readable storage medium. The storage medium mentioned can be a read-only memory, a magnetic disk or an optical disk, etc.
以上所述仅为本申请一个实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above is only an embodiment of this application and is not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection scope of this application. Inside.

Claims (18)

  1. 一种安卓应用程序迁移的方法,其特征在于,所述方法应用于原计算节点,所述方法包括:An Android application migration method, characterized in that the method is applied to the original computing node, and the method includes:
    导出第一安卓应用程序的第一基础资源信息;Export the first basic resource information of the first Android application;
    调用第一匿名共享内存Ashmem内核驱动程序,导出所述第一安卓应用程序的第一Ashmem资源信息;Calling the first anonymous shared memory Ashmem kernel driver to export the first Ashmem resource information of the first Android application;
    调用第一进程间通信Binder内核驱动程序,导出所述第一安卓应用程序的第一Binder资源信息;Calling the first inter-process communication Binder kernel driver to export the first Binder resource information of the first Android application;
    生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的资源信息集合;Generating a resource information set of the first Android application that includes the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
    将所述第一安卓应用程序的资源信息集合发送至目的计算节点,以使所述目的计算节点基于所述第一基础资源信息,恢复第一安卓应用程序的基础资源,调用第二Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源,调用第二Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。Send the resource information collection of the first Android application to the target computing node, so that the target computing node restores the basic resources of the first Android application based on the first basic resource information, and calls the second Ashmem kernel driver The program restores the Ashmem resource of the first Android application based on the first Ashmem resource information, calls the second Binder kernel driver, and restores the Binder of the first Android application based on the first Binder resource information resource.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    检测所述第一安卓应用程序是否生成新的基础资源信息,如果检测到所述第一安卓应用程序生成新的基础资源信息,则导出新生成的基础资源信息;Detecting whether the first Android application program generates new basic resource information, and if it is detected that the first Android application program generates new basic resource information, exporting the newly generated basic resource information;
    检测所述第一安卓应用程序是否生成新的Ashmem资源信息,如果检测到所述第一安卓应用程序生成新的Ashmem资源信息,则导出新生成的Ashmem资源信息;Detecting whether the first Android application program generates new Ashmem resource information, and if it is detected that the first Android application program generates new Ashmem resource information, export the newly generated Ashmem resource information;
    检测所述第一安卓应用程序是否生成新的Binder资源信息,如果检测到所述第一安卓应用程序生成新的Binder资源信息,则导出新生成的Binder资源信息;Detecting whether the first Android application program generates new Binder resource information, and if it is detected that the first Android application program generates new Binder resource information, export the newly generated Binder resource information;
    生成包括所述新生成的基础资源信息、所述新生成的Ashmem资源信息和所述新生成的Binder资源信息的第一安卓应用程序的新增资源信息集合;Generating a new resource information set of the first Android application that includes the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information;
    将所述第一安卓应用程序的新增资源信息集合发送至所述目的计算节点。Sending the newly added resource information set of the first Android application to the destination computing node.
  3. 一种安卓应用程序迁移的方法,其特征在于,所述方法应用于目的计算节点,所述方法包括:An Android application program migration method, characterized in that the method is applied to a target computing node, and the method includes:
    获取原计算节点发送的第一安卓应用程序的资源集合,其中,所述第一安卓应用程序的资源集合中包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息;Obtain the resource set of the first Android application sent by the original computing node, where the resource set of the first Android application includes the first basic resource information of the first Android application, the first Ashmem resource information, and the first resource information of the first Android application. -Binder resource information;
    基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源;Restore the basic resources of the first Android application based on the first basic resource information;
    调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源;Call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
    调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。Invoke the Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
  4. 根据权利要求3所述的方法,其特征在于,所述第一基础资源信息中包括所述第一安卓应用程序的进程信息和文件信息;The method according to claim 3, wherein the first basic resource information includes process information and file information of the first Android application;
    所述基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源,包括:The restoring the basic resources of the first Android application based on the first basic resource information includes:
    基于所述进程信息,创建所述进程信息对应的进程;Based on the process information, creating a process corresponding to the process information;
    基于所述文件信息,在文件系统中创建所述文件信息对应的文件。Based on the file information, a file corresponding to the file information is created in the file system.
  5. 根据权利要求4所述的方法,其特征在于,所述第一Ashmem资源信息包括所述第一安卓应用程序的多个进程共享的共享内存的目标内存信息和共享文件的目标文件信息,所述目标内存信息包括所述多个目标进程共享的共享内存的属性信息和存储数据,所述文件信息对应的文件包括所述目标文件信息对应的目标共享文件;The method according to claim 4, wherein the first Ashmem resource information includes target memory information of a shared memory shared by multiple processes of the first Android application and target file information of a shared file, and The target memory information includes attribute information and storage data of the shared memory shared by the multiple target processes, and the file corresponding to the file information includes the target shared file corresponding to the target file information;
    所述基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源,包括:The restoring the Ashmem resource of the first Android application based on the first Ashmem resource information includes:
    基于所述目标内存信息,创建目标共享内存,并基于所述属性信息,配置所述目标共享内存;Create a target shared memory based on the target memory information, and configure the target shared memory based on the attribute information;
    将所述存储数据写入所述目标共享内存,并作为所述目标共享文件的文件内容数据。The storage data is written into the target shared memory and used as the file content data of the target shared file.
  6. 根据权利要求4或5中所述的方法,其特征在于,所述第一Binder资源信息中包括所述第一安卓应用程序的客户端进程和第二安卓应用程序的服务端进程之间的通信连接信息,所述进程信息对应的进程包括所述第一安卓应用程序的客户端进程;The method according to claim 4 or 5, wherein the first Binder resource information includes the communication between the client process of the first Android application and the server process of the second Android application Connection information, where the process corresponding to the process information includes the client process of the first Android application;
    所述基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源,包括:The restoring the Binder resource of the first Android application based on the first Binder resource information includes:
    基于所述通信连接信息,建立所述客户端进程和所述目的计算节点中所述第二安卓应用程序的服务端进程之间的通信连接。Based on the communication connection information, a communication connection between the client process and the server process of the second Android application in the target computing node is established.
  7. 一种安卓应用程序快照恢复的方法,其特征在于,所述方法应用于计算节点,所述方法包括:A method for restoring a snapshot of an Android application program, wherein the method is applied to a computing node, and the method includes:
    接收对第一安卓应用程序的第一时刻的快照恢复指令;Receiving a snapshot restoration instruction at the first moment of the first Android application;
    获取存储的所述第一时刻对应的第一安卓应用程序的快照,其中,所述第一安卓应用程序的快照包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息;Acquire a stored snapshot of the first Android application corresponding to the first moment, where the snapshot of the first Android application includes first basic resource information of the first Android application, first Ashmem resource information, and The first Binder resource information;
    基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源;Restore the basic resources of the first Android application based on the first basic resource information;
    调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源;Call the Ashmem kernel driver, and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
    调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。Invoke the Binder kernel driver, and restore the Binder resource of the first Android application based on the first Binder resource information.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    在所述第一时刻,接收对所述第一安卓应用程序的快照生成指令;At the first moment, receiving a snapshot generation instruction for the first Android application;
    导出所述第一基础资源信息;Export the first basic resource information;
    调用所述Ashmem内核驱动程序,导出所述第一Ashmem资源信息;Calling the Ashmem kernel driver to export the first Ashmem resource information;
    调用所述Binder内核驱动程序,导出所述第一Binder资源信息;Calling the Binder kernel driver to export the first Binder resource information;
    生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的快照;Generating a snapshot of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
    将所述第一安卓应用程序的快照和所述第一时刻对应存储。Correspondingly store the snapshot of the first Android application and the first moment.
  9. 一种安卓应用程序迁移的装置,其特征在于,所述装置包括:An Android application program migration device, characterized in that the device includes:
    基础资源管理模块,用于导出第一安卓应用程序的第一基础资源信息;The basic resource management module is used to export the first basic resource information of the first Android application;
    Ashmem资源管理模块,用于调用第一Ashmem内核驱动程序,导出所述第一安卓应用程序对应的第一Ashmem资源信息;The Ashmem resource management module is used to call the first Ashmem kernel driver and export the first Ashmem resource information corresponding to the first Android application;
    Binder资源管理模块,用于第一Binder内核驱动程序,导出所述第一安卓应用程序对应的第一Binder资源信息;The Binder resource management module is used for the first Binder kernel driver to export the first Binder resource information corresponding to the first Android application;
    生成模块,用于生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的资源信息集合;A generating module, configured to generate a resource information set of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
    发送模块,用于将所述第一安卓应用程序的资源信息集合发送至目的计算节点,以使所述目的计算节点基于所述第一基础资源信息,恢复第一安卓应用程序的基础资源,调用第二Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源,调用第二Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。The sending module is configured to send the resource information collection of the first Android application to a target computing node, so that the target computing node restores the basic resources of the first Android application based on the first basic resource information, and calls The second Ashmem kernel driver restores the Ashmem resource of the first Android application based on the first Ashmem resource information, calls the second Binder kernel driver, and restores the first Binder resource information based on the first Binder resource information. Binder resources for Android applications.
  10. 根据权利要求9所述的装置,其特征在于,所述发送模块,还用于将所述第一安卓应用程序的资源信息集合发送至第一计算节点;The device according to claim 9, wherein the sending module is further configured to send the resource information collection of the first Android application to a first computing node;
    所述基础资源管理模块,还用于检测所述第一安卓应用程序是否生成新的基础资源信息,如果检测到所述第一安卓应用程序生成新的基础资源信息,则导出新生成的基础资源信息;The basic resource management module is also used to detect whether the first Android application generates new basic resource information, and if it is detected that the first Android application generates new basic resource information, export the newly generated basic resource information;
    所述Ashmem资源管理模块,还用于检测所述第一安卓应用程序是否生成新的Ashmem资源信息,如果检测到所述第一安卓应用程序生成新的Ashmem资源信息,则导出新生成的Ashmem资源信息;The Ashmem resource management module is also used to detect whether the first Android application generates new Ashmem resource information, and if it is detected that the first Android application generates new Ashmem resource information, export the newly generated Ashmem resource information;
    所述Binder资源管理模块,还用于检测所述第一安卓应用程序是否生成新的Binder资源信息,如果检测到所述第一安卓应用程序生成新的Binder资源信息,则导出新生成的Binder资源信息;The Binder resource management module is also used to detect whether the first Android application generates new Binder resource information, and if it is detected that the first Android application generates new Binder resource information, export the newly generated Binder resource information;
    所述生成模块,还用于生成包括所述新生成的基础资源信息、所述新生成的Ashmem资源信息和所述新生成的Binder资源信息的第一安卓应用程序的新增资源信息集合;The generating module is further configured to generate a new resource information set of the first Android application including the newly generated basic resource information, the newly generated Ashmem resource information, and the newly generated Binder resource information;
    所述发送模块,还用于将所述第一安卓应用程序的新增资源信息集合发送至所述目的计算节点。The sending module is further configured to send the newly added resource information set of the first Android application to the destination computing node.
  11. 一种安卓应用程序迁移的装置,其特征在于,所述装置应用于目的计算节点,所述装置包括:An Android application program migration device, characterized in that the device is applied to a target computing node, and the device includes:
    获取模块,用于获取原计算节点发送的第一安卓应用程序的资源集合,其中,所述第一安卓应用程序的资源集合中包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem 资源信息和第一Binder资源信息;The acquiring module is used to acquire the resource collection of the first Android application sent by the original computing node, wherein the resource collection of the first Android application includes the first basic resource information of the first Android application, the first Ashmem resource information and first Binder resource information;
    基础资源管理模块,用于基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源;A basic resource management module, configured to restore the basic resources of the first Android application based on the first basic resource information;
    Ashmem资源管理模块,用于调用Ashmem内核驱动程序,基于所述第一Ashmem资源信息,恢复所述第一安卓应用程序的Ashmem资源;The Ashmem resource management module is used to call the Ashmem kernel driver and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
    Binder资源管理模块,用于调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。The Binder resource management module is used to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
  12. 根据权利要求11所述的装置,其特征在于,所述第一基础资源信息中包括所述第一安卓应用程序的进程信息和文件信息;The device according to claim 11, wherein the first basic resource information includes process information and file information of the first Android application;
    所述基础资源管理模块,用于:The basic resource management module is used to:
    基于所述进程信息,创建所述进程信息对应的进程;Based on the process information, creating a process corresponding to the process information;
    基于所述文件信息,在文件系统中创建所述文件信息对应的文件。Based on the file information, a file corresponding to the file information is created in the file system.
  13. 根据权利要求12所述的装置,其特征在于,所述第一Ashmem资源信息包括所述第一安卓应用程序的多个进程共享的共享内存的目标内存信息和共享文件的目标文件信息,所述目标内存信息包括所述多个目标进程共享的共享内存的属性信息和存储数据,所述文件信息对应的文件包括所述目标文件信息对应的目标共享文件;The device according to claim 12, wherein the first Ashmem resource information includes target memory information of a shared memory shared by multiple processes of the first Android application and target file information of a shared file, and The target memory information includes attribute information and storage data of the shared memory shared by the multiple target processes, and the file corresponding to the file information includes the target shared file corresponding to the target file information;
    所述Ashmem资源管理模块,用于:The Ashmem resource management module is used for:
    基于所述目标内存信息,创建目标共享内存,并基于所述属性信息,配置所述目标共享内存;Create a target shared memory based on the target memory information, and configure the target shared memory based on the attribute information;
    将所述存储数据写入所述目标共享内存,并作为所述目标共享文件的文件内容数据。The storage data is written into the target shared memory and used as the file content data of the target shared file.
  14. 根据权利要求12或13所述的装置,其特征在于,所述第一Binder资源信息中包括所述第一安卓应用程序的客户端进程和第二安卓应用程序的服务端进程之间的通信连接信息,所述进程信息对应的进程包括所述第一安卓应用程序的客户端进程;The device according to claim 12 or 13, wherein the first Binder resource information includes a communication connection between the client process of the first Android application and the server process of the second Android application Information, the process corresponding to the process information includes the client process of the first Android application;
    所述Binder资源管理模块,用于:The Binder resource management module is used to:
    基于所述通信连接信息,建立所述客户端进程和所述目的计算节点中所述第二安卓应用程序的服务端进程之间的通信连接。Based on the communication connection information, a communication connection between the client process and the server process of the second Android application in the target computing node is established.
  15. 一种安卓应用程序快照恢复的装置,其特征在于,所述方法应用于计算节点,所述装置包括:A device for restoring a snapshot of an Android application program, wherein the method is applied to a computing node, and the device includes:
    接收模块,用于接收对第一安卓应用程序的第一时刻的快照恢复指令;The receiving module is used to receive the snapshot restoration instruction at the first moment of the first Android application;
    获取模块,用于获取存储的所述第一时刻对应的第一安卓应用程序的快照,其中,所述第一安卓应用程序的快照包括所述第一安卓应用程序的第一基础资源信息、第一Ashmem资源信息和第一Binder资源信息;The acquiring module is configured to acquire a stored snapshot of the first Android application corresponding to the first moment, wherein the snapshot of the first Android application includes the first basic resource information and the first Android application of the first Android application. One Ashmem resource information and the first Binder resource information;
    基础资源管理模块,用于基于所述第一基础资源信息,恢复所述第一安卓应用程序的基础资源;A basic resource management module, configured to restore the basic resources of the first Android application based on the first basic resource information;
    Ashmem资源管理模块,用于调用Ashmem内核驱动程序,基于所述第一Ashmem资源 信息,恢复所述第一安卓应用程序的Ashmem资源;The Ashmem resource management module is used to call the Ashmem kernel driver and restore the Ashmem resource of the first Android application based on the first Ashmem resource information;
    Binder资源管理模块,用于调用Binder内核驱动程序,基于所述第一Binder资源信息,恢复所述第一安卓应用程序的Binder资源。The Binder resource management module is used to call the Binder kernel driver and restore the Binder resource of the first Android application based on the first Binder resource information.
  16. 根据权利要求15所述的装置,其特征在于,所述接收模块还用于:The device according to claim 15, wherein the receiving module is further configured to:
    在所述第一时刻,接收对所述第一安卓应用程序的快照生成指令;At the first moment, receiving a snapshot generation instruction for the first Android application;
    所述基础资源管理模块,还用于导出所述第一基础资源信息;The basic resource management module is also used to export the first basic resource information;
    所述Ashmem资源管理模块,还用于调用所述Ashmem内核驱动程序,导出所述第一Ashmem资源信息;The Ashmem resource management module is further configured to call the Ashmem kernel driver to export the first Ashmem resource information;
    所述Binder资源管理模块,还用于调用所述Binder内核驱动程序,导出所述第一Binder资源信息;The Binder resource management module is further configured to call the Binder kernel driver to export the first Binder resource information;
    所述装置还包括生成模块,用于生成包括所述第一基础资源信息、所述第一Ashmem资源信息和所述第一Binder资源信息的所述第一安卓应用程序的快照;The device further includes a generating module, configured to generate a snapshot of the first Android application including the first basic resource information, the first Ashmem resource information, and the first Binder resource information;
    所述装置还包括存储模块,用于将所述第一安卓应用程序的快照和所述第一时刻对应存储。The device further includes a storage module for storing the snapshot of the first Android application program and the first moment in correspondence.
  17. 一种计算节点,其特征在于,所述计算节点包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如权利要求1至权利要求2所述的安卓应用程序迁移的方法所执行的操作,或者实现如权利要求3至权利要求6所述的安卓应用程序迁移的方法所执行的操作,或者实现如权利要求7至权利要求8所述的安卓应用程序快照恢复的方法所执行的操作。A computing node, characterized in that, the computing node includes a processor and a memory, and at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement claims as claimed in claim 1 to claim 2. The operations performed by the method for migrating Android applications, or the operations performed by the method for migrating Android applications as described in claim 3 to claim 6, or the operations performed by the method for migrating Android applications as described in claim 7 to claim 8, The operations performed by the method of recovering snapshots of Android apps.
  18. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求1至权利要求2所述的安卓应用程序迁移的方法所执行的操作,或者实现如权利要求3至权利要求6所述的安卓应用程序迁移的方法所执行的操作,或者实现如权利要求7至权利要求8所述的安卓应用程序快照恢复的方法所执行的操作。A computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to realize the migration of the Android application program according to claim 1 to claim 2. The operation performed by the method, or the operation performed by the method for migrating an Android application program as described in claim 3 to claim 6, or the method for restoring a snapshot of an Android application program as described in claim 7 to claim 8. The action performed.
PCT/CN2021/098909 2020-06-20 2021-06-08 Migration method and apparatus for android application program WO2021254214A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010569613.2 2020-06-20
CN202010569613.2A CN113821333A (en) 2020-06-20 2020-06-20 Android application program migration method and device

Publications (1)

Publication Number Publication Date
WO2021254214A1 true WO2021254214A1 (en) 2021-12-23

Family

ID=78924767

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/098909 WO2021254214A1 (en) 2020-06-20 2021-06-08 Migration method and apparatus for android application program

Country Status (2)

Country Link
CN (1) CN113821333A (en)
WO (1) WO2021254214A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114025238A (en) * 2022-01-10 2022-02-08 北京蔚领时代科技有限公司 Native android application cloud virtualization method based on Linux server

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115328529B (en) * 2022-06-30 2023-08-18 北京亚控科技发展有限公司 Application management method and related equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140137183A1 (en) * 2012-11-13 2014-05-15 Auckland Uniservices Ltd. Security system and method for the android operating system
CN104239814A (en) * 2014-09-17 2014-12-24 上海斐讯数据通信技术有限公司 Mobile office safety method and mobile office safety system
US20160285958A1 (en) * 2015-03-27 2016-09-29 Intel Corporation Application container for live migration of mobile applications
CN108052328A (en) * 2017-11-09 2018-05-18 华中科技大学 A kind of construction method of Android system and its application
CN110780889A (en) * 2019-10-14 2020-02-11 广州微算互联信息技术有限公司 Cloud mobile phone data cloning method and cloud mobile phone data restoring method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140137183A1 (en) * 2012-11-13 2014-05-15 Auckland Uniservices Ltd. Security system and method for the android operating system
CN104239814A (en) * 2014-09-17 2014-12-24 上海斐讯数据通信技术有限公司 Mobile office safety method and mobile office safety system
US20160285958A1 (en) * 2015-03-27 2016-09-29 Intel Corporation Application container for live migration of mobile applications
CN108052328A (en) * 2017-11-09 2018-05-18 华中科技大学 A kind of construction method of Android system and its application
CN110780889A (en) * 2019-10-14 2020-02-11 广州微算互联信息技术有限公司 Cloud mobile phone data cloning method and cloud mobile phone data restoring method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114025238A (en) * 2022-01-10 2022-02-08 北京蔚领时代科技有限公司 Native android application cloud virtualization method based on Linux server

Also Published As

Publication number Publication date
CN113821333A (en) 2021-12-21

Similar Documents

Publication Publication Date Title
US11226847B2 (en) Implementing an application manifest in a node-specific manner using an intent-based orchestrator
US10700947B2 (en) Life cycle management method and device for network service
US11243792B2 (en) Image file conversion method and apparatus
US10346248B2 (en) Failure resistant volume creation in a shared storage environment
US8887157B2 (en) System and method for managing virtual machine states by restoring previously saved states based on a virtual machine application's request active with the virtual machine
WO2019137320A1 (en) Resource scheduling method, apparatus, device and system
US11392497B1 (en) Low latency access to data sets using shared data set portions
WO2018119601A1 (en) Data conversion method and back-up server
JP6869193B2 (en) Access method and equipment
CN114586011B (en) Inserting an owner-specified data processing pipeline into an input/output path of an object storage service
WO2021254214A1 (en) Migration method and apparatus for android application program
US10620871B1 (en) Storage scheme for a distributed storage system
US20210097476A1 (en) Container Management Method, Apparatus, and Device
CN106777394B (en) Cluster file system
US20150088825A1 (en) Virtual machine storage replication schemes
CN111698675A (en) Data processing method, device and computer readable storage medium
CN107566470B (en) Method and device for managing virtual machine in cloud data system
CN113992657A (en) Shared storage building method, device and medium based on cloud platform
CN111600755B (en) Internet access behavior management system and method
CN112035062B (en) Migration method of local storage of cloud computing, computer equipment and storage medium
WO2021226822A1 (en) Log write method and apparatus, electronic device, and storage medium
US9965357B1 (en) Virtual backup and restore of virtual machines
US20210181945A1 (en) User-based recovery point objectives for disaster recovery
KR101993309B1 (en) Method and program for storing service data by cloud account
JP6205013B1 (en) Application usage system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21824982

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21824982

Country of ref document: EP

Kind code of ref document: A1