Remote desktop implementation method and server
By using Unix domain sockets and proxy components acting as a host bridge, a remote desktop service based on an open-source protocol was implemented, solving the high cost problem and improving communication efficiency and user experience.
Patent Information
- Application Number
- CN202410934253.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-05
AI Technical Summary
Existing remote desktop services require the integration of commercial-grade proprietary remote desktop protocols, resulting in high costs.
By using the host machine as a bridge between the virtual machine and the user terminal, Unix domain sockets are used to forward user operation data and remote desktop service data. An open-source remote desktop protocol is adopted to reduce the cost of remote desktop services, and data transmission with Unix domain sockets is carried out through a proxy component, simplifying the data processing logic.
It reduces the cost of remote desktop services, improves communication efficiency and security, simplifies data processing logic, and enhances user experience.
Smart Images

Figure CN118900265A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of servers, and in particular to a method and a server for implementing a remote desktop. Background Art
[0002] As the scale of enterprises expands and business develops, office environment and needs are also changing. The traditional PC office model not only has great limitations in expansion and upgrading, but also has problems such as data dispersion and difficulty in backup. Once data leakage or loss occurs, it will bring huge losses to the enterprise.
[0003] Remote desktop (also known as cloud desktop) office can quickly adapt to the changing needs of the enterprise through simple configuration and adjustment. Whether it is adding new users or adjusting resource configuration, it can be easily achieved. In addition, remote desktop office can ensure the security and integrity of data by centrally storing data on the server and using data encryption and backup technology. At the same time, remote desktop office can also realize user authentication and access control to prevent the risk of illegal user intrusion and data leakage. Remote desktop is also widely used in the consumer market, and remote desktop can provide users with services such as cloud computers or cloud games.
[0004] However, most current remote desktop services require the integration of commercial-grade private remote desktop protocols, such as the HDP protocol, UXP protocol, ICA protocol, and PCoIP protocol, resulting in high costs for providing remote desktop services. Summary of the invention
[0005] In view of this, an embodiment of the present application provides a remote desktop implementation method and server.
[0006] In a first aspect, an embodiment of the present application provides a method for implementing a remote desktop, including:
[0007] The host machine receives user operation data sent by the user terminal, and sends the user operation data to the virtual machine deployed in the host machine through a Unix domain socket; the user terminal and the virtual machine support the remote desktop protocol;
[0008] The host machine receives the remote desktop service data fed back by the virtual machine based on the user operation data through the Unix domain socket, and sends the remote desktop service data to the user terminal.
[0009] In the embodiment of the present application, the host machine is used as a "bridge" between the virtual machine and the user terminal to forward the user operation data and the remote desktop service data, establish indirect communication between the user terminal and the virtual machine, so that the virtual machine and the user terminal can smoothly interact with each other, and provide users with remote desktop services based on the open source remote desktop protocol, thereby reducing the cost of remote desktop services. In addition, Unix domain sockets are a form of inter-process communication (IPC), which allows the host machine and the virtual machine to efficiently exchange data within the local system without going through the network protocol stack, thereby improving communication efficiency and reducing the complexity of the host machine's need to support the remote desktop protocol at the application layer.
[0010] In a possible implementation, the Unix domain socket is deployed in the host machine, an agent component is further deployed in the host machine, the host machine receives user operation data sent by the user terminal, and sends the user operation data to the virtual machine deployed in the host machine through the Unix domain socket, including:
[0011] The proxy component receives the user operation byte stream sent by the user terminal, and writes the user operation byte stream into the Unix domain socket, so that the virtual machine reads the user operation byte stream from the Unix domain socket; the user operation byte stream is the user operation data in the form of a byte stream obtained by the user terminal encapsulating the user operation data based on the remote desktop protocol;
[0012] The host machine receives the remote desktop service data fed back by the virtual machine based on the user operation data through the Unix domain socket, and sends the remote desktop service data to the user terminal, including:
[0013] The proxy component reads a remote desktop service byte stream through the Unix domain socket; the remote desktop service byte stream is the remote desktop service data in the form of a byte stream obtained by encapsulating the remote desktop service data by the virtual machine based on the remote desktop protocol;
[0014] The proxy component sends the remote desktop service byte stream to the user terminal.
[0015] In an embodiment of the present application, data is transmitted between the proxy component and the user terminal in the form of a byte stream, and data is also transmitted between the proxy component and the Unix domain socket in the form of a byte stream, and data is also transmitted between the Unix domain socket and the virtual machine in the form of a byte stream. In this way, during the data transmission process, data is only transmitted in the form of a byte stream at the transport layer, and there is no need to pay attention to the data at the application layer. The proxy component and the Unix domain socket do not need to support the remote desktop protocol. In addition, by transmitting data in a unified byte stream format, data is kept consistent when it is transmitted between different components, which simplifies the data processing logic and improves the efficiency of implementing remote desktop services.
[0016] In a possible implementation, the remote desktop service data is generated as follows:
[0017] The virtual machine obtains the user operation byte stream from the Unix domain socket, and parses the user operation byte stream based on the remote desktop protocol to obtain the user operation data;
[0018] The virtual machine executes the user operation described by the user operation data in a virtual environment to obtain remote desktop service data.
[0019] After the virtual machine obtains the user operation byte stream from the Unix domain socket, it can restore the user operation byte stream to user operation data based on the remote desktop protocol, and then parse the user operation data to confirm the operation performed by the user. Then, the virtual machine simulates these operations in the virtual environment, and uses the obtained operation results as remote desktop service data to implement remote desktop service.
[0020] In a possible implementation, a proxy component is deployed in the host machine, and the proxy component is used to expose the host machine port to the user terminal. Before the host machine receives the user operation data sent by the user terminal, the following steps are further included:
[0021] The proxy component receives a connection request sent by the user terminal through the host port, and establishes a communication channel between the proxy component and the user terminal.
[0022] In the embodiment of the present application, the host port is exposed to the user terminal through the proxy component, so that the user terminal establishes a communication connection with the proxy component in the host through the host port. After the proxy component establishes a communication channel with the user terminal, the user terminal and the proxy component can exchange data based on the communication channel, which simplifies the communication process and improves the communication efficiency.
[0023] In a possible implementation, the connection request includes a user identifier, the user operation data is first user operation data or second user operation data, and before the host machine receives the user operation data sent by the user terminal, the further comprises:
[0024] The proxy component searches for historical remote desktop service data corresponding to the user identifier according to the user identifier;
[0025] If the historical remote desktop service data is found, the user operation data is first user operation data, the proxy component sends the historical remote desktop service data to the user terminal; the first user operation data is used to describe the user's operation in the historical remote desktop, and the historical remote desktop is the desktop displayed by the user terminal based on the historical remote desktop service data;
[0026] If the historical remote desktop service data is not found, the user operation data is second user operation data, and the agent component sends initial remote desktop service data to the user terminal; the second user operation data is used to describe the user's operation in the default remote desktop, and the default remote desktop is the desktop displayed by the user terminal based on the initial remote desktop service data.
[0027] In an embodiment of the present application, the proxy component can query historical remote desktop service data based on the user identifier to distinguish between new and old users. When the historical remote desktop service data corresponding to the user identifier is queried, the remote desktop that was last operated can be provided to the old user based on the historical remote desktop service data. The old user can continue to operate the historical remote desktop, meet the user's personalized needs, and improve the user's comfort in using remote desktop services. If the historical remote desktop service data corresponding to the user identifier is not queried, the default remote desktop that has not been operated can be displayed to the new user, which can help the new user quickly become familiar with the layout and functions of the remote desktop, reduce the learning cost of the new user, and improve the efficiency of use. By distinguishing between new and old users, remote desktop services can be provided in a targeted manner to improve the user experience.
[0028] In a possible implementation, the method further includes:
[0029] The host machine configures the virtual machine to map the address and port of the virtual machine to the Unix domain socket, and establishes a communication channel between the virtual machine and the Unix domain socket.
[0030] In an embodiment of the present application, by mapping the address and port of the virtual machine to a Unix domain socket, a communication channel can be established between the virtual machine and the Unix domain socket, allowing the virtual machine and the Unix domain socket to communicate locally, reducing the risks in the network transmission process and improving the security of communication.
[0031] In a possible implementation, the host machine receives user operation data sent by the user terminal, and sends the user operation data to the virtual machine deployed in the host machine through a Unix domain socket, including:
[0032] The host machine determines the Unix domain socket corresponding to the host port according to the host port for receiving the user operation data and a port mapping table; and sends the user operation data to the virtual machine corresponding to the Unix domain socket through the Unix domain socket; the port mapping table is used to describe a one-to-one correspondence between multiple host ports and multiple Unix domain sockets.
[0033] In the embodiment of the present application, data transmission between the host machine and the virtual machine deployed in the host machine is realized through the Unix domain socket. Moreover, through the port mapping table, not only can the data be accurately transmitted to the corresponding virtual machine or user terminal, but also the corresponding relationship between multiple host machine ports and multiple Unix domain sockets can be flexibly configured to meet different communication path requirements.
[0034] In a possible implementation, after the host machine receives the user operation data sent by the user terminal and before the host machine sends the user operation data to the virtual machine, the method further includes:
[0035] The host machine sends a remote desktop service start instruction to the virtual machine.
[0036] In an embodiment of the present application, before the user uses the remote desktop service, a remote desktop service startup instruction is sent to the virtual machine, so that the virtual machine can start the remote desktop service in advance, ensuring that the virtual machine has started the corresponding service before receiving the user operation data, avoiding delays or errors, speeding up the response speed, and improving the user experience.
[0037] In a possible implementation, the method further includes:
[0038] The proxy component performs channel reinforcement on a communication channel between the proxy component and the user terminal.
[0039] In the embodiment of the present application, by reinforcing the communication channel between the proxy component and the user terminal, the communication security can be effectively improved to avoid leakage of sensitive data or attacks.
[0040] In a second aspect, an embodiment of the present application provides a remote desktop implementation device, including:
[0041] A receiving module, used for receiving user operation data sent by a user terminal, and sending the user operation data to a virtual machine deployed in the host machine through a Unix domain socket; the user terminal and the virtual machine support a remote desktop protocol;
[0042] The sending module is used to receive the remote desktop service data fed back by the virtual machine based on the user operation data through the Unix domain socket, and send the remote desktop service data to the user terminal.
[0043] In a possible implementation, the Unix domain socket is deployed in the host machine, an agent component is also deployed in the host machine, and the receiving module is specifically used for:
[0044] receiving a user operation byte stream sent by the user terminal through a proxy component, and writing the user operation byte stream into the Unix domain socket, so that the virtual machine reads the user operation byte stream from the Unix domain socket; the user operation byte stream is the user operation data in the form of a byte stream obtained by the user terminal encapsulating the user operation data based on a remote desktop protocol;
[0045] The sending module is specifically used for:
[0046] Reading a remote desktop service byte stream through the Unix domain socket; the remote desktop service byte stream is the remote desktop service data in the form of a byte stream obtained by encapsulating the remote desktop service data by the virtual machine based on the remote desktop protocol;
[0047] The remote desktop service byte stream is sent to the user terminal through a proxy component.
[0048] In a possible implementation, the remote desktop service data is generated as follows:
[0049] The virtual machine obtains the user operation byte stream from the Unix domain socket, and parses the user operation byte stream based on the remote desktop protocol to obtain the user operation data;
[0050] The virtual machine executes the user operation described by the user operation data in a virtual environment to obtain remote desktop service data.
[0051] In a possible implementation, a proxy component is deployed in the host machine, and the proxy component is used to expose the host machine port to the user terminal, and the receiving module is further used to:
[0052] The connection request sent by the user terminal through the host port is received by the proxy component, and a communication channel is established between the proxy component and the user terminal.
[0053] In a possible implementation manner, the connection request includes a user identifier, the user operation data is first user operation data or second user operation data, and the receiving module is further configured to:
[0054] Searching for historical remote desktop service data corresponding to the user identifier according to the user identifier through an agent component;
[0055] If the historical remote desktop service data is found, the user operation data is first user operation data, the sending module is further used to send the historical remote desktop service data to the user terminal through the proxy component; the first user operation data is used to describe the user's operation in the historical remote desktop, and the historical remote desktop is the desktop displayed by the user terminal based on the historical remote desktop service data;
[0056] If the historical remote desktop service data is not found, the user operation data is second user operation data, and the sending module is further used to send initial remote desktop service data to the user terminal through the proxy component; the second user operation data is used to describe the user's operation in the default remote desktop, and the default remote desktop is the desktop displayed by the user terminal based on the initial remote desktop service data.
[0057] In a possible implementation manner, the device further includes:
[0058] The connection module is used to configure the virtual machine to map the address and port of the virtual machine to the Unix domain socket, and establish a communication channel between the virtual machine and the Unix domain socket.
[0059] In a possible implementation, the receiving module is specifically configured to:
[0060] According to the host port receiving the user operation data and the port mapping table, the Unix domain socket corresponding to the host port is determined; and the user operation data is sent to the virtual machine corresponding to the Unix domain socket through the Unix domain socket; the port mapping table is used to describe the one-to-one correspondence between multiple host ports and multiple Unix domain sockets.
[0061] In a possible implementation, after the host machine receives the user operation data sent by the user terminal and before the host machine sends the user operation data to the virtual machine, the receiving module is further configured to:
[0062] A remote desktop service start instruction is sent to the virtual machine.
[0063] In a possible implementation manner, the device further includes:
[0064] A reinforcement module is used to reinforce the communication channel between the proxy component and the user terminal through the proxy component.
[0065] In a third aspect, an embodiment of the present application provides a server, comprising a processor, and a memory communicatively connected to the processor;
[0066] The memory is used to store computer-executable instructions;
[0067] The processor is used to execute the computer-executable instructions stored in the memory to implement the remote desktop implementation method described in any embodiment of the first aspect above.
[0068] In a fourth aspect, an embodiment of the present application provides a computer storage medium, in which a code is stored. When the code is executed, a device executing the code implements the remote desktop implementation method described in any one of the first aspects above. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0070] Figure 1 A schematic diagram of a scenario of a remote desktop implementation method provided in an embodiment of the present application;
[0071] Figure 2 A schematic diagram of another remote desktop implementation method provided in an embodiment of the present application;
[0072] Figure 3 A schematic diagram of a software architecture for implementing a remote desktop provided in an embodiment of the present application;
[0073] Figure 4 A software architecture diagram of a server provided in an embodiment of the present application;
[0074] Figure 5 A timing diagram of a remote desktop implementation method provided in an embodiment of the present application;
[0075] Figure 6 A remote desktop service configuration method provided in an embodiment of the present application;
[0076] Figure 7A schematic diagram of the structure of a remote desktop implementation device provided in an embodiment of the present application;
[0077] Figure 8 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] It should be noted that the embodiments described in this application are only part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0079] In order to make the following embodiments clear, the technical terms involved in this application are first introduced.
[0080] Remote desktop, also known as cloud desktop, is a technology that extends the computer desktop environment to a remote device (the terminal device used by the user) through the Internet. It allows users to connect to and control the desktop environment on another computer from one location (usually a remote location) through the network. Users do not need to be limited to a specific device and can access their desktop environment through an Internet connection, which improves the flexibility and convenience of work. The server that provides remote desktop services stores the user's desktop environment on a remote server or cloud platform to achieve resource sharing and centralized management, which can better control and manage the user's computing environment. Remote desktop services can reduce the cost of users maintaining personal devices, while also reducing the company's IT management costs and improving resource utilization and efficiency.
[0081] A virtual machine is a computer environment implemented by software, which refers to a virtual machine established on a physical machine through virtualization technology. A virtual machine can simulate a complete computer with a complete operating system, computer hardware equipment and application software. Virtual machine technology can run multiple virtual machines on a computing server in a server cluster, and each virtual machine can run independently, completely isolated from each other and not affecting each other. In the embodiment of the present application, remote desktop services can be provided to users through virtual machines.
[0082] A guest operating system (GuestOS), a client operating system, refers to an operating system running in a virtual machine. GuestOS is a software that can run on top of the operating system of a physical computer (such as a server), allowing users to run multiple operating systems at the same time. Through virtualization technology, multiple GuestOS can be run on the same physical computer, that is, multiple virtual machines are deployed on the same physical computer, and each GuestOS can run independently, with its own system resources and independent operating environment.
[0083] Qemu-Guest-Agent (QGA) is a tool for communication between virtual machines and host machines. QGA can run in the operating system of the virtual machine (such as GuestOS), and the host machine can control and monitor the status of the virtual machine through QGA. The main function of QGA is to realize information exchange between the virtual machine and the host machine, so that the host machine can obtain the status information of the virtual machine, so as to more conveniently manage and monitor the virtual machine.
[0084] Unix Domain Socket (Unix Socket for short) is a local socket provided by the Unix operating system. It is a mechanism for inter-process communication. Unix Domain Socket can establish a bidirectional communication channel between different processes on the same computer, allowing processes on the same computer to communicate without going through the network protocol stack. Unix Domain Socket is also called IPC (Inter-Process Communication) socket.
[0085] Remote Display Protocol (RDP) is an open source remote desktop protocol. GuestOS usually supports RDP protocol so that virtual machines can provide remote desktop services. RDP protocol allows users to connect from a computer (such as a smartphone or tablet) to another remote computing device (such as a server) to control applications, files, and network resources on the remote computing device. RDP protocol can realize remote desktop, remote control, remote application and other functions.
[0086] Virtual Network Console (VNC) is an open source remote graphical console solution that integrates multiple physical network consoles into a virtual network console through virtualization technology to achieve centralized management and control of multiple network devices. It can virtualize the console interface of network devices, allowing users to manage and configure multiple network devices through a unified console without having to log in to the console of each device separately.
[0087] The Simple Protocol for Independent Computing Environment (SPICE) is an open-source remote computing protocol designed to provide high performance and a good user experience for remote desktops. This protocol is widely used in virtualization and remote desktop environments, especially in Linux systems.
[0088] The embodiment of the present application provides a remote desktop implementation method and server, which uses Unix domain sockets to establish a communication connection between the virtual machine operating system and the host agent component, and then exposes the host's network port to the user terminal through the agent component in the host. When the user needs to use the remote desktop, the user terminal establishes a communication connection with the host through the host's network port. When the virtual machine provides remote desktop services, the user terminal indirectly transmits real-time data with the virtual machine through the agent component in the host. The use of the agent component for data transfer solves the problem of network isolation between the user terminal and the virtual machine. The virtual machine communicates with the host to avoid exposing the network plane of the virtual machine and related services to the user terminal. In addition, the host can communicate with the virtual machine through the local network using the agent component, and data transmission can be achieved without the help of a physical network, thereby providing remote desktop services to the user. Through the remote desktop implementation method provided by the embodiment of the present application, the remote desktop can be implemented based on the open source RDP protocol, reducing the service cost of the remote desktop.
[0089] It should also be emphasized that the remote desktop implementation method provided in the embodiment of the present application does not involve modifications to the internal operating system of the virtual machine and the RDP protocol. A communication connection between the virtual machine and the user terminal is established by running an agent component in the host machine, thereby realizing a remote desktop based on an open source protocol.
[0090] The host machine (computing device) in the embodiments of the present application is, for example, a server, a computer, or other device with computing capabilities. The server may be, for example, a rack server, a blade server, a high-density server, a tower server, a whole cabinet server, or other servers in various forms. The embodiments of the present application are described by taking the computing device as a server as an example. The user terminal in the embodiments of the present application is an electronic device that can have computing capabilities, such as a smart phone, a tablet computer, a laptop computer, and a thin client.
[0091] Below, the application scenarios of the embodiments of the present application are exemplarily described with reference to the accompanying drawings.
[0092] In one possible application scenario, a server cluster can be used to provide remote desktop services to users. Figure 1 As shown, the server cluster includes multiple servers with computing capabilities, and the server (also called host machine) can deploy one or more virtual machines.
[0093] In another possible application scenario, the server can be used to provide remote desktop services to users. Figure 2 As shown, the server (also called the host machine) includes multiple virtual machines for providing remote desktop services, and the user terminals are connected to the virtual machines in a one-to-one correspondence.
[0094] The virtual machine is used to provide remote desktop services for users. The user terminal is used to provide an interface for user interaction, through which the user can choose to use the remote desktop and operate the remote desktop. The remote desktop service in the virtual machine is in the started state. When the user uses the remote desktop service, the user terminal is used to communicate indirectly with the virtual machine to transmit remote desktop service data in real time, such as audio data and image data.
[0095] Below, the software architecture of the embodiment of the present application is exemplarily described with reference to the accompanying drawings.
[0096] like Figure 3 As shown, Figure 3 A schematic diagram of a software architecture for implementing a remote desktop provided in an embodiment of the present application. A host machine deploys three virtual machines at the same time through a virtualization platform, and can provide remote desktop services to three users at the same time.
[0097] The client is software running on the user terminal, such as Figure 3 Client A, Client B and Client C in the client. When performing remote desktop services, the client is used to receive the remote desktop service data forwarded by the proxy component from the virtual machine, and display an interactive remote desktop to the user based on the remote desktop service data. When the user operates the remote desktop, the client can send the user operation data to the proxy component, and the proxy component forwards it to the virtual machine running GuestOA through Unix Socket, thereby realizing duplex communication between the virtual machine and the client. The client connects to the proxy component through the host port exposed by the proxy component on the management plane. The client can connect to the host port through the RDP protocol, and the host port can be the Transmission Control Protocol (TCP) port of the host.
[0098] Virtualization platforms, such as KVM (Kernel-based Virtual Machine), can create and run multiple virtual machines on a physical host. KVM uses the virtualization function of the Linux kernel to support virtual machines by virtualizing the processor of the physical host into multiple virtual processors and providing virtualized memory management and I / O device virtualization. KVM itself is a kernel module. By loading this module, the Linux kernel can transform itself into a virtual machine manager, that is, a virtualization platform. KVM includes the KVM module, QEMU (Quick Emulator) and the management tool Libvirt. The KVM module is responsible for creating virtual machines on the physical host; QEMU is used to simulate a complete computer system, including processors, memory, storage devices, and network interfaces; Libvirt is used to configure virtual machines, such as configuring the data channel between the virtual machine and the Unix Socket.
[0099] The proxy component is used to implement proxy communication that forwards TCP communication to Unix Socket. The proxy component and the client exchange data through TCP communication, and the proxy component and the virtual machine communicate in duplex mode through Unix Socket. The proxy component can perform multiple groups of proxy communication at the same time. Figure 3 As shown, the proxy component communicates with multiple clients at the same time, and performs duplex communication with multiple virtual machines through Unix Socket at the same time. The proxy component can forward the user operation data sent by client A to virtual machine A running GuestOS A, and forward the remote desktop service data sent by virtual machine B running GuestOS B to client B. The proxy component is also used to reinforce the communication channel between the proxy component and the client to improve the security of data transmission.
[0100] Unix Socket can forward the data sent by the proxy component to the virtual machine, and forward the data sent by the virtual machine to the proxy component, such as Figure 3 Unix Socket A, Unix Socket B and Unix Socket C in the figure. UnixSocket does not rely on the network protocol stack, but directly uses the file system for communication. The implementation of Unix Socket is based on the file system. Unix Socket is regarded as a special file. The proxy component and GusetOS can read and write Unix Socket like ordinary files. Data transmission and synchronization between the proxy component and GusetOS can be achieved through Unix Socket.
[0101] GusetOS is an operating system running in a virtual machine, such as Figure 3 GusetOS A, GusetOS B and GusetOS C in the figure. The remote desktop service component (RDP Server) and QGA run in GusetOS. GusetOS can read the user operation data written by the proxy component from the UnixSocket, and write the remote desktop service data generated by the RDP Server to the Unix Socket. The proxy component then reads the remote desktop service data from the Unix Socket and sends it to the client. GusetOS is also used to map the IP address and port number of the virtual machine TCP communication to the Unix Socket, thereby establishing a communication connection between the Unix Socket and the virtual machine.
[0102] The server management module is used to configure the data channel between GuestOS and Unix Socket through Libvirt, and is also used to start the RDP Server of each virtual machine through QGA and monitor the status of each RDP Server.
[0103] In the embodiment of the present application, Unix Socket is used to establish a communication connection between the proxy module and each virtual machine, so that the proxy module and the virtual machine can exchange data in a two-way manner. In addition, the proxy module is used to implement proxy communication between the client and the virtual machine, so that the client and the virtual machine can communicate indirectly. The network isolation between the client and the virtual machine is eliminated by the proxy component, and the virtual machine can receive the user operation data sent by the user end in real time, and send the remote desktop service data to the user end in real time, thereby providing remote desktop services for the user. In addition, the RDP protocol supported by GuestOS has good fluency and performance when providing remote desktop services, and RDP Server is integrated in GuestOS, and GuestOS supports data transmission based on the RDP protocol, without modifying the data transmission protocol of the proxy component and Unix Socket so that the proxy component and Unix Socket support the RDP protocol, thereby reducing the cost of providing remote desktop services.
[0104] The above-mentioned server management module, proxy component, Unix Socket and GuestOS running in the virtual machine are all deployed in the host machine. The software architecture of the host machine is exemplarily described below with reference to the accompanying drawings.
[0105] Figure 4 A diagram of the software architecture of a host machine provided in an embodiment of the present application. The host machine software architecture can be divided into a management layer, a proxy layer, and a virtualization layer.
[0106] The management layer includes a server management module and a database. The server management module is used to configure the data channel between the virtual machine and the Unix Socket through Libvirt, so that the IP address and port number of the virtual machine TCP are mapped to the Unix Socket. In another implementation, the server management module can also configure the data channel between the virtual machine and the Unix Socket through QGA. The server management module is also used to start the RDP Server in the virtual machine through QGA and monitor the running status of the RDPServer. The server management module is also used to provide a server management page to the technician. The technician can configure the IP address and port number of the virtual machine, as well as the data channel between the virtual machine and the Unix Socket through the server management page, and can also view the running status of the RDP Server in each virtual machine. The database is used to store host-related configuration information (such as network configuration and storage configuration), user data and service logs for administrators to manage.
[0107] The proxy layer includes proxy components and Unix Socket. The proxy component establishes a connection with the client through TCP, receives the user operation data of the client, and sends remote desktop service data to the client; the proxy component communicates bidirectionally with the virtual machine through Unix Socket. The proxy component is also used to reinforce the communication channel between the proxy component and the client to improve data transmission security. As a communication channel between the proxy component and the virtual machine, Unix Socket can provide bidirectional data transmission and synchronization, so that the proxy component and the virtual machine can exchange data in real time. In addition, Unix Socket does not rely on the network protocol stack and directly uses the file system for communication, which reduces the overhead and delay of network communication. Even if the virtual machine does not support network communication, bidirectional communication between the virtual machine and the proxy component can be achieved.
[0108] The virtualization layer includes GuestOS, which includes RDP Server and QGA. GuestOS is the operating system running in the virtual machine. The virtual machine can run RDP Server to provide remote desktop services for users; it can generate remote desktop service data based on the user operation data of the client, and transmit the data to the agent component through Unix Socket.
[0109] QGA acts as a bridge between the virtual machine and the host. The server management module can collect the running status of the RDP Server and the status information of the virtual machine, such as CPU usage, memory usage, and disk space, in real time through QGA, and then use this information to monitor the running status of the virtual machine and manage it. The server management module can also send commands to the virtual machine through QGA and obtain the execution results of the commands. For example: configure the data channel between the virtual machine and the Unix Socket and start the RDP Server. QGA makes it easier for the host to manage and monitor the virtual machine, improving the reliability and security of the virtualization environment. It makes the management of virtual machines more efficient, flexible, and reliable, thereby providing users with a better virtualization experience.
[0110] Through the joint action of the various parts of the above software architecture, the host machine can realize data transmission between the client and the virtual machine. The user can operate the virtual machine in real time and get the experience of remote desktop services. The proxy component plays a key part in connecting the client and the virtual machine, ensuring the reliability and security of communication and breaking the network isolation between the virtual machine and the client.
[0111] In combination with the software architecture described above, the implementation method of the remote desktop provided by the embodiment of the present application is introduced. Figure 5 As shown, Figure 5 A timing diagram of a remote desktop implementation method provided in an embodiment of the present application. The implementation process of the remote desktop service includes:
[0112] S501: The client communicates with the proxy component in the host through the host port exposed by the proxy component.
[0113] The client refers to the client software that supports the RDP protocol in the user terminal operated by the user. The client is used to respond to the user triggering the remote desktop service, and send a connection request to the proxy component based on the host port to establish a communication channel between the client and the proxy component. The host port is the TCP port of the host exposed to the client by the proxy component in management, and the communication channel between the client and the proxy component is a data transmission channel that supports the TCP protocol. The client communicates with the proxy component configured on the host through the host port to realize the remote connection of the client to the host, and then the client and the proxy component can realize data transmission in the form of byte stream. As an example, a stable TCP connection is established between the client and the proxy component after completing the TCP three-way handshake process.
[0114] The RDP protocol is an application layer protocol built on the TCP protocol. The TCP protocol is a transport layer protocol that only focuses on the transmission of byte streams and not business data. The RDP protocol is an application layer protocol that encapsulates business data into byte streams. In other words, during the data interaction between the proxy component client and the proxy component, the proxy component only focuses on the transmission of byte streams and does not focus on business data. That is, the proxy component only needs to support the TCP protocol and does not need to support the RDP protocol. For the proxy component, it receives data in the form of byte streams from the client based on the TCP protocol and writes the data to the Unix Socket; or reads data from the Unix Socket and sends the data to the client in the form of byte streams based on the TCP protocol.
[0115] In a possible implementation, after the client establishes a communication channel with the proxy component, the virtual machine can provide remote desktop services to the client, and the client displays the remote desktop to the user and accepts the user's operations on the remote desktop. In the host machine, the proxy component and the virtual machine can synchronize data through Unix Socket, and the RDPServer in the virtual machine is in the started state. After the client establishes a communication channel with the proxy component, the virtual machine sends the remote desktop service data to the client through the proxy component.
[0116] In another possible implementation, the connection request includes a user identifier. The user identifier is, for example, a user identity document (ID) or a user account, and each user corresponds to a unique user identifier. After establishing a communication connection between the client and the proxy component, the virtual machine or the proxy component can search the database for historical remote desktop service data for the user based on the user identifier. If the historical remote desktop service data corresponding to the user identifier is obtained, indicating that the user has used the remote desktop before, the remote desktop service is provided to the user based on the historical remote desktop service data, and the historical remote desktop that the user has used is displayed to the user; if the historical remote desktop service data corresponding to the user identifier is not obtained, indicating that the user is using the remote desktop for the first time, the initial remote desktop service data is sent to the client, so that the client displays the initialized default remote desktop to the user. The historical remote desktop service data is the data for the last time the remote desktop service was provided to the user.
[0117] As an example, if the user has installed a certain application software using the remote desktop in the last remote desktop service, the remote desktop displayed to the user this time will include the icon of the application software, and the user can directly use the application software without repeated installation.
[0118] S502: The client sends user operation data to the proxy component in response to the user's operation on the remote desktop.
[0119] User operation data is used to describe the user's operations in the remote desktop, such as the user's click operations, input operations, command execution operations, function use operations and other interactive operations. When the user operates the remote desktop, the client encapsulates the user operation data into user operation data in the form of a byte stream (i.e., user operation byte stream) based on the RDP protocol, and sends the user operation data in the form of a byte stream to the proxy component based on the TCP protocol (i.e., the user operation byte stream is sent to the proxy component), and then indirectly sends it to the virtual machine that provides remote desktop services for the client.
[0120] In a possible implementation, if during the connection between the client and the proxy component, the proxy component queries the historical remote service data corresponding to the user ID, it indicates that this is not the first time that the user has used the remote desktop service. The proxy component sends the historical remote service data corresponding to the user ID to the client, so that the client can display the historical remote desktop to the user based on the historical remote service data. The historical remote desktop refers to the remote desktop displayed before the user last exited the remote desktop service. At this time, the user operation data is also called the first user operation data, and the first user operation data is used to describe the user's operation in the historical remote desktop. It can also be understood that the first user operation data is used to describe the user's operation on the currently displayed remote desktop (historical remote desktop) based on the historical remote service data.
[0121] On the contrary, if during the connection between the client and the proxy component, the proxy component does not query the historical remote service data corresponding to the user ID, it means that the user is using the remote desktop service for the first time. The proxy component sends the initial remote service data to the client, so that the client displays the default remote desktop to the user based on the initial remote service data. The default remote desktop is the remote desktop that is initially displayed when the remote desktop service is provided. At this time, the user operation data is also called the second user operation data. The second user operation data is used to describe the user's operation in the default remote desktop. It can also be understood that the second user operation data is used to describe the user's operation on the currently displayed remote desktop (default remote desktop) based on the initial remote service data.
[0122] In a possible implementation, a client sends user operation data to a proxy component.
[0123] The client and the proxy component communicate based on the TCP protocol. The proxy component converts the byte stream sent by the client into duplex read and write operations on the Unix Socket. The virtual machine and Unix Socke forward the user operation data to the virtual machine in a duplex manner through the channel between the virtual machine and Unix Socke in the form of a byte stream. The byte stream does not change during the intermediate process. For the virtual machine, it is just an ordinary network read and write operation.
[0124] It should be noted that the channel between the virtual machine and the Unix Socket is also a data transmission channel that supports the TCP protocol. User operation data and remote desktop service data in subsequent steps are also transmitted between the virtual machine and the Unix Socket in the form of byte streams. Unix Socket only focuses on the transmission of byte streams and does not focus on business data. That is, Unix Socket only needs to support the TCP protocol and does not need to support the RDP protocol. For Unix Socket, data is transmitted between Unix Socket and the proxy component in the form of byte streams, and data is also transmitted between Unix Socket and the virtual machine in the form of byte streams.
[0125] In a possible implementation, the proxy component listens to the host port connected to the client on the host. When the proxy component receives user operation data, the proxy component receives the user operation data in the form of a byte stream, writes it into the Unix Socket in the form of a byte stream, and forwards it to the virtual machine through the Unix Socket. The proxy component can communicate with the Unix Socket based on the TCP protocol to realize data forwarding, thereby realizing communication between the virtual machine and the client.
[0126] In another possible implementation, the proxy component can send the user operation data sent by the client to the virtual machine through the Unix Socket according to the port mapping table, or send the remote desktop service data sent by the virtual machine to the client according to the port mapping table. The port mapping table is used to describe the correspondence between each Unix Socket and each host port. The Unix Socket and the host port usually correspond one to one. As shown in Table 1.
[0127] Table 1: Port mapping table
[0128] Host port Unix Socket Host port A Unix Socket A Host port B Unix Socket B Host port C Unix Socket C
[0129] The proxy node can expose multiple host ports on the management plane, and the client is connected to the host port one-to-one. Unix Socket corresponds to the host port one-to-one, and Unix Socket corresponds to GuestOS one-to-one. Each UnixSocket is mapped to only one virtual machine's IP address and TCP port. Therefore, there is a corresponding relationship between the client, host port, UnixSocket and virtual machine.
[0130] When the proxy node listens to the host port A and obtains the user operation data, it sends the user operation data to the RDP Server in the corresponding virtual machine through UnixSocket A. When the proxy node reads Unix Socket B and obtains the remote desktop service data, it sends the remote desktop service data through the host port B to the client connected to the host port B.
[0131] By forwarding data based on the corresponding relationship described in the port mapping table, user operation data and remote desktop service data can be accurately sent to the correct recipient (client or virtual machine), thereby improving the stability of the remote desktop service.
[0132] S503: The client receives the remote desktop service data sent by the proxy component, and displays the remote desktop service data to the user.
[0133] After receiving the user operation data, the virtual machine parses the user operation data in the form of byte stream based on the RDP protocol, restores it to business data (i.e., parses the user operation byte stream to obtain the user operation data), and interprets these operations as local operations and executes them in the virtual environment to provide remote desktop services. By simulating the user's operations on the remote desktop in the virtual environment, remote desktop service data, such as screen images, sounds, etc., are obtained. The virtual machine encapsulates the remote desktop service data into data in the form of byte stream based on the RDP protocol (i.e., encapsulates the remote desktop service data into remote desktop service byte stream), and then sends the remote desktop service data back to the proxy component in the form of byte stream through Unix Socket (i.e., sends the remote desktop service byte stream to the proxy component through Unix Socket), and the proxy component then returns the remote desktop service data to the client in the form of byte stream (i.e., the proxy component sends the remote desktop service byte stream to the user terminal).
[0134] After the client receives the remote desktop service data from the proxy component, it restores the remote desktop service data from the byte stream into business data based on the RDP protocol, and outputs the remote desktop image and sound to the user's local device. The user can then see the remote desktop and perform operations.
[0135] In a possible implementation, the process of the virtual machine obtaining the remote desktop service data according to the user operation data is as follows:
[0136] The virtual machine parses the user operation data and simulates local operations based on the user operation data. The virtual machine converts the user operation data into input events of input devices such as keyboards and mice. The RDP Server simulates these events in the virtual environment. The simulated events occur directly locally. For example, if the user operation data includes a mouse click operation, the RDP Server generates a corresponding mouse click event in the GuestOS of the virtual machine. After receiving the input event, the GuestOS processes the input event as if it were a local operation of a real user, and outputs the corresponding processing results. The RDPServer captures the processing results output by the GuestOS, such as screen images, window changes, cursor movements, and audio, and encodes the captured processing results into remote desktop service data. The encoded remote desktop service data is sent to the proxy component via a Unix socket. The proxy component then sends the remote desktop service data back to the client.
[0137] After the client receives the remote desktop service data fed back by the virtual machine, it decodes and displays it on the user terminal, so that the user can see the results of his or her operations.
[0138] The RDP protocol supported by the client and GuestOS has good fluency and performance in the Windows scenarios commonly used by remote desktops, allowing users to use remote desktop services smoothly. In addition, the RDP protocol can support audio, video streaming, file transfer, printing and other multimedia operations, as well as multiple monitors and graphics processor (GPU) acceleration, covering most remote desktop usage scenarios; at the same time, technologies such as bitmap caching, frame caching and data compression can be used to reduce network latency and bandwidth usage, further improving the fluency of remote desktops.
[0139] In the remote desktop implementation method provided in the embodiment of the present application, an indirect communication connection between a virtual machine and a client is established through a proxy component and a Unix Socket, the client and the virtual machine can transmit data in real time, ignoring the network isolation between the virtual machine and the client, and using the virtual machine based on an open source protocol to provide remote desktop services to users, thereby reducing the cost of providing remote desktop services.
[0140] Before the client connects to the virtual machine for a remote desktop session, it is necessary to first configure the host machine accordingly, such as establishing a data channel between the virtual machine and the Unix Socket. The following is an exemplary description of the configuration method of the remote desktop service provided in the embodiment of the present application in conjunction with the accompanying drawings. Figure 6 As shown, Figure 6 A remote desktop service configuration method provided in an embodiment of the present application includes:
[0141] S601: The server management module configures the virtual machine through QGA.
[0142] The server management module configures the data channel between the virtual machine and the Unix Socket through QGA, establishes a communication connection between the virtual machine and the Unix Socket, and configures the IP address and TCP port of the virtual machine.
[0143] In a possible implementation, the server management module can configure the data channel of the guestfwd mode through Libvirt. The server management module edits the Libvirt configuration file of the virtual machine, adds the guestfwd configuration item in the Libvirt configuration file, and specifies the UnixSocket path of forwarding the IP address and TCP port on the virtual machine to the host machine. After modifying the Libvirt configuration file, the virtual machine can be restarted or the running virtual machine can be updated using the Libvirt command or API to make the new configuration effective.
[0144] The guestfwd mode data channel can safely expose the network services in the virtual machine to the external network (host network), and there is no need to configure additional network interfaces in the virtual machine, which facilitates the isolation and control of data flows. The proxy component communicates through Unix Socket, which is equivalent to communicating with the TCP service process in the virtual machine.
[0145] S602: The virtual machine establishes a communication channel with the Unix Socket, and maps the IP address and TCP port of the virtual machine to the Unix Socket.
[0146] The QGA in the virtual machine GuestOS receives the relevant configuration of the server management module, establishes a communication channel between the virtual machine and the UnixSocket, and then maps the IP address and TCP port of the virtual machine providing the RDP service to the UnixSocket, ensuring that the user operation data sent from the proxy component can be accurately delivered to the Unix Socket and then forwarded to the virtual machine. In addition, the virtual machine can also send remote desktop service data to the UnixSocket through this communication channel. The communication channel between the virtual machine and the Unix Socket is a data transmission channel that supports the TCP protocol. When transmitting user operation data and remote desktop service data between the virtual machine and the Unix Socket, they are all transmitted in the form of byte streams. The Unix Socket only needs to support the TCP protocol and does not need to support the RDP protocol.
[0147] In one possible implementation, each virtual machine has a unique IP address and TCP port. UnixSocket uses a special file in the Unix file system to implement communication between the proxy component and the virtual machine. When a Unix socket is created, a special file is created in the file system, and the file is used as a channel for communication between the proxy component and the virtual machine. By mapping the IP address and TCP port of the virtual machine to the Unix Socket, the proxy component can connect to the virtual machine through this file, thereby achieving two-way communication. Unlike conventional network sockets, Unix Socket can only communicate within the host machine, and Unix Socket does not rely on network protocols. Unix sockets have faster data transmission speeds than other network sockets, making remote desktop services more fluent.
[0148] In the embodiment of the present application, the proxy component communicates through Unix Socket, which is equivalent to communicating with the TCP process in the virtual machine. For the RDP Server inside the virtual machine, the RDP Server only listens and receives data from the TCP port of the virtual machine, and does not need to worry about whether the data actually comes from the Unix Socket in the host machine through the data channel. Similarly, the proxy component on the host machine only communicates with the local Unix Socket, without considering the details of the connection between the virtual machine and the Unix Socket. When the proxy component writes data to the Unix Socket, these data will be sent to the TCP port inside the virtual machine through the data channel. Conversely, when the RDP Server sends data to the TCP port of the virtual machine, these data will be forwarded to the Unix Socket through the data channel, and then read by the proxy component. Thereby achieving duplex communication between the virtual machine and the proxy component.
[0149] In one possible implementation, the IP address is a loopback address. A loopback address is a special IP address that can be understood as a local virtual interface of a virtual machine, rather than a physical network interface. In IPv4, the loopback address range is 127.0.0.0 / 8; in IPv6, the loopback address is ::1. If the IP address of a virtual machine is a loopback address, by mapping the loopback address to a Unix Socket, the RDP Server in the virtual machine communicates with the proxy component through the Unix Socket without requiring the virtual machine to have a network connection. Therefore, even if the virtual machine does not have an external network connection, the loopback address can be used for local communication, thereby providing remote desktop services to users when the virtual machine has no network.
[0150] S603: The server management module sends an RDP Server start instruction to QGA.
[0151] The RDP Server startup instruction is used to instruct the virtual machine to start the RDP Server, so that the remote desktop service is in the startup state. When the client is connected to the host port, the remote desktop service can be directly provided to the user.
[0152] S604: The server management module exposes the host port to the client through the proxy module.
[0153] The host port is the TCP port exposed by the host on the management plane. The server management module exposes the host port to the client through the proxy module, so that the client can connect to the host port and indirectly establish a communication connection between the client and the virtual machine, and provide remote desktop services to the client through the RDP Server in the virtual machine.
[0154] In a possible implementation, the server management module sends a channel protection instruction to the proxy module. The channel protection instruction is used to instruct the proxy module to enable a channel protection function to protect the communication channel between the client and the proxy component and improve the security of the remote desktop service. Channel protection can be implemented through the Transport Layer Security (TLS) protocol, which is used to encrypt communications to ensure the confidentiality and integrity of data.
[0155] In another possible implementation, after the RDP Server is started, the server management module can monitor the running status of the RDP Server through QGA. The server management module monitors the running status of the RDP Server, such as running, encountering errors or crashing, so that the administrator can take corresponding measures according to the running status of the RDP Server in time to ensure the stability and reliability of the remote desktop service.
[0156] In the embodiment of the present application, by establishing a data channel between Unix Socket and the virtual machine, the IP address TCP port of the virtual machine is mapped to Unix Socket, so that the proxy component can transmit data with the virtual machine based on the TCP protocol through Unix Socket, and the host port is exposed to the client through the proxy component, so that the client can establish a communication connection with the proxy component through the host port, breaking the network isolation between the virtual machine and the client, and establishing an indirect connection between the client and the virtual machine. After the client accesses the proxy component, the virtual machine and the client can perform duplex communication through UnixSocket and the proxy component to provide remote desktop services for users.
[0157] In the embodiment of the present application, the remote desktop is implemented based on the open source RDP protocol, and the RDP Server is integrated in the GuestOS. The GuestOS supports the RDP protocol, and the client of the user terminal also supports the RDP protocol. The method provided in the embodiment of the present application can implement the remote desktop service based on the existing operating system without modifying the RDP protocol. In addition, the proxy component and Unix Socket only need to support the TCP protocol, and do not need to support the RDP protocol. The configuration process of the remote desktop service is relatively simple.
[0158] The above are some specific implementations of the remote desktop implementation method provided in the embodiment of the present application. Based on this, the present application also provides a corresponding device. The device provided in the embodiment of the present application will be introduced below in combination with the above remote desktop implementation method.
[0159] like Figure 7 As shown, the embodiment of the present application provides a remote desktop implementation device, including:
[0160] The receiving module 701 is used to receive user operation data sent by the user terminal, and send the user operation data to the virtual machine deployed in the host machine through a Unix domain socket; the user terminal and the virtual machine support the remote desktop protocol;
[0161] The sending module 702 is configured to receive, through the Unix domain socket, the remote desktop service data fed back by the virtual machine based on the user operation data, and send the remote desktop service data to the user terminal.
[0162] The embodiments of the present application also provide a corresponding server and a computer storage medium for implementing the solution provided in the embodiments of the present application.
[0163] like Figure 8 As shown, the server 800 includes: a processor 801 and a memory 802;
[0164] The server 800 includes a processor 801 and a memory 802, the memory 802 is used to store instructions or codes, and the processor 801 is used to execute the instructions or codes so that the device executes the remote desktop implementation method described in any embodiment of the present application.
[0165] The computer storage medium stores code, and when the code is executed, the server executing the code implements the remote desktop implementation method described in any embodiment of the present application.
[0166] The "first" and "second" in the names such as "first" and "second" (if any) mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.
[0167] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0168] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0169] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A method for implementing a remote desktop, characterized in that: include: The host machine receives the user operation data sent by the user terminal, and sends the user operation data to the virtual machine deployed in the host machine through a Unix domain socket; The user terminal and the virtual machine support remote desktop protocol; The host machine receives the remote desktop service data fed back by the virtual machine based on the user operation data through the Unix domain socket, and sends the remote desktop service data to the user terminal.
2. The method according to claim 1, characterized in that The Unix domain socket is deployed in the host machine, and an agent component is also deployed in the host machine. The host machine receives user operation data sent by a user terminal, and sends the user operation data to a virtual machine deployed in the host machine through the Unix domain socket, including: The proxy component receives the user operation byte stream sent by the user terminal, and writes the user operation byte stream into the Unix domain socket, so that the virtual machine reads the user operation byte stream from the Unix domain socket; the user operation byte stream is the user operation data in the form of a byte stream obtained by the user terminal encapsulating the user operation data based on the remote desktop protocol; The host machine receives the remote desktop service data fed back by the virtual machine based on the user operation data through the Unix domain socket, and sends the remote desktop service data to the user terminal, including: The proxy component reads a remote desktop service byte stream through the Unix domain socket; the remote desktop service byte stream is the remote desktop service data in the form of a byte stream obtained by encapsulating the remote desktop service data by the virtual machine based on the remote desktop protocol; The proxy component sends the remote desktop service byte stream to the user terminal.
3. The method according to claim 2, characterized in that The generation process of the remote desktop service data is as follows: The virtual machine obtains the user operation byte stream from the Unix domain socket, and parses the user operation byte stream based on the remote desktop protocol to obtain the user operation data; The virtual machine executes the user operation described by the user operation data in a virtual environment to obtain remote desktop service data.
4. The method according to claim 1, characterized in that The host machine is deployed with a proxy component, and the proxy component is used to expose the host machine port to the user terminal. Before the host machine receives the user operation data sent by the user terminal, it also includes: The proxy component receives a connection request sent by the user terminal through the host port, and establishes a communication channel between the proxy component and the user terminal.
5. The method according to claim 4, characterized in that The connection request includes a user identifier, and the user operation data is first user operation data or second user operation data. Before the host machine receives the user operation data sent by the user terminal, the host machine further includes: The proxy component searches for historical remote desktop service data corresponding to the user identifier according to the user identifier; If the historical remote desktop service data is found, the user operation data is first user operation data, the proxy component sends the historical remote desktop service data to the user terminal; the first user operation data is used to describe the user's operation in the historical remote desktop, and the historical remote desktop is the desktop displayed by the user terminal based on the historical remote desktop service data; If the historical remote desktop service data is not found, the user operation data is second user operation data, and the agent component sends initial remote desktop service data to the user terminal; the second user operation data is used to describe the user's operation in the default remote desktop, and the default remote desktop is the desktop displayed by the user terminal based on the initial remote desktop service data.
6. The method according to claim 1, characterized in that The method further comprises: The host machine configures the virtual machine to map the address and port of the virtual machine to the Unix domain socket, and establishes a communication channel between the virtual machine and the Unix domain socket.
7. The method according to claim 6, characterized in that The host machine receives user operation data sent by the user terminal, and sends the user operation data to the virtual machine deployed in the host machine through a Unix domain socket, including: The host machine determines the Unix domain socket corresponding to the host port according to the host port for receiving the user operation data and a port mapping table; and sends the user operation data to the virtual machine corresponding to the Unix domain socket through the Unix domain socket; the port mapping table is used to describe a one-to-one correspondence between multiple host ports and multiple Unix domain sockets.
8. The method according to any one of claims 1 to 7, characterized in that: After the host machine receives the user operation data sent by the user terminal and before the host machine sends the user operation data to the virtual machine, the method further includes: The host machine sends a remote desktop service start instruction to the virtual machine.
9. The method according to claim 4 or 5, characterized in that: The method further comprises: The proxy component performs channel reinforcement on a communication channel between the proxy component and the user terminal.
10. A server, characterized in that: The server includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions; the at least one processor executes the computer program instructions so that the server executes the method according to any one of claims 1 to 9.
Citation Information
Cited By
Communication method and system, electronic equipment, medium and product
CN120416240A
Cross-system host machine control method and system
CN120768890A
A cross-system host control method and system
CN120768890B
