Application program cross-device running method and electronic device
By establishing a communication connection between smart terminals and running the target application in the virtualized container of the second device, the problems of cross-device collaboration and unutilization of resources are solved, and cross-device flow and independent operation of the application are achieved, improving the improvement of cross-device flow and operation of the application. User experience and resource utilization efficiency.
Patent Information
- Application Number
- CN202310960303.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, cross-device collaboration between smart terminals is not convenient enough, and the computing power and system resources of the device cannot be effectively utilized during the screen projection process, resulting in poor user experience.
By establishing a communication connection between the first device and the second device, data of the target application on the first device is transmitted to the second device and running the application in a virtualized container of the second device, thereby realizing the application The program flows across devices and runs independently.
It realizes the seamless flow of applications between different devices, releases the system resources of the first device, reduces standby power consumption, improves user experience, and optimizes the computing power and system resource utilization of the device.
Smart Images

Figure CN119440712A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a method for running an application across devices and an electronic device. Background Art
[0002] At present, most users have a variety of smart terminal products, such as laptops, mobile phones, tablets, surveillance cameras, smart TVs, smart speakers, smart car terminals, smart conference terminals, etc. Existing smart terminals will establish multi-device collaboration, also known as cross-device collaboration or near-field collaboration. In the collaborative scenario, a very important function is screen projection technology, which projects the screen content on one device to another device, including mirror projection or different display projection.
[0003] However, in the existing technology, it is not convenient for multiple smart terminals to establish mutual cooperation, and the computing power and system resources (such as central processing unit and memory) of the projected device are not effectively utilized in the cooperation process. At the same time, the projected device needs to keep its system resources occupied by the current projected content. Because the computing power and system resources of the device are not effectively utilized, it is also impossible to provide users with a better multi-terminal smart collaborative linkage experience. Summary of the invention
[0004] The embodiments of the present application provide a method and an electronic device for running an application across devices, so as to at least solve the problem in the related art that after an application is run across devices, it is still necessary to keep the running state in the device that originally ran the application.
[0005] According to one embodiment of the present application, a method for running an application across devices is provided, including: establishing a communication connection between a first device and a second device; transmitting data of a target application running in a first virtualization container of the first device to the second device, wherein the target application is configured to flow to a second virtualization container of the second device for running; and upon receiving a notification from the second device that the flow of the target application is successful, exiting the target application in the first virtualization container from a running state.
[0006] In an exemplary embodiment, the data of the target application running in the first virtualization container of the first device is transmitted to the second device, including: processing first data used to support the target application running in the second virtualization container and second data of the target application copied in the first virtualization container, and transmitting them to the second device; wherein the first data includes system isolation information for adapting to the second virtualization container, and the second data includes cache files, data files, memory swap files and packaged installation files of the target application.
[0007] According to another embodiment of the present application, a method for running an application across devices is provided, including: a second device establishes a communication connection with a first device; the second device receives data of a target application running in a first virtualization container of the first device sent by the first device, and runs the target application in a second virtualization container of the second device; the second device sends a notification of successful transfer of the application to the first device, and the notification is used to exit the target application in the first virtualization container from a running state.
[0008] In an exemplary embodiment, running the target application in the second virtualization container of the second device includes: restoring the first data and the second data of the application in the second virtualization container and configuring environment parameters, and running the target application; wherein the first data includes the system isolation information for adapting the second virtualization container, and the second data includes the cache files, data files, memory swap files, and packaged installation files of the target application.
[0009] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0010] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0011] Through the present application, since a communication connection is established between the first device and the second device, when the target application running in the first device needs to be transferred to the second device, the data of the target application running in the first virtualization container of the first device can be transmitted to the second device. Based on the transmitted data, the application is successfully transferred to the second device without relying on the first device to run independently. Therefore, the target application in the first device can exit the running state, which can solve the problem that after the application runs across devices, it still needs to keep running in the device originally running the application, thereby causing a waste of system resources, thereby achieving the effect of independent operation of the application across devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a hardware structure block diagram of a computer terminal according to a method for running an application across devices in an embodiment of the present application;
[0013] Figure 2is a flowchart of a method for running an application across devices according to an embodiment of the present application;
[0014] Figure 3 is a flowchart of a method for running an application across devices according to yet another embodiment of the present application;
[0015] Figure 4 is a structural block diagram of an apparatus for running an application across devices according to an embodiment of the present application;
[0016] Figure 5 is a structural block diagram of an apparatus for running an application across devices according to yet another embodiment of the present application;
[0017] Figure 6 is a flowchart of a method for running an application across devices according to another embodiment of the present application;
[0018] Figure 7 It is a schematic diagram of an application running across devices according to an embodiment of the present application. DETAILED DESCRIPTION
[0019] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0021] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a method for running an application across devices in an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0022] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for running the application across devices in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0023] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0024] Figure 2 is a flowchart of a method for running an application across devices according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0025] Step S202, the first device establishes a communication connection with the second device;
[0026] The manner in which the first device and the second device establish a communication connection through the near field communication includes one of the following: the first device and the second device use the same account to access the same wireless network hotspot; the first device and the second device both turn on Bluetooth; the first device touches the second device through near field communication NFC.
[0027] Step S204, transmitting data of a target application running in a first virtualized container of the first device to the second device, wherein the target application is configured to be transferred to a second virtualized container of the second device for execution;
[0028] In step S204 of the present embodiment, the data of the target application running in the first virtualization container of the first device is transmitted to the second device, including: processing first data used to support the target application running in the second virtualization container and second data of the target application copied in the first virtualization container, and transmitting them to the second device; wherein the first data includes system isolation information for adapting to the second virtualization container, and the second data includes cache files, data files, memory swap files and packaged installation files of the target application.
[0029] If the target application wants to flow from the first device to the second device, the necessary preparation is to transfer the data that supports the target application to run on the second device to the second device. Since the second device may not have the environmental conditions for the target application to run, in order for the target application to adapt to the second device, the system isolation information needs to be transmitted to the second device. At the same time, the cache files, data files, memory swap files and packaged installation files of the target application also need to be transmitted to the second device for the subsequent installation and operation of the target application. The flow of applications in this application can also be called application relay, which is a technology for the cross-device operation of applications under multi-device collaboration. In an embodiment of the present application, the application running on the first device is transferred to other second devices according to the user's intention to continue running, so that the user can use the application uninterruptedly on two or even more smart devices. The application flow or relay technology of this application can optimize the computing power and system resources on the device, significantly reduce power consumption problems, increase the use time of the device, and can be used in parallel for other purposes on the device.
[0030] In an exemplary embodiment, the system isolation information includes namespace information and operating system permission management information that are provided and recorded by the first virtualization container and support the running of the target application.
[0031] In an exemplary embodiment, the method further includes pausing the running of the target application in the first virtual container.
[0032] Since data needs to be copied before transmission, the application will be suspended to ensure smooth data copying and transmission.
[0033] In step S204 of this embodiment, data of the target application running in the virtualization container of the first device is transmitted to the second device, including: transmitting data of the target application running in the virtualization container of the first device that meets the display specifications of the screen of the second device to the second device.
[0034] In an exemplary embodiment, the operating system of the first device is different from the operating system of the second device.
[0035] Regardless of whether the operating systems of the first device and the second device are the same or different, the application can be run across devices.
[0036] Step S206: upon receiving a notification from the second device that the target application has been successfully transferred, the target application in the first virtualization container is exited from the running state.
[0037] The target application is successfully transferred, that is, the target application realizes independent operation in the second device, so there is no need to continue to run the target application in the first device. After the first device closes the target application, part of the computing power can be released to avoid waste of resources.
[0038] Figure 3 is a flowchart of a method for running an application across devices according to yet another embodiment of the present application. Figure 3 As shown, the process includes the following steps:
[0039] Step S302, the second device establishes a communication connection with the first device;
[0040] Step S304: the second device receives data of a target application running in a first virtualization container of the first device and sent by the first device, and runs the target application in a second virtualization container of the second device;
[0041] In step S304 of this embodiment, running the target application in the second virtualization container of the second device includes: restoring the first data and the second data of the application in the second virtualization container and configuring the environment parameters, and running the target application; wherein the first data includes the system isolation information for adapting the second virtualization container, and the second data includes the cache files, data files, memory swap files and packaged installation files of the target application.
[0042] In an exemplary embodiment, the system isolation information includes namespace information and operating system permission management information that are provided and recorded by the first virtualization container and support the running of the target application.
[0043] In step S304 of this embodiment, the second device receives data of a target application running in a first virtualization container of the first device and sent by the first device, including: the second device receives data of the target application running in the first virtualization container of the first device and meeting display specifications of a screen of the second device and sent by the first device.
[0044] In an exemplary embodiment, the operating system of the second device is different from the operating system of the first device.
[0045] Step S306: The second device sends a notification of successful transfer of the application to the first device, where the notification is used to exit the target application in the first virtualization container from a running state.
[0046] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0047] In this embodiment, a device for running an application across devices and a device for running an application across devices are also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0048] Figure 4 is a structural block diagram of an apparatus for running an application across devices according to an embodiment of the present application, such as Figure 4 As shown, the device includes: a first communication module 10, a transmission module 20, and a setting module 30;
[0049] A first communication module 10, used for establishing a communication connection between the first device and the second device;
[0050] A transmission module 20, configured to transmit data of a target application running in a first virtualization container of the first device to the second device, wherein the target application is configured to be transferred to a second virtualization container of the second device for execution;
[0051] The setting module 30 is used to exit the target application in the first virtualization container from the running state when receiving the notification of successful transfer of the target application from the second device.
[0052] Figure 5 is a structural block diagram of an apparatus for running an application across devices according to yet another embodiment of the present application, such as Figure 5 As shown, the device includes: a second communication module 40, an operation module 50, and a sending module 60;
[0053] The second communication module 40 is used for the second device to establish a communication connection with the first device;
[0054] An operating module 50 is configured to receive, by the second device, data of a target application program running in a first virtualized container of the first device and sent by the first device, and to run the target application program in a second virtualized container of the second device;
[0055] The sending module 60 is used for the second device to send a notification of successful transfer of the application to the first device, where the notification is used to exit the target application in the first virtualization container from a running state.
[0056] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0057] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0058] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0059] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0060] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0061] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0062] To facilitate the understanding of the technical solution provided by the present application, a detailed explanation will be given below in combination with embodiments of specific scenarios.
[0063] Figure 6 is a flowchart of a method for running an application across devices according to another embodiment of the present application. Figure 6 As shown, the process includes the following steps:
[0064] Step S602, the master device opens a cross-device collaborative service or function;
[0065] Step S604: The main device scans in the background to find a collaborative device, and a collaborative relationship is established between the main device and the collaborative device;
[0066] Step S606, starting the application in the virtualized container in the main device;
[0067] Specifically, the application that needs to be transferred is started in the virtualized container in the main device. The virtualized container is responsible for providing the namespace information and operating system permission management information required for the application to run, thereby realizing the environmental isolation of the application.
[0068] Step S608: The user operates the application program to be transferred to the collaborative device, the virtualized container starts the clone mode, and the data in the container is serialized and transferred to the collaborative device;
[0069] Step S610, after receiving the streaming data, the collaborative device starts the virtualized container and restores the application data in the container, and configures the environment parameters;
[0070] Specifically, it is ensured that the application can run in the collaborative device by configuring the environment parameters.
[0071] Step S612: After the application is successfully transferred, the collaborative device notifies the main device to close the virtualized container and the application in the container.
[0072] Specifically, the notification message is used for the main device to release computing power and resources after closing the virtualization container and the application in the container after receiving the notification message.
[0073] In this embodiment, the container is responsible for providing the namespace required for the application to run, operating system permission management, and recording these key information. The application runs in the operating system isolation environment provided by the container. When the application is transferred, it can automatically adapt these operating system environment isolation information according to the environment in which the container runs on the other end, ensuring that the application is not affected by changes in the operating environment and can continue to run normally. The container also provides management of application data and code in the container, and can serialize and transmit these application data to the other end so that these application data can be copied in the new container environment on the other end.
[0074] Figure 7 is a schematic diagram of an application program running across devices according to an embodiment of the present application, such as Figure 7 As shown, based on the operating system virtualization technology, the application runs in the virtualization container provided by the smart terminal operating system. The container provides operating system environment isolation and supports serialization and cross-physical node cloning. When the master and slave devices want to start transferring applications (Application, APP), the master device uses the suspension application mechanism provided by the container to suspend the running of the application to be transferred, and then serializes the data of the application to be transferred in the memory (program segment, data segment), including all parameters of the virtualization container supporting the running of the application, as well as the cache files, data files, memory swap files of the application to be transferred in the flash file system, and the application itself packaged installation files, which are transferred to the slave device, and then the corresponding container is started in the slave device, the data of the application is restored, and the method provided by the container is used to restore the program to the running state, and the user operation interface UI of the program is refreshed to the layout corresponding to the screen specifications of the slave device, and presented to the user for continued use.
[0075] The screen size and resolution of device A and device B may be different, so before the flow, there needs to be a mechanism to negotiate the screen differences and determine whether the application supports the user interface layout of both ends at the same time. In other words, there are customized requirements for the application, and the application must meet the screen display specifications of the devices at both ends to support the flow.
[0076] When the master and slave devices belong to heterogeneous systems, different virtualized containers on the heterogeneous systems can be used to provide a consistent operating environment for the application, shielding the impact of the heterogeneous systems on the operation of the same application.
[0077] The embodiments of the present application can be applied to a variety of multi-device collaboration or interconnection scenarios, including: collaboration and interconnection between mobile phones and laptops / tablet computers; collaboration and interconnection between mobile phones and augmented reality (AR) glasses or wearable devices; collaboration and interconnection between mobile terminals and smart TVs / displays; collaboration and interconnection between mobile phones or tablet computers and in-car entertainment systems; collaboration and interconnection between mobile terminals and smart conference systems, etc., so as to meet the needs of users in various scenarios such as smart homes, smart offices, and smart travel.
[0078] Through the embodiment of the present application, the experience of seamless use of the same application across devices can be achieved. The advantage of this solution is that after the application is transferred, the computing power and system resources of the main device are released, effectively reducing the problem of standby power consumption. Moreover, users can run different applications on two devices at the same time, improving the user experience.
[0079] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0080] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for running an application across devices, characterized in that: include: The first device establishes a communication connection with the second device; Transmitting data of a target application running in a first virtualized container of the first device to the second device, wherein the target application is configured to flow to a second virtualized container of the second device for execution; When receiving a notification from the second device that the target application has been successfully transferred, the target application in the first virtualization container is exited from the running state.
2. The method according to claim 1, characterized in that Transmitting the data of the target application running in the first virtualization container of the first device to the second device includes: processing first data used to support the target application running in the second virtualization container and second data of the target application copied in the first virtualization container, and transmitting the processed data to the second device; The first data includes system isolation information for adapting the second virtualization container, and the second data includes cache files, data files, memory swap files and packaged installation files of the target application.
3. The method according to claim 2, characterized in that The system isolation information includes namespace information and operating system permission management information that are provided and recorded by the first virtualization container and support the running of the target application.
4. The method according to claim 2, characterized in that: The method further includes pausing the running of the target application in the first virtual container.
5. The method according to claim 1, characterized in that Transmitting data of a target application running in a virtualized container of the first device to the second device, comprising: The data of the target application program running in the virtualization container of the first device and meeting the display specification of the screen of the second device is transmitted to the second device.
6. The method according to claim 1, characterized in that The operating system of the first device is different from the operating system of the second device.
7. A method for running an application across devices, characterized in that: include: The second device establishes a communication connection with the first device; The second device receives data of a target application running in a first virtualization container of the first device and sent by the first device, and runs the target application in a second virtualization container of the second device; The second device sends a notification of successful transfer of the application to the first device, where the notification is used to exit the target application in the first virtualization container from a running state.
8. The method according to claim 7, characterized in that Running the target application in the second virtualization container of the second device includes: Recovering the first data and the second data of the application in the second virtualization container and configuring environment parameters, and running the target application; The first data includes the system isolation information used to adapt the second virtualization container, and the second data includes cache files, data files, memory swap files and packaged installation files of the target application.
9. The method according to claim 8, characterized in that The system isolation information includes namespace information and operating system permission management information that are provided and recorded by the first virtualization container and support the running of the target application.
10. The method according to claim 7, characterized in that The second device receives data of a target application running in a first virtualization container of the first device and sent by the first device, including: The second device receives data of the target application running in the first virtualization container of the first device and meeting the display specification of the screen of the second device, which is sent by the first device.
11. The method according to claim 7, characterized in that The operating system of the second device is different from the operating system of the first device.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented, or the steps of the method described in any one of claims 7 to 11 are implemented.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the steps of the method described in any one of claims 1 to 6, or implements the steps of the method described in any one of claims 7 to 11.