CN112328356A - Android and Windows intercommunication method and device, storage medium and computer equipment - Google Patents

Android and Windows intercommunication method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN112328356A
CN112328356A CN202011129647.6A CN202011129647A CN112328356A CN 112328356 A CN112328356 A CN 112328356A CN 202011129647 A CN202011129647 A CN 202011129647A CN 112328356 A CN112328356 A CN 112328356A
Authority
CN
China
Prior art keywords
android
virtual
windows
target
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011129647.6A
Other languages
Chinese (zh)
Other versions
CN112328356B (en
Inventor
郑家超
刘程
宋治波
王伟民
胡燚
田野
何世伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Anyixun Technology Co ltd
Original Assignee
Chengdu Anyixun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Anyixun Technology Co ltd filed Critical Chengdu Anyixun Technology Co ltd
Priority to CN202011129647.6A priority Critical patent/CN112328356B/en
Publication of CN112328356A publication Critical patent/CN112328356A/en
Application granted granted Critical
Publication of CN112328356B publication Critical patent/CN112328356B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses an intercommunication method and device of Android and Windows, a storage medium and computer equipment, wherein the method comprises the following steps: determining target virtual hardware for converting the QEVent event into a target instruction according to the event type identifier in the received QEVent event; and the target virtual hardware sends the target instruction to a virtual hardware driver of the Android of the virtual machine through a VirtIO interface, and the virtual hardware driver is used for analyzing the target instruction and sending the target instruction to the Android frame layer of the virtual machine. By means of the method and the device, the intercommunication performance of the Android and the Windows can be effectively improved by means of the advantages of the VirtIO interface on the IO performance of the virtual machine, so that the intercommunication performance is close to the IO performance of the physical machine, the operation efficiency of the simulator is improved, and the problems that the data interaction between the Android and the Windows is delayed greatly and a network port needs to be occupied are solved.

Description

Android and Windows intercommunication method and device, storage medium and computer equipment
Technical Field
The present application relates to the field of network security technologies, and in particular, to a method, an apparatus, a storage medium, and a computer device for interworking between Android and Windows.
Background
With the development of intelligent terminal devices and the rise of mobile internet, more and more users use mobile terminal devices, and in order to better meet the user demands, a large number of application manufacturers begin to develop applications based on mobile devices. The Android system occupies most market share in mobile equipment, but the current Android-based mobile terminal equipment still cannot meet various requirements of users in the aspects of privacy protection, hardware performance, battery capacity, charging technology and the like.
The existing solution is to realize data interaction between Android of a virtual machine and Windows of a physical machine based on traditional communication methods such as UDP, TCP and the like, but the traditional communication methods adopting UDP, TCP and the like have the following defects: the data interaction between the Android of the virtual machine and the Windows of the physical machine is delayed greatly, and a network port needs to be occupied.
Disclosure of Invention
In view of this, the application provides an interworking method, device, storage medium and computer device for Android and Windows, which can effectively solve the technical problems that data interaction between Android of the existing virtual machine and Windows of the physical machine is delayed greatly and a network port needs to be occupied.
According to one aspect of the application, an interworking method of Android and Windows is provided, which includes:
determining target virtual hardware for converting the QEVent event into a target instruction according to the event type identifier in the received QEVent event;
and the target virtual hardware sends the target instruction to a virtual hardware driver of the Android of the virtual machine through a VirtIO interface, and the virtual hardware driver is used for analyzing the target instruction and sending the target instruction to the Android frame layer of the virtual machine.
According to another aspect of the present application, there is provided an interworking method between Android and Windows, including:
sending a target instruction from an Android frame layer of the virtual machine to a virtual hardware driver of the Android of the virtual machine;
and the virtual hardware driver of the Android of the virtual machine sends a target instruction to target virtual hardware of Windows through a VirtIO interface, and the target virtual hardware is used for sending the target instruction to a target process of Windows based on a PIPE interface protocol.
According to another aspect of the present application, there is provided an interworking device between Android and Windows, including:
the determining module is used for determining target virtual hardware for converting the QEVent event into a target instruction according to the event type identifier in the received QEVent event;
the first sending module is used for sending the target instruction to a virtual hardware driver of the Android of the virtual machine through the VirtIO interface by the target virtual hardware, and the virtual hardware driver is used for analyzing the target instruction and sending the target instruction to the Android frame layer of the virtual machine.
According to another aspect of the present application, there is provided an interworking device between Android and Windows, including:
the receiving module is used for sending the target instruction from the Android frame layer of the virtual machine to the virtual hardware drive of the Android of the virtual machine;
and the second sending module is used for sending the target instruction to target virtual hardware of Windows through a VirtIO interface by the virtual hardware driver of the Android of the virtual machine, and the target virtual hardware is used for sending the target instruction to a target process of Windows based on a PIPE interface protocol.
According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and the program, when executed by a processor, implements the above method for interworking Android with Windows.
According to another aspect of the present application, a computer device is provided, which includes a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, where the processor implements the above method for interworking Android and Windows when executing the program.
According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and the program, when executed by a processor, implements the above method for interworking Android with Windows.
According to another aspect of the present application, a computer device is provided, which includes a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, where the processor implements the above method for interworking Android and Windows when executing the program.
By means of the technical scheme, the Android and Windows intercommunication method, the Android and Windows intercommunication device, the storage medium and the computer equipment determine target virtual hardware for converting a QEVent event into a target instruction according to an event type identifier in the received QEVent event; and the target virtual hardware sends the target instruction to a virtual hardware driver of the Android of the virtual machine through a VirtIO interface, and the virtual hardware driver is used for analyzing the target instruction and sending the target instruction to the Android frame layer of the virtual machine. The physical machine Windows in the application can determine target virtual hardware for converting the QEVent event into a corresponding target instruction by analyzing the event type corresponding to the QEVent event so as to send the QEVent event to the target virtual hardware, and the target virtual hardware sends the corresponding target instruction to the virtual hardware driver of the virtual machine Android through the VirtiO interface.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 shows a schematic flowchart of an interworking method between Android and Windows provided in an embodiment of the present application;
fig. 2 shows a communication architecture diagram of an interworking method between Android and Windows provided in an embodiment of the present application;
fig. 3 is a flowchart illustrating another Android and Windows interworking method provided in the embodiment of the present application;
fig. 4(a) shows a touch screen communication architecture diagram of another Android and Windows interworking method provided by an embodiment of the present application;
fig. 4(b) shows a keyboard communication architecture diagram of another Android and Windows interworking method provided by the embodiment of the present application;
fig. 5 is a flowchart illustrating another Android and Windows interworking method provided in the embodiment of the present application;
fig. 6 is a flowchart illustrating another Android and Windows interworking method provided in the embodiment of the present application;
fig. 7 is a flowchart illustrating another Android and Windows interworking method provided in the embodiment of the present application;
fig. 8 is a diagram illustrating a GPU communication architecture of another Android and Windows interworking method provided by an embodiment of the present application;
fig. 9 is a schematic structural diagram illustrating an interworking device between Android and Windows provided in an embodiment of the present application;
fig. 10 is a schematic structural diagram illustrating another Android and Windows interworking device provided in the embodiment of the present application;
fig. 11 is a schematic structural diagram illustrating another Android and Windows interworking device provided in the embodiment of the present application;
fig. 12 is a schematic structural diagram of another Android and Windows interworking device provided in the embodiment of the present application.
Detailed Description
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
The method aims at the technical problems that the data interaction between the Android of the virtual machine and the Windows of the physical machine is delayed greatly and a network port needs to be occupied. The embodiment provides an Android and Windows intercommunication method, which can effectively improve the Android and Windows intercommunication performance, so that the intercommunication performance is close to the IO performance of a physical machine, and the running efficiency of a simulator is improved.
As shown in fig. 1 and 2, this embodiment is a method for implementing communication from a physical machine Windows to a virtual machine Android direction based on a communication architecture between the virtual machine Android and the physical machine Windows, where the method includes:
step 101, according to the event type identifier in the received Qevent, determining a target virtual hardware for converting the Qevent into a target instruction.
In this embodiment, the logical operation of the virtual hardware is implemented on the Windows side of the physical machine, that is, the event type identifier corresponding to the qvent event is obtained by analyzing the received qvent event, so as to determine that the qvent event is event information generated by the keyboard or mouse hardware. After the event type identifier in the Qevent is determined, corresponding operation information in the Qevent is converted into operation events (touch screen events and keyboard events) corresponding to the corresponding operation information (key information and mouse information), and the operation events are sent to corresponding target virtual hardware, so that the corresponding target virtual hardware can generate corresponding target instructions. The target virtual hardware is a virtual keyboard and a virtual touch screen, so that a virtual communication link of input and output equipment based on the type of the target virtual hardware is established, and the communication efficiency between the Android of the virtual machine and the Windows of the physical machine is effectively improved.
And 102, the target virtual hardware sends the target instruction to a virtual hardware driver of the Android of the virtual machine through a VirtiO interface, and the virtual hardware driver is used for analyzing the target instruction and sending the target instruction to the Android frame layer of the virtual machine.
In this embodiment, through a communication link (a communication link between the target virtual hardware and the Android of the virtual machine) established based on the communication interface VirtIO, the target virtual hardware sends the target instruction to a virtual hardware driver of the Android of the virtual machine, that is, an occupancy driver, and the virtual hardware driver analyzes the received target instruction according to a standard information format required by the Android of the virtual machine, and feeds back instruction information in the standard information format conforming to the Android requirement to the Android framework layer of the virtual machine, so as to implement calling of the reporting API, and further sends the instruction information to the application layer. The virtual hardware drive of the relevant target virtual hardware is realized on the Android side of the virtual machine in advance, and the virtual hardware drive does not depend on hardware and only depends on a communication interface VirtiO.
By applying the technical scheme of the embodiment, the physical machine Windows can convert the QEVent event into the corresponding operation event by analyzing the event type corresponding to the QEVent event and send the operation event to the target virtual hardware, so that the target virtual hardware can generate the corresponding target instruction according to the corresponding operation event and then send the corresponding target instruction to the virtual hardware driver of the virtual machine Android through the VirtiO interface.
Further, as a refinement and an extension of the specific implementation of the above embodiment, in order to fully describe the specific implementation process of the embodiment, another method for interworking between Android and Windows is provided, as shown in fig. 3 and 4, this embodiment is a method for implementing communication from Windows of a physical machine to Android of the virtual machine based on a communication architecture between Android of the virtual machine and Windows of the physical machine, and in particular, a method for communicating event information generated by keyboard hardware, where the method includes:
step 201, if the event type identifier is a keyboard identifier, determining a target virtual hardware for converting the QEvent into a target instruction according to the event type identifier in the received QEvent; the event types comprise a keyboard and a mouse.
In the foregoing embodiment, in order to illustrate a specific implementation process of step 201, as an optional manner, step 201 includes:
step 2011: and converting the key information in the Qevent and then sending the key information to a virtual touch screen or a virtual keyboard.
Step 2012: and if the virtual touch screen is sent to the virtual touch screen, the virtual touch screen generates a corresponding touch screen instruction based on a preset communication protocol.
Step 2013: and if the command is sent to the virtual keyboard, the virtual keyboard generates a corresponding keyboard command based on a preset communication protocol.
In the above embodiment, to illustrate a specific implementation process of step 2011, as an optional manner, step 2011 includes: whether the key information exists in a preset scene configuration table or not is inquired, and the converted key information is sent to a virtual touch screen or a virtual keyboard, and the method specifically comprises the following steps: if the key information exists in the preset scene configuration table, converting the key information into a touch screen event and sending the touch screen event to a virtual touch screen or converting the key information into a keyboard event and sending the keyboard event to a virtual keyboard according to the preset scene configuration table; and if the key information does not exist in the preset scene configuration table, converting the key information into a keyboard event and sending the keyboard event to a virtual keyboard.
In specific implementation, when an event type identifier in a QEvent received by a Windows of a physical machine is a keyboard identifier, acquiring key information in the QEvent, and determining whether the QEvent is a touch screen event or a keyboard event by querying whether the key information exists in a preset scene configuration table corresponding to a current application program, where the preset scene configuration table is a corresponding relationship table of the key information and the touch screen event or the keyboard event, as shown in fig. 4(a), if the key information is in the scene configuration table, for example, the key information in the QEvent is acquired as a key a and a key pressing/lifting state, converting the key information into an Android touch screen event according to the corresponding relationship between the key a in the preset scene configuration table and the Android touch screen event, and sending the Android touch screen event to a virtual touch screen. Specifically, according to a preset scene configuration condition of a key A in a scene configuration table, it is determined that a target object moves to the left, so that key information is converted into a touch screen event and is sent to a virtual touch screen, the virtual touch screen performs logical operation on the touch screen event, and a touch screen instruction (including coordinate point information of an Android screen and a key pressing/lifting state) that the target object moves to the left for a certain distance is generated based on a preset communication protocol, so that conversion of the touch screen event is achieved. The touch screen pressing and lifting definition in the preset communication protocol is that the touch screen is pressed: MSMPRT: [ slot ]: y ]; lifting a touch screen: MSMTER [ slot ].
Acquiring key information in the Qevent according to the requirements of an actual application scene, converting the key information into an Android keyboard event according to the corresponding relation between the key information in a preset scene configuration table and the Android keyboard event, and sending the Android keyboard event to a virtual keyboard, wherein the application scene is not specifically limited.
According to the requirements of an actual application scene, if the key information is a screen sliding operation (a set of a series of key operations), obtaining a screen sliding start-stop coordinate point [ x1, y1], [ x2, y2] and a screen sliding duration T according to a scene configuration condition of the key information (screen sliding operation) in a scene configuration table, carrying out interpolation calculation on the screen sliding operation to obtain each coordinate point, sending a touch screen event which is converted into a touch screen pressing state to a virtual touch screen until the coordinate point [ x2, y2], sending the touch screen event which is converted into a touch screen lifting state to the virtual touch screen, and respectively generating corresponding touch screen instructions according to the series of touch screen events based on a preset communication protocol by the virtual touch screen to simulate the screen sliding event and realize the conversion of the screen sliding event.
Correspondingly, if the key information is not in the scene configuration table, it indicates that the QEvent is a keyboard event, and the QEvent is not converted into a touch event, and directly sends the key information to the virtual keyboard, as shown in fig. 4(b), the virtual keyboard performs logical operation on the keyboard event, and generates a keyboard instruction based on a preset communication protocol, where the keyboard event in the preset communication protocol is defined as a keyboard pressed: KBDPR [ keyCode ]; lifting the keyboard: KBDRE: [ keyCode ].
According to the requirements of the actual application scene, if the key information is character input, identifying the Windows side as English input or Chinese input; if the character input is English input, directly sending the character input to a virtual keyboard according to a keyboard event, and generating a corresponding keyboard instruction by the virtual keyboard; and if the character input is Chinese input, sending the received character string to the Android of the virtual machine through Netlink so that the Android of the virtual machine informs the application process to fill the input box according to the received character string. Wherein the definition of the character input in the preset communication protocol is [ size ] [ character string of input ].
In addition, if the key information is stored in the scene configuration table, the key information may also be converted into a text input event according to the scene configuration table, where the correspondence relationship and the scene conversion function in the scene configuration table are not specifically limited.
Step 202, if the target virtual hardware is a virtual touch screen, sending a corresponding touch screen instruction to a virtual touch screen driver of the Android of the virtual machine through a virtual touch screen driving communication link established based on the VirtiO interface.
Step 203, if the target virtual hardware is a virtual keyboard, sending a corresponding keyboard instruction to a virtual keyboard driver of the Android of the virtual machine through a virtual keyboard driver communication link established based on the virtoi interface.
In specific implementation, based on a PIPE interface protocol, sending a corresponding touch screen event or a keyboard event to a VirtualBox process on a Windows side, after a virtual hardware (a virtual touch screen or a virtual keyboard) of a simulator in the VirtualBox process generates a corresponding touch screen instruction or a keyboard instruction according to the received touch screen event or keyboard event, forwarding the touch screen instruction or the keyboard instruction to an occupancy driver (a virtual touch screen driver or a virtual keyboard driver) of the Android of the virtual machine through a virtual touch screen driving communication link or a virtual keyboard driving communication link established based on a virtorio interface.
Further, the placeholder driver (a virtual touch screen driver or a virtual keyboard driver) performs character string analysis on the received touch screen instruction or keyboard instruction, obtains instruction information according to a standard information format requirement of an Input SubSystem (Input SubSystem), and reports the instruction information to a virtual machine Android framework layer (Android framework layer), and the virtual machine Android framework layer reports the received instruction information to an application layer to complete corresponding processing operation. Therefore, compared with the traditional virtual hardware drive which needs to perform logic operation on the QEVent event and perform instruction analysis, the resource consumption of the CPU of the Android of the virtual machine can be effectively reduced.
By applying the technical scheme of the embodiment, various mobile-end application programs can be run efficiently under the condition that the communication performance of the Windows end of the physical machine is not required, namely, the corresponding operations of the Android of the virtual machine, especially the corresponding operations and the audio/video input/output (corresponding to the data communication between the Android of the virtual machine and the Windows of the physical machine) in the game running environment are controlled in a simulation mode through hardware equipment of the Windows end of the physical machine. In addition, by means of the advantages of the VirtIO interface in the IO performance of the virtual machine, a memory mechanism is shared, information copying is reduced, occupation of a CPU is reduced, compared with the traditional communication methods such as UDP (user Datagram protocol) and TCP (Transmission control protocol), a protocol stack can be prevented from being executed, the encoding and decoding processes can be reduced, occupation of a host network port can be avoided, and conflict with other applications occupying the network port can be reduced.
In the foregoing embodiment, based on a communication architecture between the virtual machine Android and the physical machine Windows, a method for implementing communication from the physical machine Windows to the virtual machine Android is implemented, as shown in fig. 5, and in particular, based on a communication method of event information generated by mouse hardware, the method further includes:
step 204: and if the event type identifier is a mouse identifier, determining a virtual touch screen for converting the QEVent event into a touch screen instruction or a virtual keyboard for converting the QEVent event into a keyboard instruction by converting mouse information in the QEVent event.
Step 205: the virtual touch screen transmits a corresponding touch screen instruction to a virtual touch screen driver of the Android of the virtual machine through a virtual touch screen driver communication link established based on the VirtIO interface; or the virtual keyboard sends the corresponding keyboard instruction to the virtual keyboard driver of the Android of the virtual machine through a virtual keyboard driver communication link established based on the VirtiO interface.
In specific implementation, when an event type identifier in a QEvent received by a physical machine Windows is a mouse identifier, obtaining mouse information (mouse button information or mouse wheel information) in the QEvent, taking the mouse wheel information as an example, converting the current position of the mouse into a coordinate point [ x, y ] of an Android screen according to a scene configuration condition of the mouse wheel information in a scene configuration table, and determining starting and stopping coordinates [ x, y1], [ x, y2] and a screen sliding direction of the sliding screen, so as to obtain the mouse wheel event and send the mouse wheel event to a virtual touch screen, so that the virtual touch screen generates a corresponding touch screen instruction based on a preset communication protocol, thereby simulating a screen sliding operation and realizing conversion of the screen sliding operation.
According to the requirements of the actual application scene, if the mouse button information in the scene configuration table corresponds to the keyboard event, the mouse button information is converted into the keyboard event according to the scene configuration conditions of the mouse button information in the scene configuration table and is sent to the virtual keyboard, so that the virtual keyboard generates a corresponding keyboard instruction based on a preset communication protocol, and the corresponding relation and the scene conversion function in the scene configuration table are not specifically limited.
By applying the technical scheme of the embodiment, the physical machine Windows can convert the QEVent event into the corresponding operation event by analyzing the event type corresponding to the QEVent event and send the operation event to the target virtual hardware, so that the target virtual hardware can generate the corresponding target instruction according to the corresponding operation event and then send the corresponding target instruction to the virtual hardware driver of the virtual machine Android through the VirtiO interface.
The embodiment provides an Android and Windows intercommunication method, which can effectively improve the Android and Windows intercommunication performance, so that the intercommunication performance is close to the IO performance of a physical machine, and the running efficiency of a simulator is improved. As shown in fig. 6, this embodiment is a method for implementing communication from the Android of the virtual machine to the Windows of the physical machine based on a communication architecture between the Android of the virtual machine and the Windows of the physical machine, where the method includes:
step 301: and sending the target instruction from the Android frame layer of the virtual machine to a virtual hardware driver of the Android of the virtual machine.
Step 302: and the virtual hardware driver of the Android of the virtual machine sends a target instruction to target virtual hardware of Windows through a VirtIO interface, and the target virtual hardware is used for sending the target instruction to a target process of Windows based on a PIPE interface protocol.
In this embodiment, the virtual machine Android framework layer sends the received rendering instruction (e.g., [ code ] [ size ] [ param1] [ param2]) to the placeholder driver (GPU driver), that is, by calling the placeholder driver (GPU driver) interface, forwards the rendering instruction to the virtual hardware (virtual GPU) of the simulator in the Windows side VirtualBox process via the communication link established based on the virrtio interface, that is, the communication link (GPU driver communication link) between the virtual machine Android and the target virtual hardware, so that the virtual hardware (virtual GPU) is sent to the rendering process of Windows based on the PIPE interface protocol, and thus executes the corresponding rendering instruction using the hardware resources, and feeds back the corresponding execution result to the virtual machine Android in the same communication manner.
Because the virtual machine Android is drawn by the GPU through the OpenGL ES, by applying the technical scheme of the embodiment, the OpenGL ES/EGL function of the virtual machine Android can be simulated by establishing a communication bridge between the OpenGL ES and the EGL and utilizing the OpenGL/WGL interface of the physical machine Windows, so that the drawing and the output of the internal image of the virtual machine Android in the simulator can be realized by utilizing the GPU computing resource of the physical machine Windows.
Further, as a refinement and an extension of the specific implementation of the above embodiment, in order to fully describe the specific implementation process of the embodiment, an interworking method between Android and Windows is provided, as shown in fig. 7 and 8, the method includes:
step 401: sending a target instruction from an Android frame layer of the virtual machine to a virtual hardware driver of the Android of the virtual machine; the target instruction is a rendering instruction, and the virtual hardware drive of the Android of the virtual machine is a GPU drive.
Step 402: and through a GPU drive communication link established based on a VirtiO interface, the GPU drive of the Android of the virtual machine sends a rendering instruction to a virtual GPU of Windows, and the virtual GPU is used for sending the rendering instruction to a rendering process of Windows based on a PIPE interface protocol.
By applying the technical scheme of the embodiment, the received rendering instruction is sent to the virtual GPU of Windows by the virtual machine Android through the GPU drive communication link established based on the VirtIO interface, and therefore, by establishing the communication link from the virtual machine Android to Windows by means of the advantages of the VirtIO interface on the IO performance of the virtual machine, high-efficiency intercommunication between the Android and Windows can be achieved, the data communication performance is close to the IO performance of a physical machine, the operation efficiency of the simulator is effectively improved, and meanwhile the problems that the existing Android and Windows have large data interaction delay and need to occupy network ports are effectively solved.
In addition, the communication architecture between the Android of the virtual machine and the Windows of the physical machine in the embodiment has strong expansibility, is suitable for various data communications (such as a keyboard event, a mouse event, a touch event and a GPU event), and realizes non-interference of communication data while efficiently creating a communication link between the Windows of the physical machine and the Android of the virtual machine.
Further, as a specific implementation of the method shown in fig. 1 to 5, an embodiment of the present application provides an interworking device between Android and Windows, as shown in fig. 9, which is a device for implementing communication from a physical machine Windows to a virtual machine Android direction based on a communication architecture between the virtual machine Android and the physical machine Windows, and the device includes: a determination module 51 and a first sending module 52.
And the determining module 51 is configured to determine, according to the event type identifier in the received QEvent, target virtual hardware for converting the QEvent into a target instruction.
And a first sending module 52, configured to send, by the target virtual hardware, the target instruction to a virtual hardware driver of the Android of the virtual machine via the virtoi interface, where the virtual hardware driver is configured to analyze the target instruction and send the target instruction to the Android framework layer of the virtual machine.
In a specific application scenario, as shown in fig. 10, the event types include a keyboard and a mouse.
In a specific application scenario, if the event type identifier is a keyboard identifier, the determining module 51 specifically includes: a first conversion unit 511, a first generation unit 512, and a second generation unit 513.
And the first conversion unit 511 is configured to convert the key information in the QEvent and send the converted key information to a virtual touch screen or a virtual keyboard.
A first generating unit 512, configured to, if the virtual touch screen is sent to a virtual touch screen, generate, by the virtual touch screen, a corresponding touch screen instruction based on a preset communication protocol.
A second generating unit 513, configured to generate, if the virtual keyboard is sent to a virtual keyboard, a corresponding keyboard instruction based on a preset communication protocol by the virtual keyboard.
In a specific application scenario, the first conversion unit 511 is specifically configured to send the converted key information to a virtual touch screen or a virtual keyboard by querying whether the key information exists in a preset scenario configuration table, and specifically includes: if the key information exists in the preset scene configuration table, converting the key information into a touch screen event and sending the touch screen event to a virtual touch screen or converting the key information into a keyboard event and sending the keyboard event to a virtual keyboard according to the preset scene configuration table; and if the key information does not exist in the preset scene configuration table, converting the key information into a keyboard event and sending the keyboard event to a virtual keyboard.
In a specific application scenario, the first sending module 52 specifically includes: virtual touch screen driving unit 521 and virtual keyboard driving unit 522.
And the virtual touch screen driving unit 521 is configured to, if the target virtual hardware is a virtual touch screen, send a corresponding touch screen instruction to a virtual touch screen driver of the Android of the virtual machine through a virtual touch screen driving communication link established based on the VirtIO interface.
And the virtual keyboard driving unit 522 is configured to, if the target virtual hardware is a virtual keyboard, send a corresponding keyboard instruction to a virtual keyboard driver of the Android of the virtual machine through a virtual keyboard driver communication link established based on the virtoi interface.
In a specific application scenario, if the event type identifier is a mouse identifier, the determining module 51 specifically includes: a second conversion unit 514.
A second conversion unit 514, configured to determine, by converting the mouse information in the qvent event, a virtual touch screen for converting the qvent event into a touch screen instruction, or a virtual keyboard for converting the qvent event into a keyboard instruction.
The virtual touch screen driving unit 521 is further configured to send, by the virtual touch screen, a corresponding touch screen instruction to a virtual touch screen driver of the Android of the virtual machine through a virtual touch screen driver communication link established based on the virtoi interface;
the virtual keyboard driving unit 522 is further configured to send, by the virtual keyboard, a corresponding keyboard instruction to a virtual keyboard driver of the Android of the virtual machine via a virtual keyboard driver communication link established based on the virtoi interface.
Based on the method shown in fig. 1 to 5, correspondingly, an embodiment of the present application further provides a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for interworking Android and Windows shown in fig. 1 to 5 is implemented.
It should be noted that other corresponding descriptions of the functional units related to the interworking device of Android and Windows provided in the embodiment of the present application may refer to the corresponding descriptions in fig. 1 to fig. 5, and are not described herein again.
Further, as a specific implementation of the method shown in fig. 6 to 8, an embodiment of the present application provides an interworking device between Android and Windows, as shown in fig. 11, which is a device for implementing communication from the Android of a virtual machine to the Windows of a physical machine based on a communication architecture between the Android of the virtual machine and the Windows of the physical machine, and the device includes: a receiving module 61 and a second sending module 62.
And the receiving module 61 is used for sending the target instruction from the Android frame layer of the virtual machine to the virtual hardware driver of the Android of the virtual machine.
And a second sending module 62, configured to send, by the virtual hardware driver of the Android of the virtual machine, the target instruction to the target virtual hardware of Windows via the virtoi interface, where the target virtual hardware is configured to send the target instruction to a target process of Windows based on a PIPE interface protocol.
In a specific application scenario, as shown in fig. 12, if the target instruction is a rendering instruction and the virtual hardware driver of the Android of the virtual machine is a GPU driver, the second sending module 62 specifically includes: the GPU driving unit 621.
The GPU driving unit 621 is used for driving a communication link through a GPU established based on a VirtIO interface, the GPU driver of the Android of the virtual machine sends a rendering instruction to a virtual GPU of Windows, and the virtual GPU is used for sending the rendering instruction to a rendering process of Windows based on a PIPE interface protocol.
Based on the method shown in fig. 1 to 5, correspondingly, an embodiment of the present application further provides a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for interworking Android and Windows shown in fig. 1 to 5 is implemented.
Based on the foregoing methods as shown in fig. 6 to 8, correspondingly, an embodiment of the present application further provides a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for interworking Android and Windows as shown in fig. 6 to 8 is implemented.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Based on the methods shown in fig. 1 to fig. 5 and the virtual device embodiments shown in fig. 9 and fig. 10, in order to achieve the above object, an embodiment of the present application further provides a computer device, which may specifically be a personal computer, a server, a network device, and the like, where the computer device includes a storage medium and a processor; a storage medium for storing a computer program; a processor, configured to execute a computer program to implement the aforementioned Android and Windows interworking method shown in fig. 1 to 5.
Based on the methods shown in fig. 6 to fig. 8 and the virtual device embodiments shown in fig. 11 and fig. 12, in order to achieve the above object, the present application further provides a computer device, which may specifically be a personal computer, a server, a network device, and the like, where the computer device includes a storage medium and a processor; a storage medium for storing a computer program; a processor, configured to execute a computer program to implement the aforementioned Android and Windows interworking method shown in fig. 6 to 8.
Optionally, the computer device may also include a user interface, a network interface, a camera, Radio Frequency (RF) circuitry, sensors, audio circuitry, a WI-FI module, and so forth. The user interface may include a Display screen (Display), an input unit such as a keypad (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., a bluetooth interface, WI-FI interface), etc.
It will be appreciated by those skilled in the art that the present embodiment provides a computer device architecture that is not limiting of the computer device, and that may include more or fewer components, or some components in combination, or a different arrangement of components.
The storage medium may further include an operating system and a network communication module. An operating system is a program that manages and maintains the hardware and software resources of a computer device, supporting the operation of information handling programs, as well as other software and/or programs. The network communication module is used for realizing communication among components in the storage medium and other hardware and software in the entity device.
Through the description of the above embodiment, those skilled in the art can clearly understand that the method can be implemented by means of software and a necessary general hardware platform, and also can implement analysis of the event type of the qvent event by means of hardware, and send the qvent event to the target virtual hardware, so that the target virtual hardware sends the converted target instruction to the virtual hardware driver of the Android of the virtual machine through the virtou interface.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (10)

