Cross-device quick migration method for WayAndroid container and related product
By dividing container data into static and dynamic parts in the Waydroid Android container migration solution and using Bluetooth BLE transmission, the problems of easy network interruption and high latency in the existing technology are solved, and the stable migration of containers and the preservation of process state in low-speed communication links are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG ZHONGXING NEWSTART TECH CO LTD
- Filing Date
- 2025-12-18
- Publication Date
- 2026-05-05
AI Technical Summary
Existing Waydroid container migration solutions rely on stable Wi-Fi or wired networks in portable device scenarios, which are prone to interruption and have high latency. They cannot achieve real-time synchronization of container status and cannot retain the complete application process state of the source device.
The first host device searches for the second host device, initiates a pairing request, and encapsulates the container's writable storage data into dynamic data packets and read-only image data into static data packets. It then uses Bluetooth BLE to transmit the data over a low-speed communication link, thus enabling hot migration of the container.
Stable container migration was achieved in mobile scenarios, reducing data transfer volume, lowering migration latency, and ensuring the integrity of application process state.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of container migration technology, and in particular to a method and related products for rapid cross-device migration of Waydroid Android containers. Background Technology
[0002] Waydroid is an open-source project based on Linux containers. It runs the Android system as a system container on a Linux host machine, allowing direct access to the host machine's hardware to run Android programs. For example, it can install Android programs such as WPS, Alipay, and WeChat on a Linux system.
[0003] The emergence of Waydroid Android containers has greatly accelerated the adoption of Linux systems in portable devices. In common office and entertainment scenarios using Windows and Android systems, users need to seamlessly switch between multiple devices to operate programs running on the previous device. For example, after editing a document on a Linux tablet, users might want to continue working on it on a Linux laptop, or switch to a desktop computer to watch a video while it's playing on a portable device.
[0004] Container migration is a core technology for enabling application reuse across devices. Existing traditional LXC container network migration solutions have the following technical shortcomings: 1) During the migration process, it relies on a stable Wi-Fi or wired network. In mobile device scenarios, the network is prone to interruption, and the full image transmission has high latency.
[0005] 2) It is impossible to synchronize the real-time state of containers between two devices, and it is impossible to retain the complete application process state of the source device container (such as unsaved document cache, game progress). Summary of the Invention
[0006] The main objective of this application is to propose a method for fast cross-device migration of Waydroid Android containers, a device for cross-device migration of Waydroid Android containers, and a system for cross-device migration of Waydroid Android containers. The aim is to migrate containers between two or more Linux host devices, synchronize the real-time status of containers, and preserve the complete application process status of containers.
[0007] To achieve the above objectives, a first aspect of this application proposes a Waydroid Android container cross-device migration method, applied to a first host device, wherein the first host device is used to migrate a container of a running process to a second host device, the method comprising: In response to the container migration request, search for a second host device and initiate a pairing request to the second host device; If the pairing is successful, the writable storage data of the container to be migrated will be encapsulated into a dynamic data packet, and the read-only image data of the container to be migrated will be encapsulated into a static data packet; the writable storage data is all data that can be modified and / or generated after the container starts, and the read-only image data is the data that is solidified to build the container image; The dynamic data packet and the static data packet are sent to the second host device used to rebuild the container of the running process.
[0008] In some embodiments, the step of searching for a second host device and initiating a pairing request to the second host device specifically includes: Listen for broadcast data packets sent by the second host device; The signal transmission distance between the second host device and the first host device is determined based on the broadcast data packet. If the signal transmission distance is less than or equal to a preset distance threshold, a pairing request is initiated to the second host device.
[0009] In some embodiments, the signal transmission distance between the second host device and the first host device is determined based on the broadcast data packet. If the signal transmission distance is less than or equal to a preset distance threshold, a pairing request is initiated to the second host device. The method further includes: The signal transmission distance between the second host device and the first host device is determined based on the broadcast data packet; If the signal transmission distance of more than two second host devices is less than or equal to a preset distance threshold, then the device status information of each second host device is obtained; The second host device that initiated the pairing request is determined based on the device status information.
[0010] In some embodiments, the encapsulation of the writable storage data of the container to be migrated into a dynamic data packet and the encapsulation of the read-only image data of the container to be migrated into a static data packet specifically includes: Receive pre-stored file information sent by the second host device, the pre-stored file information being used to indicate the data of the container to be migrated that the second host device has pre-stored; Based on the metadata of the container to be migrated and the pre-stored file information, read the writable storage data and the read-only image data that are not pre-existing in the second host device; The writable storage data is encapsulated into dynamic data packets, and the read-only image data is encapsulated into static data packets; the writable storage data includes registers, cache, main memory, and runtime data in the disk.
[0011] In some embodiments, encapsulating the writable storage data into dynamic data packets and the read-only image data into static data packets specifically includes: The writable storage data and the read-only image data are compressed using a data compression algorithm, and the compressed data is then encapsulated to obtain the dynamic data packet and the static data packet.
[0012] A second aspect of this application provides a method for migrating Waydroid Android containers across devices, applied to a second host device, wherein the second host device is used to rebuild the container of a running process migrated from a first host device, the method comprising: Broadcast pairing information in response to a pairing request initiated by the first host device; If pairing is successful, the dynamic data packet and static data packet sent by the first host device are received, parsed and verified. The dynamic data packet includes the writable storage data of the container to be migrated, and the static data packet includes the read-only image data of the container to be migrated. The writable storage data is all data that can be modified and / or generated after the container starts, and the read-only image data is the data that is solidified to build the container image. Reconstruct the container of the running process based on the writable storage data and the read-only image data obtained from the parsing.
[0013] In some embodiments, the dynamic data packet and the static data packet are encapsulated with a CRC32 expected value. Receiving, parsing, and verifying the dynamic data packet and the static data packet sent by the first host device specifically includes: Receive the dynamic data packet and the static data packet, and calculate the CRC32 checksum of the dynamic data packet and the static data packet; The data integrity of the dynamic data packet and the static data packet is determined based on the expected CRC32 value and the CRC32 check value. The writable storage data is obtained by parsing and verifying the dynamic data packet, and the read-only image data is obtained by parsing and verifying the static data packet.
[0014] A third aspect of this application provides an electronic device comprising: at least one processor; at least one memory for storing at least one program; wherein when the at least one program is executed by the at least one processor, the at least one processor performs the method as described in the first aspect of this application.
[0015] A fourth aspect of this application provides an electronic device comprising: at least one processor; at least one memory for storing at least one program; wherein when the at least one program is executed by the at least one processor, the at least one processor performs the method as described in the second aspect of this application.
[0016] A fifth aspect of this application provides a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the method described in the first aspect of this application, or the computer program, when executed by a processor, implements the method described in the second aspect of this application.
[0017] The embodiments of this application include at least the following beneficial effects: This application provides a method and related products for cross-device migration of Waydroid Android containers. The solution involves a first host device responding to a container migration request, searching for a second host device, and initiating a matching request to the second host device. If a match is successful, the writable storage data of the container to be migrated is encapsulated into a dynamic data packet, and the read-only image data is encapsulated into a static data packet. The dynamic and static data packets are then sent to the second host device to start and run the container. This solution divides the data used to rebuild the container into static and dynamic parts. The dynamic data packet allows the second host device to start and run the container containing the in-process being migrated from the first host device, achieving hot migration without interrupting container operation. The read-only image data contains shared files within the container environment, and the static data packet can encapsulate only the read-only image data not shared between the first and second host devices, reducing data transmission volume and improving data transmission success rate in low-speed communication links between the two devices. Attached Figure Description
[0018] Figure 1 This is a first flowchart of the container cross-device migration method provided in this application embodiment; Figure 2 yes Figure 1 A flowchart illustrating step 101 in the method shown; Figure 3 yes Figure 2 A flowchart illustrating step 202 in the method shown; Figure 4 yes Figure 1 A flowchart illustrating step 102 in the method shown; Figure 5 This is a second flowchart of the container cross-device migration method provided in the embodiments of this application; Figure 6 yes Figure 5 A flowchart illustrating step 502 in the method shown; Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application; Figure 8 This is a schematic diagram of the data processing and transmission process of the electronic device provided in the embodiments of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0020] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0021] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0023] In related technologies, containers rely on stable Wi-Fi or wired networks during migration. In portable device mobile scenarios, the network is prone to interruption, and the full image transmission has high latency. It is impossible to achieve real-time synchronization of container status between two devices, and it is impossible to retain the complete application process status of the source device container (such as unsaved document cache, game progress).
[0024] In view of this, embodiments of this application provide a method for migrating Waydroid Android containers across devices and related products. The Waydroid Android container cross-device migration method and related products provided in embodiments of this application relate to the field of information technology.
[0025] The Waydroid Android container cross-device migration method provided in this application can be applied to terminals, servers, or software running on terminals or servers. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application that implements the Waydroid Android container cross-device migration method, but is not limited to the above forms.
[0026] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0027] It should be noted that in each specific implementation of this application, when it is necessary to process data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards.
[0028] Furthermore, when this application embodiment needs to obtain sensitive personal information of users, it will obtain the user's separate permission or consent through pop-up windows or redirection to a confirmation page. After clearly obtaining the user's separate permission or consent, it will then obtain the necessary user-related data for enabling the application embodiment to operate normally.
[0029] Figure 1This is an optional flowchart of the Waydroid Android container cross-device migration method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps 101 to 103.
[0030] Step 101: In response to the container migration request, search for a second host device and initiate a pairing request to the second host device; Step 102: If the pairing is successful, the writable storage data and read-only image data of the container to be migrated are encapsulated into dynamic data packets and static data packets, respectively; the writable storage data is all data that can be modified and / or generated after the container starts, and the read-only image data is the data that is solidified when the container image is built; Step 103: Send the dynamic data packet and the static data packet to the second host device used to rebuild the container of the running process.
[0031] Steps 101 to 103, as illustrated in this embodiment, involve dividing the data used to rebuild the container into static and dynamic parts. The dynamic data packet allows the second host device to start and run the container containing the in-process process migrated from the first host device, achieving hot migration of the container without interruption. The read-only image data contains shared files within the container environment. The static data packet can encapsulate only the read-only image data not shared between the first and second host devices, reducing data transmission volume and improving data transmission success rate between the two devices in low-speed communication links.
[0032] The following section provides a detailed description and explanation of the solution provided in this embodiment of the invention, using a specific example of the Waydroid Android container cross-device migration process: Please see Figure 1 This application provides a Waydroid Android container cross-device migration method, applied to a first host device, including steps 101 to 103.
[0033] Step 101: In response to the container migration request, search for a second host device and initiate a pairing request to the second host device; Step 102: If the pairing is successful, the writable storage data of the container to be migrated is encapsulated into a dynamic data packet, and the read-only image data of the container to be migrated is encapsulated into a static data packet; the writable storage data is all data that can be modified and / or generated after the container starts, and the read-only image data is the data that is solidified to build the container image; Step 103: Send the dynamic data packet and the static data packet to the second host device used to rebuild the container of the running process.
[0034] In some embodiments of step 101, the first host device and the second host device achieve automatic device discovery and distance detection via Bluetooth BLE, and combine multi-layer authentication to ensure migration security and accuracy.
[0035] Specifically, the primary host device continuously scans for nearby secondary host devices at 500ms intervals to ensure rapid detection of nearby secondary host devices. After scanning, an authentication process is triggered, supporting device unique identifier (such as MAC address) verification, preset device group matching (a set of devices pre-bound by the user), or biometric authentication such as fingerprint / face recognition. The authentication timeout is set to 3 seconds.
[0036] In some embodiments, if the first host device and the second host device have a one-to-one correspondence, then step 101 specifically includes, but is not limited to, the following: Figure 2 Steps 201 to 202 are shown.
[0037] 201. Listen for broadcast data packets sent by the second host device; 202. Determine the signal transmission distance between the second host device and the first host device based on the broadcast data packet. If the signal transmission distance is less than or equal to a preset distance threshold, initiate a pairing request to the second host device.
[0038] In some embodiments, if in step 201 more than one second host device is detected within a preset distance threshold, and the first host device and the second host device have a one-to-many relationship, then step 202 specifically includes, but is not limited to, the following: Figure 3 As shown, steps 301 to 303.
[0039] 301. Determine the signal transmission distance between the second host device and the first host device based on the broadcast data packet; 302. If the signal transmission distance of more than two second host devices is less than or equal to a preset distance threshold, then obtain the device status information of each second host device; 303. Determine the second host device that initiated the pairing request based on the device status information.
[0040] In steps 301 to 303, the device status information includes device usage time, screen on / off status, and recent operation timestamp. The devices are sorted according to this status information, with priority given to devices most recently used by the user.
[0041] In some embodiments, the signal transmission distance in steps 201 to 202 and steps 301 to 303 is calculated based on the Bluetooth BLE signal strength. For example, the signal transmission distance is calculated as follows:
[0042] in, Bluetooth signal strength, The signal strength at a preset distance threshold. It is an environmental degradation factor.
[0043] In this embodiment of the application, the preset distance threshold is 1 meter. When the second host device is ≤1 meter away, the authentication process is triggered.
[0044] In some embodiments, when the device moves away from the second host device during container migration (distance > 1 meter), the transmission is automatically paused and the progress is cached, and synchronization resumes when the device moves closer again.
[0045] In some embodiments, to overcome Bluetooth rate limitations, the data that the migration container needs to send is split into static data packets and dynamic data packets, transmitting only the changing dynamic data, and combining compression and encryption to ensure transmission efficiency and security. Step 102 specifically includes, but is not limited to, the following: Figure 4 Steps 401 to 403 are shown.
[0046] 401. Receive pre-stored file information sent by the second host device, wherein the pre-stored file information is used to indicate the data of the container to be migrated that has been pre-stored by the second host device; 402. Read the writable storage data and the read-only image data that are not pre-existing in the second host device based on the metadata of the container to be migrated and the pre-stored file information; 403. Encapsulate the writable storage data into dynamic data packets and encapsulate the read-only image data into static data packets; the writable storage data includes registers, cache, main memory, and runtime data in the disk.
[0047] It is understandable that all data during container runtime can be divided into writable storage data and read-only image data. The writable storage data includes runtime data in registers, cache, main memory, and disk, such as the LXC container's PID namespace mapping, CGroups resource quotas, Android Binder communication status, application process register data, incremental memory snapshots, file handle status, and application operation progress (such as document editing cache and video playback progress). The read-only image data includes data that does not change with the runtime state, such as the Android system image and application installation packages.
[0048] In steps 401 to 403, the pre-stored file information sent by the second host device to the first host device consists of read-only image data and writable storage data that were already stored in the second host device before migration. During migration, the first host device packages the read-only image data and writable storage data that were not stored in the second host device.
[0049] In this embodiment, the first host device identifies the differences between the read-only image data and the writable storage data of the second host device using a hash comparison algorithm (such as SHA-256), and only transmits the missing data fragments in the second host device, thereby reducing the amount of data transmitted.
[0050] In some embodiments of step 402, the state capture module of the first host device obtains container metadata, including namespace configuration and CGroups resource quota, by calling interfaces such as lxc_list and lxc_info through the LXC API; it attaches to the application process through the ptrace tool to capture register data, memory page table, and file handle status; and it obtains Binder communication status and application running information through the dumpsys tool of the Android system, integrates and generates a lightweight dynamic data snapshot, and the snapshot generation time is controlled within 2 seconds.
[0051] In some embodiments, limited by the Bluetooth transmission rate, the read-only image data is stored in the data storage module of the second host device after the initial migration, or pre-synchronized to the data storage module of the second host device via Wi-Fi or wired network to reduce the amount of data in the static data packets.
[0052] In some embodiments, in order to further reduce the amount of data transmission, step 403 includes, but is not limited to: compressing the writable storage data and the read-only image data using a data compression algorithm, and encapsulating the compressed data to obtain the dynamic data packet and the static data packet.
[0053] In this embodiment, the LZ4 lightweight compression algorithm is used to compress dynamic data, and the compression level is set to level 4 to achieve a balance between compression efficiency and time consumption, ensuring that the compression time of a single file is ≤100ms.
[0054] The steps in the above embodiments are the operations performed by the first host device when migrating the container. The first host device divides the data used to rebuild the container into two parts, static and dynamic, and sends them to the second host device. Furthermore, during the data packaging process, incremental synchronization and data compression are used to reduce the amount of data transmitted, ensuring a smooth migration under Bluetooth transmission rate limitations.
[0055] In some embodiments, step 103 specifically includes: transmitting the dynamic data packet and the static data packet to the second host device via an AES-128 encrypted Bluetooth BLE channel.
[0056] Without relying on communication modules such as Wi-Fi or wired networks, this application embodiment achieves stable migration in mobile scenarios through Bluetooth BLE. Employing incremental synchronization and compression technology, the migration latency is reduced from over 30 seconds to within 8 seconds, and it eliminates the need to transmit a complete image, reducing bandwidth dependence. The Bluetooth BLE + incremental synchronization solution of this invention offers lower migration latency, eliminates the need for a stable network, and has stronger compatibility, making it more suitable for mobile scenarios involving portable Linux devices.
[0057] This application also provides a method for migrating Waydroid Android containers across devices, specifically including but not limited to steps 501 to 503.
[0058] Please see Figure 5 : 501. Broadcast pairing information in response to a pairing request initiated by the first host device; 502. If pairing is successful, receive and parse the dynamic data packet and static data packet sent by the first host device. The dynamic data packet includes the writable storage data of the container to be migrated, and the static data packet includes the read-only image data of the container to be migrated. The writable storage data is all data that can be modified and / or generated after the container starts, and the read-only image data is the data that is used to build and solidify the container image. 503. Reconstruct the container of the running process based on the writable storage data and the read-only image data obtained from the parsing.
[0059] In some embodiments, the dynamic data packet and the static data packet are encapsulated with a CRC32 expected value. The process of receiving, parsing and verifying the dynamic data packet and the static data packet sent by the first host device includes, but is not limited to, steps 601 to 603.
[0060] Please see Figure 6 : 601. Receive the dynamic data packet and the static data packet, and calculate the CRC32 checksum of the dynamic data packet and the static data packet; 602. Determine the data integrity of the dynamic data packet and the static data packet based on the expected CRC32 value and the CRC32 checksum; 603. Parse the verified dynamic data packet to obtain the writable storage data, and parse the verified static data packet to obtain the read-only image data.
[0061] The steps in the above embodiments are the operations performed by the second host device when migrating the container. The second host device verifies the data upon receipt; if verification is successful, it starts and runs the container, reconstructing the container's process on the first host device according to the dynamic data packet, thus achieving hot migration.
[0062] In this embodiment, steps 601 to 603 can verify whether the dynamic and static data packets sent by the first host device are lost or corrupted. If the data integrity is low, the first host device can be requested to resend the data.
[0063] This application also provides an electronic device, including: at least one processor; at least one memory for storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor performs the method as described in steps 101 to 103 of the above embodiments.
[0064] Correspondingly, this application also provides an electronic device, including: at least one processor; at least one memory for storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor implements the methods in steps 501 to 503 of the above embodiments.
[0065] Please see Figure 7 The first and second host devices have the same logical structure, including a data storage module for storing data; a triggering and authentication module for establishing a handshake between the two devices; a state capture module for reading read-only image data; a transmission control module for performing data compression, encrypted transmission and reception verification functions; and a state recovery module for rebuilding the container.
[0066] Please see Figure 8 When the first host device and the second host device execute the methods described in the above embodiments, the data processing and transmission process is as follows: Figure 8 As shown.
[0067] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0068] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0069] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0070] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0071] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0072] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0073] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0074] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0075] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0076] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0077] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0078] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for migrating Waydroid Android containers across devices, characterized in that, Applied to a first host device, which is used to migrate containers of running processes to a second host device, the method includes: In response to the container migration request, search for a second host device and initiate a pairing request to the second host device; If the pairing is successful, the writable storage data of the container to be migrated will be encapsulated into a dynamic data packet, and the read-only image data of the container to be migrated will be encapsulated into a static data packet; the writable storage data is all data that can be modified and / or generated after the container starts, and the read-only image data is the data that is solidified to build the container image; The dynamic data packet and the static data packet are sent to the second host device used to rebuild the container of the running process.
2. The Waydroid Android container cross-device migration method as described in claim 1, characterized in that, The process of searching for a second host device and initiating a pairing request to the second host device specifically includes: Listen for broadcast data packets sent by the second host device; The signal transmission distance between the second host device and the first host device is determined based on the broadcast data packet. If the signal transmission distance is less than or equal to a preset distance threshold, a pairing request is initiated to the second host device.
3. The Waydroid Android container cross-device migration method as described in claim 2, characterized in that, The signal transmission distance between the second host device and the first host device is determined based on the broadcast data packet. If the signal transmission distance is less than or equal to a preset distance threshold, a pairing request is initiated to the second host device. The method also includes: The signal transmission distance between the second host device and the first host device is determined based on the broadcast data packet; If the signal transmission distance of more than two second host devices is less than or equal to a preset distance threshold, then the device status information of each second host device is obtained; The second host device that initiated the pairing request is determined based on the device status information.
4. The Waydroid Android container cross-device migration method as described in claim 1, characterized in that, The process of encapsulating the writable storage data of the container to be migrated into a dynamic data packet and the read-only image data of the container to be migrated into a static data packet specifically includes: Receive pre-stored file information sent by the second host device, the pre-stored file information being used to indicate the data of the container to be migrated that the second host device has pre-stored; Based on the metadata of the container to be migrated and the pre-stored file information, read the writable storage data and the read-only image data that are not pre-existing in the second host device; The writable storage data is encapsulated into dynamic data packets, and the read-only image data is encapsulated into static data packets; the writable storage data includes registers, cache, main memory, and runtime data in the disk.
5. The Waydroid Android container cross-device migration method as described in claim 4, characterized in that, The step of encapsulating the writable storage data into a dynamic data packet and the read-only image data into a static data packet specifically includes: The writable storage data and the read-only image data are compressed using a data compression algorithm, and the compressed data is then encapsulated to obtain the dynamic data packet and the static data packet.
6. A method for migrating Waydroid Android containers across devices, characterized in that, The method, applied to a second host device used to rebuild a container of a running process migrated from a first host device, includes: Broadcast pairing information in response to a pairing request initiated by the first host device; If pairing is successful, the dynamic data packet and static data packet sent by the first host device are received, parsed and verified. The dynamic data packet includes the writable storage data of the container to be migrated, and the static data packet includes the read-only image data of the container to be migrated. The writable storage data is all data that can be modified and / or generated after the container starts, and the read-only image data is the data that is solidified to build the container image. Reconstruct the container of the running process based on the writable storage data and the read-only image data obtained from the parsing.
7. A method for cross-device migration of a Waydroid container as described in claim 6, characterized in that, The dynamic data packet and the static data packet are encapsulated with a CRC32 expected value. The receiving, parsing, and verification of the dynamic data packet and static data packet sent by the first host device specifically includes: Receive the dynamic data packet and the static data packet, and calculate the CRC32 checksum of the dynamic data packet and the static data packet; The data integrity of the dynamic data packet and the static data packet is determined based on the expected CRC32 value and the CRC32 check value. The writable storage data is obtained by parsing and verifying the dynamic data packet, and the read-only image data is obtained by parsing and verifying the static data packet.
8. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; when said at least one program is executed by said at least one processor, such that said at least one processor implements the method as described in any one of claims 1-5.
9. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; when said at least one program is executed by said at least one processor, said at least one processor implements the method as described in any one of claims 6-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 5, or when the computer program is executed by a processor, it implements the method of any one of claims 6 to 7.