CN112256385A - Method and system for sharing keyboard and mouse by virtual machine - Google Patents
Method and system for sharing keyboard and mouse by virtual machine Download PDFInfo
- Publication number
- CN112256385A CN112256385A CN202011014283.7A CN202011014283A CN112256385A CN 112256385 A CN112256385 A CN 112256385A CN 202011014283 A CN202011014283 A CN 202011014283A CN 112256385 A CN112256385 A CN 112256385A
- Authority
- CN
- China
- Prior art keywords
- zero terminal
- keyboard
- mouse
- virtual machine
- zero
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
Abstract
The utility model provides a method and a system for sharing a keyboard and a mouse by a virtual machine, which relate to the computer technology and can solve the problem that the operation is complicated because a set of keyboard and mouse equipment needs to be set for each zero terminal. The specific technical scheme is as follows: the first zero terminal and the second zero terminal are in communication connection, and a first virtual machine corresponding to the first zero terminal is directly controlled through a keyboard and a mouse; the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal; and the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal, so that the second zero terminal sends the first keyboard and mouse signal to the second virtual machine, and the second virtual machine is controlled by the keyboard and mouse. Because can come two virtual machines of simultaneous control through a set of key mouse, like this, when many zero terminal equipment of user simultaneous control, this kind of scheme can bring very big facility for the user, and the user need not go to frequently change different key mouse when operating different zero terminals, can improve user experience greatly.
Description
Technical Field
The disclosure relates to the technical field of computers, in particular to a method and a system for sharing a keyboard and a mouse by a virtual machine.
Background
At present, in zero-terminal systems, there are often such usage scenarios: one user controls two pieces of zero terminal equipment at the same time, and needs to control the two pieces of zero terminal equipment. Under the circumstance, a user faces two displays, two virtual machines and two sets of key mice (keyboards and mice), and the two sets of key mice need to be frequently switched to control different virtual machines, so that the user is often in a busy and messy state in the scene, and the operation is very inconvenient.
Disclosure of Invention
The embodiment of the disclosure provides a method and a system for sharing a keyboard and a mouse by a virtual machine, which can solve the problem that operation is complicated because a set of keyboard and mouse equipment needs to be set for each zero terminal. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a method for a virtual machine to share a keyboard and mouse, the method being applied to a first zero terminal in a system for the virtual machine to share the keyboard and mouse, the system including: the first zero terminal, the second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse;
the first zero terminal and the second zero terminal establish communication connection, and the first virtual machine corresponding to the first zero terminal is directly controlled through the keyboard and mouse;
the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
and the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal, so that the second zero terminal sends the first keyboard and mouse signal to the second virtual machine, and the second virtual machine is controlled by the keyboard and mouse.
The method for sharing the keyboard and the mouse by the virtual machine provided by the embodiment of the disclosure comprises the following steps: the method is applied to a first zero terminal in a virtual machine sharing keyboard and mouse system, and the system comprises the following steps: the system comprises a first zero terminal, a second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse; the first zero terminal and the second zero terminal are in communication connection, and a first virtual machine corresponding to the first zero terminal is directly controlled through a keyboard and a mouse; the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal; and the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal, so that the second zero terminal sends the first keyboard and mouse signal to the second virtual machine, and the second virtual machine is controlled by the keyboard and mouse. Because can come two virtual machines of simultaneous control through a set of key mouse, like this, when many zero terminal equipment of user simultaneous control, this kind of scheme can bring very big facility for the user, and the user need not go to frequently change different key mouse when operating different zero terminals, can improve user experience greatly.
In one embodiment, the sending, by the first zero terminal, a key and mouse master control right transfer message to the second zero terminal includes:
the first zero terminal receives the keyboard and mouse master control right transfer message triggered by a user;
and the first zero terminal sends the keyboard and mouse master control right transfer message to the second zero terminal.
In one embodiment, the first zero terminal transmits the captured first keystroke signal to the second zero terminal, including:
and after the first zero terminal receives the keyboard and mouse master control right transfer response message, the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal.
In one embodiment, the first zero terminal transmits the captured first keystroke signal to the second zero terminal, including:
the first zero terminal converts the captured first keyboard and mouse analog signals into first keyboard and mouse digital signals;
and the first zero terminal sends the first keyboard and mouse digital signal to the second zero terminal.
In one embodiment, the first zero terminal transmits the captured first keystroke signal to the second zero terminal, including:
and the first zero terminal sends the captured second keyboard and mouse analog signal to the second zero terminal.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for a virtual machine to share a keyboard and mouse, the method being applied to a second zero terminal in a system for the virtual machine to share the keyboard and mouse, the system including: the system comprises a first zero terminal, a second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse;
the second zero terminal establishes communication connection with the first zero terminal, and directly controls the first virtual machine corresponding to the first zero terminal through the keyboard and mouse;
the second zero terminal receives a keyboard and mouse master control right transfer message sent by the first zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
and the second zero terminal receives a first keyboard and mouse signal sent by the first zero terminal and sends the first keyboard and mouse signal to the second virtual machine so as to realize the control of the second virtual machine by the keyboard and mouse.
In one embodiment, before the second zero terminal receives the first keystroke signal transmitted by the first zero terminal, the method further includes:
and after the second zero terminal receives the keyboard and mouse master control right transfer message, the second zero terminal sends a keyboard and mouse master control right transfer response message to the first zero terminal.
In one embodiment, the receiving, by the second zero terminal, the first keystroke and mouse signal sent by the first zero terminal, and sending the first keystroke and mouse signal to the second virtual machine includes:
and the second zero terminal receives the first keyboard and mouse digital signal sent by the first zero terminal and sends the first keyboard and mouse digital signal to the second virtual machine.
In one embodiment, the receiving, by the second zero terminal, the first keystroke and mouse signal sent by the first zero terminal, and sending the first keystroke and mouse signal to the second virtual machine includes:
the second zero terminal receives a second keyboard and mouse analog signal sent by the first zero terminal;
the second zero terminal converts the second keyboard and mouse analog signal into a second keyboard and mouse digital signal;
and the second zero terminal sends the second keyboard and mouse digital signal to the second virtual machine.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for a virtual machine to share a keyboard and mouse, the apparatus being applied to a first zero terminal in a system for the virtual machine to share the keyboard and mouse, the system including: the first zero terminal, the second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse; the device includes:
the first communication connection establishing module is used for establishing communication connection with the second zero terminal and directly controlling the first virtual machine corresponding to the first zero terminal through the keyboard and mouse;
the first sending module is used for sending a keyboard and mouse master control right transfer message to the second zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
and the second sending module is used for sending the captured first keyboard and mouse signal to the second zero terminal by the first zero terminal so that the second zero terminal sends the first keyboard and mouse signal to the second virtual machine to realize the control of the second virtual machine by the keyboard and mouse.
In one embodiment, the first sending module includes:
the first receiving submodule is used for receiving the keyboard and mouse master control right transfer message triggered by a user;
and the first sending submodule is used for sending the keyboard and mouse master control right transfer message to the second zero terminal.
In one embodiment, the second sending module includes:
the second receiving submodule is used for receiving the keyboard and mouse master control right transfer response message;
and the second sending submodule is used for sending the captured first keyboard and mouse signal to the second zero terminal after the second receiving submodule receives the keyboard and mouse master control right transfer response message.
In one embodiment, the second sending module includes:
the first conversion submodule is used for converting the captured first keyboard and mouse analog signal into a first keyboard and mouse digital signal;
and the third sending submodule is used for sending the first keyboard and mouse digital signal to the second zero terminal.
In one embodiment, the second sending module includes:
and the fourth sending submodule is used for sending the captured second keyboard and mouse analog signal to the second zero terminal.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an apparatus for sharing a keyboard and mouse by a virtual machine, the apparatus being applied to a second zero terminal in a system for sharing a keyboard and mouse by a virtual machine, the system including: the first zero terminal, the second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse; the device includes:
the second communication connection establishing module is used for establishing communication connection with the first zero terminal and directly controlling the first virtual machine corresponding to the first zero terminal through the keyboard and mouse;
the first receiving module is used for receiving a keyboard and mouse master control right transfer message sent by the first zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
and the processing module is used for receiving a first keyboard and mouse signal sent by the first zero terminal and sending the first keyboard and mouse signal to the second virtual machine so as to realize the control of the second virtual machine through the keyboard and mouse.
In one embodiment, further comprising:
and the second receiving module is used for sending a keyboard and mouse master control right transfer response message to the first zero terminal after the first receiving module receives the keyboard and mouse master control right transfer message before the processing module receives the first keyboard and mouse signal sent by the first zero terminal.
In one embodiment, the processing module includes:
and the fifth sending submodule is used for receiving the first keyboard and mouse digital signal sent by the first zero terminal and sending the first keyboard and mouse digital signal to the second virtual machine.
In one embodiment, the processing module includes:
the third receiving submodule is used for receiving a second keyboard and mouse analog signal sent by the first zero terminal;
the conversion submodule is used for converting the second keyboard and mouse analog signal into a second keyboard and mouse digital signal;
and the sixth sending submodule is used for sending the second keyboard and mouse digital signal to the second virtual machine.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a virtual machine sharing keymouse system, the system including: the system comprises a first zero terminal, a second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse;
the first zero terminal and the second zero terminal establish communication connection, and the first virtual machine corresponding to the first zero terminal is directly controlled through the keyboard and mouse;
the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal;
and the second zero terminal sends the first keyboard and mouse signal to the second virtual machine so as to realize the control of the second virtual machine by the keyboard and mouse.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a structural diagram of a virtual machine sharing keyboard and mouse system according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for sharing a keyboard and mouse by a virtual machine according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a method for sharing a keyboard and mouse by a virtual machine according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a method for sharing a keyboard and mouse by a virtual machine according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a method for sharing a keyboard and mouse by a virtual machine according to an embodiment of the present disclosure;
fig. 6 is a structural diagram of a keyboard and mouse sharing device of a virtual machine according to an embodiment of the present disclosure;
fig. 7 is a structural diagram of a first sending module in a keyboard and mouse sharing device of a virtual machine according to an embodiment of the present disclosure;
fig. 8 is a structural diagram of a second sending module in a virtual machine shared keyboard and mouse device according to an embodiment of the present disclosure;
fig. 9 is a structural diagram of a second sending module in a virtual machine shared keyboard and mouse device according to an embodiment of the present disclosure;
fig. 10 is a structural diagram of a second sending module in a virtual machine shared keyboard and mouse device according to an embodiment of the present disclosure;
fig. 11 is a structural diagram of a keyboard and mouse sharing device of a virtual machine according to an embodiment of the disclosure;
fig. 12 is a structural diagram of a keyboard and mouse sharing device of a virtual machine according to an embodiment of the disclosure;
fig. 13 is a structural diagram of a processing module in a virtual machine sharing keyboard and mouse device according to an embodiment of the present disclosure;
fig. 14 is a structural diagram of a processing module in a virtual machine sharing keyboard and mouse device according to an embodiment of the present disclosure;
fig. 15 is a schematic diagram of a method for sharing a keyboard and mouse by a virtual machine according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
With the advance of technology, the terminal side will be developed towards more and more lightweight, that is, the terminal is configured to be lower and smaller.
At present, various zero terminal (ZC) solutions have been proposed, so-called zero terminals, i.e., terminals that only need to have a screen, a simple CPU and memory, an image receiving and decoding module for processing images, and a reverse control processing module. This solution enables a considerable simplification of the size and configuration of the mobile terminal. All programs of the zero terminal run in the cloud server, the zero terminal uses the corresponding application program by accessing the virtual machine distributed by the cloud server, the corresponding application program is controlled by reverse control, and the server sends the real-time processing picture to the zero terminal, so that the zero terminal operates as if the zero terminal is locally operated.
At present, in zero-terminal systems, there are often such usage scenarios: one user controls two pieces of zero terminal equipment at the same time, and needs to control the two pieces of zero terminal equipment. Under the circumstance, a user faces two displays, two virtual machines and two sets of key mice (keyboards and mice), and the two sets of key mice need to be frequently switched to control different virtual machines, so that the user is often in a busy and messy state in the scene, and the operation is very inconvenient.
The embodiment of the present disclosure provides a structure diagram of a virtual machine sharing keyboard and mouse system, as shown in fig. 1, the system includes: the system comprises two zero terminals (a first zero terminal and a second zero terminal), two virtual machines (a first virtual machine corresponding to the first zero terminal and a second virtual machine corresponding to the second zero terminal) and a keyboard and mouse set.
The embodiment of the present disclosure provides a method for sharing a keyboard and a mouse by a virtual machine, which may be applied to a first zero terminal in a system shown in fig. 1, as shown in fig. 2, and the method includes the following steps:
101. the first zero terminal and the second zero terminal are in communication connection, and a first virtual machine corresponding to the first zero terminal is directly controlled through a keyboard and a mouse.
In one embodiment, the communication connection established between the first zero terminal and the second zero terminal may include: TCP/IP communication connection. At this time, the first zero terminal and the second zero terminal are respectively provided with the IP addresses of the other parties, and at this time, the TCP/IP communication connection can be established according to the set IP addresses.
In practical implementation, the TCP/IP connection may be automatically established after the two zero terminals are started, or the TCP/IP communication connection between the two zero terminals may be manually established by a user.
Because there is only one set of keyboard and mouse, after the computer is started, the keyboard and mouse master control right can be set to belong to the first zero terminal, and the keyboard and mouse master control right can be switched to the first zero terminal or the second zero terminal in the use process (for example, the keyboard and mouse master control right can be switched to the first zero terminal or the second zero terminal through a preset shortcut key in the use process).
At this time, since the keyboard and mouse master control right belongs to the first zero terminal, the first virtual machine corresponding to the first zero terminal can be directly controlled by the set of keyboard and mouse.
In one implementation, the keyboard and mouse can be connected to the first zero terminal in a wired or wireless manner.
The process of controlling the first virtual machine through the keyboard and the mouse is as follows: the first zero terminal converts the captured keyboard and mouse analog signals into keyboard and mouse digital signals, the keyboard and mouse digital signals are sent to the first virtual machine, and the first virtual machine locally executes the keyboard and mouse digital signals to control the desktop image.
102. And the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal. The keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal.
When the keyboard and mouse master control right needs to be switched to the second zero terminal, the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal, and the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right needs to be switched to the second zero terminal, namely, the second zero terminal needs to be controlled by the keyboard and mouse connected with the first zero terminal.
103. And the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal, so that the second zero terminal sends the first keyboard and mouse signal to the second virtual machine, and the second virtual machine is controlled by the keyboard and mouse.
After the keyboard and mouse master control right is switched, a first keyboard and mouse signal subsequently received by the first zero terminal is used for controlling the virtual machine corresponding to the second zero terminal by a user, so that the first zero terminal can send the captured first keyboard and mouse signal to the second zero terminal, the second zero terminal can send the first keyboard and mouse signal to the second virtual machine, and the second virtual machine can be controlled by the keyboard and mouse.
Wherein, the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal, including: and after the first zero terminal receives the key mouse master control right transfer response message, the first zero terminal sends the captured first key mouse signal to the second zero terminal.
After the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal, the second zero terminal returns a keyboard and mouse master control right transfer response message to the first zero terminal after receiving the keyboard and mouse master control right transfer message sent by the first zero terminal, and after the second zero terminal sends the keyboard and mouse master control right transfer response message, the second zero terminal can monitor a first keyboard and mouse signal sent by the first zero terminal.
After the first zero terminal receives the keyboard and mouse master control right transfer response message, the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal.
The method for sharing the keyboard and the mouse by the virtual machine provided by the embodiment of the disclosure comprises the following steps: the method is applied to a first zero terminal in a virtual machine sharing keyboard and mouse system, and the system comprises the following steps: the system comprises a first zero terminal, a second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse; the first zero terminal and the second zero terminal are in communication connection, and a first virtual machine corresponding to the first zero terminal is directly controlled through a keyboard and a mouse; the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal; and the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal, so that the second zero terminal sends the first keyboard and mouse signal to the second virtual machine, and the second virtual machine is controlled by the keyboard and mouse. Because can come two virtual machines of simultaneous control through a set of key mouse, like this, when many zero terminal equipment of user simultaneous control, this kind of scheme can bring very big facility for the user, and the user need not go to frequently change different key mouse when operating different zero terminals, can improve user experience greatly.
In one embodiment, as shown in FIG. 3, the above step 102 comprises the following sub-steps:
1021. and the first zero terminal receives a keyboard and mouse master control right transfer message triggered by a user.
For example, the user may switch the keyboard and mouse master control right to the second zero terminal through a preset shortcut key.
1022. And the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal.
When the user triggers the shortcut key, the first zero terminal receives the keyboard and mouse master control right transfer message triggered by the user, and at the moment, the first zero terminal informs the second zero terminal of the event, that is, the first zero terminal sends the keyboard and mouse master control right transfer message to the second zero terminal.
In one embodiment, the first zero terminal sends the captured first keystroke signal to the second zero terminal in the following two ways:
the first method comprises the following steps:
the first zero terminal directly converts the received keyboard and mouse analog signals into keyboard and mouse digital signals and then sends the keyboard and mouse digital signals to the second zero terminal.
Specifically, the first zero terminal converts the captured first keyboard and mouse analog signal into a first keyboard and mouse digital signal; and the first zero terminal sends the first keyboard and mouse digital signal to the second zero terminal.
And the second method comprises the following steps:
and the first zero terminal directly sends the captured second keyboard and mouse analog signal to the second zero terminal.
Wherein the first zero terminal transmitting the captured first keystroke signal to the second zero terminal may include:
and the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal through the TCP/IP communication connection between the two zero terminals.
The embodiment of the present disclosure provides a method for sharing a keyboard and a mouse by a virtual machine, where the method may be applied to a second zero terminal in a system shown in fig. 1, as shown in fig. 4, and the method includes the following steps:
201. and the second zero terminal establishes communication connection with the first zero terminal and directly controls the first virtual machine corresponding to the first zero terminal through a keyboard and a mouse.
202. And the second zero terminal receives the keyboard and mouse master control right transfer message sent by the first zero terminal. The keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal.
203. And the second zero terminal receives the first keyboard and mouse signal sent by the first zero terminal and sends the first keyboard and mouse signal to the second virtual machine so as to realize the control of the second virtual machine by the keyboard and mouse.
The method for sharing the keyboard and the mouse by the virtual machine provided by the embodiment of the disclosure comprises the following steps: the method is applied to a second zero terminal in a virtual machine sharing keyboard and mouse system, and the system comprises the following steps: the system comprises a first zero terminal, a second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse; the second zero terminal establishes communication connection with the first zero terminal, and directly controls a first virtual machine corresponding to the first zero terminal through a keyboard and a mouse; the second zero terminal receives the keyboard and mouse master control right transfer message sent by the first zero terminal; and the second zero terminal receives the first keyboard and mouse signal sent by the first zero terminal and sends the first keyboard and mouse signal to the second virtual machine so as to realize the control of the second virtual machine by the keyboard and mouse. Because can come two virtual machines of simultaneous control through a set of key mouse, like this, when many zero terminal equipment of user simultaneous control, this kind of scheme can bring very big facility for the user, and the user need not go to frequently change different key mouse when operating different zero terminals, can improve user experience greatly.
In one embodiment, before the second zero terminal receives the first keystroke signal transmitted by the first zero terminal, the method further includes:
and after the second zero terminal receives the keyboard and mouse master control right transfer message, the second zero terminal sends a keyboard and mouse master control right transfer response message to the first zero terminal.
In one embodiment, if the first zero terminal converts the captured first keyboard and mouse analog signal into a first keyboard and mouse digital signal and sends the first keyboard and mouse digital signal to the second zero terminal, the second zero terminal receives the first keyboard and mouse signal sent by the first zero terminal and sends the first keyboard and mouse signal to the second virtual machine, including: and the second zero terminal receives the first keyboard and mouse digital signal sent by the first zero terminal and sends the first keyboard and mouse digital signal to the second virtual machine.
In one embodiment, if the first zero terminal directly transmits the captured first keystroke and mouse analog signal to the second zero terminal, then, as shown in fig. 5, the second zero terminal receives the first keystroke and mouse signal transmitted by the first zero terminal and transmits the first keystroke and mouse signal to the second virtual machine, the method includes the following sub-steps:
2031. and the second zero terminal receives the second keyboard and mouse analog signal sent by the first zero terminal.
2032. And the second zero terminal converts the second keyboard and mouse analog signal into a second keyboard and mouse digital signal.
2033. And the second zero terminal sends the second keyboard and mouse digital signal to the second virtual machine.
And the second zero terminal converts the received second keyboard and mouse analog signals into second keyboard and mouse digital signals and then sends the second keyboard and mouse digital signals to the second virtual machine, so that the control of the second virtual machine is realized.
In the two implementation modes, if the first zero terminal sends a second keyboard and mouse analog signal to the second zero terminal, the second zero terminal needs to convert the second keyboard and mouse analog signal into a second keyboard and mouse digital signal and then sends the second keyboard and mouse digital signal to the second virtual machine; if the first zero terminal sends the first keyboard and mouse digital signals to the second zero terminal, the second zero terminal does not need to be converted and can directly send the first keyboard and mouse digital signals to the second virtual machine.
Based on the method for sharing a keyboard and mouse by a virtual machine described in the embodiment corresponding to fig. 2, the following is an embodiment of the apparatus of the present disclosure, which can be used to execute an embodiment of the method of the present disclosure.
The embodiment of the present disclosure provides a device for sharing a keyboard and mouse by a virtual machine, where the device is applied to a first zero terminal in a system for sharing a keyboard and mouse by a virtual machine as shown in fig. 1, and as shown in fig. 6, the device includes:
a first communication connection establishing module 11, configured to establish a communication connection with the second zero terminal, and directly control the first virtual machine corresponding to the first zero terminal through the keyboard and mouse;
the first sending module 12 is configured to send a keyboard and mouse master control right transfer message to the second zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
a second sending module 13, configured to send the captured first keyboard and mouse signal to the second zero terminal by the first zero terminal, so that the second zero terminal sends the first keyboard and mouse signal to the second virtual machine, so as to implement control of the second virtual machine by using the keyboard and mouse.
In one embodiment, as shown in fig. 7, the first sending module 12 includes:
the first receiving submodule 121 is configured to receive the keyboard and mouse master control right transfer message triggered by the user;
the first sending sub-module 122 is configured to send the keyboard and mouse master control right transfer message to the second zero terminal.
In one embodiment, as shown in fig. 8, the second sending module 13 includes:
the second receiving submodule 131 is configured to receive the keyboard and mouse master control right transfer response message;
the second sending submodule 132 is configured to send the captured first keystroke and mouse signal to the second zero terminal after the second receiving submodule receives the keystroke and mouse master control right transfer response message.
In one embodiment, as shown in fig. 9, the second sending module 13 includes:
a first conversion submodule 133, configured to convert the captured first keyboard and mouse analog signal into a first keyboard and mouse digital signal;
and a third sending submodule 134, configured to send the first keystroke and mouse digital signal to the second zero terminal.
In one embodiment, as shown in fig. 10, the second sending module 13 includes:
a fourth sending submodule 135, configured to send the captured second keyboard and mouse analog signal to the second zero terminal.
Based on the method for sharing a keyboard and mouse by virtual machines described in the embodiment corresponding to fig. 4, the following is an embodiment of the apparatus of the present disclosure, which can be used to execute an embodiment of the method of the present disclosure.
The embodiment of the present disclosure provides a device for sharing a keyboard and mouse by a virtual machine, where the device is applied to a second zero terminal in a system for sharing a keyboard and mouse by a virtual machine as shown in fig. 1, and as shown in fig. 11, the device includes:
a second communication connection establishing module 21, configured to establish a communication connection with the first zero terminal, and directly control the first virtual machine corresponding to the first zero terminal through the keyboard and mouse
A first receiving module 22, configured to receive a keyboard and mouse master control right transfer message sent by the first zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
the processing module 23 is configured to receive a first keyboard and mouse signal sent by the first zero terminal, and send the first keyboard and mouse signal to the second virtual machine, so as to implement control of the second virtual machine by the keyboard and mouse.
In one embodiment, as shown in fig. 12, further includes:
the second receiving module 24 is configured to send a keyboard and mouse master control right transfer response message to the first zero terminal after the first receiving module 22 receives the keyboard and mouse master control right transfer message before the processing module 23 receives the first keyboard and mouse signal sent by the first zero terminal.
In one embodiment, as shown in fig. 13, the processing module 23 includes:
the fifth sending submodule 231 is configured to receive the first keyboard and mouse digital signal sent by the first zero terminal, and send the first keyboard and mouse digital signal to the second virtual machine.
In one embodiment, as shown in fig. 14, the processing module 23 includes:
the third receiving submodule 232 is configured to receive a second keyboard and mouse analog signal sent by the first zero terminal;
a conversion sub-module 233, configured to convert the second keyboard and mouse analog signal into a second keyboard and mouse digital signal;
a sixth sending submodule 234, configured to send the second keyboard and mouse digital signal to the second virtual machine.
The embodiment of the present disclosure provides a virtual machine sharing keyboard and mouse system, as shown in fig. 1, the system includes: the system comprises a first zero terminal, a second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse, and specifically, the implementation method of the system comprises the following steps:
the first zero terminal and the second zero terminal establish communication connection, and the first virtual machine corresponding to the first zero terminal is directly controlled through the keyboard and mouse;
the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal;
and the second zero terminal sends the first keyboard and mouse signal to the second virtual machine so as to realize the control of the second virtual machine by the keyboard and mouse.
Specifically, as shown in fig. 15, after receiving a keyboard and mouse signal sent by a keyboard and mouse for controlling a first virtual machine, the first zero terminal directly sends the keyboard and mouse signal for controlling the first virtual machine to the first virtual machine, and after the first zero terminal sends a keyboard and mouse master control transfer message to the second zero terminal, the first zero terminal sends the captured first keyboard and mouse signal for controlling the second zero terminal to the second virtual machine through the second zero terminal.
In one embodiment, the sending, by the first zero terminal, a key and mouse master control right transfer message to the second zero terminal includes:
the first zero terminal receives the keyboard and mouse master control right transfer message triggered by a user;
and the first zero terminal sends the keyboard and mouse master control right transfer message to the second zero terminal.
In one embodiment, the receiving, by the first zero terminal, the user-triggered keyboard and mouse master control right transfer message includes:
and the first zero terminal receives the keyboard and mouse master control right transfer message triggered by the user through the shortcut key.
In one embodiment, the first zero terminal transmits the captured first keystroke signal to the second zero terminal, including:
after the second zero terminal receives the keyboard and mouse master control right transfer message, the second zero terminal sends a keyboard and mouse master control right transfer response message to the first zero terminal;
and after the first zero terminal receives the keyboard and mouse master control right transfer response message, the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal.
In one embodiment, the first zero terminal transmits the captured first keystroke signal to the second zero terminal, including:
the first zero terminal converts the captured first keyboard and mouse analog signals into first keyboard and mouse digital signals;
the first zero terminal sends the first keyboard and mouse digital signal to the second zero terminal;
the second zero terminal sends the keyboard and mouse signal to the second virtual machine, and the method comprises the following steps:
and the second zero terminal sends the first keyboard and mouse digital signal to the second virtual machine.
In one embodiment, the first zero terminal transmits the captured first keystroke signal to the second zero terminal, including:
the first zero terminal sends the captured second keyboard and mouse analog signal to the second zero terminal;
the second zero terminal sends the keyboard and mouse signal to the second virtual machine corresponding to the second zero terminal, and the method comprises the following steps:
the second zero terminal converts the second keyboard and mouse analog signal into a second keyboard and mouse digital signal;
and the second zero terminal sends the second keyboard and mouse digital signal to the second virtual machine.
In one embodiment, the establishing of the communication connection between the first zero terminal and the second zero terminal includes:
and the first zero terminal and the second zero terminal establish TCP/IP communication connection.
In one embodiment, the directly controlling, by the keyboard and mouse, the first virtual machine corresponding to the first zero terminal includes:
and the first zero terminal sends the captured second keyboard and mouse signal to the first virtual machine so as to realize the control of the first virtual machine by the keyboard and mouse.
In one embodiment, the first zero terminal sends the captured second keystroke signal to the first virtual machine, including:
the first zero terminal converts the captured third rat analog signal into a third rat digital signal;
and the first zero terminal sends the third mouse digital signal to the first virtual machine.
Based on the method for sharing a keyboard and a mouse by a virtual machine described in the embodiment corresponding to fig. 2, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the data transmission method described in the embodiment corresponding to fig. 2, which is not described herein again.
Based on the method for sharing a keyboard and a mouse by a virtual machine described in the embodiment corresponding to fig. 4, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the data transmission method described in the embodiment corresponding to fig. 2, which is not described herein again.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (10)
1. A method for sharing a keyboard and mouse by a virtual machine is applied to a first zero terminal in a system for sharing the keyboard and mouse by the virtual machine, and the system comprises: the first zero terminal, the second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse;
the first zero terminal and the second zero terminal establish communication connection, and the first virtual machine corresponding to the first zero terminal is directly controlled through the keyboard and mouse;
the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
and the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal, so that the second zero terminal sends the first keyboard and mouse signal to the second virtual machine, and the second virtual machine is controlled by the keyboard and mouse.
2. The method according to claim 1, wherein the sending, by the first zero terminal, a keyboard and mouse master right transfer message to the second zero terminal includes:
the first zero terminal receives the keyboard and mouse master control right transfer message triggered by a user;
and the first zero terminal sends the keyboard and mouse master control right transfer message to the second zero terminal.
3. The method of claim 1, wherein the first zero terminal sends the captured first keystroke signal to the second zero terminal, comprising:
and after the first zero terminal receives the keyboard and mouse master control right transfer response message, the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal.
4. The method of claim 1, wherein the first zero terminal sends the captured first keystroke signal to the second zero terminal, comprising:
the first zero terminal converts the captured first keyboard and mouse analog signals into first keyboard and mouse digital signals;
and the first zero terminal sends the first keyboard and mouse digital signal to the second zero terminal.
5. The method of claim 1, wherein the first zero terminal sends the captured first keystroke signal to the second zero terminal, comprising:
and the first zero terminal sends the captured second keyboard and mouse analog signal to the second zero terminal.
6. A method for sharing a keyboard and mouse by a virtual machine is applied to a second zero terminal in a system for sharing the keyboard and mouse by the virtual machine, and the system comprises: the system comprises a first zero terminal, a second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse;
the second zero terminal establishes communication connection with the first zero terminal, and directly controls the first virtual machine corresponding to the first zero terminal through the keyboard and mouse;
the second zero terminal receives a keyboard and mouse master control right transfer message sent by the first zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
and the second zero terminal receives a first keyboard and mouse signal sent by the first zero terminal and sends the first keyboard and mouse signal to the second virtual machine so as to realize the control of the second virtual machine by the keyboard and mouse.
7. The method of claim 6, wherein before the second null terminal receives the first keystroke signal transmitted by the first null terminal, the method further comprises:
and after the second zero terminal receives the keyboard and mouse master control right transfer message, the second zero terminal sends a keyboard and mouse master control right transfer response message to the first zero terminal.
8. The method according to claim 6, wherein the second zero terminal receives the first keystroke signal sent by the first zero terminal and sends the first keystroke signal to the second virtual machine, and the method comprises:
and the second zero terminal receives the first keyboard and mouse digital signal sent by the first zero terminal and sends the first keyboard and mouse digital signal to the second virtual machine.
9. The method according to claim 6, wherein the second zero terminal receives the first keystroke signal sent by the first zero terminal and sends the first keystroke signal to the second virtual machine, and the method comprises:
the second zero terminal receives a second keyboard and mouse analog signal sent by the first zero terminal;
the second zero terminal converts the second keyboard and mouse analog signal into a second keyboard and mouse digital signal;
and the second zero terminal sends the second keyboard and mouse digital signal to the second virtual machine.
10. A virtual machine shared keyboard and mouse system, the system comprising: the system comprises a first zero terminal, a second zero terminal, a first virtual machine corresponding to the first zero terminal, a second virtual machine corresponding to the second zero terminal and a set of keyboard and mouse;
the first zero terminal and the second zero terminal establish communication connection, and the first virtual machine corresponding to the first zero terminal is directly controlled through the keyboard and mouse;
the first zero terminal sends a keyboard and mouse master control right transfer message to the second zero terminal; the keyboard and mouse master control right transfer message indicates that the keyboard and mouse master control right is switched from the first zero terminal to the second zero terminal;
the first zero terminal sends the captured first keyboard and mouse signal to the second zero terminal;
and the second zero terminal sends the first keyboard and mouse signal to the second virtual machine so as to realize the control of the second virtual machine by the keyboard and mouse.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011014283.7A CN112256385A (en) | 2020-09-24 | 2020-09-24 | Method and system for sharing keyboard and mouse by virtual machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011014283.7A CN112256385A (en) | 2020-09-24 | 2020-09-24 | Method and system for sharing keyboard and mouse by virtual machine |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112256385A true CN112256385A (en) | 2021-01-22 |
Family
ID=74232665
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011014283.7A Pending CN112256385A (en) | 2020-09-24 | 2020-09-24 | Method and system for sharing keyboard and mouse by virtual machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112256385A (en) |
-
2020
- 2020-09-24 CN CN202011014283.7A patent/CN112256385A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10805380B2 (en) | Data transmission method and device | |
WO2022062623A1 (en) | Remote control method and apparatus, and device, and storage medium, and system | |
EP3163972B1 (en) | Terminal, server, and terminal control method | |
CN110012328B (en) | Method and device for interacting with smart television | |
CN103024504B (en) | Based on the intelligent remote control system of digital TV set-top box | |
US10223062B1 (en) | Method and apparatus of capturing a screen image of a remotely managed machine | |
CN112905289A (en) | Application picture display method, device, terminal, screen projection system and medium | |
US20180014063A1 (en) | Method and Apparatus for Accessing a Terminal Device Camera to a Target Device | |
CN107948724B (en) | Video transmission control method, device, storage medium and mobile terminal | |
CN113489805B (en) | Butt joint method, device, equipment and storage medium of cloud desktop system | |
CN112269631A (en) | Keyboard and mouse sharing system of virtual machine | |
CN110474948B (en) | Interaction method between network devices | |
CN112770078B (en) | Video conference terminal fusion method and device and readable storage medium | |
US11405434B2 (en) | Data sharing method providing reception status of shared data among receiving terminals, and communication system and recording medium therefor | |
CN104639501A (en) | Data stream transmission method, equipment and system | |
AU2019101539A4 (en) | Android-based image and text information feedback terminal system | |
CN115567518B (en) | Device, system and method for reorienting camera of cloud desktop | |
WO2023071749A1 (en) | Parameter adjustment method and apparatus, and storage medium and electronic apparatus | |
CN112256385A (en) | Method and system for sharing keyboard and mouse by virtual machine | |
CN111767176A (en) | Method and device for remotely controlling terminal equipment | |
CN115695383A (en) | Screen sharing method and system, electronic device and android device | |
CN110913268A (en) | Multi-screen interaction method and device and electronic equipment | |
CN112269630A (en) | Keyboard and mouse sharing system of virtual machine | |
CN112714272A (en) | Inter-device control method, terminal, and computer-readable storage medium | |
CN110111790B (en) | Method, device and equipment for processing external equipment access of intelligent equipment |
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 |