1. An interworking method between Android and Windows is characterized by comprising the following steps:
determining target virtual hardware for converting the QEVent event into a target instruction according to the event type identifier in the received QEVent event;
and the target virtual hardware sends the target instruction to a virtual hardware driver of the Android of the virtual machine through a VirtIO interface, and the virtual hardware driver is used for analyzing the target instruction and sending the target instruction to the Android frame layer of the virtual machine.
2. The method of claim 1, wherein the event types include a keyboard, a mouse.
3. The method according to claim 1 or 2, wherein if the event type identifier is a keyboard identifier, determining a target virtual hardware for converting the QEvent into a target instruction according to an event type identifier in the received QEvent, specifically comprising:
converting the key information in the Qevent and then sending the key information to a virtual touch screen or a virtual keyboard;
if the virtual touch screen is sent to the virtual touch screen, the virtual touch screen generates a corresponding touch screen instruction based on a preset communication protocol;
and if the command is sent to the virtual keyboard, the virtual keyboard generates a corresponding keyboard command based on a preset communication protocol.
4. An interworking method between Android and Windows is characterized by comprising the following steps:
sending a target instruction from an Android frame layer of the virtual machine to a virtual hardware driver of the Android of the virtual machine;
and the virtual hardware driver of the Android of the virtual machine sends a target instruction to target virtual hardware of Windows through a VirtIO interface, and the target virtual hardware is used for sending the target instruction to a target process of Windows based on a PIPE interface protocol.
5. An intercommunication device for Android and Windows is characterized by comprising:
the determining module is used for determining target virtual hardware for converting the QEVent event into a target instruction according to the event type identifier in the received QEVent event;
the first sending module is used for sending the target instruction to a virtual hardware driver of the Android of the virtual machine through the VirtIO interface by the target virtual hardware, and the virtual hardware driver is used for analyzing the target instruction and sending the target instruction to the Android frame layer of the virtual machine.
6. An intercommunication device for Android and Windows is characterized by comprising:
the receiving module is used for sending the target instruction from the Android frame layer of the virtual machine to the virtual hardware drive of the Android of the virtual machine;
and the second sending module is used for sending the target instruction to target virtual hardware of Windows through a VirtIO interface by the virtual hardware driver of the Android of the virtual machine, and the target virtual hardware is used for sending the target instruction to a target process of Windows based on a PIPE interface protocol.
7. A storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the Android and Windows interworking method of any of claims 1 to 3.
8. Computer device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method for interworking Android and Windows according to any one of claims 1 to 3 when executing the program.
9. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the Android and Windows interworking method of claim 4.
10. A computer device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the method for interworking Android and Windows of claim 4.
CN202011129647.6A 2020-10-21 2020-10-21 Intercommunication method and device for Android and Windows, storage medium and computer equipment Active CN112328356B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011129647.6A CN112328356B (en) 2020-10-21 2020-10-21 Intercommunication method and device for Android and Windows, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011129647.6A CN112328356B (en) 2020-10-21 2020-10-21 Intercommunication method and device for Android and Windows, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN112328356A true CN112328356A (en) 2021-02-05
CN112328356B CN112328356B (en) 2023-09-29

