Search

CN-121979613-A - Waydroid android container cross-equipment rapid migration method and related products

CN121979613ACN 121979613 ACN121979613 ACN 121979613ACN-121979613-A

Abstract

The application relates to the technical field of container migration, in particular to a Waydroid android container cross-device rapid migration method and related products, wherein the method comprises the steps of responding to a container migration request, searching a second host device and initiating a pairing request to the second host device; if the pairing is successful, the writable storage data and the read-only mirror image data of the container to be migrated are respectively packaged into a dynamic data packet and a static data packet, the writable storage data is all data which can be modified and/or generated after the container is started, the read-only mirror image data is data for constructing container mirror image solidification, and the dynamic data packet and the static data packet are sent to second host equipment for reconstructing the container of the running process. The scheme of the application can migrate the container between two or more Linux host devices, synchronize the real-time state of the container and keep the complete application process state of the container.

Inventors

  • ZOU GUOYUAN
  • MAI ZHUODONG
  • GONG JING

Assignees

  • 广东中兴新支点技术有限公司

Dates

Publication Date
20260505
Application Date
20251218

Claims (10)

  1. 1. A Waydroid android container cross-device migration method, applied to a first host device, the first host device being configured to migrate a container of a running process to a second host device, the method comprising: Responding to a container migration request, searching a second host device, and initiating a pairing request to the second host device; If the pairing is successful, the writable storage data of the container to be migrated is packaged into a dynamic data packet, and the read-only mirror image data of the container to be migrated is packaged into a static data packet, wherein the writable storage data is all data which can be modified and/or generated after the container is started, and the read-only mirror image data is data for constructing the mirror image solidification of the container; The dynamic data packet and the static data packet are sent to the second host device for rebuilding a container of the running process.
  2. 2. The Waydroid android container cross-device migration method as claimed in claim 1, wherein the searching for a second host device and initiating a pairing request to the second host device specifically includes: monitoring a broadcast data packet sent by the second host device; and determining signal transmission distances between the second host device and the first host device according to the broadcast data packet, and if the signal transmission distance is smaller than or equal to a preset distance threshold value, initiating a pairing request to the second host device.
  3. 3. The Waydroid android container cross-device migration method of claim 2, wherein determining signal transmission distances of the second host device and the first host device according to the broadcast data packet, and if the signal transmission distance is less than or equal to a preset distance threshold, initiating a pairing request to the second host device, further comprises: Determining signal transmission distances of the second host device and the first host device according to the broadcast data packet; If the signal transmission distances of more than 2 second host devices are smaller than or equal to a preset distance threshold, acquiring device state information of each second host device; and determining the second host equipment for initiating the pairing request according to the equipment state information.
  4. 4. The method for trans-device migration of Waydroid android containers according to claim 1, wherein the encapsulating the writable storage data of the container to be migrated into a dynamic data packet and encapsulating the read-only mirror data of the container to be migrated into a static data packet specifically includes: receiving pre-stored file information sent by the second host device, wherein the pre-stored file information is used for indicating data of a container to be migrated, which is pre-stored by the second host device; Reading the writable storage data and the read-only mirror image data which are not pre-stored in the second host device according to the metadata of the container to be migrated and the pre-stored file information; And packaging the writable storage data into a dynamic data packet, and packaging the read-only mirror image data into a static data packet, wherein the writable storage data comprises a register, a cache, a main memory and runtime data in a disk.
  5. 5. The method for trans-device migration of Waydroid android containers as recited in claim 4, wherein said encapsulating said writable storage data into dynamic data packets and said encapsulating said read-only mirrored data into static data packets comprises: and compressing the writable storage data and the read-only mirror image data through a data compression algorithm, and encapsulating the compressed data to obtain the dynamic data packet and the static data packet.
  6. 6. A Waydroid android container cross-device migration method, applied to a second hosting device, the second hosting device being configured to reconstruct a container of a running process migrated by a first hosting device, the method comprising: Broadcasting pairing information, and responding to a pairing request initiated by the first host device; if the pairing is successful, receiving and analyzing and checking a dynamic data packet and a static data packet sent by the first host device, wherein the dynamic data packet comprises writable storage data of a container to be migrated, and the static data packet comprises read-only mirror image data of the container to be migrated; And rebuilding a container of the running process according to the writable storage data and the read-only mirror image data obtained through analysis.
  7. 7. The method for trans-device migration of Waydroid android containers as recited in claim 6, wherein said dynamic data packets and said static data packets are provided with expected values of CRC32, and said receiving and parsing verifies said dynamic data packets and static data packets sent by said first host device, specifically comprising: Receiving the dynamic data packet and the static data packet, and calculating CRC32 check values of the dynamic data packet and the static data packet; Determining the data integrity of the dynamic data packet and the static data packet according to the CRC32 expected value and the CRC32 check value; analyzing the verified dynamic data packet to obtain the writable storage data, and analyzing the verified static data packet to obtain the read-only mirror image data.
  8. 8. An electronic device comprising at least one processor, at least one memory for storing at least one program, the at least one program when executed by the at least one processor causing the at least one processor to implement the method of any one of claims 1-5.
  9. 9. An electronic device comprising at least one processor, at least one memory for storing at least one program, the at least one program when executed by the at least one processor causing the at least one processor to implement the method of any of claims 6-7.
  10. 10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method of any one of claims 1 to 5 or the computer program when executed by a processor implements the method of any one of claims 6 to 7.

Description

Waydroid android container cross-equipment rapid migration method and related products Technical Field The application relates to the technical field of container migration, in particular to a Waydroid android container cross-equipment rapid migration method and related products. Background Waydroid the android container is an open source item based on a Linux container, and an android system is used as a system container to run in a Linux host, so that hardware of the host can be directly called to run an android program. For example, android programs such as wps, payment treasures, weChat and the like are installed in a Linux system. The advent of Waydroid android containers has greatly accelerated the popularity of the Linux system in portable devices. In the common office entertainment scenes of Windows system and android system, users need to relay directly on a plurality of devices, and switch the program operated by one device. For example, after editing a document on a Linux tablet, it is desirable to continue operating on a Linux notebook or switch to a desktop for continued viewing while playing video on a portable device. The container migration is a core technology for realizing the application continuation of the cross-device, and the existing traditional LXC container network migration scheme has the following technical defects: 1) The network is easy to break in the mobile scene of the portable equipment by depending on a stable Wi-Fi or wired network in the migration process, and the transmission delay of the full mirror image is high. 2) Synchronization of the real-time state of the container cannot be achieved between two devices, and the complete application process state (such as unsaved document cache and game progress) of the container of the source device cannot be reserved. Disclosure of Invention The embodiment of the application mainly aims to provide a Waydroid android container cross-device rapid migration method, a Waydroid android container cross-device migration device and a Waydroid android container cross-device migration system, and aims to migrate containers between two or more Linux host devices, synchronize the real-time state of the containers and keep the complete application process state of the containers. To achieve the above objective, a first aspect of the embodiments of the present application proposes a Waydroid android container cross-device migration method, applied to a first host device, where the first host device is configured to migrate a container that is running a process to a second host device, where the method includes: Responding to a container migration request, searching a second host device, and initiating a pairing request to the second host device; If the pairing is successful, the writable storage data of the container to be migrated is packaged into a dynamic data packet, and the read-only mirror image data of the container to be migrated is packaged into a static data packet, wherein the writable storage data is all data which can be modified and/or generated after the container is started, and the read-only mirror image data is data for constructing the mirror image solidification of the container; The dynamic data packet and the static data packet are sent to the second host device for rebuilding a container of the running process. In some embodiments, the searching the second host device, and initiating a pairing request to the second host device specifically includes: monitoring a broadcast data packet sent by the second host device; and determining signal transmission distances between the second host device and the first host device according to the broadcast data packet, and if the signal transmission distance is smaller than or equal to a preset distance threshold value, initiating a pairing request to the second host device. In some embodiments, determining the signal transmission distance between the second host device and the first host device according to the broadcast data packet, and if the signal transmission distance is less than or equal to a preset distance threshold, initiating a pairing request to the second host device, further including: Determining signal transmission distances of the second host device and the first host device according to the broadcast data packet; If the signal transmission distances of more than 2 second host devices are smaller than or equal to a preset distance threshold, acquiring device state information of each second host device; and determining the second host equipment for initiating the pairing request according to the equipment state information. In some embodiments, the packaging the writable storage data of the container to be migrated into a dynamic data packet and the packaging the read-only mirror image data of the container to be migrated into a static data packet specifically includes: receiving pre-stored file information sent by the second host device, wherein the pre-stored fil