Interface rendering method, device, equipment and medium

By initializing the middle layer and graphics library interface on the closed-source driver type graphics card, the problem of running the Virtio-GPU desktop virtualization function on the closed-source driver graphics card is solved, the driver of the closed-source graphics card is realized, and the virtualization function is expanded. Scope of application.

CN114675917BActive Publication Date: 2024-10-18BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210280361.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-21
Publication Date
2024-10-18
Estimated Expiration
2042-03-21

AI Technical Summary

Technical Problem

The existing Virtio-GPU desktop virtualization function can only run normally on open source driver type graphics cards and cannot implement interface rendering on closed source driver type graphics cards.

Method used

By receiving rendering instructions for the target virtual machine, initializing the middle layer interface and graphics library interface of the target graphics card, and calling the graphics processor of the target graphics card through these interfaces, the driver of the closed-source driver type graphics card is realized, thereby supporting the desktop virtualization function. .

Benefits of technology

Interface rendering is implemented on closed-source driver type graphics cards, which expands the scope of application of desktop virtualization functions, supports drivers for closed-source driver type graphics cards, and enables the normal operation of virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114675917B_ABST
    Figure CN114675917B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an interface rendering method, device, equipment and medium. The interface rendering method includes: receiving a rendering instruction for a target virtual machine; in the case where the target graphics card used for interface rendering is a closed-source driver type, initializing the middle layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card; initializing the graphics library interface of the target graphics card based on the target attribute information corresponding to the middle layer interface; calling the graphics processor of the target graphics card through the graphics library interface, so that the graphics processor renders the target user interface corresponding to the rendering instruction. According to the embodiment of the present disclosure, the desktop virtualization function for the target virtual machine can be realized based on the target graphics card of the closed-source driver type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of virtual machine technology, and in particular to an interface rendering method, device, equipment and medium. Background Art

[0002] A virtual machine is a complete computer system that is simulated by software and has complete hardware system functions and runs in a completely isolated environment. A virtual machine allows a platform to run multiple computer systems at the same time, and applications can run in independent spaces without affecting each other, thereby significantly improving the work efficiency of the computer.

[0003] Currently, the desktop virtualization function based on Virtio-GPU can only realize interface rendering based on graphics cards with open source drivers. If the graphics card on the host machine is a closed-source driver type, the desktop virtualization function cannot run normally. Summary of the invention

[0004] In order to solve the above technical problems, the present disclosure provides an interface rendering method, device, equipment and medium.

[0005] In a first aspect, the present disclosure provides an interface rendering method, comprising:

[0006] Receiving rendering instructions for a target virtual machine;

[0007] In the case where the target graphics card used for interface rendering is a closed source driver type, initializing the intermediate layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card;

[0008] Initialize the graphics library interface of the target graphics card based on the target attribute information corresponding to the middle layer interface;

[0009] The graphics processor of the target graphics card is called through the graphics library interface so that the graphics processor renders the target user interface corresponding to the rendering instruction.

[0010] In a second aspect, the present disclosure provides an interface rendering device, comprising:

[0011] An instruction receiving module, used for receiving rendering instructions for a target virtual machine;

[0012] A first initialization module is used to initialize the intermediate layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card when the target graphics card used for interface rendering belongs to a closed source driver type;

[0013] A second initialization module is used to initialize the graphics library interface of the target graphics card based on the target attribute information corresponding to the intermediate layer interface;

[0014] The interface rendering module is used to call the graphics processor of the target graphics card through the graphics library interface so that the graphics processor renders the target user interface corresponding to the rendering instruction.

[0015] In a third aspect, the present disclosure provides an electronic device, including:

[0016] processor;

[0017] A memory for storing executable instructions;

[0018] Among them, the processor is used to read executable instructions from the memory and execute the executable instructions to implement the interface rendering method described in the first aspect.

[0019] In a fourth aspect, the present disclosure provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the interface rendering method described in the first aspect.

[0020] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0021] The interface rendering method, apparatus, device and medium of the disclosed embodiments can, after receiving a rendering instruction for a target virtual machine, initialize the middle layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card and initialize the graphics library interface of the target graphics card based on the target attribute information corresponding to the middle layer interface after determining that the target graphics card used for interface rendering is of a closed-source driver type, and then call the graphics processor of the target graphics card through the graphics library interface to enable the graphics processor to render the target user interface corresponding to the rendering instruction. As a result, the target graphics card of the closed-source driver type can be driven through the middle layer interface and the graphics library interface, and then the desktop virtualization function for the target virtual machine can be realized based on the target graphics card of the closed-source driver type. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0023] Figure 1 An architectural diagram of an interface rendering provided by an embodiment of the present disclosure;

[0024] Figure 2 A flowchart of an interface rendering method provided by an embodiment of the present disclosure;

[0025] Figure 3 A flowchart of another interface rendering method provided by an embodiment of the present disclosure;

[0026] Figure 4 A schematic diagram of the structure of an interface rendering device provided by an embodiment of the present disclosure;

[0027] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0034] Currently, the desktop virtualization function based on Virtio-GPU is an open source desktop virtualization function, which can only realize interface rendering based on graphics cards with open source drivers (such as AMD graphics cards, Intel graphics cards, etc.). If the graphics card on the host machine is a closed source driver type such as Nvidia graphics cards, the open source desktop virtualization function cannot run normally.

[0035] In order to solve the above problems, the embodiments of the present disclosure provide an interface rendering method, apparatus, device and medium to transform the desktop virtualization function of an electronic device so that it can also implement interface rendering based on a closed-source driver type graphics card.

[0036] Combine the following Figure 1 First, the architecture of the interface rendering method for implementing the embodiment of the present disclosure is described.

[0037] Figure 1 FIG. 1 shows an architecture diagram of an interface rendering provided by an embodiment of the present disclosure. Figure 1 As shown, the architecture includes a virtual machine 110 , virtual machine software 120 and a host machine 130 . The virtual machine software 120 can be run in the host machine 130 to run the virtual machine 110 .

[0038] In the embodiment of the present disclosure, the host machine 130 may be an electronic device, which may include but is not limited to mobile terminals such as mobile phones, notebook computers, PADs (tablet computers), etc., and fixed terminals such as digital TVs, desktop computers, etc.

[0039] Among them, the virtual machine software 120 can simulate a virtual graphics card for use by the virtual machine 110 based on software or software-hardware collaboration. The virtual graphics card can be implemented through the desktop virtualization function and is responsible for translating the rendering instructions of the virtual machine 110 to the host machine 130 for rendering.

[0040] Specifically, the virtual machine 110 may include a virtual graphics card driver module 111 , the virtual machine software 120 may include a rendering execution module 121 and a result reading module 122 , and the host machine 130 may include a closed-source graphics card driver 131 .

[0041] When the virtual machine 110 has an interface rendering requirement, the rendering execution module 121 in the virtual machine software 120 can be driven by the virtual graphics card driver module 111, so that the rendering execution module 121 implements interface rendering based on the closed-source driver graphics card 131 of the host machine 130, and obtains the rendering result of the closed-source driver graphics card 131 through the result reading module 122.

[0042] In the embodiment of the present disclosure, the process of the rendering execution module 121 implementing the interface rendering based on the closed-source driver graphics card 131 of the host machine 130 is as follows:

[0043] The rendering execution module 121 can receive a rendering instruction for the virtual machine 110 sent by the virtual graphics card driver module 111, and when it is determined that the graphics card used for interface rendering in the host machine 130 is a closed-source driver graphics card 131, the intermediate layer interface corresponding to the closed-source driver graphics card 131 is initialized based on the rendering node information of the closed-source driver graphics card 131, and the graphics library interface of the closed-source driver graphics card 131 is initialized based on the target attribute information corresponding to the intermediate layer interface, and then the graphics processor of the closed-source driver graphics card 131 is called through the graphics library interface, so that the graphics processor of the closed-source driver graphics card 131 renders the target user interface corresponding to the rendering instruction. Therefore, the rendering execution module 121 can realize the driving of the closed-source driver graphics card 131 through the intermediate layer interface and the graphics library interface, and then realize the desktop virtualization function for the virtual machine 110 based on the closed-source driver graphics card 131.

[0044] Combine the following Figures 2 to 3 , and then the interface rendering method provided by the embodiment of the present disclosure is described in detail.

[0045] In the embodiment of the present disclosure, the interface rendering method may be executed by an electronic device. Figure 1 The host machine 130 shown, further, the interface rendering method can be executed by the rendering execution module 121 in the virtual machine software 120 running on the host machine 130.

[0046] The electronic devices may include but are not limited to mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.

[0047] Figure 2 A flow chart of an interface rendering method provided by an embodiment of the present disclosure is shown.

[0048] like Figure 2 As shown, the interface rendering method may include the following steps.

[0049] S210: Receive a rendering instruction for a target virtual machine.

[0050] In an embodiment of the present disclosure, when a target virtual machine running on an electronic device has an interface rendering requirement, a rendering instruction for the target virtual machine may be sent to the electronic device so that the electronic device receives the rendering instruction of the target virtual machine.

[0051] In some embodiments, when the target virtual machine is started, the target virtual machine has an interface rendering requirement. At this time, the rendering instruction may be generated based on a start event for the target virtual machine.

[0052] In some other embodiments, when the target virtual machine is operated by a user, the target virtual machine has an interface rendering requirement. In this case, the rendering instruction may be generated based on a user operation event on the target virtual machine.

[0053] Therefore, in the embodiment of the present disclosure, the electronic device can meet different rendering requirements of the target virtual machine.

[0054] S220: In the case where the target graphics card used for interface rendering is a closed-source driver type, initializing the intermediate layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card.

[0055] In the disclosed embodiment, after receiving the rendering instruction, the electronic device can determine whether the target graphics card used for interface rendering is of a closed-source driver type. If the target graphics card used for interface rendering is not of a closed-source driver type, that is, the target graphics card used for interface rendering is of an open-source driver type, the graphics processor of the target graphics card can be directly called to enable the graphics processor to render the target user interface corresponding to the rendering instruction; if the target graphics card used for interface rendering is of a closed-source driver type, the intermediate layer interface corresponding to the target graphics card can be initialized based on the rendering node information of the target graphics card.

[0056] Optionally, S220 may specifically include: determining target intermediate layer interface description information corresponding to the target graphics card based on the rendering node information; and initializing the intermediate layer interface corresponding to the target graphics card based on the target intermediate layer interface description information.

[0057] Specifically, in a Linux environment, the electronic device may store a plurality of node information of a target graphics card, and the plurality of node information may include rendering node information, direct rendering manager node information, and closed-source driver node information.

[0058] Taking the target graphics card as an Nvidia graphics card as an example, the Nvidia graphics card includes rendering (render) node information such as dev / dri / renderD12x, direct rendering manager (drm) node information such as dev / dri / cardx, and closed-source driver (Nvidia) node information such as dev / dri / nvidiax.

[0059] Since the rendering node information is usually configured in the virtual machine configuration to be used for selecting a graphics card, in the embodiment of the present disclosure, after receiving the rendering instruction, the electronic device can select the target graphics card as the graphics card for interface rendering through the rendering node information of the target graphics card, and then determine whether the target graphics card is a closed-source driver type.

[0060] Furthermore, since the rendering node information is configured for selecting a graphics card, when the electronic device selects a graphics card, it can directly obtain the rendering node information of the target graphics card, and when it is determined that the target graphics card belongs to a closed-source driver type, it can continue to use the rendering node information of the target graphics card to determine the target intermediate layer interface description information corresponding to the target graphics card, and then initialize the intermediate layer interface corresponding to the target graphics card based on the target intermediate layer interface description information.

[0061] Optionally, the intermediate layer interface may be EGL, and the target intermediate layer interface description information for initializing the intermediate layer interface may be EGLDevice. After acquiring EGLDevice, the electronic device may call eglInitialize to initialize EGL.

[0062] In some embodiments, when the target intermediate layer interface description information is stored in association with the rendering node information of the target graphics card, the target intermediate layer interface description information stored in association with the rendering node information of the target graphics card can be directly queried from multiple preset intermediate layer interface description information.

[0063] In other embodiments, when the target intermediate layer interface description information is stored in association with the direct rendering manager node information of the target graphics card, determining the target intermediate layer interface description information corresponding to the target graphics card based on the rendering node information may specifically include: searching for the direct rendering manager node information corresponding to the rendering node information in the system file; and determining the target intermediate layer interface description information from multiple preset intermediate layer interface description information based on the direct rendering manager node information.

[0064] Specifically, multiple node information of the target graphics card can be stored in the system file of the electronic device. Therefore, the electronic device can search the system file for the direct rendering manager node information corresponding to the rendering node information. Then, among the multiple preset intermediate layer interface description information, the target intermediate layer interface description information stored in association with the direct rendering manager node information is determined.

[0065] Furthermore, the associated storage method of the node information and the target intermediate layer interface description information may be that the node information is stored in the device file attribute of the target intermediate layer interface description information. Therefore, the specific method of determining the target intermediate layer interface description information associated with the node information may be to query the intermediate layer interface description information in which the node information is stored in the device file attribute among multiple preset intermediate layer interface description information, and use the queried intermediate layer interface description information as the target intermediate layer interface description information.

[0066] Optionally, if the intermediate layer interface is EGL and the intermediate layer interface description information is EGLDevice, the device file attribute may be an EGL_DRM_DEVICE_FILE attribute. Further, the electronic device may use eglQueryDeviceStringEXT to query the intermediate layer interface description information storing the node information in the device file attribute in multiple preset intermediate layer interface description information.

[0067] Therefore, in the embodiment of the present disclosure, the electronic device can initialize the intermediate layer interface corresponding to the target graphics card, and then implement the call to the target graphics card based on the intermediate layer interface.

[0068] S230: Initialize the graphics library interface of the target graphics card based on the target attribute information corresponding to the intermediate layer interface.

[0069] In the disclosed embodiment, after initializing the intermediate layer interface corresponding to the target graphics card, the electronic device can initialize the graphics library interface of the target graphics card based on the target attribute information corresponding to the initialized intermediate layer interface, and the graphics library interface can implement the call to the target graphics card.

[0070] Optionally, S230 may specifically include: initializing context information of a graphics library interface according to target attribute information corresponding to the intermediate layer interface; and initializing a graphics library interface of a target graphics card according to the context information.

[0071] The target attribute information may include at least one of off-screen rendering attributes and window rendering attributes.

[0072] If the target attribute information is an off-screen rendering attribute, the electronic device may initialize context information using the off-screen rendering attribute. If the target attribute information is a window rendering attribute, the electronic device may initialize context information using the window rendering attribute.

[0073] Optionally, if the intermediate layer interface is EGL, the off-screen rendering attribute may be an EGL_PBUFFER_BIT attribute, and the window rendering attribute may be an EGL_WINDOW_BIT attribute.

[0074] Furthermore, if the target attribute information is an off-screen rendering attribute, the electronic device can create an off-screen window in the context information environment after initializing the context information of the graphics library interface, thereby completing the initialization of the graphics library interface of the target graphics card. If the target attribute information is a window rendering attribute, the electronic device can create an actual window in the context information environment after initializing the context information of the graphics library interface, thereby completing the initialization of the graphics library interface of the target graphics card.

[0075] Therefore, in the embodiment of the present disclosure, the electronic device can initialize the graphics library interface of the target graphics card based on different window requirements, and then implement the call of different window requirements of the target graphics card based on the graphics library interface.

[0076] S240: Calling a graphics processor of a target graphics card through a graphics library interface, so that the graphics processor renders a target user interface corresponding to the rendering instruction.

[0077] In the embodiment of the present disclosure, after initializing the graphics library interface of the target graphics card, the electronic device can call the graphics processor of the target graphics card through the graphics library interface to enable the graphics processor to render the target user interface corresponding to the rendering instruction.

[0078] When the electronic device calls the graphics processor of the target graphics card through the graphics library interface, the rendering instruction can be sent to the graphics processor of the target graphics card, so that the graphics processor executes the rendering instruction and renders the target user interface.

[0079] Specifically, in this interface rendering method, Figure 1 When the rendering execution module 121 in the virtual machine software 120 running on the host machine 130 shown is executed, the rendering execution module 121 can call the graphics library interface to further implement the call to the graphics processor of the target graphics card. After the image processor completes the rendering of the target user interface, the rendering result is stored in a window generated based on the context information environment, and the result reading module 122 can read the rendering result from the window.

[0080] In some embodiments, when the rendering instruction is generated based on a start event for a target virtual machine, the target user interface may include a main interface of the virtual machine.

[0081] In some other embodiments, when the rendering instruction is generated based on a user operation event for the target virtual machine, the target user interface may include a virtual machine operation interface, wherein the virtual machine operation interface is used to display the user operation result.

[0082] In an embodiment of the present disclosure, after receiving a rendering instruction for a target virtual machine, when it is determined that a target graphics card used for interface rendering is of a closed-source driver type, an intermediate layer interface corresponding to the target graphics card can be initialized based on the rendering node information of the target graphics card, and a graphics library interface of the target graphics card can be initialized based on the target attribute information corresponding to the intermediate layer interface, and then the graphics processor of the target graphics card is called through the graphics library interface to enable the graphics processor to render the target user interface corresponding to the rendering instruction. As a result, the target graphics card of the closed-source driver type can be driven through the intermediate layer interface and the graphics library interface, and then the desktop virtualization function for the target virtual machine can be implemented based on the target graphics card of the closed-source driver type.

[0083] In other embodiments of the present disclosure, if the electronic device has multiple graphics cards, after receiving the rendering instruction for the target virtual machine, the electronic device may first select a target graphics card for interface rendering.

[0084] In some embodiments, after S210, the interface rendering method may further include: querying the graphics card status of each preset graphics card; and taking any preset graphics card whose graphics card status is an idle state as a target graphics card.

[0085] Specifically, the electronic device can query the graphics card status of each preset graphics card. If there is one preset graphics card with an idle graphics card status, the preset graphics card is directly used as the target graphics card; if there are multiple preset graphics cards with an idle graphics card status, any one of the preset graphics cards can be used as the target graphics card.

[0086] In other embodiments, after S210, the interface rendering method may further include: querying the graphics card status of each preset graphics card; and taking a preset graphics card whose graphics card status is idle and meets the preset graphics card requirements as a target graphics card.

[0087] Specifically, the electronic device can query the graphics card status of each preset graphics card. If there is one preset graphics card with an idle graphics card status, the preset graphics card is directly used as the target graphics card. If there are multiple preset graphics cards with an idle graphics card status, a preset graphics card that meets the preset graphics card requirements can be selected from these preset graphics cards as the target graphics card.

[0088] Furthermore, if there are multiple preset graphics cards that meet the preset graphics card requirements, any preset graphics card that meets the preset graphics card requirements can be selected as the target graphics card, or the preset graphics card with the best performance can be selected as the target graphics card, without limitation.

[0089] Optionally, the preset graphics card requirement may be a graphics card requirement that is pre-set as needed and can meet a rendering requirement of a target virtual machine, which is not limited herein.

[0090] Therefore, in the embodiment of the present disclosure, when the electronic device has multiple graphics cards, a graphics card for interface rendering can be accurately and efficiently selected for the target virtual machine.

[0091] The interface rendering method provided by the embodiment of the present disclosure is further illustrated below with a specific example.

[0092] Figure 3 A flow chart of another interface rendering method provided by an embodiment of the present disclosure is shown.

[0093] like Figure 3As shown, the virtual machine software can be run in the host machine to run the virtual machine. The virtual machine can run 2D / 3D applications. When the virtual machine is started or the user operates the 2D / 3D application, the virtual graphics driver module of the virtual machine, such as the Virtio-gpu driver module, can encode all rendering calls to the user-state driver into a rendering operation sequence, and then the virtual graphics driver module can send the rendering operation sequence to the virtual machine software, such as Qemu, through the data channel provided by the kernel-state driver, where Qemu implements the actual rendering function.

[0094] Furthermore, the rendering operation sequence is sent to the rendering execution module of the virtual machine software, such as Virtio-gpu, and the rendering execution module can translate the rendering operation sequence into rendering instructions corresponding to the 3D rendering call on the host machine. The rendering execution module can respond to each rendering instruction in turn, select a target graphics card for interface rendering, such as an Nvidia graphics card, and in the case where the target graphics card for interface rendering belongs to a closed-source driver type, initialize the middle layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card, and initialize the graphics library interface of the target graphics card based on the target attribute information corresponding to the middle layer interface, and then call the graphics library interface to call the graphics processor of the target graphics card to perform the actual rendering process. Thus, a result reading module such as egl-headless can read the rendering results.

[0095] Figure 4 A schematic structural diagram of an interface rendering device provided by an embodiment of the present disclosure is shown.

[0096] In the embodiment of the present disclosure, the interface rendering device may be arranged in an electronic device. Figure 1 The host machine 130 shown, further, the interface rendering device can form a rendering execution module 122 in the virtual machine software 120 running on the host machine 130.

[0097] The electronic devices may include but are not limited to mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.

[0098] like Figure 4 As shown, the interface rendering device 400 may include an instruction receiving module 410 , a first initialization module 420 , a second initialization module 430 and an interface rendering module 440 .

[0099] The instruction receiving module 410 may be configured to receive a rendering instruction for a target virtual machine.

[0100] The first initialization module 420 can be used to initialize the intermediate layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card when the target graphics card used for interface rendering belongs to a closed source driver type.

[0101] The second initialization module 430 may be used to initialize the graphics library interface of the target graphics card based on the target attribute information corresponding to the intermediate layer interface.

[0102] The interface rendering module 440 can be used to call the graphics processor of the target graphics card through the graphics library interface, so that the graphics processor renders the target user interface corresponding to the rendering instruction.

[0103] In an embodiment of the present disclosure, after receiving a rendering instruction for a target virtual machine, when it is determined that a target graphics card used for interface rendering is of a closed-source driver type, an intermediate layer interface corresponding to the target graphics card can be initialized based on the rendering node information of the target graphics card, and a graphics library interface of the target graphics card can be initialized based on the target attribute information corresponding to the intermediate layer interface, and then the graphics processor of the target graphics card is called through the graphics library interface to enable the graphics processor to render the target user interface corresponding to the rendering instruction. As a result, the target graphics card of the closed-source driver type can be driven through the intermediate layer interface and the graphics library interface, and then the desktop virtualization function for the target virtual machine can be implemented based on the target graphics card of the closed-source driver type.

[0104] In some embodiments of the present disclosure, the target user interface may include a virtual machine main interface, and the rendering instruction may be generated based on a start event for the target virtual machine.

[0105] In some embodiments of the present disclosure, the target user interface may include a virtual machine operation interface, the virtual machine operation interface may be used to display user operation results, and the rendering instruction may be generated based on a user operation event for the target virtual machine.

[0106] In some embodiments of the present disclosure, the interface rendering device 400 may further include a status query module and a graphics card determination module.

[0107] The status query module may be used to query the graphics card status of each preset graphics card after receiving a rendering instruction for a target virtual machine.

[0108] The graphics card determination module can be used to use any preset graphics card whose graphics card status is an idle state as a target graphics card.

[0109] In some embodiments of the present disclosure, the first initialization module 420 may include an information determination unit and a first initialization unit.

[0110] The information determination unit may be used to determine target intermediate layer interface description information corresponding to a target graphics card based on the rendering node information.

[0111] The first initialization unit may be used to initialize the intermediate layer interface corresponding to the target graphics card based on the target intermediate layer interface description information.

[0112] In some embodiments of the present disclosure, the information determination unit may include a first determination subunit and a second determination subunit.

[0113] The first determining subunit may be used to search for direct rendering manager node information corresponding to the rendering node information in a system file.

[0114] The second determining subunit may be configured to determine target intermediate layer interface description information from a plurality of preset intermediate layer interface description information according to the direct rendering manager node information.

[0115] In some embodiments of the present disclosure, the second initialization module 430 may include a second initialization unit and a third initialization unit.

[0116] The second initialization unit may be used to initialize the context information of the graphics library interface according to the target attribute information corresponding to the intermediate layer interface.

[0117] The third initialization unit may be configured to initialize a graphics library interface of a target graphics card according to the context information.

[0118] In some embodiments of the present disclosure, the target attribute information may include at least one of off-screen rendering attributes and window rendering attributes.

[0119] It should be noted that Figure 4 The interface rendering device 400 shown can execute Figures 2 to 3 The various steps in the method embodiment shown in the figure are implemented Figures 2 to 3 The various processes and effects in the method embodiment shown are not described in detail here.

[0120] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown.

[0121] In some embodiments of the present disclosure, the electronic device may include but is not limited to mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.

[0122] like Figure 5 As shown, the electronic device may include a controller 501 and a memory 502 storing computer program instructions.

[0123] Specifically, the controller 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0124] The memory 502 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 502 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 502 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 502 is a non-volatile solid-state memory. In a particular embodiment, the memory 502 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.

[0125] The controller 501 reads and executes the computer program instructions stored in the memory 502 to perform the steps of the interface rendering method provided in the embodiment of the present disclosure.

[0126] In one example, the electronic device may further include a transceiver 503 and a bus 504. Figure 5 As shown, the controller 501, the memory 502 and the transceiver 503 are connected via a bus 504 and communicate with each other.

[0127] The bus 504 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 504 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0128] The embodiments of the present disclosure further provide a computer-readable storage medium, which may store a computer program. When the computer program is executed by a processor, the processor implements the interface rendering method provided by the embodiments of the present disclosure.

[0129] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0130] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An interface rendering method, characterized in that: include: Receiving rendering instructions for a target virtual machine; In the case where the target graphics card used for interface rendering is of a closed source driver type, initializing the intermediate layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card; Initializing the graphics library interface of the target graphics card based on the target attribute information corresponding to the intermediate layer interface; The graphics processor of the target graphics card is called through the graphics library interface, so that the graphics processor renders the target user interface corresponding to the rendering instruction.

2. The method according to claim 1, characterized in that The target user interface includes a virtual machine main interface, and the rendering instruction is generated based on a startup event for the target virtual machine.

3. The method according to claim 1, characterized in that The target user interface includes a virtual machine operation interface, the virtual machine operation interface is used to display user operation results, and the rendering instruction is generated based on a user operation event for the target virtual machine.

4. The method according to claim 1, characterized in that: After receiving the rendering instruction for the target virtual machine, the method further includes: Query the graphics card status of each preset graphics card; Any preset graphics card whose graphics card status is an idle state is used as the target graphics card.

5. The method according to claim 1, characterized in that The initializing the intermediate layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card includes: Based on the rendering node information, determining the target intermediate layer interface description information corresponding to the target graphics card; Based on the target intermediate layer interface description information, the intermediate layer interface corresponding to the target graphics card is initialized.

6. The method according to claim 5, characterized in that The determining, based on the rendering node information, target intermediate layer interface description information corresponding to the target graphics card includes: In the system file, searching for the direct rendering manager node information corresponding to the rendering node information; The target intermediate layer interface description information is determined from a plurality of preset intermediate layer interface description information according to the direct rendering manager node information.

7. The method according to claim 1, characterized in that Initializing the graphics library interface of the target graphics card based on the target attribute information corresponding to the intermediate layer interface includes: Initializing the context information of the graphics library interface according to the target attribute information corresponding to the intermediate layer interface; Initialize the graphics library interface of the target graphics card according to the context information.

8. The method according to claim 1 or 7, characterized in that: The target attribute information includes at least one of off-screen rendering attributes and window rendering attributes.

9. An interface rendering device, characterized in that: include: An instruction receiving module, used for receiving rendering instructions for a target virtual machine; A first initialization module is used to initialize the intermediate layer interface corresponding to the target graphics card based on the rendering node information of the target graphics card when the target graphics card used for interface rendering belongs to a closed source driver type; A second initialization module, configured to initialize a graphics library interface of the target graphics card based on target attribute information corresponding to the intermediate layer interface; The interface rendering module is used to call the graphics processor of the target graphics card through the graphics library interface, so that the graphics processor renders the target user interface corresponding to the rendering instruction.

10. An electronic device, characterized in that: include: processor; A memory for storing executable instructions; Wherein, the processor is used to read the executable instructions from the memory and execute the executable instructions to implement the interface rendering method described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the processor implements the interface rendering method described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Software architecture suitable for large-scale animation rendering service cloud platform

    CN103268220A

  • Image rendering method, device and equipment and storage medium

    CN108765534A