Family

ID=74310592

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011129647.6A Active CN112328356B (en) 2020-10-21 2020-10-21 Intercommunication method and device for Android and Windows, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN112328356B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113238687A (en) * 2021-04-27 2021-08-10 北京麟卓信息科技有限公司 Method and device for realizing android application button function on desktop platform

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707882A (en) * 2012-04-27 2012-10-03 深圳瑞高信息技术有限公司 Method for converting control modes of application program of touch screen with virtual icons and touch screen terminal
CN104740872A (en) * 2015-04-13 2015-07-01 北京奇虎科技有限公司 Method and device for operating and controlling game program in simulated Android environment
CN105094839A (en) * 2015-08-14 2015-11-25 深圳市众联悠游科技有限公司 Method for achieving running of Android system applications based on PC machine
US20170161952A1 (en) * 2015-12-03 2017-06-08 Beijing Pico Technology Co., Ltd. Virtual reality system, and method and apparatus for displaying an android application image therein
CN107463402A (en) * 2017-07-31 2017-12-12 腾讯科技(深圳)有限公司 The operation method and device of virtual opetrating system
CN107844243A (en) * 2017-11-09 2018-03-27 新华三云计算技术有限公司 Cloud tabletop touch implementation method and device
US20190087212A1 (en) * 2016-08-10 2019-03-21 Beijing Qihoo Technology Company Limited Android simulator and method for implementing android simulator
WO2019127476A1 (en) * 2017-12-29 2019-07-04 深圳前海达闼云端智能科技有限公司 Virtual system bluetooth communication method and device, virtual system, storage medium, and electronic apparatus
CN110597597A (en) * 2019-08-30 2019-12-20 北京卓识网安技术股份有限公司 Method, system, device and storage medium for virtualization of hardware
US20200007405A1 (en) * 2018-06-29 2020-01-02 Juniper Networks, Inc. Monitoring and policy control of distributed data and control planes for virtual nodes
CN111522670A (en) * 2020-05-09 2020-08-11 中瓴智行(成都)科技有限公司 GPU virtualization method, system and medium for Android system
CN111625293A (en) * 2020-05-15 2020-09-04 武汉蓝星科技股份有限公司 Terminal dual system based on linux kernel and hardware access management method thereof
US10997106B1 (en) * 2020-09-22 2021-05-04 Pensando Sytems Inc. Inter-smartNIC virtual-link for control and datapath connectivity

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707882A (en) * 2012-04-27 2012-10-03 深圳瑞高信息技术有限公司 Method for converting control modes of application program of touch screen with virtual icons and touch screen terminal
CN104740872A (en) * 2015-04-13 2015-07-01 北京奇虎科技有限公司 Method and device for operating and controlling game program in simulated Android environment
CN105094839A (en) * 2015-08-14 2015-11-25 深圳市众联悠游科技有限公司 Method for achieving running of Android system applications based on PC machine
US20170161952A1 (en) * 2015-12-03 2017-06-08 Beijing Pico Technology Co., Ltd. Virtual reality system, and method and apparatus for displaying an android application image therein
US20190087212A1 (en) * 2016-08-10 2019-03-21 Beijing Qihoo Technology Company Limited Android simulator and method for implementing android simulator
CN107463402A (en) * 2017-07-31 2017-12-12 腾讯科技(深圳)有限公司 The operation method and device of virtual opetrating system
CN107844243A (en) * 2017-11-09 2018-03-27 新华三云计算技术有限公司 Cloud tabletop touch implementation method and device
WO2019127476A1 (en) * 2017-12-29 2019-07-04 深圳前海达闼云端智能科技有限公司 Virtual system bluetooth communication method and device, virtual system, storage medium, and electronic apparatus
US20200007405A1 (en) * 2018-06-29 2020-01-02 Juniper Networks, Inc. Monitoring and policy control of distributed data and control planes for virtual nodes
CN110597597A (en) * 2019-08-30 2019-12-20 北京卓识网安技术股份有限公司 Method, system, device and storage medium for virtualization of hardware
CN111522670A (en) * 2020-05-09 2020-08-11 中瓴智行(成都)科技有限公司 GPU virtualization method, system and medium for Android system
CN111625293A (en) * 2020-05-15 2020-09-04 武汉蓝星科技股份有限公司 Terminal dual system based on linux kernel and hardware access management method thereof
US10997106B1 (en) * 2020-09-22 2021-05-04 Pensando Sytems Inc. Inter-smartNIC virtual-link for control and datapath connectivity

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
C.LUCAS等: "Virtual Machines with Dedicated Graphics for Software Development", 《2019 INTERNATIONAL CONFERENCE ON COMPUTATIONAL SCIENCE AND COMPUTATIONAL INTELLIGENCE(CSCI)》, pages 1568 - 1569 *
STRAY2B: "virtio-input", pages 1 - 6, Retrieved from the Internet <URL:https://blog.csdn.net/stray2b/article/details/128640730> *
张凯华等: "基于桌面云的GPU设备虚拟化设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 7, pages 137 - 7 *
时钰森: "面向桌面云的Android虚拟机设备虚拟化的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 5, pages 137 - 11 *
汤雄: "基于KVM的3D远程桌面同步技术的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 01, pages 138 - 2300 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113238687A (en) * 2021-04-27 2021-08-10 北京麟卓信息科技有限公司 Method and device for realizing android application button function on desktop platform
CN113238687B (en) * 2021-04-27 2021-11-16 北京麟卓信息科技有限公司 Method and device for realizing android application button function on desktop platform

