Patent ID: 11928493
Assignee: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 6:
7. An apparatus for sharing a field-programmable gate array (FPGA) board among a plurality of virtual machines, comprising:
a memory, configured to store a computer program, and
a processor, configured to execute the computer program to perform:
establishing a peripheral component interface express (PCIE) virtual layer in a host system of a cloud server in advance, wherein the PCIE virtual layer comprises one or more PCIE virtual sub-layers that are in first one-to-one correspondence with one or more FPGA boards, and each of the one or more FPGA boards is an acceleration card shared among virtual machines configured in the cloud server;
selecting, for each PCIE virtual sub-layer, virtual machines interacting with said PCIE virtual sub-layer, from the virtual machines configured in the cloud server in advance;
creating, in each PCIE virtual sub-layer, virtual PCIE devices that are in second one-to-one correspondence with the virtual machines interacting with said PCIE virtual sub-layer;
loading a first virtual PCIE device onto a first virtual machine of the virtual machines configured in the cloud server, after the first virtual machine is activated, wherein the first virtual PCIE device is in a first PCIE virtual sub-layer of the one or more PCIE virtual sub-layers, and corresponds to the first virtual machine in the second one-to-one correspondence;
receiving, via the first virtual PCIE device, to-be-processed data from the first virtual machine; and
sending, through the first PCIE virtual sub-layer, the to-be-processed data to a first FPGA board corresponding to the first PCIE virtual sub-layer;
wherein the processor is further configured to execute the computer program to perform: in response to more than one virtual machines comprising the first virtual machine sending respective to-be-processed data to the first FPGA board simultaneously,
processing, by the first FPGA board according to a preset sharing mode, the to-be-processed data sent from the more than one virtual machines; and
returning, by the first FPGA board, the processed to-be-processed data correspondingly to the more than one virtual machines.