Display method and system for cloud desktop
By creating a virtual graphics card for the virtual machine and driving the display processing according to the connection method, the problem of slow graphics card switching and high resource utilization in cloud desktop display is solved, achieving faster display speed and simplified system maintenance.
Patent Information
- Application Number
- CN202011066250.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2040-09-30
AI Technical Summary
In the prior art, there is a problem that the graphics card switching is slow or the switching fails, and the system resources are occupied during the cloud desktop display process.
Create a virtual graphics card for the virtual machine through the virtual machine platform, and obtain the connection method of the client connecting to the cloud desktop through the display driver. The driver of the virtual graphics card is displayed according to the connection method, distinguishing the way the client connects directly to the cloud desktop and connects through the cloud desktop host to avoid graphics card switching.
It improves the display processing speed of cloud desktops, reduces system resource usage and complexity, simplifies system maintenance, facilitates troubleshooting, and supports multi-display display.
Smart Images

Figure CN114327318B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communications, and more particularly, to a display method and system for a cloud desktop. Background Art
[0002] With the development of technologies such as cloud computing and virtualization, the number of cloud desktop users is increasing; the basic principle of a cloud desktop is to virtualize the desktop of a computer through virtualization technology, so that any device can access our personal desktop system on the network at any location and at any time, and the remote terminal device and the server perform desktop graphics transmission through the remote desktop protocol.
[0003] In common cloud desktop systems (such as vmware, Citrix, etc.), there are generally two virtual graphics cards to meet the usage requirements of different scenarios. The common cloud desktop connection methods and usage scenarios include the following: Scenario 1: The user directly connects to the desktop to use the cloud desktop; Scenario 2: The user connects to the cloud desktop through the host where virtualization is located; Scenario 3: When directly connecting to the cloud desktop, an exception occurs and the direct connection mode cannot work, and it is necessary to connect through the host to locate and troubleshoot; one of the graphics cards is used when the user directly connects to the cloud desktop, completes desktop rendering and provides desktop images to remote users, and the other graphics card is used when the administrator troubleshoots a virtual desktop failure or when the user connects to the cloud desktop through the host, and different graphics cards are activated according to the usage scenario; using two virtual graphics cards to handle different scenarios has the disadvantages of slow graphics card switching or graphics card switching failure, high system resource occupancy, increased system complexity, and large code volume and difficult maintenance.
[0004] In the related art, in the process of using multiple virtual graphics cards to implement cloud desktop display, there are problems such as slow switching or graphics card switching failure, and high system resource occupancy, and no effective solution has been proposed yet. Summary of the Invention
[0005] The embodiments of the present invention provide a display method and system for a cloud desktop, so as to at least solve the problems of slow switching or graphics card switching failure, and high system resource occupancy in the process of using multiple virtual graphics cards to implement cloud desktop display in the related art.
[0006] According to an embodiment of the present invention, a display method for a cloud desktop is provided, and the method includes:
[0007] Create a virtual graphics card for a virtual machine using a virtual machine platform, where the virtual graphics card is driven by a display driver on the virtual machine;
[0008] Obtain the connection method of the client connecting to the cloud desktop through the display driver, and drive the virtual graphics card according to the connection method to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client. The connection method includes at least one of the following: the connection method in which the client is directly connected to the cloud desktop, and the connection method in which the client connects to the cloud desktop through the cloud desktop host.
[0009] In an exemplary embodiment, obtaining the connection method of the client connecting to the cloud desktop through the display driver includes: when the display driver receives the indication information sent by the input / output control interface of the virtual graphics card, determining that the connection method adopted by the client is the connection method of directly connecting to the cloud desktop; when the display driver receives the target mouse instruction sent by the cloud desktop host, determining that the connection method adopted by the client is the connection method of connecting to the cloud desktop through the cloud desktop host.
[0010] In an exemplary embodiment, after creating a virtual graphics card for the virtual machine using the virtual machine platform, the method further includes: when the connection method adopted by the client is the connection method of directly connecting to the cloud desktop and the cloud desktop fails, detecting whether there is a target object connecting to the cloud desktop through the cloud desktop host.
[0011] In an exemplary embodiment, after creating a virtual graphics card for the virtual machine using the virtual machine platform, the method further includes: when it is detected that there is a target object connecting to the cloud desktop through the cloud desktop host, driving the virtual graphics card to perform display processing on the cloud desktop through the display driver, so as to display the processed cloud desktop on the client, and the target object processes the failure according to the processed cloud desktop.
[0012] In an exemplary embodiment, driving the virtual graphics card to perform display processing on the cloud desktop according to the connection method includes: when the connection method adopted by the client is the connection method of directly connecting to the cloud desktop, driving the virtual graphics card to render the image of the cloud desktop to be displayed, and outputting the rendered image to the memory of the virtual machine, so that the virtual machine encodes the rendered image from the memory and sends the encoded image to the client.
[0013] In an exemplary embodiment, driving the virtual graphics card according to the connection method to perform display processing on the cloud desktop according to the connection method includes: when the client connects to the cloud desktop through the cloud desktop host, driving the virtual graphics card to render the image of the cloud desktop to be displayed, and outputting the rendered image to the memory of the virtual machine, so that the cloud desktop host encodes the rendered image from the memory and sends the encoded image to the client.
[0014] According to another embodiment of the present invention, there is also provided a display system for a cloud desktop, including:
[0015] A virtual machine platform, a virtual machine, wherein,
[0016] The virtual machine platform is used to create a virtual graphics card for the virtual machine, wherein the virtual graphics card is driven by a display driver on the virtual machine;
[0017] The virtual machine is further used to obtain the connection method for the client to connect to the cloud desktop through the display driver, and drive the virtual graphics card to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client, and the connection method includes at least one of the following: the connection method in which the client directly connects to the cloud desktop, and the connection method in which the client connects to the cloud desktop through the cloud desktop host.
[0018] In an exemplary embodiment, the virtual machine is further used to determine that the client uses the connection method of directly connecting to the cloud desktop when the display driver receives the indication information sent by the input / output control interface of the virtual graphics card; and determine that the client uses the connection method of connecting to the cloud desktop through the cloud desktop host when the display driver receives the target mouse instruction sent by the cloud desktop host.
[0019] According to still another embodiment of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and wherein the computer program is set to execute the steps in any one of the above method embodiments when running.
[0020] According to still another embodiment of the present invention, there is also provided an electronic device, including a memory and a processor, a computer program is stored in the memory, and the processor is set to run the computer program to execute the steps in any one of the above method embodiments.
[0021] Through the present invention, since a virtual graphics card is created for a virtual machine by using a virtual machine platform, and the connection method for a client to connect to a cloud desktop can be obtained through the graphics card driver on the virtual machine that drives the virtual graphics card, thereby distinguishing the connection method for the client to directly connect to the cloud desktop and the connection method for the client to connect to the cloud desktop through a cloud desktop host. Then, according to the obtained connection method, the virtual graphics card is driven to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client. Therefore, it can solve the problems in the related art that there are slow switching or graphics card switching failures and high system resource occupancy during the display process of a cloud desktop by using multiple virtual graphics cards, achieving the effect of avoiding graphics card switching without increasing system resource occupancy and system complexity and improving the display processing speed of the cloud desktop. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flowchart of a method for displaying a cloud desktop according to an embodiment of the present invention;
[0023] Figure 2 is a flowchart of a display method when a client directly connects to a cloud desktop according to an embodiment of the present invention;
[0024] Figure 3 is a flowchart of a display method when a client connects to a cloud desktop through a cloud desktop host according to an embodiment of the present invention;
[0025] Figure 4 is a flowchart of a processing method when a failure occurs when a client directly connects to a cloud desktop according to an embodiment of the present invention;
[0026] Figure 5 is a flowchart of the working process of a virtual graphics card receiving an instruction sent by a virtual machine platform according to an embodiment of the present invention;
[0027] Figure 6 is a flowchart of the working process of a virtual graphics card when a failure occurs when a client directly connects to a cloud desktop according to an embodiment of the present invention;
[0028] Figure 7 is a schematic structural diagram of a display system of a cloud desktop according to an embodiment of the present invention;
[0029] Figure 8 is a structural block diagram of a display system of a cloud desktop according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0030] In the following, embodiments of the present invention will be described in detail with reference to the drawings and in conjunction with the embodiments.
[0031] The solution provided by the embodiments of the present invention relates to the virtual graphics card technology in the field of virtualized cloud desktops. With the development of technologies such as cloud computing and virtualization, there are more and more users of cloud desktops (the cloud desktops described in the present invention run in the form of virtual machines, and the cloud desktops can also be represented by virtual machines). The common cloud desktop connection methods and usage scenarios are as follows: Scenario 1: The user connects to the IP address of the cloud desktop itself through the network to use the cloud desktop; Scenario 2: The user connects to the cloud desktop by connecting to the IP address of the background server where the cloud desktop is located (hereinafter referred to as the cloud desktop host); Scenario 3: When directly connecting to the cloud desktop through the network is abnormal and the direct connection mode cannot work, it is necessary to connect through the cloud desktop host to locate and troubleshoot the problem.
[0032] The embodiments of the present invention can run on Figure 7 the network architecture shown in Figure 7 As shown, the network architecture includes two parts: a virtual machine and a virtual machine platform. The virtual machine is used to create a virtual graphics card for the graphics card driver through a virtual driver. Among them, the virtual graphics card is driven by the display driver on the virtual machine; it is also used to obtain the connection method for the client to connect to the cloud desktop through the display driver, and drive the virtual graphics card according to the connection method to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client.
[0033] The embodiments of the present invention provide a display method for a cloud desktop running on the above virtual machine, which uses a virtual graphics card to process the different usage scenarios described above; avoiding the technical defects caused by repeated switching of multiple virtual graphics cards.
[0034] Exemplarily, in this embodiment, a virtual graphics card is virtualized for the virtual machine through a virtualization platform. The graphics card driver inside the virtual machine drives this virtual graphics card to provide desktop images for different usage scenarios at the same time. The flowchart of the cloud desktop display method is as Figure 1 shown, and the specific implementation method is as follows:
[0035] Step S110: Use the virtual machine platform to create a virtual graphics card for the virtual machine. Among them, the virtual graphics card is driven by the display driver on the virtual machine;
[0036] In this step, the virtual machine platform can create a virtual graphics card for the virtual machine, drive it through the display driver on the virtual machine, and provide the relevant hardware information of the virtual graphics card to the cloud desktop operating system, so that the cloud desktop operating system can recognize the virtual graphics card as a physical display adapter when accessing. In this way, the virtual graphics card can use entity hardware such as a computer CPU or a server to perform corresponding graphics processing work, and provide the processed data to the cloud desktop operating system, and then store the processed data in the storage space such as the video memory of the virtual graphics card or the main memory of the virtual machine for the cloud desktop operating system or other accessed systems to read.
[0037] Step S120: Obtain the connection method of the client connecting to the cloud desktop through the display driver, and drive the virtual graphics card to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client. The connection method includes at least one of the following: the connection method in which the client is directly connected to the cloud desktop, and the connection method in which the client is connected to the cloud desktop through the cloud desktop host.
[0038] Through the above steps, since a virtual graphics card is created for the virtual machine by using the virtual machine platform, the connection method of the client connecting to the cloud desktop can be obtained through the graphics card driver on the virtual machine that drives the virtual graphics card, so as to distinguish the connection method in which the client is directly connected to the cloud desktop and the connection method in which the client is connected to the cloud desktop through the cloud desktop host. Then, according to the obtained connection method, the virtual graphics card is driven to perform display processing on the cloud desktop according to the connection method, and the processed cloud desktop is displayed on the client. Therefore, it can solve the problems in the related art that in the process of using multiple virtual graphics cards to implement the display of the cloud desktop, there are problems such as slow switching or failure of graphics card switching, and high system resource occupancy, achieving the effect of avoiding graphics card switching and improving the display processing speed of the cloud desktop without increasing system resource occupancy and system complexity.
[0039] In step S120, the virtual machine platform receives the cloud desktop request of the cloud desktop operating system, forwards the request to the virtual graphics card, and then identifies whether the client is directly connected to the cloud desktop operating system or the client is connected to the cloud desktop through the cloud desktop host according to the input / output control interface of the virtual graphics card. Then, the image information of the cloud desktop system is processed based on the connection method and returned to the client. Since only one virtual graphics card is required, there is no problem of graphics card switching. It only adds the process of outputting images to the host when needed, and there is no process of switching the graphics card to adjust the resolution, which improves the processing speed of the cloud desktop operating system; on the one hand, the system resources such as the cloud desktop kernel address space and interrupts are less occupied, reducing the load of the cloud desktop system, and on the other hand, the memory resource consumption of the virtualization platform is reduced;
[0040] In an example, obtain the connection method of the client connecting to the cloud desktop through the display driver. Among them, the connection method may include: when the display driver receives the indication information sent by the input / output control interface of the virtual graphics card, it is determined that the client uses the connection method of directly connecting to the cloud desktop; when the display driver receives the target mouse instruction sent by the cloud desktop host, it is determined that the client uses the connection method of connecting to the cloud desktop through the cloud desktop host.
[0041] In this example, when the client directly connects to the cloud desktop, the virtual graphics card identifies the connection method of the client as directly connecting to the cloud desktop through the input / output control interface. After the virtual graphics card learns the current connection method, it does not output desktop image and other information to the host side, but only provides images for the client, and at the same time notifies the host side program that the current connection method is the client directly connecting to the cloud desktop, and the host side program does not work. When the client uses the connection method of connecting to the cloud desktop through the cloud desktop host, it can construct a target mouse instruction and then send it to the graphics card driver in the cloud desktop operating system. When the display driver receives the target mouse instruction sent by the cloud desktop host, it determines that the client uses the connection method of connecting to the cloud desktop through the cloud desktop host. At this time, the host side program will regularly request the image information of the cloud desktop from the cloud desktop.
[0042] In one example, as Figure 2 shown, in the case of the connection method where the client directly connects to the cloud desktop, the following steps are included:
[0043] Step S210: Determine that the client uses the connection method of directly connecting to the cloud desktop;
[0044] Step S220: Notify the virtual graphics card to switch the working mode, and after switching, the working mode of the virtual graphics card is the working mode corresponding to the client directly connecting to the cloud desktop;
[0045] Step S230: Drive the virtual graphics card to render the image of the cloud desktop to be displayed; then output the rendered image to the memory of the virtual machine;
[0046] Step S240: The virtual machine encodes the rendered image from the memory;
[0047] Step S250: Package and send the encoded image to the client.
[0048] In this example, when the client directly connects to the cloud desktop, after the virtual graphics card finishes each rendering task, it obtains the image information of the cloud desktop image. The image information includes information such as the image and the changed area of the image. Then, it outputs the image and the changed area of the image and other information to the shared memory of the virtual machine (equivalent to the memory of the virtual machine in the above embodiment). Then, the cloud desktop operating system reads the image information from the shared memory for encoding. After the encoding is completed, the encoding result is encapsulated according to the remote desktop protocol and sent to the client (equivalent to the client in the above embodiment) for the user to use. Repeating steps S210 to S250 can complete the work of the client directly connecting to the cloud desktop.
[0049] In one example, as Figure 3As shown, when the client connects to the cloud desktop through the cloud desktop host, the following steps are included:
[0050] Step S310: The graphics driver determines that the client uses the connection method of connecting to the cloud desktop through the cloud desktop host;
[0051] Step S320: The cloud desktop host notifies the virtual graphics card to switch the working mode, and after switching, the working mode of the virtual graphics card is the working mode corresponding to the client connecting to the cloud desktop through the cloud desktop host;
[0052] Step S330: The cloud desktop host notifies the graphics driver to output the image of the cloud desktop to the cloud desktop host;
[0053] Step S340: The virtual machine drives the virtual graphics card to render the image of the cloud desktop to be displayed; then outputs the rendered image to the memory of the virtual machine; and, the cloud desktop host reads the rendered image from the memory, that is, the graphics driver outputs the rendered image to the cloud desktop host;
[0054] Step S350: The host protocol program in the cloud desktop host encodes the rendered image;
[0055] Step S360: Encapsulate and send the encoded image to the client.
[0056] In this example, after the virtual graphics card completes each rendering task, it obtains the image information of the cloud desktop image, and the image information includes information such as the image and the changed area of the image, and then outputs the image and the changed area of the image to the video memory. The host will regularly read the image information from the video memory of the virtual graphics card, that is, the cloud desktop image and the changed area of the image, etc. Here, the time is determined based on the preset refresh rate and is encoded by the host side; after encoding, the encoding result is encapsulated and sent to the client, and repeating steps S310 to S330 can complete the client connecting to the cloud desktop through the cloud desktop host to work.
[0057] A display method of a cloud desktop provided in this embodiment further includes:
[0058] When the client uses the connection method of directly connecting to the cloud desktop and the cloud desktop fails, it is detected whether there is a target object connecting to the cloud desktop through the cloud desktop host.
[0059] In an example, as Figure 4 shown, if a failure occurs when the client connects to the cloud desktop, the following processing steps may be included:
[0060] Step S410: Determine that the client uses the connection method of directly connecting to the cloud desktop;
[0061] Step S420: When the cloud desktop cannot be used properly, the client reports it.
[0062] Step S430: The client connects to the cloud desktop through the cloud desktop host.
[0063] Step S440: The graphics driver determines that the client uses the connection method of connecting to the cloud desktop through the cloud desktop host. The cloud desktop host notifies the virtual graphics card to switch the working mode, and after the switch, the working mode of the virtual graphics card is the working mode corresponding to the client connecting to the cloud desktop through the cloud desktop host.
[0064] Step S450: The cloud desktop host notifies the graphics driver to output the image of the cloud desktop to the cloud desktop host; the virtual machine drives the virtual graphics card to render the image of the cloud desktop to be displayed; then the rendered image is output to the memory of the virtual machine; and, the cloud desktop host reads the rendered image from the memory, that is, the graphics driver outputs the rendered image to the cloud desktop host.
[0065] Step S460: The host protocol program in the cloud desktop host encodes the rendered image.
[0066] Step S470: The encoded image is encapsulated and sent to the client.
[0067] In the above steps, if a failure occurs when the client connects to the cloud desktop, such as a black screen or a frozen machine, resulting in the user being unable to use the cloud desktop operating system normally, at this time, the user can connect to the cloud desktop operating system through the host to handle the failure, that is, send a target mouse instruction to the cloud desktop operating system through the cloud desktop host; the graphics driver of the virtual graphics card determines that the current usage scenario requires switching the working mode according to the target mouse instruction. After the graphics driver controls the virtual graphics card to complete the rendering task, it copies the desktop image and the changed area of the image to the video memory of the virtual graphics card; the cloud desktop host parses the desktop image and the changed area of the image from the video memory of the virtual graphics card, and then sends them to the cloud desktop host to encode the parsed image information. After the encoding is completed, the encoding result is encapsulated according to the remote desktop protocol and sent to the administrator, so that the failure can be located and processed. At this time, the switching process of the graphics card working mode does not require the participation of a third party and is automatically completed by the graphics driver.
[0068] A display method of a cloud desktop provided in this embodiment, as Figure 5 shown, further includes that the virtual graphics card receives an instruction sent by the virtual machine platform and makes corresponding actions according to the received instruction, which may include the following steps:
[0069] Step S510: The virtual graphics card receives an instruction sent by the virtual machine platform.
[0070] Step S520: Determine whether the instruction received by the virtual graphics card is a mouse position instruction. If a mouse position instruction is received, information such as mouse visibility and coordinates is transmitted to the in-cloud desktop protocol program through shared memory, and the mouse information is synchronously transmitted to the host-side protocol program; otherwise, proceed to the next step.
[0071] Step S530: Determine whether the instruction received by the virtual graphics card is a mouse pointer shape instruction. If a mouse pointer shape instruction is received, the image data of the mouse shape is transmitted to the in-cloud desktop protocol program through shared memory, and the mouse shape information is synchronously transmitted to the host-side protocol program; otherwise, proceed to the next step.
[0072] Step S540: Determine whether the instruction received by the virtual graphics card is an add resolution instruction. If an add resolution instruction is received (the virtual graphics card supports adding any resolution), the display driver adds the specified resolution internally and reports it to the operating system so that the operating system supports the newly added resolution; otherwise, proceed to the next step.
[0073] Step S550: Determine whether the instruction received by the virtual graphics card is a modify resolution instruction. If a modify resolution instruction is received, the display driver modifies the cloud desktop resolution to the specified value and transmits the current resolution information to the host-side program through video memory; otherwise, proceed to the next step.
[0074] Step S560: Determine whether the instruction received by the virtual graphics card is a drawing instruction. If a drawing instruction is received, the display driver completes the drawing internally, transmits the drawn image data to the in-cloud desktop protocol program through shared memory, and simultaneously transmits the drawn image data to the host-side protocol program through video memory; otherwise, proceed to the next step.
[0075] Step S570: Return to Step 510.
[0076] It should be noted that the execution order between the above Step S520 to Step S560 can be switched arbitrarily according to the actual working scenario, and if the client directly connects to the cloud desktop operating system, the host side does not work, and the cloud desktop operating system does not send any data to the host side.
[0077] Optionally, as Figure 6 shown, when the client directly connects to the cloud desktop operating system, if a failure occurs, the working process of the virtual graphics card can include the following steps:
[0078] Step S610: The virtual graphics card receives a mouse instruction;
[0079] Step S620: Detect whether the client connects through the cloud desktop host in the mouse instruction;
[0080] Step S630: If the client connects to the cloud desktop operating system through the cloud desktop host, the working mode is automatically switched.
[0081] Step S640: Output the image information to the video memory for the cloud desktop host to read.
[0082] Through the above steps, since a virtual graphics card is created for the virtual machine using the virtual machine platform, and the connection method of the client connecting to the cloud desktop can be obtained through the graphics card driver on the virtual machine that drives the virtual graphics card, the connection method of the client directly connecting to the cloud desktop and the connection method of the client connecting to the cloud desktop through the cloud desktop host can be distinguished. Then, according to the obtained connection method, the virtual graphics card is driven to perform display processing on the cloud desktop according to the connection method, and the processed cloud desktop is displayed on the client. Therefore, the problems of slow or failed switching between two graphics cards in the original cloud desktop system, high consumption of system resources, and large amount of code and difficult maintenance can be solved, and it has the following beneficial effects:
[0083] 1. Only one virtual graphics card is needed for cloud desktop display processing, and there is no problem of graphics card switching. Only the process of outputting images to the cloud desktop host is added when needed, and there is no process of switching the graphics card to adjust the resolution. Therefore, the display speed of the cloud desktop is faster and the process is more user-friendly.
[0084] 2. The system resources such as the kernel address space and interrupts of the virtual machine platform are occupied less, reducing the load of the virtual machine.
[0085] 3. Since there is only one virtual graphics card, the memory resource consumption of the virtual machine platform is reduced.
[0086] 4. Make the display system of the cloud desktop simpler and easier to maintain, and more user-friendly.
[0087] 5. Facilitate fault handling. Sometimes faults will occur when the client is directly connected to the cloud desktop, such as not being able to see the desktop image. At this time, the administrator needs to locate and handle the fault. In the original multi-graphics card scenario, the graphics card needs to be switched inside the cloud desktop first before the administrator can connect through the cloud desktop host to see the cloud desktop image. If the graphics card switching fails or the switching module is abnormal, the administrator cannot enter the cloud desktop. After only one virtual graphics card is used for cloud desktop display processing, the virtual graphics card can automatically switch the working mode to output the cloud desktop image to the cloud desktop host in the fault scenario, facilitating the administrator to handle the fault.
[0088] 6. A single virtual graphics card can also support multi-display screen display.
[0089] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0090] In this embodiment, a display system for a cloud desktop is further provided. This system is used to implement the above embodiments and preferred implementation methods, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0091] As Figure 7 shown, the display system of the cloud desktop includes a virtual machine platform and a virtual machine. Among them, the virtual machine platform is used to create a virtual graphics card for the virtual machine, and the virtual graphics card is driven by a display driver on the virtual machine; the virtual machine is used to obtain the connection method of the client connecting to the cloud desktop through the display driver, and drive the virtual graphics card according to the connection method to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client. The connection method includes at least one of the following: the method of directly connecting the client to the cloud desktop, and the method of connecting the client to the cloud desktop through a cloud desktop host.
[0092] It should be noted that the virtual machine platform can create a virtual graphics card for the virtual machine, drive it through the display driver on the virtual machine, and provide the relevant hardware information of the virtual graphics card to the cloud desktop operating system, so that the cloud desktop operating system can recognize the virtual graphics card as a physical display adapter when accessing. In this way, the virtual graphics card can use entity hardware such as a computer CPU or a server to perform corresponding graphics processing work, and provide the processed data to the cloud desktop operating system, and then store the processed data in the storage space such as the video memory of the virtual graphics card or the main memory of the virtual machine for the cloud desktop operating system or other accessing systems to read.
[0093] In one example, the virtual machine is further configured to determine that the client uses a connection method of directly connecting to the cloud desktop when the display driver receives the indication information sent by the input / output control interface of the virtual graphics card; and to determine that the client uses a connection method of connecting to the cloud desktop through the cloud desktop host when the display driver receives the target mouse instruction sent by the cloud desktop host.
[0094] In this example, the virtual machine receives the indication information sent by the input / output control interface of the virtual graphics card or the target mouse instruction sent by the cloud desktop host through the display driver, then determines the connection method between the client and the cloud desktop based on the indication information or the target mouse instruction sent by the input / output control interface of the virtual graphics card, and switches to the working mode corresponding to the two working scenarios of the client directly connecting to the cloud desktop or the client connecting to the cloud desktop through the cloud desktop host based on the obtained connection method.
[0095] It should be noted that when the display driver receives the indication information sent by the input / output control interface of the virtual graphics card, it is determined that the client uses a connection method of directly connecting to the cloud desktop; after each rendering task is completed by the virtual graphics card, the image information of the cloud desktop image is obtained, and the image information includes information such as the image and the changed area of the image, and then the image and the changed area of the image and other information are output to the shared memory of the virtual machine (equivalent to the memory of the virtual machine in the above embodiment), and then the cloud desktop operating system reads the image information from the shared memory for encoding. After the encoding is completed, the encoding result is encapsulated according to the remote desktop protocol and sent to the client (equivalent to the client in the above embodiment) for the user to use; when the display driver receives the target mouse instruction sent by the cloud desktop host, it is determined that the client uses a connection method of connecting to the cloud desktop through the cloud desktop host; after each rendering task is completed by the virtual graphics card, the image information of the cloud desktop image is obtained, and the image information includes information such as the image and the changed area of the image, and then the image and the changed area of the image and other information are output to the video memory. The host will regularly read the image information from the video memory of the virtual graphics card, that is, the cloud desktop image and the changed area of the image and other information. Here, the time is determined based on the pre-set refresh rate and is encoded by the host side; after the encoding is completed, the encoding result is encapsulated and sent to the client.
[0096] In one example, the virtual machine is further configured to detect whether there is a target object connecting to the cloud desktop through the cloud desktop host when the client uses a connection method of directly connecting to the cloud desktop and the cloud desktop fails.
[0097] When the virtual machine detects that there is a target object connecting to the cloud desktop through the cloud desktop host, the virtual machine drives the virtual graphics card through the display driver to perform display processing on the cloud desktop, so as to display the processed cloud desktop on the client, and the target object processes the fault according to the processed cloud desktop.
[0098] In this embodiment, when the client is directly connected to the cloud desktop, if the cloud desktop fails and the client cannot normally connect to the cloud desktop, the virtual machine will detect whether there is a target object connecting to the cloud desktop through the cloud desktop host. Here, the target object can be a user or the management and maintenance personnel of the cloud desktop. If the virtual machine detects that there is a target object connecting to the cloud desktop through the cloud desktop host, that is, the display driver receives a target mouse instruction, the display driver drives the virtual graphics card to render the image of the cloud desktop to be displayed, and outputs the rendered image to the memory of the virtual machine, so that the cloud desktop host encodes the rendered image from the memory and sends the encoded image to the client.
[0099] Among them, as Figure 8 shown, the display system of this cloud desktop includes:
[0100] A graphics card driver module 22, which is used to identify the connection method between the client and the cloud desktop, drive the virtual graphics card to complete the rendering task of the operating system in the cloud desktop, and then output image information to the virtual memory of the virtual machine;
[0101] Specifically, the graphics card driver module 22 determines that the client is connected to the cloud desktop through the cloud desktop host based on the received target mouse instruction; or, the graphics card driver module 22 determines that the client is directly connected to the virtual machine by reading the input information sent from the cloud desktop operating system to the virtual graphics card. After obtaining the user's connection method, the graphics card driver module 22 switches the virtual graphics card to the corresponding working mode to provide cloud desktop images for remote clients.
[0102] And an information transceiver module 24, which is used to receive the input information of the client and send the cloud desktop image to the client; or, send the image information to the host.
[0103] Specifically, the information transceiver module 24 is also used to receive the data request information of the cloud desktop host, and the data request information includes information such as the cloud desktop image and its changed area requested by the cloud desktop host from the virtual graphics card video memory. The information transceiver module 24 is responsible for forwarding network messages, including sending the encoding result of the virtual machine to the client, sending the request of the client to the cloud desktop operating system, sending the data request of the host to the graphics card driver program of the virtual graphics card, and sending the image information in the virtual graphics card video memory to the cloud desktop host.
[0104] In one example, the display system of the cloud desktop further includes:
[0105] A cloud desktop encoding module, which is used to read the image information in the shared memory at regular intervals and perform encoding when the client directly connects to the cloud desktop, and send the encoded result to the information transceiver module 24 after encoding.
[0106] An input module, which is responsible for the input of user keyboard and mouse messages.
[0107] In one example, when the graphics card driver module 22 determines that the client connects to the cloud desktop through the cloud desktop host based on the received target mouse instruction, it drives the virtual graphics card to render the image of the cloud desktop to be displayed, and outputs the rendered image to the memory of the virtual machine, so that the cloud desktop host encodes the rendered image from the memory and sends the encoded image to the client. Among them, the cloud desktop host includes a graphics card interaction control module, which is used to notify the graphics card driver module 22 whether to output information such as the desktop image and the changed area to the video memory of the virtual graphics card; it is also used to parse information such as the desktop image and the changed area from the video memory of the virtual graphics card and send it to the host encoding module; the host encoding module is used to perform compression encoding on information such as the desktop image and the changed area, and send the encoding result to the network module; the network encoding module is used for forwarding network messages, including sending the encoding result to the client and forwarding the input of the client. Optionally, it further includes a host input module, which is used for the input of user keyboard and mouse messages.
[0108] It should be noted that the above-mentioned various modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned various modules are respectively located in different processors in any combination form.
[0109] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is set to execute the steps in any one of the above method embodiments when running.
[0110] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs and other various media that can store computer programs.
[0111] Optionally, in this embodiment, the above storage medium may be set to store program codes for executing the following steps:
[0112] S1. Create a virtual graphics card for the virtual machine using the virtual machine platform, where the virtual graphics card is driven by a display driver on the virtual machine;
[0113] S2. Obtain the connection method of the client connecting to the cloud desktop through the display driver, and drive the virtual graphics card to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client. The connection method includes at least one of the following: the connection method of the client directly connecting to the cloud desktop, and the connection method of the client connecting to the cloud desktop through the cloud desktop host.
[0114] An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0115] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:
[0116] S1. Create a virtual graphics card for the virtual machine using the virtual machine platform, where the virtual graphics card is driven by a display driver on the virtual machine;
[0117] S2. Obtain the connection method of the client connecting to the cloud desktop through the display driver, and drive the virtual graphics card to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client. The connection method includes at least one of the following: the connection method of the client directly connecting to the cloud desktop, and the connection method of the client connecting to the cloud desktop through the cloud desktop host.
[0118] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0119] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.
[0120] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a sequence different from that here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0121] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A display method for a cloud desktop, characterized in that, The method includes: Using a virtual machine platform to create a virtual graphics card for a virtual machine, wherein the virtual graphics card is driven by a display driver on the virtual machine; Obtaining, by the display driver, a connection method for a client to connect to a cloud desktop, and driving, according to the connection method, the virtual graphics card to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client, where the connection method includes at least one of the following: a connection method in which the client connects to the cloud desktop by connecting to the IP address of the cloud desktop itself through a network, and a connection method in which the client connects to the cloud desktop through a cloud desktop host.
2. The method according to claim 1, characterized in that, Obtaining, by the display driver, a connection method for a client to connect to a cloud desktop includes: When the display driver receives indication information sent by an input / output control interface of the virtual graphics card, determining that the connection method adopted by the client is a connection method of directly connecting to the cloud desktop; When the display driver receives a target mouse instruction sent by the cloud desktop host, determining that the connection method adopted by the client is a connection method of connecting to the cloud desktop through the cloud desktop host.
3. The method according to claim 1, wherein After using the virtual machine platform to create a virtual graphics card for the virtual machine, the method further includes: When the connection method adopted by the client is a connection method of directly connecting to the cloud desktop and the cloud desktop fails, detecting whether there is a target object connecting to the cloud desktop through the cloud desktop host.
4. The method according to claim 3, wherein After using the virtual machine platform to create a virtual graphics card for the virtual machine, the method further includes: When it is detected that there is a target object connecting to the cloud desktop through the cloud desktop host, driving, by the display driver, the virtual graphics card to perform display processing on the cloud desktop, so as to display the processed cloud desktop on the client, and enabling the target object to process the failure according to the processed cloud desktop.
5. The method according to claim 1, characterized in that, Driving, according to the connection method, the virtual graphics card to perform display processing on the cloud desktop according to the connection method includes: When the connection method adopted by the client is a connection method of directly connecting to the cloud desktop, driving the virtual graphics card to render an image of the cloud desktop to be displayed, and outputting the rendered image to the memory of the virtual machine, so that the virtual machine encodes the rendered image from the memory and sends the encoded image to the client.
6. The method according to claim 1, wherein Driving, according to the connection method, the virtual graphics card to perform display processing on the cloud desktop according to the connection method includes: When the client connects to the cloud desktop through a cloud desktop host, driving the virtual graphics card to render an image of the cloud desktop to be displayed, and outputting the rendered image to the memory of the virtual machine, so that the cloud desktop host encodes the rendered image from the memory and sends the encoded image to the client.
7. A display system for a cloud desktop, characterized in that, The system includes: A virtual machine platform, a virtual machine, wherein, The virtual machine platform is used to create a virtual graphics card for the virtual machine, wherein the virtual graphics card is driven by a display driver on the virtual machine; The virtual machine is used to obtain the connection method for the client to connect to the cloud desktop through the display driver, and drive the virtual graphics card to perform display processing on the cloud desktop according to the connection method, so as to display the processed cloud desktop on the client. The connection method includes at least one of the following: the connection method in which the client connects to the cloud desktop by connecting to the IP address of the cloud desktop itself through the network, and the connection method in which the client connects to the cloud desktop through the cloud desktop host.
8. The system according to claim 7, wherein The virtual machine is further used to determine that the client adopts a connection method of directly connecting to the cloud desktop when the display driver receives the indication information sent by the input / output control interface of the virtual graphics card; and determine that the client adopts a connection method of connecting to the cloud desktop through the cloud desktop host when the display driver receives the target mouse instruction sent by the cloud desktop host.
9. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Implementation method for enabling multiple users to share graphic workstation by using virtual desktop and GPU pass-through
CN103491188A
System architecture for automatically identifying slider verification code and implementation method
CN111310155A