Terminal simulation method and device

By simulating the cloud terminal hardware device in the target container of the cloud server and sending call instructions to the physical terminal, the problem of the cloud terminal not being configured with hardware devices is solved, achieving better user experience and application compatibility.

CN114924831BActive Publication Date: 2025-05-09ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210422765.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-21
Publication Date
2025-05-09
Estimated Expiration
2042-04-21

AI Technical Summary

Technical Problem

Because the cloud terminal is not configured with hardware devices, it cannot use hardware-based functions, which affects the normal use of the application and may be detected as plug-ins, resulting in compatibility issues.

Method used

Run the target operating system in the target container of the cloud server, simulate the hardware device corresponding to the cloud terminal, obtain the operating system calling instructions, and send it to the associated physical terminal, so that the physical terminal calls the corresponding hardware device, and feedback the device data to the cloud.

Benefits of technology

It realizes the simulation of hardware devices in a cloud terminal, and uses hardware device data from physical terminals, improving the user experience of cloud terminals and application compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114924831B_ABST
    Figure CN114924831B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for terminal simulation, the method comprising: running a target operating system for a cloud terminal in a target container constructed by a cloud server, and simulating a first hardware device corresponding to the cloud terminal in the target container; obtaining a call instruction for the first hardware device from the target operating system, and sending the call instruction to a physical terminal associated with the cloud terminal, so that the physical terminal calls a second hardware device corresponding to the first hardware device, the second hardware device being a physical hardware device; obtaining device data of the second hardware device from the physical terminal, and feeding the device data back to the target operating system. Through the embodiment of the present invention, the simulation of hardware devices in the cloud terminal is realized, and the real device data of the hardware devices in the physical terminal is used, which improves the user experience of the cloud terminal and the compatibility with the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud terminals, and in particular to a method and device for terminal simulation. Background Art

[0002] A cloud terminal can be understood as a virtual terminal running in a cloud server. Through the cloud terminal, the computing, storage and other capabilities originally provided by the physical terminal can be converted to be provided by the cloud server, reducing the configuration requirements for the physical terminal.

[0003] However, due to the limitations of the hardware configuration of the cloud server where the cloud terminal is deployed, the cloud terminal is usually not equipped with hardware devices such as cameras, microphones, gravity sensors, acceleration sensors, SIM (Subscriber Identity Module) cards, etc. Since the corresponding hardware devices are not configured, users cannot use hardware-based functions on the cloud terminal, which in turn affects the normal use of some applications. Users can feel the obvious difference between the cloud terminal and the physical terminal, and the user experience is poor.

[0004] For example, map applications cannot use GPS positioning because the GPS device is not configured. Another example is that some applications cannot use the camera for face scanning login because the camera is not configured.

[0005] Moreover, some applications will detect whether the operating environment is a real physical terminal during operation to prevent problems such as plug-ins. However, since cloud terminals are not configured with hardware devices and do not have real device data, they may be detected as plug-ins, causing application compatibility issues. Summary of the invention

[0006] In view of the above problems, a method and device for terminal simulation is proposed to overcome the above problems or at least partially solve the above problems, including:

[0007] A terminal simulation method, the method comprising:

[0008] In a target container constructed by the cloud server, a target operating system for the cloud terminal is run, and in the target container, a first hardware device corresponding to the cloud terminal is simulated;

[0009] Obtaining a call instruction of the target operating system to the first hardware device, and sending the call instruction to the physical terminal associated with the cloud terminal, so that the physical terminal calls a second hardware device corresponding to the first hardware device, where the second hardware device is a physical hardware device;

[0010] The device data of the second hardware device is obtained from the physical terminal, and the device data is fed back to the target operating system.

[0011] Optionally, before obtaining the call instruction of the target operating system to the first hardware device, the method further includes:

[0012] In the target container or cloud server, simulate local services for cloud endpoints.

[0013] Optionally, the first hardware device and the local service perform interactive communication via a Socket mechanism.

[0014] Optionally, obtaining a call instruction of the target operating system to the first hardware device includes:

[0015] Obtaining, from a local service, a call instruction of the target operating system to the first hardware device through a provided service interface;

[0016] Feed device data back to the target operating system, including:

[0017] The device data is sent to the local service through the provided service interface so that the target operating system can obtain the device data.