Also Published As

Publication number Publication date
CN112328356B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
KR101773638B1 (en) Methods for interfacing with a virtualized computing service over a network using a lightweight client
US11451619B2 (en) App remote control method and related devices
CN102413150B (en) Server and virtual desktop control method and virtual desktop control system
KR101761409B1 (en) Method and apparatus for providing virtual platform
CN113079216B (en) Cloud application implementation method and device, electronic equipment and readable storage medium
US8762544B2 (en) Selectively communicating data of a peripheral device to plural sending computers
CN104660687A (en) Realization method and system for virtual desktop display
CN111552450A (en) Screen projection method and device
CN111354063B (en) Three-dimensional element rendering method, desktop cloud server and desktop cloud system
CN103888485A (en) Method for distributing cloud computing resource, device thereof and system thereof
CN111494936A (en) Picture rendering method, device, system and storage medium
CN102378976B (en) The compression of images of multiple processor is used to accelerate
US20140108940A1 (en) Method and system of remote communication over a network
WO2021169236A1 (en) Rendering method and apparatus
WO2011097520A2 (en) Graphics remoting using augmentation data
CN111773691A (en) Cloud game service system, cloud client and data processing method
US20170272545A1 (en) Method and system for transmitting remote screen
WO2020238846A1 (en) Image acquisition method, device, server and storage medium
CN115445194A (en) Rendering method, device and equipment of game and storage medium
CN112328356B (en) Intercommunication method and device for Android and Windows, storage medium and computer equipment
CN110807111A (en) Three-dimensional graph processing method and device, storage medium and electronic equipment
CN113778593B (en) Cloud desktop control method and device, electronic equipment, storage medium and program product
CN111143017B (en) Cloud operation system interaction processing method, client and cloud operation system
CN110012003B (en) Cloud application screen capturing method and device
Pandey et al. An automation framework for benchmarking and optimizing performance of remote desktops in the cloud

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant