Data processing method, device and system based on hardware acceleration

By using paravirtualization technology in virtual machines, API call requests are sent to paravirtualization drivers, access to accelerated hardware is achieved, and the problems of high-density hardware acceleration and hot migration are solved.

CN112445568BActive Publication Date: 2025-02-11ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910822676.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-02
Publication Date
2025-02-11
Estimated Expiration
2039-09-02

AI Technical Summary

Technical Problem

The existing technology cannot support high-density hardware-accelerated virtual machine services and hot migration. This is mainly because the virtual machine needs RDMA network capabilities, the RDMA network card pass-through method can only support a limited number of virtual machines and does not support hot migration.

Method used

By using paravirtualization technology, the hardware-accelerated API call request generated by the application is sent to the paravirtualization driver, and the API call request is sent to the corresponding acceleration hardware through the host to achieve access to the acceleration hardware.

Benefits of technology

It realizes high-density hardware acceleration services in virtual machines and supports hot migration, solving the problem of limiting the number of virtual machines and not supporting hot migration in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112445568B_ABST
    Figure CN112445568B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, device and system based on hardware acceleration, which relates to the field of data processing and can solve the problem that the prior art cannot support high-density hardware-accelerated virtual machine services and hot migration. The method of the present invention mainly comprises: an application running on a virtual machine sends an API call request based on hardware acceleration to a semi-virtualized driver through an API forwarding program; the semi-virtualized driver sends the API call request to the corresponding acceleration hardware through a host machine. The present invention is mainly applicable to the scenario of realizing hardware acceleration based on a virtual machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a data processing method, device and system based on hardware acceleration. Background Art

[0002] Hardware acceleration is to use hardware modules to replace software algorithms to make full use of the inherent fast characteristics of hardware. Hardware acceleration is usually more efficient than software algorithms. Currently, various hardware acceleration functions have been realized, such as graphics processing unit (GPU) hardware acceleration and field programmable gate array (FPGA) hardware acceleration.

[0003] For security reasons, all public cloud services are currently run in virtual machines. Hardware acceleration can also be achieved based on virtual machines, including: passing acceleration hardware directly to virtual machines, and in order to achieve remote hardware acceleration capabilities, a remote call function can be added to the virtual machine to convert local API calls into remote API calls, and deploy low-latency channels such as Remote Direct Memory Access (RDMA) between the virtual machine and the remote acceleration hardware, so that remote API calls can be efficiently called.

[0004] However, since the virtual machine needs to have RDMA network capabilities, the RDMA network card needs to be passed through to the virtual machine in a direct passthrough manner. However, general RDMA network cards can only support 10-32 virtual machines in a direct passthrough manner, so it is impossible to support hundreds or even more hardware-accelerated virtual machine services at a high density at the same time; and the direct passthrough method does not support hot migration, so virtual machines cannot achieve hot migration. Summary of the invention

[0005] In view of this, the present invention provides a data processing method, device and system based on hardware acceleration, the purpose of which is to solve the problem that the existing technology cannot support high-density hardware-accelerated virtual machine services and hot migration.

[0006] In a first aspect, the present invention provides a data processing method based on hardware acceleration, the method comprising:

[0007] The application running on the virtual machine sends the hardware-accelerated API call request to the paravirtualized driver through the API forwarding program;

[0008] The paravirtualized driver sends the API call request to the corresponding acceleration hardware through the host machine.

[0009] Optionally, the application running on the virtual machine sends the hardware-accelerated API call request to the paravirtualized driver through the API forwarding program, including:

[0010] The application program running on the virtual machine sends the API call request based on hardware acceleration to the paravirtualized front-end driver located in the virtual machine through the API forwarding program;

[0011] The paravirtualized front-end driver sends the API call request to the paravirtualized back-end driver located in the hypervisor;

[0012] The paravirtualized driver sends the API call request to the corresponding acceleration hardware through the host machine, including:

[0013] The paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine.

[0014] Optionally, before the paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine, the method further includes:

[0015] When the paravirtualized backend driver determines that the API call request is a request for obtaining acceleration hardware static information, querying the acceleration hardware static information corresponding to the API call request from the cache;

[0016] The paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine, including:

[0017] If the static information of the acceleration hardware corresponding to the API call request is not found in the cache, the semi-virtualized back-end driver sends the API call request to the corresponding acceleration hardware through the host machine, so that the semi-virtualized back-end driver receives the static information feedback of the acceleration hardware corresponding to the API call request through the host machine.

[0018] Optionally, if the acceleration hardware static information corresponding to the API call request is queried in the cache, the method further includes:

[0019] The paravirtualized backend driver obtains the acceleration hardware static information corresponding to the API call request from the cache, and forwards the obtained acceleration hardware static information to the application program through the paravirtualized front-end driver and the API forwarding program in sequence.

[0020] Optionally, the method further includes:

[0021] After receiving the acceleration hardware static information fed back by the acceleration hardware corresponding to the API call request, the paravirtualized backend driver associates and caches the received acceleration hardware static information with the called API.

[0022] Optionally, the paravirtualized backend driver sending the API call request to the corresponding acceleration hardware through the host machine includes:

[0023] When the API call request is used to call local acceleration hardware, the paravirtualized backend driver sends the API call request to the corresponding acceleration hardware in the host machine;

[0024] When the API call request is used to call remote acceleration hardware, the paravirtualized backend driver sends the API call request to the network card in the host machine, and the network card sends the API call request to the corresponding remote acceleration hardware through a preset remote transmission protocol.

[0025] Optionally, before the paravirtualized backend driver sends the API call request to the network card in the host machine, the method further includes:

[0026] If the multiple API call requests are all requests for obtaining dynamic information of acceleration hardware, the multiple API call requests are packaged.

[0027] Optionally, the application running on the virtual machine sends the hardware-accelerated API call request to the paravirtualized driver through the API forwarding program, including:

[0028] The application program in the container running on the virtual machine sends the API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program.

[0029] In a second aspect, the present invention provides a data processing device based on hardware acceleration, the device comprising:

[0030] A first sending unit is used to send an API call request based on hardware acceleration to a paravirtualized driver through an API forwarding program by an application running on the virtual machine;

[0031] The second sending unit is used for sending the API call request to the corresponding acceleration hardware through the host machine by the paravirtualization driver.

[0032] Optionally, the first sending unit includes:

[0033] A first sending module, configured to send, by an application running on the virtual machine, an API call request based on hardware acceleration to a paravirtualized front-end driver located in the virtual machine through the API forwarding program;

[0034] A second sending module, configured to send the API call request from the paravirtualized front-end driver to the paravirtualized back-end driver in the hypervisor;

[0035] The second sending unit is used for sending the API call request to the corresponding acceleration hardware through the host machine by the paravirtualized back-end driver.

[0036] Optionally, the device further comprises:

[0037] A query unit, configured to query the acceleration hardware static information corresponding to the API call request from a cache when the paravirtualized backend driver determines that the API call request is a request for obtaining acceleration hardware static information before the paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine;

[0038] The second sending unit is configured to, when static information of the acceleration hardware corresponding to the API call request is not found in the cache, send the API call request to the corresponding acceleration hardware through the host machine by the paravirtualized backend driver;

[0039] The receiving unit is used for receiving, by the paravirtualized backend driver, static information of acceleration hardware feedback corresponding to the API call request through the host machine.

[0040] Optionally, the device further comprises:

[0041] an acquisition unit, configured to, when the acceleration hardware static information corresponding to the API call request is queried in the cache, acquire the acceleration hardware static information corresponding to the API call request from the cache by the paravirtualized backend driver;

[0042] The forwarding unit is used to forward the acquired acceleration hardware static information to the application program through the semi-virtualized front-end driver and the API forwarding program in sequence.

[0043] Optionally, the device further comprises:

[0044] The cache unit is used for associating and caching the received acceleration hardware static information with the called API after the paravirtualized backend driver receives the acceleration hardware static information fed back by the acceleration hardware corresponding to the API call request.

[0045] Optionally, a second sending unit is used to, when the API call request is used to call local acceleration hardware, the paravirtualized back-end driver sends the API call request to the corresponding acceleration hardware in the host machine; when the API call request is used to call remote acceleration hardware, the paravirtualized back-end driver sends the API call request to the network card in the host machine, and the network card sends the API call request to the corresponding remote acceleration hardware through a preset remote transmission protocol.

[0046] Optionally, the device further comprises:

[0047] A packing unit is used to pack the multiple API call requests before the paravirtualized back-end driver sends the API call request to the network card in the host machine, if the multiple API call requests are all requests for obtaining dynamic information of acceleration hardware.

[0048] Optionally, the first sending unit is used to enable an application program in a container running on a virtual machine to send an API call request based on hardware acceleration to a paravirtualized driver through the API forwarding program.

[0049] In a third aspect, the present invention provides a data processing system based on hardware acceleration, the system comprising: a virtual machine, an application running on the virtual machine, an API forwarding program running on the virtual machine, a paravirtualized driver and acceleration hardware;

[0050] The application is used to send the API call request based on hardware acceleration to the API forwarding program;

[0051] The API forwarding program is used to send the API call request to the paravirtualization driver;

[0052] The paravirtualized driver is used to send the API call request to the corresponding acceleration hardware through the host machine.

[0053] In a fourth aspect, the present invention provides a storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the data processing method based on hardware acceleration as described in the first aspect.

[0054] In a fifth aspect, the present invention provides an electronic device, the electronic device comprising a storage medium and a processor;

[0055] The processor is adapted to implement each instruction;

[0056] The storage medium is suitable for storing a plurality of instructions;

[0057] The instructions are suitable for being loaded by the processor and executing the data processing method based on hardware acceleration as described in the first aspect.

[0058] By means of the above technical scheme, the data processing method, device and system based on hardware acceleration provided by the present invention can send an API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program when the application running on the virtual machine generates an API call request based on hardware acceleration, and the paravirtualized driver sends the API call request to the corresponding acceleration hardware through the host machine. It can be seen from this that when the present invention implements the hardware acceleration function in the virtual machine, it does not realize the virtual machine's access to the acceleration hardware by directly connecting the virtual machine and the acceleration hardware, but uses the paravirtualization technology to send the API call request to the acceleration hardware to the paravirtualized driver, and then the paravirtualized driver realizes the access to the corresponding acceleration hardware through the host machine, and paravirtualization is a software implementation that can support any number of virtual machines and hot migration, so the present invention can realize high-density hardware-accelerated virtual machine services and hot migration.

[0059] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0061] Figure 1 A flowchart of a data processing method based on hardware acceleration provided by an embodiment of the present invention is shown;

[0062] Figure 2 A flowchart of another data processing method based on hardware acceleration provided by an embodiment of the present invention is shown;

[0063] Figure 3 A schematic diagram of a structure for implementing hardware acceleration based on a virtual machine provided by an embodiment of the present invention is shown;

[0064] Figure 4 Another structural diagram of implementing hardware acceleration based on a virtual machine provided by an embodiment of the present invention is shown;

[0065] Figure 5 A schematic diagram of a structure for implementing GPU hardware acceleration based on a container provided by an embodiment of the present invention is shown;

[0066] Figure 6 A block diagram showing a data processing device based on hardware acceleration provided by an embodiment of the present invention is shown;

[0067] Figure 7 A block diagram showing the composition of another data processing device based on hardware acceleration provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0068] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary 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 limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0069] The embodiment of the present invention provides a data processing method based on hardware acceleration, such as Figure 1 As shown, the method mainly includes:

[0070] 101. The application program running on the virtual machine sends the API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program.

[0071] A variety of applications can be installed in a virtual machine, such as applications with artificial intelligence computing requirements, and applications with graphics computing and rendering requirements. During the running of an application, when it is necessary to query the static information of a GPU video memory size, the number of CUDA (Compute Unified Device Architecture, a computing platform launched by graphics card manufacturer NVIDIA) cores, FPGA (Field-Programmable Gate Array) information, and other acceleration hardware, or when it is necessary to request the GPU to perform graphics computing rendering and other acceleration hardware dynamic information, the application will generate an API (Application Programming Interface) call request based on hardware acceleration. After the API forwarding program obtains the API call request, it can send it to the paravirtualization driver so that the paravirtualization driver can perform subsequent transmission processing on the API call request. Among them, paravirtualization is a popular technology similar to full virtualization. It uses hypervisor to share access to the underlying hardware, but its client operating system integrates virtualization code, and the operating system itself can cooperate well with the virtual process, so this method does not need to be recompiled or cause traps. In order to realize the paravirtualization function, the paravirtualization driver needs to be installed to work. The paravirtualization driver may be a Virtio driver or other driver based on paravirtualization technology.

[0072] 102. The paravirtualized driver sends the API call request to the corresponding acceleration hardware through the host machine.

[0073] After receiving the API call request, the paravirtualized driver can send the API call request to the corresponding acceleration hardware, such as GPU, FPGA and other acceleration hardware, through the host of the virtual machine. And the paravirtualized driver can obtain the data fed back by the acceleration hardware through the host. Among them, the API call request can include the unique identifier of the acceleration hardware, so that the target acceleration hardware can be determined by the unique identifier, or it can only include the IP address of the server, so that the corresponding server can determine the target acceleration hardware according to the acceleration hardware load.

[0074] In addition, the current mainstream container technology already supports hardware acceleration. For reasons such as security reinforcement, all container services on public clouds currently run in virtual machines. The existing method for containers running in virtual machines to implement hardware acceleration functions is to pass the acceleration hardware directly to the virtual machine, and start the container service in the virtual machine, with the ratio of virtual machines to containers being 1:1. In other words, the prior art also has the problem of being unable to support high-density hardware accelerated container services and hot migration. In order to solve this technical problem, the application in the container running on the virtual machine can also first send the API call request based on hardware acceleration to the semi-virtualized driver through the API forwarding program, and then the semi-virtualized driver sends the API call request to the corresponding acceleration hardware through the host machine.

[0075] The data processing method based on hardware acceleration provided by the embodiment of the present invention can send an API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program when the application running on the virtual machine generates an API call request based on hardware acceleration, and the paravirtualized driver sends the API call request to the corresponding acceleration hardware through the host machine. It can be seen that when the present invention implements the hardware acceleration function in the virtual machine, it does not realize the virtual machine's access to the acceleration hardware by directly connecting the virtual machine and the acceleration hardware, but uses the paravirtualization technology to send the API call request to the acceleration hardware to the paravirtualized driver, and then the paravirtualized driver realizes the access to the corresponding acceleration hardware through the host machine, and paravirtualization is a software implementation that can support any number of virtual machines and hot migration. Therefore, the present invention can realize high-density hardware-accelerated virtual machine services and hot migration.

[0076] Further, based on Figure 1 Another embodiment of the present invention further provides a data processing method based on hardware acceleration, such as Figure 2 As shown, the method mainly includes:

[0077] 201. An application program running on a virtual machine sends an API call request based on hardware acceleration to a paravirtualized front-end driver program located in the virtual machine through the API forwarding program.

[0078] 202. The paravirtualized front-end driver sends the API call request to a paravirtualized back-end driver located in a hypervisor.

[0079] Specifically, a paravirtualized front-end driver (such as a Virtio front-end driver) may be installed in a virtual machine or container, and a paravirtualized back-end driver (such as a Virtio back-end driver) may be installed in a hypervisor. Paravirtualization technology may be implemented through communication between the paravirtualized front-end driver and the paravirtualized back-end driver.

[0080] Therefore, when an application running on a virtual machine generates an API call request based on hardware acceleration, the API forwarding program can first send the API call request to the paravirtualized front-end driver, which then sends it to the paravirtualized back-end driver.

[0081] 203. The paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine.

[0082] Specifically, when the API call request is used to call local acceleration hardware, the paravirtualized back-end driver can directly send the API call request to the corresponding acceleration hardware in the host machine; when the API call request is used to call remote acceleration hardware, the paravirtualized back-end driver sends the API call request to the network card in the host machine, and the network card sends the API call request to the corresponding remote acceleration hardware through a preset remote transmission protocol.

[0083] The preset remote transmission protocol may be bitfusion, RCUDA (Remote Compute Unified Device Architecture, a remote computing platform launched by graphics card manufacturer NVIDIA), and other remote transmission protocols. In addition, in order to increase the remote transmission rate, a high-bandwidth, low-latency remote channel may be deployed. For example, an RDMA network card may be deployed.

[0084] The remote acceleration hardware can be pooled acceleration hardware or ordinary acceleration hardware. Regardless of whether it is pooled acceleration hardware or ordinary acceleration hardware, the embodiments of the present invention can implement the regulation of acceleration hardware load. For example, if there is currently a GPU1 being used by the customer and another GPU0 is idle, the API call request can be sent to GPU0. When deploying an RDMA network card and the remote acceleration hardware is pooled acceleration hardware, the architecture diagram of the embodiments of the present invention can be as follows Figure 3 shown.

[0085] The data processing method based on hardware acceleration provided by the embodiment of the present invention can, when a virtual machine implements the hardware acceleration function, not realize the access of the virtual machine to the acceleration hardware by directly connecting the virtual machine and the acceleration hardware, but utilize the paravirtualization technology to send the API call request for the acceleration hardware to the paravirtualized front-end driver, and then send it to the paravirtualized back-end driver by the paravirtualized front-end driver, and finally the paravirtualized driver realizes the access to the corresponding acceleration hardware through the host machine. Paravirtualization is a software implementation that can support any number of virtual machines or containers, and also supports hot migration. Therefore, the present invention can realize high-density hardware-accelerated virtual machine services and hot migration.

[0086] Optionally, since the embodiment of the present invention can implement high-density hardware-accelerated virtual machine services, in order to efficiently process a large number of API call requests generated in virtual machines, the following two solutions can be adopted:

[0087] Solution 1: Static information of acceleration hardware that will not change can be cached so that the static information of acceleration hardware can be directly obtained from the cache next time. Specifically, before the semi-virtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine, the semi-virtualized backend driver can query the static information of acceleration hardware corresponding to the API call request from the cache when determining that the API call request is a request for obtaining static information of acceleration hardware; if the static information of acceleration hardware corresponding to the API call request is not found in the cache, the semi-virtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine so that the semi-virtualized backend driver receives static information fed back by the acceleration hardware corresponding to the API call request through the host machine; if the static information of acceleration hardware corresponding to the API call request is found in the cache, the semi-virtualized backend driver obtains the static information of acceleration hardware corresponding to the API call request from the cache, and forwards the obtained static information of acceleration hardware to the application through the semi-virtualized front-end driver and the API forwarding program in sequence.

[0088] Among them, when the acceleration hardware static information corresponding to the API call request is not found in the cache, after the semi-virtualized back-end driver receives the acceleration hardware static information fed back by the acceleration hardware corresponding to the API call request, the received acceleration hardware static information and the called API can be associated and cached, so that the next time the same API call request is received, the data can be directly obtained from the local cache without remote acquisition.

[0089] Solution 2: Before the paravirtualized back-end driver sends the API call request to the host machine, if multiple API call requests are all requests for obtaining dynamic information of acceleration hardware, the multiple API call requests are packaged and then sent to the remote acceleration hardware server, so that the remote acceleration hardware server can unpack the multiple API call requests and distribute them to the corresponding acceleration hardware.

[0090] The semi-virtualized backend driver may package multiple API call requests received within a preset time interval, for example, package API call requests received within 0.1 ms.

[0091] When the two methods of caching and packaging are included, the architecture diagram of the embodiment of the present invention can be as follows: Figure 4 As shown, the aggregation module is used to package multiple API call requests, and the cache module and the aggregation module can be located in the paravirtualized backend driver, or outside the paravirtualized backend driver, in the Hypervisor.

[0092] For example, when the embodiment of the present invention is applied to the scenario of container-based GPU hardware acceleration, the architecture diagram can be as follows: Figure 5 As shown. AI APPS is an application with artificial intelligence computing requirements, and the aggregation module is used to package multiple API call requests. Since the GPU is not directly connected to the virtual machine, any number of virtual machines can be deployed, any number of corresponding containers can be deployed, and hot migration can be achieved. In addition, the cache module and the aggregation module can be located in the virtio backend driver, or outside the virtio backend driver and in the Hypervisor.

[0093] It should be added that the present invention is also detectable, and the detection methods include but are not limited to the following two:

[0094] The first one: Since the implementation of the paravirtualization function requires the installation of a front-end driver, it can be determined by judging whether the front-end driver exists.

[0095] Specifically, the virtual machine is started first, and then "ispci|grep virtio" is used to check whether there is a virtio front-end driver, and all the queried virtio front-end drivers are uninstalled to determine whether the application call is normal; if not, it is determined that the present invention is adopted. It is also possible to use tools such as perf and strace to check whether the virtio related driver is called when the application calls; if the virtio related driver is called, it is determined that the present invention is adopted.

[0096] The second method: When the remote device uses an accelerated hardware pool, there will be no accelerated hardware driver inside the local virtual machine, so it can be determined by detecting whether there is an accelerated hardware driver inside the virtual machine.

[0097] Specifically, "lsmod|grep nvidia" can be executed in Linux to determine whether the acceleration hardware driver exists. If it does not exist, and the application program runs normally, it means that the present invention is adopted.

[0098] Further, according to the above method embodiment, another embodiment of the present invention also provides a data processing device based on hardware acceleration, such as Figure 6 As shown, the device comprises:

[0099] A first sending unit 31 is used for sending an API call request based on hardware acceleration to a paravirtualized driver through an API forwarding program by an application running on the virtual machine;

[0100] The second sending unit 32 is used for sending the API call request to the corresponding acceleration hardware through the host machine by the paravirtualization driver.

[0101] Optional, such as Figure 7 As shown, the first sending unit 31 includes:

[0102] A first sending module 311 is used for sending the API call request based on hardware acceleration by the application program running on the virtual machine to the paravirtualized front-end driver located in the virtual machine through the API forwarding program;

[0103] A second sending module 312, configured to send the API call request from the paravirtualized front-end driver to the paravirtualized back-end driver in the hypervisor;

[0104] The second sending unit 32 is configured to send the API call request to the corresponding acceleration hardware through the host machine by the paravirtualized backend driver.

[0105] Optional, such as Figure 7 As shown, the device also includes:

[0106] A query unit 33, configured to query the acceleration hardware static information corresponding to the API call request from a cache when the paravirtualized backend driver determines that the API call request is a request for obtaining acceleration hardware static information before the paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine;

[0107] The second sending unit 32 is configured to send the API call request to the corresponding acceleration hardware through the host machine when the static information of the acceleration hardware corresponding to the API call request is not found in the cache;

[0108] The receiving unit 34 is configured to receive, by the paravirtualized backend driver, static information of acceleration hardware feedback corresponding to the API call request through the host machine.

[0109] Optional, such as Figure 7 As shown, the device also includes:

[0110] The acquisition unit 35 is configured to, when the acceleration hardware static information corresponding to the API call request is queried in the cache, acquire the acceleration hardware static information corresponding to the API call request from the cache by the paravirtualized backend driver;

[0111] The forwarding unit 36 ​​is used to forward the acquired acceleration hardware static information to the application program through the paravirtualization front-end driver and the API forwarding program in sequence.

[0112] Optional, such as Figure 7 As shown, the device also includes:

[0113] The cache unit 37 is used for associating and caching the received acceleration hardware static information with the called API after the paravirtualized backend driver receives the acceleration hardware static information fed back by the acceleration hardware corresponding to the API call request.

[0114] Optionally, the second sending unit 32 is used for, when the API call request is used to call local acceleration hardware, the semi-virtualized back-end driver sends the API call request to the corresponding acceleration hardware in the host machine; when the API call request is used to call remote acceleration hardware, the semi-virtualized back-end driver sends the API call request to the network card in the host machine, and the network card sends the API call request to the corresponding remote acceleration hardware through a preset remote transmission protocol.

[0115] Optional, such as Figure 7 As shown, the device also includes:

[0116] The packing unit 38 is used to pack the multiple API call requests before the paravirtualized backend driver sends the API call request to the network card in the host machine, if the multiple API call requests are all requests for obtaining dynamic information of the accelerated hardware.

[0117] Optionally, the first sending unit 31 is used to send the API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program by the application in the container running on the virtual machine.

[0118] The data processing device based on hardware acceleration provided by the embodiment of the present invention can send an API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program when the application running on the virtual machine generates an API call request based on hardware acceleration, and the paravirtualized driver sends the API call request to the corresponding acceleration hardware through the host machine. It can be seen that when the present invention implements the hardware acceleration function in the virtual machine, it does not realize the virtual machine's access to the acceleration hardware by directly connecting the virtual machine and the acceleration hardware, but uses the paravirtualization technology to send the API call request for the acceleration hardware to the paravirtualized driver, and then the paravirtualized driver realizes the access to the corresponding acceleration hardware through the host machine, and paravirtualization is a software implementation that can support any number of virtual machines and also supports hot migration. Therefore, the present invention can realize high-density hardware-accelerated virtual machine services and hot migration.

[0119] Furthermore, another embodiment of the present invention provides a data processing system based on hardware acceleration, the system comprising: a virtual machine, an application running on the virtual machine, an API forwarding program running on the virtual machine, a paravirtualized driver, and acceleration hardware;

[0120] The application is used to send the API call request based on hardware acceleration to the API forwarding program;

[0121] The API forwarding program is used to send the API call request to the paravirtualization driver;

[0122] The paravirtualized driver is used to send the API call request to the corresponding acceleration hardware through the host machine.

[0123] Optionally, the paravirtualized driver includes a paravirtualized front-end driver and a paravirtualized back-end driver; the paravirtualized front-end driver is located in the virtual machine, and the paravirtualized back-end driver is located in the hypervisor;

[0124] The API forwarding program is used to send the API call request to the paravirtualized front-end driver;

[0125] The paravirtualized front-end driver is used to send the API call request to the paravirtualized back-end driver;

[0126] The paravirtualized backend driver is used to send the API call request to the corresponding acceleration hardware through the host machine.

[0127] Optionally, the semi-virtualized back-end driver is used to query the acceleration hardware static information corresponding to the API call request from the cache when it is determined that the API call request is a request for obtaining acceleration hardware static information before sending the API call request to the corresponding acceleration hardware through the host machine; if the acceleration hardware static information corresponding to the API call request is not found in the cache, the API call request is sent to the corresponding acceleration hardware through the host machine, so that the semi-virtualized back-end driver receives the static information fed back by the acceleration hardware corresponding to the API call request through the host machine.

[0128] Optionally, the semi-virtualized back-end driver is used to obtain the acceleration hardware static information corresponding to the API call request from the cache when the acceleration hardware static information corresponding to the API call request is queried in the cache, and forward the obtained acceleration hardware static information to the application through the semi-virtualized front-end driver and the API forwarding program in sequence.

[0129] Optionally, the semi-virtualized back-end driver is used to associate and cache the received acceleration hardware static information with the called API after receiving the acceleration hardware static information fed back by the acceleration hardware corresponding to the API call request.

[0130] Optionally, the semi-virtualized back-end driver is used to send the API call request to the corresponding acceleration hardware in the host machine when the API call request is used to call local acceleration hardware; and to send the API call request to the network card in the host machine when the API call request is used to call remote acceleration hardware, and the network card sends the API call request to the corresponding remote acceleration hardware through a preset remote transmission protocol.

[0131] Optionally, the semi-virtualized back-end driver is used to package the multiple API call requests before sending the API call requests to the network card in the host machine, if the multiple API call requests are all requests for obtaining dynamic information of accelerated hardware.

[0132] Optionally, the system further includes a container, wherein the container runs on the virtual machine, and the application is located in the container.

[0133] The data processing system based on hardware acceleration provided by the embodiment of the present invention can send an API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program when the application running on the virtual machine generates an API call request based on hardware acceleration, and the paravirtualized driver sends the API call request to the corresponding acceleration hardware through the host machine. It can be seen that when the present invention implements the hardware acceleration function in the virtual machine, it does not realize the virtual machine's access to the acceleration hardware by directly connecting the virtual machine and the acceleration hardware, but uses the paravirtualization technology to send the API call request to the acceleration hardware to the paravirtualized driver, and then the paravirtualized driver realizes the access to the corresponding acceleration hardware through the host machine, and paravirtualization is a software implementation that can support any number of virtual machines and also supports hot migration, so the present invention can realize high-density hardware-accelerated virtual machine services and hot migration.

[0134] Furthermore, another embodiment of the present invention provides a storage medium, wherein the storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the data processing method based on hardware acceleration as described above.

[0135] The instructions stored in the storage medium provided by the embodiment of the present invention can be sent to the semi-virtualized driver through the API forwarding program when the application running on the virtual machine generates an API call request based on hardware acceleration, and the semi-virtualized driver sends the API call request to the corresponding acceleration hardware through the host machine. It can be seen that when the present invention implements the hardware acceleration function in the virtual machine, it does not realize the virtual machine's access to the acceleration hardware by directly connecting the virtual machine and the acceleration hardware, but uses the semi-virtualization technology to send the API call request for the acceleration hardware to the semi-virtualized driver, and then the semi-virtualized driver realizes the access to the corresponding acceleration hardware through the host machine, and the semi-virtualization is a software implementation that can support any number of virtual machines and also supports hot migration. Therefore, the present invention can realize high-density hardware-accelerated virtual machine services and hot migration.

[0136] Furthermore, another embodiment of the present invention provides an electronic device, the electronic device comprising a storage medium and a processor;

[0137] The processor is adapted to implement each instruction;

[0138] The storage medium is suitable for storing a plurality of instructions;

[0139] The instructions are suitable for being loaded by the processor and executing the GPU-based data processing method as described above.

[0140] The electronic device provided by the embodiment of the present invention can send an API call request based on hardware acceleration to the semi-virtualized driver through the API forwarding program when the application running on the virtual machine generates an API call request based on hardware acceleration, and the semi-virtualized driver sends the API call request to the corresponding acceleration hardware through the host machine. It can be seen that when the present invention implements the hardware acceleration function in the virtual machine, it does not realize the virtual machine's access to the acceleration hardware by directly connecting the virtual machine and the acceleration hardware, but uses the semi-virtualization technology to send the API call request for the acceleration hardware to the semi-virtualized driver, and then the semi-virtualized driver realizes the access to the corresponding acceleration hardware through the host machine, and the semi-virtualization is a software implementation that can support any number of virtual machines and also supports hot migration. Therefore, the present invention can realize high-density hardware-accelerated virtual machine services and hot migration.

[0141] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0142] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.

[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0144] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0145] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0146] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0147] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0148] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0149] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the data processing method, device, and system based on hardware acceleration according to an embodiment of the present invention. The present invention may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0150] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

Claims

1. A data processing method based on hardware acceleration, characterized in that: The method comprises: The application running on the virtual machine sends the hardware-accelerated API call request to the paravirtualized driver through the API forwarding program; When the paravirtualization driver determines that the API call request is a request for obtaining acceleration hardware static information, querying the acceleration hardware static information corresponding to the API call request from the cache; If the static information of the acceleration hardware corresponding to the API call request is not found in the cache, the semi-virtualized driver sends the API call request to the corresponding acceleration hardware through the host machine, so that the semi-virtualized driver receives the static information feedback from the acceleration hardware corresponding to the API call request through the host machine.

2. The method according to claim 1, characterized in that The application running on the virtual machine sends the hardware-accelerated API call request to the paravirtualized driver through the API forwarding program, including: The application program running on the virtual machine sends the API call request based on hardware acceleration to the paravirtualized front-end driver located in the virtual machine through the API forwarding program; The paravirtualized front-end driver sends the API call request to the paravirtualized back-end driver located in the hypervisor; The paravirtualized driver sends the API call request to the corresponding acceleration hardware through the host machine, including: The paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine.

3. The method according to claim 2, characterized in that When the paravirtualization driver determines that the API call request is a request for obtaining acceleration hardware static information, querying the acceleration hardware static information corresponding to the API call request from the cache, including: when the paravirtualization backend driver determines that the API call request is a request for obtaining acceleration hardware static information, querying the acceleration hardware static information corresponding to the API call request from the cache; The paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine, including: The paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine.

4. The method according to claim 3, characterized in that: If the acceleration hardware static information corresponding to the API call request is queried in the cache, the method further includes: The paravirtualized backend driver obtains the acceleration hardware static information corresponding to the API call request from the cache, and forwards the obtained acceleration hardware static information to the application program through the paravirtualized front-end driver and the API forwarding program in sequence.

5. The method according to claim 3, characterized in that: The method further comprises: After receiving the acceleration hardware static information fed back by the acceleration hardware corresponding to the API call request, the paravirtualized backend driver associates and caches the received acceleration hardware static information with the called API.

6. The method according to claim 2, characterized in that The paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine, including: When the API call request is used to call local acceleration hardware, the paravirtualized backend driver sends the API call request to the corresponding acceleration hardware in the host machine; When the API call request is used to call remote acceleration hardware, the paravirtualized backend driver sends the API call request to the network card in the host machine, and the network card sends the API call request to the corresponding remote acceleration hardware through a preset remote transmission protocol.

7. The method according to claim 6, characterized in that Before the paravirtualized backend driver sends the API call request to the network card in the host machine, the method further includes: If the multiple API call requests are all requests for obtaining dynamic information of acceleration hardware, the multiple API call requests are packaged.

8. The method according to any one of claims 1 to 7, characterized in that The application running on the virtual machine sends the hardware-accelerated API call request to the paravirtualized driver through the API forwarding program, including: The application program in the container running on the virtual machine sends the API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program.

9. A data processing device based on hardware acceleration, characterized in that: The device comprises: A first sending unit is used to send an API call request based on hardware acceleration to a paravirtualized driver through an API forwarding program by an application running on the virtual machine; A query unit, configured to query the acceleration hardware static information corresponding to the API call request from a cache when the paravirtualization driver determines that the API call request is a request for obtaining acceleration hardware static information; A second sending unit is configured to send the API call request to the corresponding acceleration hardware through the host machine by the paravirtualization driver if the acceleration hardware static information corresponding to the API call request is not found in the cache; The receiving unit is used for receiving, by the paravirtualized driver, static information of acceleration hardware feedback corresponding to the API call request through the host machine.

10. The device according to claim 9, characterized in that The first sending unit includes: A first sending module, configured to send, by an application running on the virtual machine, an API call request based on hardware acceleration to a paravirtualized front-end driver located in the virtual machine through the API forwarding program; A second sending module, configured to send the API call request from the paravirtualized front-end driver to the paravirtualized back-end driver in the hypervisor; The second sending unit is specifically configured to send the API call request to the corresponding acceleration hardware through the host machine by the paravirtualized backend driver.

11. The device according to claim 10, characterized in that The query unit is specifically configured to query the acceleration hardware static information corresponding to the API call request from the cache when the paravirtualized backend driver determines that the API call request is a request for obtaining acceleration hardware static information before the paravirtualized backend driver sends the API call request to the corresponding acceleration hardware through the host machine; The second sending unit is configured to, when static information of the acceleration hardware corresponding to the API call request is not found in the cache, send the API call request to the corresponding acceleration hardware through the host machine by the paravirtualized backend driver; The receiving unit is specifically configured to receive, by the paravirtualized backend driver, static information of acceleration hardware feedback corresponding to the API call request through the host machine.

12. The device according to claim 11, characterized in that The device also includes: an acquisition unit, configured to, when the acceleration hardware static information corresponding to the API call request is queried in the cache, acquire the acceleration hardware static information corresponding to the API call request from the cache by the paravirtualized backend driver; The forwarding unit is used to forward the acquired acceleration hardware static information to the application program through the semi-virtualized front-end driver and the API forwarding program in sequence.

13. The device according to claim 11, characterized in that The device also includes: The cache unit is used for associating and caching the received acceleration hardware static information with the called API after the paravirtualized backend driver receives the acceleration hardware static information fed back by the acceleration hardware corresponding to the API call request.

14. The device according to claim 10, characterized in that A second sending unit, configured to, when the API call request is used to call local acceleration hardware, cause the paravirtualized backend driver to send the API call request to corresponding acceleration hardware in the host machine; When the API call request is used to call remote acceleration hardware, the paravirtualized backend driver sends the API call request to the network card in the host machine, and the network card sends the API call request to the corresponding remote acceleration hardware through a preset remote transmission protocol.

15. The device according to claim 14, characterized in that The device also includes: A packing unit is used to pack the multiple API call requests before the paravirtualized back-end driver sends the API call request to the network card in the host machine, if the multiple API call requests are all requests for obtaining dynamic information of acceleration hardware.

16. The device according to any one of claims 9 to 15, characterized in that The first sending unit is used for sending the API call request based on hardware acceleration to the paravirtualized driver through the API forwarding program by the application program in the container running on the virtual machine.

17. A data processing system based on hardware acceleration, characterized in that: The system includes: a virtual machine, an application program running on the virtual machine, an API forwarding program running on the virtual machine, a paravirtualized driver and acceleration hardware; The application is used to send the API call request based on hardware acceleration to the API forwarding program; The API forwarding program is used to send the API call request to the paravirtualization driver; The paravirtualized driver is used to query the acceleration hardware static information corresponding to the API call request from the cache when it is determined that the API call request is a request for obtaining acceleration hardware static information; If the static information of the acceleration hardware corresponding to the API call request is not found in the cache, the semi-virtualized driver is used to send the API call request to the corresponding acceleration hardware through the host machine, so that the semi-virtualized driver receives the static information feedback from the acceleration hardware corresponding to the API call request through the host machine.

18. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the data processing method based on hardware acceleration according to any one of claims 1 to 8.

19. An electronic device, characterized in that: The electronic device includes a storage medium and a processor; The processor is adapted to implement each instruction; The storage medium is suitable for storing a plurality of instructions; The instructions are suitable for being loaded by the processor and executing the data processing method based on hardware acceleration as claimed in any one of claims 1 to 8.

Citation Information

Patent Citations

  • KVM-based accelerator virtualization data processing system and method

    CN106681793A