Desktop Cloud System and Related Method, Apparatus, Device, and Medium
20230236856 · 2023-07-27
Inventors
Cpc classification
G06F9/452
PHYSICS
International classification
Abstract
A desktop cloud system includes a desktop cloud server and a terminal. A virtual desktop instance is deployed on the desktop cloud server. The desktop cloud server is configured to obtain encoded data output by the virtual desktop instance, and send the encoded data to the terminal corresponding to the virtual desktop instance. The terminal is configured to decode the encoded data to obtain raw data, and present a virtual desktop based on the raw data.
Claims
1. A system comprising: a desktop cloud server comprising a virtual desktop instance deployed on the desktop cloud server and configured to: obtain encoded data from the virtual desktop instance; and send the encoded data; and a terminal corresponding to the virtual desktop instance and configured to: receive the encoded data from the desktop cloud server. decode the encoded data to obtain raw data, and present a virtual desktop based on the raw data.
2. The system of claim 1, wherein the desktop cloud server is further configured to skip encoding or decoding the encoded data.
3. The system of claim 1, wherein the terminal is further configured to further decode, using a bytecode specification, the encoded data to obtain the raw data.
4. The system of claim 1, wherein the terminal is further configured to: receive an event, encode the event to obtain an encoded event; and send the encoded event to the desktop cloud server, wherein the desktop cloud server is further configured to operate the virtual desktop instance based on the encoded event to obtain the encoded data from the virtual desktop instance.
5. The system of claim 4, wherein the terminal is further configured to process, in parallel, any combination of the following: encoding the event to obtain the encoded event; sending the encoded event to the desktop cloud server; receiving the encoded data; or decoding the encoded data to obtain the raw data.
6. The system of claim 4, wherein the event comprises at least one of a mouse input, a keyboard input, or an audio input.
7. The system of claim 1, wherein the raw data comprises any one or more of image data, or video data.
8. The system of claim 1, wherein the terminal is further configured to deploy, in the terminal, a browser client for accessing the virtual desktop instance.
9. A method implemented by a desktop cloud system, wherein the method comprises: obtaining, by a desktop cloud server of the desktop cloud system, encoded data from a virtual desktop instance, wherein the virtual desktop instance is deployed on the desktop cloud server; sending, by the desktop cloud server, the encoded data to a terminal of the desktop cloud system, wherein the terminal corresponds to the virtual desktop instance; decoding, by the terminal, the encoded data to obtain raw data; and presenting, by the terminal, a virtual desktop based on the raw data.
10. The method of claim 9, further comprising skipping, by the desktop cloud server, encoding or decoding the encoded data.
11. The method of claim 9, further comprising further decoding, by the terminal using a bytecode specification, the encoded data to obtain the raw data.
12. The method of claim 9, further comprising: receiving, by the terminal, an event; encoding, by the terminal, the event to obtain an encoded event; operating, by the desktop cloud server, the virtual desktop instance based on the encoded event to obtain the encoded data from the virtual desktop instance.
13. The method of claim 12, further comprising processing, by the terminal in parallel, any combination of the following: encoding the event to obtain the encoded event; sending the encoded event to the desktop cloud server; receiving the encoded data; or decoding the encoded data to obtain the raw data.
14. The method of claim 12, wherein the event comprises at least one of a mouse input, a keyboard input, and/or an audio input.
15. The method of claim 9, wherein the raw data comprises any one or more of image data, or video data.
16. The method of claim 9, further comprising deploying, by the terminal, a browser client for accessing the virtual desktop instance.
17. A desktop cloud server comprising: a memory configured to store instructions; and one or more processors coupled to the memory and configured to execute the instructions to cause the desktop cloud server to: obtain encoded data from the virtual desktop instance, wherein the encoded data represent a virtual desktop: and send the encoded data to a terminal corresponding to the virtual desktop instance.
18. The desktop cloud server of claim 17, wherein the one or more processors are further configured to execute the instructions to cause the desktop cloud server to skip encoding or decoding the encoded data.
19. The desktop cloud server of claim 17, wherein the one or more processors are further configured to execute the instructions to cause the desktop cloud server to: receive an encoded event from the terminal; and operate the virtual desktop instance based on the encoded event to obtain the encoded data from the virtual desktop instance.
20. The desktop cloud server of claim 17, wherein the raw data comprises any one or more of image data, audio data, or video data.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0049] To describe the technical methods in embodiments of this disclosure more clearly, the following briefly describes the accompanying drawings used in describing the embodiments.
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
DESCRIPTION OF EMBODIMENTS
[0057] The terms “first” and “second” in the embodiments of this disclosure are merely intended for a purpose of description, and shall not be understood as an indication or implication of relative importance or implicit indication of a quantity of indicated technical features. Therefore, a feature limited by “first ” or “second” may explicitly indicate or implicitly include one or more such features.
[0058] Some technical terms used in the embodiments of this disclosure are first described.
[0059] A VDI is a system architecture that provides a virtual desktop for a user. A principle of a VDI architecture-based virtual desktop solution is as follows. A dedicated virtual machine is prepared for each user on a server side, an operating system and various applications that are required by the user are deployed on the virtual machine, and a complete virtual machine desktop (namely, a virtual desktop) is delivered to a remote user through a desktop access protocol.
[0060] The VDI architecture-based system is also referred to as a desktop cloud system. The desktop cloud system includes a desktop cloud server and a terminal. The desktop access protocol defines an interaction protocol and a communication channel for transmitting data such as a desktop image, a video, and a peripheral event between the terminal (for example, a desktop cloud client deployed on the terminal) and the desktop cloud server (for example, a virtual machine deployed on the desktop cloud server).
[0061] Different types of desktop cloud systems define proprietary desktop access protocols of the systems. To support different protocol specifications, an open-source client project deploys an extensible protocol conversion component architecture on a web server. The extensible protocol conversion component architecture adds an independent component to support different protocol specifications, and converts the independent component into protocol data that complies with a specified protocol specification, such as a Guacamole Protocol specification. The terminal and the desktop cloud server are connected through the Guacamole Protocol specification, which may improve flexibility and protocol extensibility of the desktop cloud system.
[0062] However, the protocol conversion component needs to consume a large quantity of computing capabilities to decrypt and decode server-end protocol data such as a video stream, and re-compress, in the decoded data, data such as a video, an image, and an audio according to an algorithm of a Guacamole Protocol. Therefore, a large quantity of additional computing overheads is generated, a quantity of web clients served by the web server is limited, and hardware costs of the desktop cloud system are increased.
[0063] In view of this, an embodiment of this disclosure provides a desktop cloud system and a method for providing a virtual desktop based on the desktop cloud system. The desktop cloud system includes a desktop cloud server and a terminal. A virtual desktop instance is deployed on the desktop cloud server. The desktop cloud server is configured to obtain encoded data output by the virtual desktop instance, and send the encoded data to the corresponding terminal. Then, the terminal decodes the encoded data to obtain raw data on a terminal side, and presents a virtual desktop based on the raw data. Because secondary transcoding does not need to be performed, additional computing overheads caused by the secondary transcoding are avoided, a quantity of terminals that can be served by the desktop cloud server is increased, and hardware costs of the desktop cloud system are reduced.
[0064] The terminal may precompile, into bytecode by using a bytecode specification, for example, by using a wasm bytecode specification, an algorithm provided by a proprietary desktop access protocol, and directly execute the bytecode to perform encoding or decoding. Source code of the algorithm provided by the proprietary desktop access protocol is invisible on the terminal, thereby resolving a problem of leakage of the proprietary desktop access protocol.
[0065] In addition, the algorithm provided by the proprietary desktop access protocol is compiled into the bytecode, for example, is compiled into WEBASSEMBLY bytecode. An amount of data of the WEBASSEMBLY bytecode is greatly reduced, and an interpreter is not required for interpretation, so that loading and instantiation can be fast, and a waiting time before running is reduced. In this way, a computing-intensive task such as encoding or decoding can be performed with performance close to that of a binary executable program, and encoding or decoding acceleration is implemented, thereby further increasing a quantity of terminals that can be served by the desktop cloud server, and further reducing hardware costs.
[0066] To make the technical solutions of this disclosure clearer and easier to understand, the following describes a desktop cloud system provided in the embodiments of this disclosure with reference to the accompanying drawings.
[0067] Referring to a schematic diagram of an architecture of a desktop cloud system shown in
[0068] Further, the desktop cloud server 14 is configured to obtain encoded data output by the virtual desktop instance 142, and the encoded data is data obtained by encoding raw data, for example, data obtained by encoding based on an algorithm in a proprietary desktop access protocol. The raw data may include any one or more of image data, audio data, and video data. Then, the desktop cloud server 14 sends the encoded data to the terminal 12 corresponding to the virtual desktop instance 142. The terminal 12 is configured to decode the encoded data to obtain the raw data, and present a virtual desktop based on the raw data. The terminal 12 may obtain the raw data through decoding, and present the virtual desktop by using the browser client 122.
[0069] In some possible implementations, referring to
[0070] It should be noted that the terminal-side protocol module 1222 in the browser client 122 may be obtained in real time when a virtual desktop needs to be used. Further, the desktop cloud system 10 further includes an access control subsystem, and the access control subsystem includes a web server 16. The portal module 1224 may present a desktop user login page, capture, by using the desktop user login page, login information entered by a user, for example, information such as a user name, a password, and a verification code, and then send the login information to a network service module 162 in the web server 16. The network service module 162 may perform login verification based on the login information, for example, compare the login information with related information in an account database, to implement login verification. When the login verification succeeds, the browser client 122 may download code of the terminal-side protocol module 1222 from the web server 16 such as the network service module 162, and then deploy the terminal-side protocol module 1222 on the browser client 122 based on the code.
[0071] Further, the web server 16 may further include a permission control module 164. The permission control module 164 is configured to authenticate a login user, for example, authenticate access to the virtual desktop instance 142. After the authentication succeeds, the login user is allowed to access the virtual desktop instance 142. Therefore, the browser client 122 may download the code of the terminal-side protocol module 1222 from the web server 16. If the authentication fails, the login user is rejected to access the virtual desktop instance 142, and the browser client 122 fails to download the code of the terminal-side protocol module 1222.
[0072] The network service module 162 and the permission control module 164 may be software modules or hardware modules having corresponding functions. When the network service module 162 and the permission control module 164 are software modules, the software modules may be integrated into a same piece of software, or may be distributed in different pieces of software. In addition,
[0073] In some possible implementations, the browser client 122 is configured to receive an event, for example, any one or more of a keyboard input event, a mouse input event, or an audio input event, encode the event to obtain an encoded event, and send the encoded event to the desktop cloud server 14. Correspondingly, the desktop cloud server 14 is configured to operate the virtual desktop instance 142 based on the encoded event, to obtain the encoded data output by the virtual desktop instance 142.
[0074] The browser client 122 receives the event by using the portal module 1224. The portal module 1224 includes a peripheral capture thread, an audio capture and play thread, and an image rendering thread. The peripheral capture thread is configured to capture a peripheral input event, for example, a keyboard input event or a mouse input event. The audio capture and play thread is configured to capture an audio input event.
[0075] The terminal-side protocol module 1222 may obtain the foregoing event from the portal module 1224, encode the event to obtain an encoded event, and then send the encoded event to the desktop cloud server 14. Further, the terminal-side protocol module 1222 includes a transmission thread, a peripheral processing thread, and an audio processing thread. The transmission thread may be configured to obtain an event from the portal module 1224, the peripheral processing thread may be configured to encode the event to obtain an encoded event, and the transmission thread is further configured to send the encoded event to the desktop cloud server 14.
[0076] The terminal-side protocol module 1222 may further include any one or more of an image processing thread and a video processing thread. The transmission thread is further configured to obtain the encoded data output by the virtual desktop instance 142, and the encoded data may be encoded image data, encoded audio data, or encoded video data. The image processing thread is configured to decode encoded image data, the audio processing thread is further configured to decode encoded audio data, and the video processing thread is configured to decode encoded video data.
[0077] The portal module 1224 may obtain image data from the terminal-side protocol module 1222, and perform image rendering by using the image rendering thread, to present a virtual desktop on a desktop display main page. The portal module 1224 may further obtain audio data from the terminal-side protocol module 1222, and play an audio by using the audio capture and play thread. Similarly, the portal module 1224 may further obtain video data from the terminal-side protocol module 1222, and then play a video on the desktop display main page.
[0078] In some possible implementations, the terminal-side protocol module 1222 may be implemented by using a bytecode specification, for example, a WEBASSEMBLY bytecode specification. The terminal-side protocol module 1222 runs in a WEBASSEMBLY runtime environment, and may natively support a plurality of threads. Therefore, the browser client 122 may create, by using the terminal-side protocol module 1222, parallel threads, such as a parallel video processing thread, an image processing thread, an audio processing thread, a peripheral processing thread, and a transmission thread, to perform in parallel any combination of a plurality of the following steps of encoding the event to obtain the encoded event, sending the encoded event to the desktop cloud server 14, receiving the encoded data, and decoding the encoded data to obtain the raw data.
[0079] The plurality of parallel threads may be used to decouple desktop protocol operations, so that synchronization dependency between the desktop protocol operations may be prevented from affecting real-time performance of a desktop operation.
[0080] Further, the threads may share memory. In this way, when exchanging data, the threads may directly exchange data by using the shared memory, thereby reducing a quantity of data copying times, reducing resource occupation, and improving resource utilization. For example, the peripheral processing thread and the transmission thread may share memory. After the peripheral processing thread encodes a peripheral input event to obtain an encoded event, the transmission thread directly obtains the encoded event by using the shared memory, and transmits the encoded event to the desktop cloud server 14.
[0081] Similarly, the portal module 1224 and the terminal-side protocol module 1222 may also share memory. In this way, a quantity of data copying times between the portal module 1224 and the terminal-side protocol module 1222 can be reduced, resource occupation can be reduced, resource utilization can be improved, and a latency caused by data copying can be reduced.
[0082] In addition, the terminal-side protocol module 1222 implemented based on a bytecode specification such as WEBASSEMBLY may execute, on the browser client 122, a computing-intensive task such as protocol encoding or decoding with performance close to that of a binary executable program, to implement encoding or decoding acceleration. Compared with a terminal-side program based on an interpreted language such as asm.js or JAVASCRIPT, performance can be improved by several times or more than 10 times. In this way, a quantity of browser clients 122 that can be served by the desktop cloud server 14 is further increased, and hardware costs are reduced.
[0083] In addition, the desktop cloud system 10 may compress an event or raw data by using an efficient encoding and compression algorithm provided by a proprietary protocol specification, to obtain data with a high compression ratio. Transmission can be performed between the terminal 12 (for example, the browser client 122) and the desktop cloud server 14 by using only a small quantity of bandwidth resources, thereby improving bandwidth resource utilization efficiency, ensuring real-time performance of keyboard and mouse interaction, and resolving problems such as video image jitter and smearing.
[0084] A plurality of virtual desktop instances is deployed on the desktop cloud server 14 to provide services for a plurality of browser clients 122. In consideration of this, the desktop cloud system 10 may further include a desktop gateway 18. The desktop gateway 18 is further configured to route encoded events of different browser clients 122, and route encoded data of different virtual desktop instances 142.
[0085] An application layer long connection may be established between the browser client 122 and the desktop cloud server 14. The application layer long connection is used to transmit an encoded event or encoded data. The desktop cloud server 14 does not encode or decode the encoded data output by the virtual desktop instance 142. In other words, secondary transcoding does not need to be performed, thereby increasing a quantity of browser clients 122 that can be served by the desktop cloud server 14, and reducing hardware costs. The application layer long connection is a long connection established at an application layer, and the application layer long connection may be a websocket long connection.
[0086] As shown in
[0087] It should be noted that
[0088] In
[0089] Referring to a flowchart of a method for providing a virtual desktop shown in
[0090] S202: The terminal 12 receives an event.
[0091] The event may be a peripheral input event or an audio input event. The peripheral input event includes a keyboard input event, a mouse input event, a touch input event, a stylus input event, and the like, which are not listed one by one herein.
[0092] During specific implementation, a client, for example, the browser client 122, used to access the virtual desktop instance 142, is deployed on the terminal 12. The browser client 122 may capture a peripheral input event by using the peripheral capture thread in the portal module 1224, and capture an audio input event by using the audio capture and play thread. Details are not described herein.
[0093] S204: The terminal 12 encodes the event to obtain an encoded event.
[0094] The terminal-side protocol module 1222 in the browser client 122 deployed on the terminal 12 may be implemented based on a bytecode specification such as WEBASSEMBLY. The terminal 12 may directly encode the event on a terminal side by using the terminal-side protocol module 1222 implemented based on the bytecode specification and by using a proprietary desktop access protocol, further, by using an algorithm provided by the desktop access protocol, to obtain the encoded event. The encoded event may be an encoded event with a high compression ratio, so as to reduce bandwidth resource consumption. In addition, the terminal-side protocol module 1222 implemented based on the bytecode specification does not need an interpreter for interpretation, and can encode an event with performance close to that of a binary executable program, thereby greatly improving encoding efficiency.
[0095] It should be noted that the terminal-side protocol module 1222 may share memory with the portal module 1224. Based on this, the terminal-side protocol module 1222 may directly obtain an event by using the shared memory. In this way, a quantity of copy operations can be reduced, thereby reducing unnecessary overheads.
[0096] S206: The terminal 12 sends the encoded event to the desktop cloud server 14.
[0097] Further, the terminal 12 may first send the encoded event to the desktop gateway 18 through an application layer long connection, for example, a websocket long connection, between the terminal-side protocol module 1222 and the desktop gateway 18, and then the desktop gateway 18 sends the encoded event to the desktop cloud server 14 through a connection to the desktop cloud server 14, for example, a TCP or UDP connection. The desktop gateway 18 may route the encoded event to the virtual desktop instance 142 that is deployed on the desktop cloud server 14 and that corresponds to the terminal 12.
[0098] S208: The desktop cloud server 14 is configured to operate the virtual desktop instance 142 based on the encoded event, to obtain encoded data output by the virtual desktop instance 142.
[0099] Further, the desktop cloud server 14 provides the encoded event for the corresponding virtual desktop instance 142, and the virtual desktop instance 142 may decode the encoded event to obtain an input event, for example, a peripheral input event or an audio input event. The virtual desktop instance 142 may perform a corresponding operation based on the input event to obtain raw data, for example, obtain image data, audio data, or video data. The virtual desktop instance 142 may encode the raw data to obtain encoded data, and output the encoded data. The desktop cloud server 14 obtains the encoded data output by the virtual desktop instance.
[0100] It should be noted that, when the method for providing a virtual desktop in this embodiment of this disclosure is performed, S202 to S208 may not be performed. For example, the desktop cloud server 14 may directly obtain the encoded data output by the virtual desktop instance 142. This is not limited in this embodiment of this disclosure.
[0101] S210: The desktop cloud server 14 sends the encoded data to the terminal 12.
[0102] Further, the desktop cloud server 14 may send the encoded data to the terminal 12 through the application layer long connection, for example, the web socket long connection, between the desktop gateway 18 and the terminal-side protocol module 1222, for example, to the terminal-side protocol module 1222 in the browser client 122 deployed on the terminal 12.
[0103] S212: The terminal 12 decodes the encoded data to obtain the raw data.
[0104] The terminal-side protocol module 1222 in the browser client 122 deployed on the terminal 12 may be implemented based on a bytecode specification such as WEBASSEMBLY. The terminal 12 may directly decode the encoded data on a terminal side by using the terminal-side protocol module 1222 implemented based on the bytecode specification and by using a proprietary desktop access protocol, further, an algorithm provided by the desktop access protocol, to obtain the raw data. In addition, the terminal-side protocol module 1222 implemented based on the bytecode specification does not need an interpreter for interpretation, and can decode the encoded data with performance close to that of a binary executable program, thereby greatly improving decoding efficiency.
[0105] S214: The terminal 12 presents a virtual desktop based on the raw data.
[0106] When the raw data includes image data, the terminal may perform image rendering based on the image data, so as to present the virtual desktop. Further, the portal module 1224 in the browser client 122 deployed in the terminal 12 may obtain image data from the terminal-side protocol module 1222, then perform image rendering by using the image rendering thread, and display a rendered image on a desktop display main page, to present the virtual desktop.
[0107] When output data includes video data, the terminal 12 may further perform video rendering based on the video data, to present a video picture. When the output data includes audio data, the terminal 12 may further play an audio based on the audio data.
[0108] In the embodiment shown in
[0109] Further, the uplink data transmission queue obtains, in a memory sharing manner from an input processing thread such as the peripheral processing thread or the audio processing thread, an encoded event that needs to be transmitted to the desktop cloud server 14, and the encoded event includes an encoded keyboard input event, an encoded mouse input event (mouse press or click), or encoded microphone audio input data.
[0110] The websocket client converts an underlying TCP/UDP communication request corresponding to uplink data (or the foregoing encoded event) generated by the terminal-side protocol module 1222 into a websocket request, and interacts with a websocket listening port of the desktop gateway 18, and the encoded data obtained from the desktop cloud server 14 is buffered into the downlink data transmission queue.
[0111] The downlink data transmission queue buffers the encoded data obtained from the desktop cloud server 14, including encoded image data, encoded video data, encoded audio data, and the like, and then forwards, in a memory sharing manner, the encoded data to an output processing thread, for example, the image processing thread, the audio processing thread, and the video processing thread. The output processing thread decodes the encoded data to obtain raw data, for example, any one or more of image data, audio data, and video data. Then, the thread interacts with the portal module 1224, and the portal module 1224 presents the virtual desktop on the desktop display main page based on the raw data.
[0112] Content displayed on the desktop display main page comes from the terminal-side protocol module 1222. The desktop display main page of the portal module 1224 and the terminal-side protocol module 1222 exchange data in a memory sharing manner.
[0113] Further, different types of data may have different latency-sensitive features. For example, a mouse input event is sensitive to a latency, and video data is insensitive to a latency. Based on this, when asynchronous interaction is performed between the desktop display main page and the terminal-side protocol module 1222 based on the shared memory, the desktop display main page may be updated and displayed at different time intervals based on latency-sensitive features of various types of data, to avoid blocking a main thread of the browser client 122 and affecting overall performance of the desktop cloud system 10.
[0114] In the foregoing embodiment, the method for providing a virtual desktop provided in this embodiment of this disclosure is described from a perspective of the desktop cloud system 10. The method provided in this embodiment of this disclosure is described in detail below from a perspective of the terminal 12.
[0115] Referring to a flowchart of a method for providing a virtual desktop shown in
[0116] S502: The terminal 12 receives an event, encodes the event to obtain an encoded event, and sends the encoded event to the desktop cloud server 14.
[0117] A client, for example, the browser client 122, used to access the virtual desktop instance 142, is deployed on the terminal 12. The terminal 12 may receive the event by using the portal module 1224 of the browser client 122. Further, the terminal 12 may capture a peripheral input event, for example, a keyboard input event or a mouse input event, by using the peripheral capture thread in the portal module 1224, or the terminal 12 may capture an audio input event by using an audio capture thread in the portal module 1224.
[0118] The terminal 12 may encode the event by using the terminal-side protocol module 1222 of the browser client 122, for example, encode the event such as a keyboard input event, a mouse input event, or an audio input event, to obtain the encoded event.
[0119] In some possible implementations, an application layer long connection, for example, a websocket long connection, is established between the terminal 12 and the desktop cloud server 14. When the desktop cloud system 10 includes the desktop gateway 18, an application layer long connection, for example, a websocket long connection, may be established between the terminal 12 (or the terminal-side protocol module 1222) and the desktop gateway 18. In this way, the terminal-side protocol module 1222 of the terminal 12 may send the encoded event through the websocket long connection to the desktop gateway 18, and then send the encoded event to the desktop cloud server 14 by using the desktop gateway 18.
[0120] S504: The terminal 12 receives encoded data returned by the desktop cloud server 14.
[0121] The encoded data is obtained by the desktop cloud server 14 by operating, based on the encoded event, the virtual desktop instance 142 corresponding to the terminal 12 (or the browser client 122 deployed on the terminal 12). The encoded data may be encoded image data, encoded audio data, and encoded video data.
[0122] In some possible implementations, the encoded data is sent by the desktop cloud server 14 to the desktop gateway 18, and the terminal 12 may receive the encoded data through the websocket long connection to the desktop gateway 18.
[0123] S506: The terminal 12 decodes the encoded data to obtain raw data, and presents a virtual desktop based on the raw data.
[0124] In some possible implementations, the terminal 12 may create a plurality of parallel threads by using the terminal-side protocol module 1222, and then process, by using the parallel threads, in parallel any combination of a plurality of the following steps of encoding the event to obtain the encoded event, sending the encoded event to the desktop cloud server, receiving the encoded data, and decoding the encoded data to obtain the raw data.
[0125] The plurality of parallel threads may share memory. In this way, data copying can be reduced, and data processing efficiency can be improved. Further, the portal module 1224 in the browser client 122 may share memory with the terminal-side protocol module 1222. Correspondingly, the portal module 1224 may exchange raw data with the terminal-side protocol module 1222 in a memory sharing manner, and after obtaining the raw data, perform image rendering based on the raw data such as image data, to present the virtual desktop.
[0126] In this embodiment of this disclosure, the WEBASSEMBLY-based browser client 122 may run in a sandbox environment controlled by the browser client 122, and cannot directly access a device file. Therefore, hardware acceleration provided by the browser client 122 may be used to support hardware acceleration on operations of a desktop cloud, for example, perform graphics processing unit (GPU) rendering on a two-dimensional (2D) or three-dimensional (3D) image by using a Web Graphics Library (WEBGL).
[0127] In some possible implementations, an acceleration service may be further provided at an operating system level. The service provides an acceleration capability for a WEBASSEMBLY program (for example, a terminal-side protocol module 1222) in the browser client 122 in a manner such as memory sharing or a websocket service. In this way, an operation of a large amount of data can be accelerated at a time, and additional overheads caused by interaction of the service can be reduced.
[0128] With reference to
[0129] An embodiment of this disclosure provides an apparatus for providing a virtual desktop. The apparatus includes modules configured to perform the method steps performed by the terminal 12 in the embodiment shown in
[0130] The apparatus for providing a virtual desktop according to this embodiment of this disclosure may correspondingly perform the method described in the embodiments of this disclosure, and the foregoing and other operations and/or functions of the modules/units of the apparatus for providing a virtual desktop are separately used to implement corresponding procedures of the methods in the embodiment shown in
[0131] An embodiment of this disclosure further provides a desktop cloud server 14. The desktop cloud server 14 is further configured to implement a function of the desktop cloud server 14 in the desktop cloud system 10 shown in
[0132]
[0133] The bus 601 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one bold line is used for representation in
[0134] The processor 602 may be any one or more of processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (I/O), or a digital signal processor (DSP).
[0135] The communications interface 603 is an input/output (I/O) device. The communications interface 603 is configured to communicate with the outside. Further, the communications interface 603 may receive an encoded event sent by a terminal 12, or send, to the terminal 12 corresponding to a virtual desktop instance 142, or the like, encoded data output by the virtual desktop instance 142.
[0136] The memory 604 may include a volatile memory, for example, a random-access memory (RAM). The memory 604 may further include a non-volatile memory, for example, a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD).
[0137] The memory 604 stores executable program code. The processor 602 executes the executable program code to perform the foregoing method for providing a virtual desktop.
[0138] An embodiment of this disclosure further provides a terminal 12. The terminal 12 is further configured to implement a function of the terminal 12 in the desktop cloud system 10 shown in
[0139]
[0140] The bus 701 may be a PCI bus, an EISA bus, or the like. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one bold line is used for representation in
[0141] The processor 702 may be any one or more of processors such as a CPU, a GPU, a MP, or a DSP.
[0142] The communications interface 703 is an input/output device. The communications interface 703 is configured to communicate with the outside. Further, the communications interface 703 may send an encoded event to a desktop cloud server 14, or receive encoded data sent by the desktop cloud server 14, or the like. Further, the communications interface 703 may further include a display. Based on different manufacturing materials, the display may be classified into a liquid-crystal display (LCD), an organic light-emitting diode (LED) (OLED) display, and the like. The communications interface 703 may also include a microphone. The display may present a virtual desktop, and the microphone may receive an audio input.
[0143] The memory 704 may include a volatile memory, for example, a RAM. The memory 704 may further include a non-volatile memory, for example, a ROM, a flash memory, an HDD, or an SSD.
[0144] The memory 704 stores executable program code. The processor 702 executes the executable program code to perform the foregoing method for providing a virtual desktop.
[0145] An embodiment of this disclosure further provides a virtual desktop instance 142. The virtual desktop instance 142 is configured to implement a function of the virtual desktop instance 142 in the desktop cloud system 10 shown in
[0146] An embodiment of this disclosure further provides a computer-readable storage medium. The computer-readable storage medium includes instructions, and the instructions instruct a desktop cloud server 14 to perform the foregoing method for providing a virtual desktop.
[0147] An embodiment of this disclosure further provides a computer-readable storage medium. The computer-readable storage medium includes instructions, and the instructions instruct a terminal 12 to perform the foregoing method for providing a virtual desktop.
[0148] An embodiment of this disclosure further provides a computer program product. When the computer program product is executed by a computer, the computer performs any one of the foregoing methods for providing a virtual desktop. The computer program product may be a software installation package. When any one of the foregoing methods for providing a virtual desktop needs to be used, the computer program product may be downloaded, and the computer program product may be executed on a computer.