[0018] Optionally, the service interface is a service interface of a Binder service.

[0019] Optionally, a proxy based on streaming technology is deployed in the target container, and a client based on streaming technology is deployed in the physical terminal, and the calling instruction is sent to the physical terminal associated with the cloud terminal, including:

[0020] The call instruction is sent to the corresponding client in the physical terminal associated with the cloud terminal through the proxy in the target container;

[0021] From the physical terminal, device data of the second hardware device is obtained, including:

[0022] The device data of the second hardware device is obtained from the corresponding client in the physical terminal through the proxy in the target container.

[0023] Optionally, the target container is a Docker container, and the target operating system is an Android operating system.

[0024] A terminal simulation device, the device comprising:

[0025] A first hardware device simulation module is used to run a target operating system for the cloud terminal in a target container constructed by the cloud server, and to simulate a first hardware device corresponding to the cloud terminal in the target container;

[0026] A calling instruction sending module, used for obtaining a calling instruction of the target operating system for the first hardware device, and sending the calling instruction to the entity terminal associated with the cloud terminal, so that the entity terminal calls a second hardware device corresponding to the first hardware device, the second hardware device being the entity's hardware device;

[0027] The device data acquisition module is used to acquire the device data of the second hardware device from the physical terminal and feed the device data back to the target operating system.

[0028] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the terminal simulation method as described above when executed by the processor.

[0029] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the terminal simulation method as described above is implemented.

[0030] The embodiments of the present invention have the following advantages:

[0031] In an embodiment of the present invention, a target operating system for a cloud terminal is run in a target container constructed by a cloud server, and a first hardware device corresponding to the cloud terminal is simulated in the target container. Then, a call instruction of the target operating system to the first hardware device is obtained, and the call instruction is sent to a physical terminal associated with the cloud terminal, so that the physical terminal calls a second hardware device corresponding to the first hardware device, and then obtains device data of the second hardware device from the physical terminal, and feeds the device data back to the target operating system, thereby simulating hardware devices in the cloud terminal and using real device data of the hardware devices in the physical terminal, thereby improving the user experience of the cloud terminal and its compatibility with application programs. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0033] Figure 1 is a flowchart of a terminal simulation method provided by an embodiment of the present invention;

[0034] Figure 2 is a flowchart of another terminal simulation method provided by an embodiment of the present invention;

[0035] Figure 3 is a flowchart of another terminal simulation method provided by an embodiment of the present invention;

[0036] Figure 4 is a flowchart of another terminal simulation method provided by an embodiment of the present invention;

[0037] Figure 5 is a schematic diagram of a mobile phone simulation architecture provided by an embodiment of the present invention;

[0038] Figure 6 is a schematic diagram of another mobile phone simulation architecture provided by an embodiment of the present invention;

[0039] Figure 7 It is a structural block diagram of a terminal simulation device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] For terminal simulation technology, an Android emulator can usually be used. The Android emulator can run the Android operating system in an Android virtual device (AVD), which is a virtual machine. Specifically, the Android emulator is deployed on a host machine (i.e., a physical terminal), runs the Android operating system in the Android virtual device, and transmits data through a high-speed channel (such as QEMU PIPE). The instructions in the Android operating system are streamed to the emulator, and then the emulator converts the instructions into API (Application Programming Interface) calls on the host machine.

[0042] However, the solution using the Android emulator has the following disadvantages:

[0043] 1. In the solution using the Android emulator, the emulator can only be run locally on the host machine, which depends on the data of the host machine and cannot be applied in cloud scenarios.

[0044] 2. In the solution using Android emulator, it usually runs on operating systems such as Windows and Mac, and cannot run on some platforms.

[0045] 3. In the solution using the Android emulator, since the system runs in the virtual machine of the Android virtual device, the solution using the Android emulator not only needs to simulate hardware devices such as GPS, SIM card, and sensor, but also needs to simulate GLES (OpenGL for Embedded Systems, a subset of the OpenGL 3D graphics API) 1.1, GLES2.0, and EGL (EGL is an intermediate interface layer between the OpenGL ES rendering API and the local window system), and then call the host machine's API through instruction conversion. There will be a certain performance loss in the instruction conversion process.

[0046] In an embodiment of the present invention, a solution combining Android containerization and cloud terminal simulation is adopted to directly implement device simulation capabilities in the cloud terminal. Both the Android operating system and the simulator run in the same Docker container environment. When the simulator in the container receives a device call from the Android operating system, it directly streams the instructions and sends the data to the physical terminal through the Internet network protocol, and then collects the real device data and feeds it back to the cloud terminal simulation.

[0047] The solution of the embodiment of the present invention has the following advantages:

[0048] 1. In the embodiment of the present invention, the Docker container can run on a cloud server and can adapt to cloud scenarios. The data source is relatively flexible and can collect device data from physical terminals through streaming technology or customized simulation data.

[0049] 2. In the embodiment of the present invention, it runs in a Docker containerized manner and has good adaptability to hardware platforms such as Qualcomm 865 and 845 chips.

[0050] 3. In the embodiment of the present invention, since the hardware device is simulated directly in the Docker container, a GPU pass-through solution can be adopted, which does not require instruction conversion and has better performance.

[0051] The following is a detailed description:

[0052] Reference Figure 1 , shows a flowchart of a terminal simulation method provided by an embodiment of the present invention, which may specifically include the following steps:

[0053] Step 101: Run a target operating system for a cloud terminal in a target container constructed by a cloud server, and simulate a first hardware device corresponding to the cloud terminal in the target container.

[0054] In order to realize the simulation of the physical terminal in the cloud, a target container can be built in the cloud server, and then the target operating system of the cloud terminal can be run in the target container. The target operating system can be an Android operating system, and the target container can be an Android container (Android In Container, AIC). Specifically, the target container can be a Docker container.

[0055] Due to the limitation of the hardware configuration in the cloud server where the cloud terminal is deployed, the cloud terminal is usually not configured with corresponding hardware devices. In order to avoid the impact of unconfigured hardware devices on the cloud terminal, the first hardware device corresponding to the cloud terminal can be simulated in the target container in the HAL (Hardware Abstract Layer). The first hardware device is a virtual device, which can be an external device of the cloud terminal. For example, the first hardware device can be a WIFI device, a SIM card, a camera, a microphone, a GPS device, a sensor, a battery, a vibration regulator, and other devices.

[0056] Step 102, obtain the target operating system's call instruction for the first hardware device, and send the call instruction to the physical terminal associated with the cloud terminal, so that the physical terminal calls the second hardware device corresponding to the first hardware device, the second hardware device being the physical hardware device.

[0057] During the use of the cloud terminal, such as when the user plays a cloud game through the cloud terminal, the user can control the cloud terminal on the physical terminal side. In response to the user operation, the cloud terminal can call the simulated first hardware device through the deployed target operating system. For example, to control the cloud terminal to turn on the camera, the target operating system needs to call the simulated camera, and then obtain the target operating system's calling instruction for the first hardware device.

[0058] After obtaining the calling instruction, it can be sent to the physical terminal associated with the cloud terminal. After receiving the calling instruction, the physical terminal can further call the second hardware device corresponding to the first hardware device.

[0059] In one embodiment of the present invention, before obtaining the call instruction of the target operating system to the first hardware device, the following may also be included:

[0060] In the target container or cloud server, simulate local services for cloud endpoints.

[0061] In order to communicate with the simulated first hardware device, a local service for the cloud terminal may be simulated. Specifically, a local service for the cloud terminal (Simulation Service) may be simulated in a target container. The first hardware device and the local service may communicate interactively through a Socket mechanism.

[0062] Of course, the local service for the cloud terminal can also be simulated in the host server where the cloud terminal is located, and multiple containers in the cloud server can share the local service through the socket network.

[0063] In one embodiment of the present invention, obtaining a call instruction of the target operating system to the first hardware device may include:

[0064] The target operating system obtains a calling instruction for the first hardware device from the local service through the provided service interface.

[0065] In order to use the local service, an external service interface can be provided for the local service. Specifically, the service interface can be a service interface of the Binder service by registering the Binder service. Then, the target operating system can obtain the calling instruction for the first hardware device through the provided service interface.

[0066] In one embodiment of the present invention, in order to communicate with the physical terminal, an agent based on streaming technology may be deployed in the target container, and a client based on streaming technology may be deployed in the physical terminal. Sending a call instruction to the physical terminal associated with the cloud terminal may include:

[0067] The call instruction is sent to the corresponding client in the physical terminal associated with the cloud terminal through the proxy in the target container.

[0068] After obtaining the calling instruction, the cloud terminal can send the calling instruction to the corresponding client in the physical terminal associated with the cloud terminal through the proxy in the target container based on the streaming technology.

[0069] Step 103: Obtain device data of the second hardware device from the physical terminal, and feed the device data back to the target operating system.

[0070] After the physical terminal calls the local second hardware device, the device data of the second hardware device can be obtained. For example, by calling the camera to take a picture, the picture data taken by the camera can be obtained. The physical terminal can feed back the device data of the second hardware device to the target operating system of the cloud terminal.

[0071] In an embodiment of the present invention, obtaining device data of the second hardware device from the physical terminal may include:

[0072] The device data of the second hardware device is obtained from the corresponding client in the physical terminal through the proxy in the target container.

[0073] Since a proxy based on streaming technology can be deployed in the target container and a client based on streaming technology can be deployed in the physical terminal, the physical terminal can send the device data of the second hardware device to the proxy in the target container through the client based on streaming technology.

[0074] In one embodiment of the present invention, feeding back device data to the operating system may include:

[0075] The device data is sent to the local service through the provided service interface so that the target operating system can obtain the device data.

[0076] Since an external service interface is provided for the local service, such as a service interface for a Binder service, after obtaining the device data, the device data can be injected into the local service through the provided service interface, and the target operating system can then obtain the device data.

[0077] In an embodiment of the present invention, a target operating system for a cloud terminal is run in a target container constructed by a cloud server, and a first hardware device corresponding to the cloud terminal is simulated in the target container. Then, a call instruction of the target operating system to the first hardware device is obtained, and the call instruction is sent to a physical terminal associated with the cloud terminal, so that the physical terminal calls a second hardware device corresponding to the first hardware device, and then obtains device data of the second hardware device from the physical terminal, and feeds the device data back to the target operating system, thereby simulating hardware devices in the cloud terminal and using real device data of the hardware devices in the physical terminal, thereby improving the user experience of the cloud terminal and its compatibility with application programs.

[0078] Reference Figure 2 , shows a flowchart of another terminal simulation method provided by an embodiment of the present invention, which may specifically include the following steps:

[0079] Step 201 : running a target operating system for a cloud terminal in a target container constructed by a cloud server, and simulating a first hardware device corresponding to the cloud terminal in the target container.

[0080] In order to simulate the physical terminal in the cloud, a target container can be built in the cloud server, and then the target operating system of the cloud terminal can be run in the target container. The target operating system can be an Android operating system, and the target container can be an Android container. Specifically, the target container can be a Docker container.

[0081] Due to the limitations of the hardware configuration in the cloud server where the cloud terminal is deployed, the cloud terminal is usually not configured with corresponding hardware devices. In order to avoid the impact of unconfigured hardware devices on the cloud terminal, the first hardware device corresponding to the cloud terminal can be simulated in the target container through HAL. The first hardware device is a virtual device, which can be an external device of the cloud terminal. For example, the first hardware device can be a WIFI device, a SIM card, a camera, a microphone, a GPS device, a sensor, a battery, a vibration regulator and other devices.

[0082] Step 202: In the target container or cloud server, a local service for the cloud terminal is simulated, and the first hardware device and the local service interact and communicate with each other through a Socket mechanism.

[0083] In order to communicate with the simulated first hardware device, a local service for the cloud terminal may be simulated. Specifically, the local service for the cloud terminal may be simulated in the target container. The first hardware device and the local service may communicate interactively through a Socket mechanism.

[0084] Of course, the local service for the cloud terminal can also be simulated in the host server where the cloud terminal is located, and multiple containers in the cloud server can share the local service through the socket network.

[0085] Step 203, through the provided service interface, obtain the target operating system's call instruction for the first hardware device from the local service, and send the call instruction to the physical terminal associated with the cloud terminal, so that the physical terminal calls the second hardware device corresponding to the first hardware device, and the second hardware device is the physical hardware device.

[0086] During the use of the cloud terminal, such as when the user plays a cloud game through the cloud terminal, the user can control the cloud terminal on the physical terminal side. In response to the user operation, the cloud terminal can call the simulated first hardware device through the deployed target operating system. For example, to control the cloud terminal to turn on the camera, the target operating system needs to call the simulated camera, and then obtain the target operating system's calling instruction for the first hardware device.

[0087] Specifically, in order to use the local service, an external service interface can be provided for the local service. By registering the Binder service, the service interface can be the service interface of the Binder service. Then, the target operating system can obtain the calling instruction for the first hardware device through the provided service interface.

[0088] After obtaining the calling instruction, it can be sent to the physical terminal associated with the cloud terminal. After receiving the calling instruction, the physical terminal can further call the second hardware device corresponding to the first hardware device.

[0089] Step 204, obtaining device data of the second hardware device from the physical terminal, and sending the device data to the local service through the provided service interface, so that the target operating system obtains the device data.

[0090] After the physical terminal calls the local second hardware device, the device data of the second hardware device can be obtained. For example, by calling the camera to take a picture, the picture data taken by the camera can be obtained. The physical terminal can feed back the device data of the second hardware device to the target operating system of the cloud terminal.

[0091] Specifically, since an external service interface is provided for the local service, such as a service interface of a Binder service, after obtaining the device data, the device data can be injected into the local service through the provided service interface, and the target operating system can then obtain the device data.

[0092] Reference Figure 3 , shows a flowchart of another terminal simulation method provided by an embodiment of the present invention, which may specifically include the following steps:

[0093] Step 301, in the target container constructed by the cloud server, run the target operating system for the cloud terminal, and in the target container, simulate the first hardware device corresponding to the cloud terminal, an agent based on streaming technology is deployed in the target container, and a client based on streaming technology is deployed in the physical terminal.

[0094] In order to simulate the physical terminal in the cloud, a target container can be built in the cloud server, and then the target operating system of the cloud terminal can be run in the target container. The target operating system can be an Android operating system, and the target container can be an Android container. Specifically, the target container can be a Docker container.

[0095] Due to the limitations of the hardware configuration in the cloud server where the cloud terminal is deployed, the cloud terminal is usually not configured with corresponding hardware devices. In order to avoid the impact of unconfigured hardware devices on the cloud terminal, the first hardware device corresponding to the cloud terminal can be simulated in the target container through HAL. The first hardware device is a virtual device, which can be an external device of the cloud terminal. For example, the first hardware device can be a WIFI device, a SIM card, a camera, a microphone, a GPS device, a sensor, a battery, a vibration regulator and other devices.

[0096] Step 302, obtain the target operating system's call instruction for the first hardware device, and send the call instruction to the corresponding client in the physical terminal associated with the cloud terminal through the agent in the target container, so that the physical terminal calls the second hardware device corresponding to the first hardware device, and the second hardware device is the physical hardware device.

[0097] During the use of the cloud terminal, such as when the user plays a cloud game through the cloud terminal, the user can control the cloud terminal on the physical terminal side. In response to the user operation, the cloud terminal can call the simulated first hardware device through the deployed target operating system. For example, to control the cloud terminal to turn on the camera, the target operating system needs to call the simulated camera, and then obtain the target operating system's calling instruction for the first hardware device.

[0098] After obtaining the calling instruction, it can be sent to the physical terminal associated with the cloud terminal. After receiving the calling instruction, the physical terminal can further call the second hardware device corresponding to the first hardware device.

[0099] Specifically, in order to communicate with the physical terminal, an agent based on streaming technology can be deployed in the target container, and a client based on streaming technology can be deployed in the physical terminal. After obtaining the call instruction, the cloud terminal can send the call instruction to the corresponding client in the physical terminal associated with the cloud terminal through the agent in the target container based on streaming technology.

[0100] Step 303: Obtain device data of the second hardware device from the corresponding client in the physical terminal through the agent in the target container, and feed the device data back to the target operating system.

[0101] After the physical terminal calls the local second hardware device, the device data of the second hardware device can be obtained. For example, by calling the camera to take a picture, the picture data taken by the camera can be obtained. The physical terminal can feed back the device data of the second hardware device to the target operating system of the cloud terminal.

[0102] Specifically, since a proxy based on streaming technology can be deployed in the target container and a client based on streaming technology can be deployed in the physical terminal, the physical terminal can send the device data of the second hardware device to the proxy in the target container through the client based on streaming technology.

[0103] Reference Figure 4 , shows a flowchart of another terminal simulation method provided by an embodiment of the present invention, which may specifically include the following steps:

[0104] Step 401, in the target container constructed by the cloud server, run the target operating system for the cloud terminal, and in the target container, simulate the first hardware device corresponding to the cloud terminal, an agent based on streaming technology is deployed in the target container, and a client based on streaming technology is deployed in the physical terminal.

[0105] In order to simulate the physical terminal in the cloud, a target container can be built in the cloud server, and then the target operating system of the cloud terminal can be run in the target container. The target operating system can be an Android operating system, and the target container can be an Android container. Specifically, the target container can be a Docker container.

[0106] Due to the limitations of the hardware configuration in the cloud server where the cloud terminal is deployed, the cloud terminal is usually not configured with corresponding hardware devices. In order to avoid the impact of unconfigured hardware devices on the cloud terminal, the first hardware device corresponding to the cloud terminal can be simulated in the target container through HAL. The first hardware device is a virtual device, which can be an external device of the cloud terminal. For example, the first hardware device can be a WIFI device, a SIM card, a camera, a microphone, a GPS device, a sensor, a battery, a vibration regulator and other devices.

[0107] Step 402: In the target container or cloud server, a local service for the cloud terminal is simulated, and the first hardware device and the local service interact and communicate with each other through a Socket mechanism.

[0108] In order to communicate with the simulated first hardware device, a local service for the cloud terminal may be simulated. Specifically, a local service for the cloud terminal (Simulation Service) may be simulated in a target container. The first hardware device and the local service may communicate interactively through a Socket mechanism.

[0109] Of course, the local service for the cloud terminal can also be simulated in the host server where the cloud terminal is located, and multiple containers in the cloud server can share the local service through the socket network.

[0110] Step 403: Obtain a call instruction of the target operating system to the first hardware device from the local service through the provided service interface.

[0111] During the use of the cloud terminal, such as when the user plays a cloud game through the cloud terminal, the user can control the cloud terminal on the physical terminal side. In response to the user operation, the cloud terminal can call the simulated first hardware device through the deployed target operating system. For example, to control the cloud terminal to turn on the camera, the target operating system needs to call the simulated camera, and then obtain the target operating system's calling instruction for the first hardware device.

[0112] Specifically, in order to use the local service, an external service interface can be provided for the local service. By registering the Binder service, the service interface can be the service interface of the Binder service. Then, the target operating system can obtain the calling instruction for the first hardware device through the provided service interface.

[0113] Step 404, sending a call instruction to a corresponding client in a physical terminal associated with the cloud terminal through the proxy in the target container, so that the physical terminal calls a second hardware device corresponding to the first hardware device, where the second hardware device is a physical hardware device.

[0114] After obtaining the calling instruction, it can be sent to the physical terminal associated with the cloud terminal. After receiving the calling instruction, the physical terminal can further call the second hardware device corresponding to the first hardware device.

[0115] Specifically, in order to communicate with the physical terminal, an agent based on streaming technology can be deployed in the target container, and a client based on streaming technology can be deployed in the physical terminal. After obtaining the call instruction, the cloud terminal can send the call instruction to the corresponding client in the physical terminal associated with the cloud terminal through the agent in the target container based on streaming technology.

[0116] Step 405 , obtaining device data of the second hardware device from the corresponding client in the physical terminal through the proxy in the target container.

[0117] After the physical terminal calls the local second hardware device, the device data of the second hardware device can be obtained. For example, by calling the camera to take a picture, the picture data taken by the camera can be obtained. The physical terminal can feed back the device data of the second hardware device to the target operating system of the cloud terminal.

[0118] Specifically, since a proxy based on streaming technology can be deployed in the target container and a client based on streaming technology can be deployed in the physical terminal, the physical terminal can send the device data of the second hardware device to the proxy in the target container through the client based on streaming technology.

[0119] Step 406: Send the device data to the local service through the provided service interface, so that the target operating system obtains the device data.

[0120] After the physical terminal calls the local second hardware device, the device data of the second hardware device can be obtained. For example, by calling the camera to take a picture, the picture data taken by the camera can be obtained. The physical terminal can feed back the device data of the second hardware device to the target operating system of the cloud terminal.

[0121] Specifically, since an external service interface is provided for the local service, such as a service interface of a Binder service, after obtaining the device data, the device data can be injected into the local service through the provided service interface, and the target operating system can then obtain the device data.

[0122] The following combination Figure 5 and Figure 6The present invention is exemplified as follows:

[0123] exist Figure 5 and Figure 6 In the host kernel of the cloud server, resource isolation functions (such as Namespace in Linux), control groups (CGroups), and Union File System (UnionFS) are provided. On this basis, an external service interface is provided for local services. Binder driver virtualization (with Binder1 and Binder2) and multi-touch virtualization (with Input1 and Inpit2) can be set up by registering Binder services. On the basis of the host kernel, a cloud terminal for mobile phones is built, which has containers AIC1 and AIC2.

[0124] Each AIC has multiple APPs, such as various types of APPs such as games.

[0125] In AIC1 and AIC2, the first hardware device corresponding to the cloud terminal is simulated, that is, the HAL layer hardware device simulation, which may include devices such as WIFI devices, SIM cards, cameras, microphones, GPS devices, sensors, batteries, vibration regulators, etc. The APP communicates with the HAL layer hardware device simulation through the Android Firewall (Android Framework).

[0126] exist Figure 5 In AIC1 and AIC2, local services for cloud terminals are simulated, that is, mobile phone simulation local services (Simulation Service), and Figure 6 In the example, local services for cloud terminals are simulated based on the host core outside the container. AIC1 and AIC2 are shared. The mobile phone simulates local services and interacts with the HAL layer hardware device simulation through the local Unix Socket.

[0127] In addition, AIC1 and AIC2 are also equipped with a mobile phone simulation SDK (Java version) and a streaming Agent, and a terminal streaming APK is provided on the mobile phone side, which can be connected to hardware devices such as mobile phone cards, GPS, cameras, microphones, and various sensors.

[0128] In the process of calling the hardware device in the cloud terminal, the mobile phone simulates the local service Simulation Service and the HAL layer hardware device simulation through Socket, and communicates with the mobile phone simulation SDK through the Binder service interface, sending the call instruction to the mobile phone simulation SDK, which is then sent by the mobile phone simulation SDK to the terminal streaming APK on the mobile phone via the streaming agent (Agent).

[0129] In the process of obtaining device data on the mobile phone, the mobile phone sends the device data to the streaming agent through the terminal streaming APK, which is then obtained by the mobile phone simulation SDK and injected into the mobile phone simulation local service through the Binder service interface.

[0130] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0131] Reference Figure 7 , shows a schematic diagram of the structure of a terminal simulation device provided by an embodiment of the present invention, which may specifically include the following modules:

[0132] The first hardware device simulation module 701 can be used to run a target operating system for the cloud terminal in a target container constructed by the cloud server, and simulate a first hardware device corresponding to the cloud terminal in the target container.

[0133] The calling instruction sending module 702 can be used to obtain the calling instruction of the target operating system for the first hardware device, and send the calling instruction to the physical terminal associated with the cloud terminal, so that the physical terminal calls the second hardware device corresponding to the first hardware device, and the second hardware device is a physical hardware device.

[0134] The device data acquisition module 703 may be used to acquire the device data of the second hardware device from the physical terminal, and feed the device data back to the target operating system.

[0135] In one embodiment of the present invention, the method may further include:

[0136] The local service simulation module can be used to simulate local services for cloud terminals in the target container or cloud server.

[0137] In an embodiment of the present invention, the first hardware device and the local service may perform interactive communication via a Socket mechanism.

[0138] In one embodiment of the present invention, the calling instruction sending module 702 may include:

[0139] The interface acquisition calling instruction submodule can be used to obtain the calling instruction of the target operating system to the first hardware device from the local service through the provided service interface.

[0140] In one embodiment of the present invention, the device data acquisition module 703 may include:

[0141] The interface acquisition device data submodule can be used to send device data to the local service through the provided service interface so that the target operating system can obtain the device data.

[0142] In one embodiment of the present invention, the service interface may be a service interface of a Binder service.

[0143] In an embodiment of the present invention, a proxy based on streaming technology may be deployed in the target container, a client based on streaming technology may be deployed in the entity terminal, and the calling instruction sending module 702 may include:

[0144] The streaming sending call instruction submodule can be used to send the call instruction to the corresponding client in the physical terminal associated with the cloud terminal through the proxy terminal in the target container.

[0145] In one embodiment of the present invention, the device data acquisition module 703 may include:

[0146] The streaming device data acquisition submodule may be used to acquire the device data of the second hardware device from the corresponding client in the physical terminal through the proxy in the target container.

[0147] In an embodiment of the present invention, the target container may be a Docker container, and the target operating system may be an Android operating system.

[0148] In an embodiment of the present invention, a target operating system for a cloud terminal is run in a target container constructed by a cloud server, and a first hardware device corresponding to the cloud terminal is simulated in the target container. Then, a call instruction of the target operating system to the first hardware device is obtained, and the call instruction is sent to a physical terminal associated with the cloud terminal, so that the physical terminal calls a second hardware device corresponding to the first hardware device, and then obtains device data of the second hardware device from the physical terminal, and feeds the device data back to the target operating system, thereby simulating hardware devices in the cloud terminal and using real device data of the hardware devices in the physical terminal, thereby improving the user experience of the cloud terminal and its compatibility with application programs.

[0149] An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the terminal simulation method as described above is implemented.

[0150] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the terminal simulation method as described above is implemented.

[0151] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0152] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0153] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0154] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0155] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0157] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0158] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0159] The above provides a detailed introduction to a terminal simulation method and device. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A terminal simulation method, characterized in that: The method comprises: In a target container constructed by a cloud server, an emulator and a target operating system for a cloud terminal are run, and in the target container, a first hardware device corresponding to the cloud terminal is simulated; wherein the target container is a Docker container, the target operating system is an Android operating system, and the emulator is an Android emulator; Obtaining, through the simulator, a call instruction of the target operating system to the first hardware device, and sending the call instruction to a physical terminal associated with the cloud terminal, so that the physical terminal calls a second hardware device corresponding to the first hardware device, where the second hardware device is a physical hardware device; The device data of the second hardware device is obtained from the physical terminal through the simulator, and the device data is fed back to the target operating system.

2. The method according to claim 1, characterized in that Before obtaining the call instruction of the target operating system to the first hardware device, the method further includes: In the target container or the cloud server, a local service for the cloud terminal is simulated.

3. The method according to claim 2, characterized in that The first hardware device and the local service communicate interactively via a Socket mechanism.

4. The method according to claim 3, characterized in that The obtaining the calling instruction of the target operating system to the first hardware device includes: Obtaining, from the local service, a call instruction of the target operating system to the first hardware device through the provided service interface; Feeding back the device data to the target operating system includes: The device data is sent to the local service through the provided service interface, so that the target operating system obtains the device data.

5. The method according to claim 4, characterized in that The service interface is the service interface of the Binder service.

6. The method according to any one of claims 1 to 5, characterized in that: The target container is deployed with a proxy terminal based on streaming technology, the physical terminal is deployed with a client terminal based on streaming technology, and the step of sending the call instruction to the physical terminal associated with the cloud terminal includes: Sending the call instruction to a corresponding client in a physical terminal associated with the cloud terminal through the proxy terminal in the target container; The acquiring the device data of the second hardware device from the physical terminal includes: The device data of the second hardware device is obtained from the corresponding client in the physical terminal through the proxy in the target container.

7. A terminal emulation device, characterized in that: The device comprises: A first hardware device simulation module is used to run a simulator and a target operating system for a cloud terminal in a target container constructed by a cloud server, and to simulate a first hardware device corresponding to the cloud terminal in the target container; wherein the target container is a Docker container, the target operating system is an Android operating system, and the simulator is an Android simulator; A calling instruction sending module, used to obtain, through the simulator, a calling instruction of the target operating system for the first hardware device, and send the calling instruction to a physical terminal associated with the cloud terminal, so that the physical terminal calls a second hardware device corresponding to the first hardware device, where the second hardware device is a physical hardware device; The device data acquisition module is used to acquire the device data of the second hardware device from the physical terminal through the simulator, and feed the device data back to the target operating system.

8. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the terminal emulation method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the terminal emulation method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Cloud container and man-machine interaction method and device based on cloud container

    CN114116124A