Patent Description:
With development of the server field, compared with a common server configured with only a central processing unit (central processing unit, CPU), a heterogeneous server emerges. The heterogeneous server refers to a same server that includes both a CPU and other heterogeneous resources. The heterogeneous resources include a graphics processing unit (graphics processing unit, GPU), a field programmable gate array (field programmable gate array, FPGA), an application-specific integrated circuit (application-specific integrated circuit, ASIC), and a neural processing unit (neural processing unit, NPU).

The heterogeneous server is usually used to assist a common server or a virtual machine running on a common server in data processing. Each heterogeneous resource is usually exclusively occupied by one common server or one virtual machine (virtual machine, VM). For example, a specific heterogeneous resource is usually bound to a specific server or a specific VM, and is only used to process an instruction of the server or the virtual machine. Different types of application programs run on a virtual machine or a server. In a communication process between the virtual machine and a heterogeneous resource, or in communication process between the server and a heterogeneous resource, heavy network traffic is generated. Consequently, communication between the virtual machine or the server and the heterogeneous server becomes a bottleneck, and data processing speed and data processing efficiency between a common computing device and a heterogeneous computing device are affected.

<CIT> discloses an apparatus and method for efficient graphics virtualization.

XP055699373 (URL:http://mediatum. de/doc/<NUM>/<NUM>. pdf) discloses a standalone disaggregated reconfigurable computing platforms in cloud data centers.

<CIT> discloses a method of writing to multiple memory destinations.

<CIT> discloses a data processing unit for compute nodes and storage nodes.

The object of the present invention is to provide a data processing method, apparatus and computing device which can improve communication performance between a server or a virtual machine and a heterogeneous server. The solution of this object according to the present invention is defined in the appended independent claims and further advantageous embodiments and improvements of the present invention are listed in the dependent claims. Hereinafter ". aspect" should be understood as relating to the broadest embodiment of the invention as claimed with the independent claims and "implementation" relates to claimed embodiments of the invention.

According to a first aspect, a data processing method is provided, including: A first computing device receives a first packet sent by a second computing device, where the first computing device is configured to assist the second computing device in performing service processing, the first computing device is a computing device in a heterogeneous resource pool, the first computing device communicates with the second computing device through a network, the heterogeneous resource pool includes at least one first computing device, and the first packet includes an instruction used to request the first computing device to process to-be-processed data. The first computing device processes the to-be-processed data based on the instruction, and sends a second packet to the second computing device, where the second packet includes a processing result of the to-be-processed data.

The heterogeneous resource pool includes a plurality of computing devices (for example, a plurality of first computing devices), so that when a plurality of second computing devices simultaneously need heterogeneous resources to assist the plurality of second computing devices in executing service requests, the requests of the plurality of second computing devices may be distributed to different computing devices in the heterogeneous resource pool. In this case, the plurality of first computing devices in the heterogeneous resource pool can assist the plurality of second computing devices in executing the corresponding service requests. Therefore, network traffic generated during communication between the second computing device and the heterogeneous resource is distributed to different computing devices in the heterogeneous resource pool, so that communication performance between the second computing device and the heterogeneous resource is improved.

The first packet that is sent by the second computing device and that is received by the first computing device includes the to-be-processed data. The first computing device parses the received first packet to obtain the to-be-processed data, and processes the to-be-processed data based on the instruction carried in the first packet.

When transmission of the to-be-processed data does not affect communication performance between the first computing device and the second computing device, the second computing device may directly send, to the first computing device, the first packet carrying the to-be-processed data. This reduces a communication latency between the first computing device and the second computing device.

In a possible implementation, the second computing device configures a first storage resource in a storage device, and the first computing device has access permission of the first storage resource. The second computing device may send, only to the first computing device, the first packet carrying a first target address, where the first target address is used to indicate a storage address of the to-be-processed data in the first storage resource. The first storage resource is a storage resource that is configured for the second computing device and that has the access permission, and the first computing device obtains the first target address from the first packet based on the received first packet, to obtain the to-be-processed data from storage space corresponding to the first target address in the first storage resource.

When a transmission process of the to-be-processed data affects communication performance between the first computing device and the second computing device, the second computing device may store the to-be-processed data in the storage space corresponding to the first target address in the first storage resource, and add the first target address to the first packet sent to the first computing device. In this way, the first computing device obtains the to-be-processed data from the storage space corresponding to the first target address in the first storage resource. This avoids direct sending of the to-be-processed data to the first computing device, thereby improving the communication performance between the first computing device and the second computing device.

In another possible implementation, after obtaining the processing result of the to-be-processed data, the first computing device may send the second packet to the second computing device, where the second packet includes the processing result of the to-be-processed data.

In another possible implementation, after obtaining the processing result of the to-be-processed data, the first computing device may store the processing result of the to-be-processed data in storage space corresponding to a second target address in a first storage resource, add the second target address to the second packet, and send the second packet to the second computing device. The second computing device obtains the second target address from the second packet based on the received second packet, to obtain the processing result of the to-be-processed data from the storage space corresponding to the second target address in the first storage resource.

When a transmission process of the processing result of the to-be-processed data may affect communication performance between the first computing device and the second computing device, the first computing device may store the to-be-processed data in the storage space corresponding to the second target address in the first storage resource, and add the second target address to the second packet sent to the second computing device. In this way, the second computing device obtains the processing result of the to-be-processed data from the storage space corresponding to the second target address in the first storage resource. This avoids direct sending of the processing result of the to-be-processed data to the second computing device, thereby improving the communication performance between the first computing device and the second computing device.

In another possible implementation, when the to-be-processed data is video bitstream data, the first computing device first needs to decode the video bitstream data to obtain image data corresponding to the video bitstream data when processing the video bitstream data. Then, the first computing device processes the image data corresponding to the video bitstream data to obtain the processing result of the to-be-processed data corresponding to the video bitstream data.

In another possible implementation, when the to-be-processed data is video bitstream data, the processing result of the to-be-processed data returned by the first computing device to the second computing device should further include image data corresponding to the video bitstream data obtained after the video bitstream data is decoded.

In another possible implementation, when the processing result of the to-be-processed data is directly sent by the first computing device to the second computing device, the processing result of the to-be-processed data may be sent by the first computing device to the second computing device in a remote direct memory access (remote direct memory access, RDMA) manner.

In another possible implementation, when the to-be-processed data is directly sent by the second computing device to the first computing device, the to-be-processed data may be sent by the second computing device to the first computing device in an RDMA manner.

In another possible implementation, the storage device configured with the first storage resource includes a file system storage device, a distributed file system storage device, a block storage device, or an object storage device.

In another possible implementation, processing corresponding to the instruction includes artificial intelligence (artificial intelligence, AI) processing.

According to a second aspect, not claimed, a data processing method is provided, including: A second computing device sends a first packet to a first computing device, where the first computing device is configured to assist the second computing device in performing service processing, the first computing device is a computing device in a heterogeneous resource pool, the first computing device communicates with the second computing device through a network, the heterogeneous resource pool includes at least one first computing device, and the first packet includes an instruction used to request the first computing device to process to-be-processed data. The first computing device processes the to-be-processed data based on the instruction, and sends a second packet to the second computing device, where the second packet includes a processing result of the to-be-processed data. The second computing device receives the second packet sent by the first computing device, where the second packet includes the processing result of the to-be-processed data.

The heterogeneous resource pool includes a plurality of computing devices (for example, a plurality of first computing devices), so that when a plurality of second computing devices simultaneously need heterogeneous resources to assist the plurality of second computing devices in performing service processing, demands of the plurality of second computing devices requesting to be assisted in performing service requests may be distributed to different computing devices in the heterogeneous resource pool. In this case, the plurality of first computing devices in the heterogeneous resource pool can assist the plurality of second computing devices in performing the corresponding service processing. Therefore, network traffic generated during communication between the second computing device and the heterogeneous resource is distributed to different computing devices in the heterogeneous resource pool, so that communication performance between the second computing device and the heterogeneous resource is improved.

In a possible implementation, the first packet that is sent by the second computing device to the first computing device includes the to-be-processed data. The first computing device parses the received first packet to obtain the to-be-processed data, and processes the to-be-processed data based on the instruction carried in the first packet.

In another possible implementation, the second computing device configures a first storage resource in a storage device, and the first computing device has access permission of the first storage resource. The second computing device adds a first target address to the first packet, where the first target address is used to indicate a storage address of the to-be-processed data in the first storage resource. The first storage resource is a storage resource that is configured for the second computing device and that has access permission, and the first computing device obtains the first target address from the first packet based on the received first packet, to obtain the to-be-processed data from storage space corresponding to the first target address in the first storage resource.

When transmission of the to-be-processed data affects communication performance between the first computing device and the second computing device, the second computing device may store the to-be-processed data in the storage space corresponding to the first target address in the first storage resource, and add the first target address to the first packet sent to the first computing device. In this way, the first computing device obtains the to-be-processed data from the storage space corresponding to the first target address in the first storage resource. This avoids direct sending of the to-be-processed data to the first computing device, thereby improving the communication performance between the first computing device and the second computing device.

In another possible implementation, the second packet that is sent by the first computing device and that is received by the second computing device includes the processing result of the to-be-processed data.

When transmission of the processing result of the to-be-processed data does not affect communication performance between the first computing device and the second computing device, the first computing device may directly send, to the second computing device, the second packet carrying the processing result of the to-be-processed data. This reduces a communication latency between the first computing device and the second computing device.

When transmission of the processing result of the to-be-processed data may affect communication performance between the first computing device and the second computing device, the first computing device may store the to-be-processed data in the storage space corresponding to the second target address in the first storage resource, and add the second target address to the second packet sent to the second computing device. In this way, the second computing device obtains the processing result of the to-be-processed data from the storage space corresponding to the second target address in the first storage resource. This avoids direct sending of the processing result of the to-be-processed data to the second computing device, thereby improving the communication performance between the first computing device and the second computing device.

In another possible implementation, processing corresponding to the instruction includes artificial intelligence AI processing.

According to a third aspect, a data processing apparatus is provided. The apparatus is configured to perform the method in any one of the first aspect or the possible implementations of the first aspect. Specifically, the apparatus may include units configured to perform the data processing method in any one of the first aspect or the possible implementations of the first aspect.

According to a fourth aspect, a data processing apparatus, not claimed, is provided. The apparatus is configured to perform the method in any one of the second aspect or the possible implementations of the second aspect. Specifically, the apparatus may include units configured to perform the data processing method in any one of the second aspect or the possible implementations of the second aspect.

According to a fifth aspect, a computing device is provided. The device includes a memory, a heterogeneous resource, and a processor. The memory is configured to store a program, and the processor is configured to: execute the program stored in the memory, and schedule the heterogeneous resource to perform the data processing method in any one of the first aspect or the possible implementations of the first aspect.

According to a sixth aspect, a computing device, not claimed, is provided. The device includes a memory and a processor. The memory is configured to store an instruction, and the processor executes the instruction stored in the memory, so that the device performs the data processing method in any one of the second aspect or the possible implementations of the second aspect.

According to a seventh aspect, a computer-readable storage medium, not claimed, is provided. The computer-readable storage medium stores an instruction, and when the instruction is run on a computer, the computer is enabled to perform the data processing method in any one of the first aspect or the possible implementations of the first aspect.

According to an eighth aspect, a computer-readable storage medium, not claimed, is provided. The computer-readable storage medium stores an instruction, and when the instruction is run on a computer, the computer is enabled to perform the data processing method in any one of the second aspect or the possible implementations of the second aspect.

According to a ninth aspect, a computer program product, not claimed, including an instruction is provided. When the instruction is run on a computer, the computer is enabled to perform the data processing method in any one of the first aspect or the possible implementations of the first aspect.

According to a tenth aspect, a computer program product, not claimed, including an instruction is provided. When the instruction is run on a computer, the computer is enabled to perform the data processing method in any one of the second aspect or the possible implementations of the second aspect.

According to an eleventh aspect, a computer system, not claimed, is provided, where the computer system includes a first computing device and a second computing device. The first computing device is configured to assist the second computing device in performing service processing, the first computing device is a computing device in a heterogeneous resource pool, the first computing device communicates with the second computing device through a network, and the heterogeneous resource pool includes at least one first computing device. The second computing device configures a first storage resource in a storage device, and the first computing device has access permission of the first storage resource. The first computing device is configured to perform the method in any one of the first aspect or the possible implementations of the first aspect, and the second computing device is configured to perform the method in any one of the second aspect or the possible implementations of the second aspect.

Based on the implementations provided in the foregoing aspects, this disclosure may further combine the implementations to provide more implementations.

The following describes technical solutions of this disclosure with reference to accompanying drawings.

<FIG> is a schematic diagram of an architecture of a computer system according to this disclosure. As shown in <FIG>, the computer system <NUM> includes at least one computing device <NUM>, at least one computing device <NUM>, and a storage device <NUM>. The computing device <NUM> communicates with the computing device <NUM> through a network. The computing device <NUM> and the computing device <NUM> separately communicate with the storage device <NUM> through a network. The storage device <NUM> includes a plurality of storage units. The network includes device connection modes such as an Ethernet connection mode, an optical fiber connection mode, an Infiniband (Infiniband, IB) connection mode, and a wireless connection mode.

In this disclosure, the computing device <NUM> is configured to assist the computing device <NUM> in performing service processing. The computing device <NUM> may be a server, and a central processing unit (central processing unit, CPU) <NUM> may be configured on the server. During specific implementation, the computing device <NUM> may also be a server. In addition to a CPU, at least one of a graphics processing unit GPU, a field programmable gate array FPGA, an application-specific integrated circuit ASIC, or a neural network processing unit NPU may be further configured on the server. In this case, the server on which the CPU and at least one of the GPU, the FPGA, the ASIC, or the NPU are configured is referred to as a heterogeneous server, and a heterogeneous resource pool includes a plurality of heterogeneous servers. The GPU, the FPGA, the ASIC, or the NPU on the server is configured to assist a CPU <NUM> in the computing device <NUM> in performing the service processing.

For ease of description, in the following description of this disclosure, a heterogeneous server that includes the GPU and that is in the computing device <NUM> is used as an example for description.

When assisting the computing device <NUM> in performing the service processing, the computing device <NUM> may configure a binding relationship between the computing device <NUM> and the computing device <NUM>. In other words, one or more computing devices <NUM> may be selected from the heterogeneous resource pool to process and perform a service of a specified computing device <NUM>. For a same computing device <NUM>, a plurality of GPUs included in the computing device <NUM> may be configured to process only a service of a same computing device <NUM>, or may process services of a plurality of computing devices <NUM>. This is not limited in this disclosure. When the binding relationship is established between the computing device <NUM> and a computing device <NUM>, the computing device <NUM> has access permission of a storage unit that can be accessed by the computing device <NUM> bound to the computing device <NUM>. For example, when the binding relationship is established between one computing device <NUM> and one computing device <NUM>, the computing device <NUM> has access permission of a storage unit that can be accessed by the computing device <NUM>.

Specifically, before assisting the computing device <NUM> in performing the service processing, the computing device <NUM> allocates, in the heterogeneous resource pool, a heterogeneous resource to the computing device <NUM>. For example, the computing device <NUM> sends an initialization packet to a computing device <NUM> in the heterogeneous resource pool. The computing device <NUM> (hereinafter referred to as "a management computing device") is responsible for managing heterogeneous resources in the heterogeneous resource pool. The initialization packet is used to request the management computing device to allocate the heterogeneous resource to the computing device <NUM>, and the initialization packet may carry a quantity of GPUs that the computing device <NUM> requests to allocate to the computing device <NUM>.

The management computing device determines, based on the initialization packet and in the heterogeneous resource pool, to allocate GPUs that meet the quantity to the computing device <NUM>. The management computing device disposes, in the computing device <NUM>, a container for the GPUs allocated to the computing device <NUM>, and feeds back an identifier of the container to the computing device <NUM>. In this way, the binding relationship is established between the computing device <NUM> and the heterogeneous resources allocated to the computing device <NUM>. The identifier of the container may be an ID of the container or an IP address of the container.

After the heterogeneous resource allocation is completed, an access permission that is the same as that of the computing device <NUM> further needs to be created on the storage device <NUM> for the container corresponding to the heterogeneous resources. After the access permission configuration is completed, the heterogeneous resources allocated to the computing device <NUM> have the access permission of the storage unit that can be accessed by the computing device <NUM> bound to the heterogeneous resources.

It should be noted that the foregoing merely uses an example in which there is only one management computing device in the heterogeneous resource pool for description, and this disclosure is not limited thereto. For example, any computing device <NUM> in the heterogeneous resource pool may be used as the foregoing management computing device. When requesting to allocate the heterogeneous resource to the computing device <NUM>, the computing device <NUM> may send the initialization packet to any computing device <NUM> (that is, the management computing device) in the heterogeneous resource pool, and the management computing device allocates the heterogeneous resource to the computing device <NUM>.

It should be further noted that the foregoing management manner of the heterogeneous resource pool does not constitute a limitation on the technical solutions of this disclosure. In addition to the foregoing management manner, the heterogeneous resource pool may be managed in another manner. For example, a computing device outside the heterogeneous resource pool manages computing devices in the heterogeneous resource pool.

<FIG> is a schematic diagram of an architecture of another computer system according to an embodiment of this disclosure. As shown in the figure, a computing device <NUM> may run one or more virtual machines (virtual machine, VM) on a CPU <NUM>. A plurality of VMs may run on one CPU <NUM>, or the plurality of VMs may be distributed in a plurality of CPUs <NUM>.

When assisting the computing device <NUM> in performing service processing, a computing device <NUM> may configure a binding relationship between the VM and the computing device <NUM>. In other words, one or more computing devices <NUM> may be selected from a heterogeneous resource pool to process and perform a service of the VM. For a same computing device <NUM>, a plurality of GPUs included in the computing device <NUM> may be configured to process only a service of a same VM, or may process services of a plurality of VMs. This is not limited in this disclosure. When the binding relationship is established between the computing device <NUM> and a VM, the computing device <NUM> has access permission of a storage unit that can be accessed by the VM bound to the computing device <NUM>. For example, when the binding relationship is established between a VM <NUM> and one computing device <NUM>, the computing device <NUM> has access permission that is of a storage unit and that is of the VM <NUM>.

It should be noted that when the computing device <NUM> assists the VM in the computing device <NUM> in performing the service processing, a heterogeneous resource also needs to be allocated, in the heterogeneous resource pool, to the VM, and an access permission that is the same as that of the VM needs to be created on a storage device <NUM> for the heterogeneous resource.

For a method for allocating, in the heterogeneous resource pool, the heterogeneous resource to the VM and creating, on the storage device <NUM>, the access permission that is the same as that of the VM for the heterogeneous resource allocated to the VM, refer to the foregoing related descriptions. For brevity, details are not described herein again.

The storage device <NUM> in this disclosure includes a file system storage device, a distributed file storage device, a block storage device, or an object storage device.

In a possible embodiment, in addition to a CPU, a computing device <NUM> may be further configured with at least one of a GPU, an FPGA, an ASIC, or an NPU (not shown in <FIG> and <FIG>). In this case, a GPU resource in a heterogeneous resource pool may come from a computing device <NUM>. One or more VMs may run on a CPU <NUM> in the computing device <NUM>. This is not specifically limited in this disclosure.

It should be noted that quantities of CPUs and VMs in each computing device <NUM> in <FIG> and <FIG>, quantities of processor cores included in each CPU, and quantities of CPUs and GPUs in the computing device <NUM> do not constitute a limitation on this disclosure.

The following uses the computer system shown in <FIG> as an example to describe a data processing method <NUM> provided in this disclosure. <FIG> is a schematic flowchart of a data processing method according to this disclosure For ease of description, in this disclosure an example in which in <FIG>, the computing device <NUM> is a first computing device, the computing device <NUM> is a second computing device, the virtual machine runs on the computing device <NUM>, and the computing device <NUM> assists the virtual machine in performing the service processing is used to describe the data processing method provided in this disclosure. As shown in the figure, the method <NUM> includes the following steps.

S201: A second computing device sends a first packet to a first computing device.

Specifically, when the second computing device (for example, the computing device <NUM> or the virtual machine running on the computing device <NUM>) needs the first computing device (for example, the computing device <NUM>) in a heterogeneous resource pool to assist in performing the service processing, the computing device <NUM> sends, to the computing device <NUM> that has a binding relationship with the computing device <NUM>, a packet (for example, a first packet) for requesting the computing device <NUM> to assist in performing the service processing. The first packet includes an instruction used to request the computing device <NUM> to process to-be-processed data.

For example, when a VM running on the computing device <NUM> needs the computing device <NUM> in the heterogeneous resource pool to assist the VM in performing the service processing, the VM sends the first packet to a computing device <NUM> in which a GPU that is in the heterogeneous resource pool and that has the binding relationship with the VM is located. A CPU <NUM> in the computing device <NUM> receives the first packet, and forwards the first packet to a GPU <NUM> that is in the computing device <NUM> and that has the binding relationship with the VM. The GPU <NUM> processes the to-be-processed data based on the instruction carried in the first packet.

S202: The first computing device receives the first packet sent by the second computing device.

S203: The first computing device processes to-be-processed data based on an instruction.

Specifically, the GPU <NUM> in the computing device <NUM> processes the to-be-processed data based on the instruction carried in the received first packet.

First, a method for obtaining the to-be-processed data by the computing device <NUM> is described. The computing device <NUM> may determine, based on a type of the to-be-processed data, a manner of transmitting the to-be-processed data to the computing device <NUM>. Alternatively, the computing device <NUM> may determine, based on a data volume of the to-be-processed data, a manner of transmitting the to-be-processed data to the computing device <NUM>. Correspondingly, the computing device <NUM> may also obtain, in a similar manner, the to-be-processed data transmitted by the computing device <NUM>. The following describes manners of obtaining the to-be-processed data by the computing device <NUM>.

Manner <NUM>: The first packet sent by the computing device <NUM> to the computing device <NUM> includes the to-be-processed data; and the computing device <NUM> parses the received first packet to obtain the to-be-processed data, and processes the to-be-processed data based on the instruction carried in the first packet.

Specifically, a CPU <NUM> in the computing device <NUM> adds the to-be-processed data to the first packet based on the type of the to-be-processed data (for example, the to-be-processed data is a video bitstream data), and sends, to the CPU <NUM> in the computing device <NUM>, the first packet carrying the to-be-processed data. The CPU <NUM> sends the first packet to the GPU <NUM>. Correspondingly, the CPU <NUM> in the computing device <NUM> receives the first packet sent by the CPU <NUM> in the computing device <NUM>. The CPU <NUM> sends the first packet to the GPU <NUM>, and the GPU <NUM> parses the first packet to obtain the to-be-processed data.

Manner <NUM>: The computing device <NUM> adds a first target address to the first packet, and the first target address is used to indicate a storage address of the to-be-processed data in a first storage resource, where the first storage resource is a storage resource for which the computing device <NUM> has access permission in a storage device <NUM>; and the computing device <NUM> obtains the first target address from the first packet based on the received first packet, to obtain the to-be-processed data from storage space corresponding to the first target address in the first storage resource.

Specifically, a CPU <NUM> in the computing device <NUM> stores, based on the type of the to-be-processed data (for example, the to-be-processed data is image data), the to-be-processed data in the storage space corresponding to the first target address in the first storage resource, and sends, to the CPU <NUM> in the computing device <NUM>, the first packet carrying the first target address. Correspondingly, the CPU <NUM> in the computing device <NUM> receives the first packet, and the CPU <NUM> sends the first packet to the GPU <NUM>. The GPU <NUM> obtains the first target address carried in the first packet, and obtains the to-be-processed data from the storage space indicated by the first target address in the storage device <NUM>.

Optionally, the computing device <NUM> may further determine, based on a comparison result between the data volume of the to-be-processed data and a preset first threshold, a manner of transmitting the to-be-processed data.

For example, the CPU <NUM> in the computing device <NUM> may further compare the data volume of the to-be-processed data with the preset first threshold. When the data volume of the to-be-processed data (for example, the data volume of the to-be-processed data is <NUM> Gbyte (gigabyte)) is greater than or equal to the preset first threshold (for example, a value of the preset first threshold is <NUM> Gbyte), the CPU <NUM> may transmit the to-be-processed data to the computing device <NUM> by using the method in the manner <NUM>. Correspondingly, the GPU <NUM> in the computing device <NUM> may obtain the to-be-processed data by using the method in the manner <NUM>. Alternatively, when the data volume of the to-be-processed data (for example, the data volume of the to-be-processed data is <NUM> Kbyte (kilobyte)) is less than or equal to the preset first threshold (for example, a value of the preset first threshold is <NUM> Gbyte), the CPU <NUM> of the computing device <NUM> may transmit the to-be-processed data to the computing device <NUM> by using the method in the manner <NUM>. The computing device <NUM> may obtain the to-be-processed data by using the method in the manner <NUM>.

When transmission of the to-be-processed data affects communication performance between the first computing device and the second computing device, the second computing device may store the to-be-processed data in storage space corresponding to a first target address in a first storage resource, and add the first target address to the first packet sent to the first computing device. In this way, the first computing device obtains the to-be-processed data from the storage space corresponding to the first target address in the first storage resource. This avoids direct sending of the to-be-processed data to the first computing device, thereby improving the communication performance between the first computing device and the second computing device.

After obtaining the to-be-processed data, the GPU <NUM> in the computing device <NUM> processes the to-be-processed data based on the instruction carried in the first packet.

For example, the to-be-processed data is the image data, and processing corresponding to the instruction carried in the first packet is artificial intelligence (Artificial Intelligence, AI) processing. The AI processing is specifically to identify that an animal in an image is a cat or a dog.

Specifically, after the GPU <NUM> in the computing device <NUM> performs the AI processing on the image data, an obtained result is that the animal in the image is the dog. The GPU <NUM> in the computing device <NUM> needs to return the processing result of the image data (that is, a processing result of the to-be-processed data) to the computing device <NUM>.

It should be noted that the value of the first threshold may be further adjusted based on network bandwidth and/or a network congestion degree between the computing device <NUM> and the computing device <NUM>. For example, when network communication quality is comparatively high, the value of the first threshold may be set to <NUM> Kbyte.

It should be further noted that, when the to-be-processed data is video bitstream data, the first computing device <NUM> first needs to decode the video bitstream data to obtain image data corresponding to the video bitstream data when processing the video bitstream data. Then, the first computing device <NUM> processes the image data corresponding to the video bitstream data to obtain the processing result of the to-be-processed data corresponding to the video bitstream data.

S204: The first computing device sends a second packet to the first computing device.

S205: The second computing device receives the second packet sent by the first computing device.

Specifically, after obtaining the processing result of the to-be-processed data, the GPU <NUM> in the computing device <NUM> returns the processing result of the to-be-processed data to the computing device <NUM>.

The following describes methods for returning, by the computing device <NUM>, the processing result of the to-be-processed data to the computing device <NUM>.

Manner <NUM>: The computing device <NUM> sends the second packet to the computing device <NUM>, where the second packet carries the processing result of the to-be-processed data.

Specifically, when the to-be-processed data is the image data, the GPU <NUM> in the computing device <NUM> adds the processing result of the to-be-processed data corresponding to the image data to the second packet, and sends the second packet to the CPU <NUM> in the computing device <NUM>. The CPU <NUM> sends the second packet to the CPU <NUM> in the computing device <NUM>.

Manner <NUM>: The computing device <NUM> stores the processing result of the to-be-processed data in storage space corresponding to a second target address in the first storage resource, and sends the second packet carrying the second target address to the computing device <NUM>.

Specifically, when the to-be-processed data is the video bitstream data, the GPU <NUM> in the computing device <NUM> stores the processing result of the to-be-processed data corresponding to the video bitstream data in the storage space corresponding to the second target address in the first storage resource, and sends the second packet carrying the second target address to the CPU <NUM> in the computing device <NUM>. The CPU <NUM> sends the second packet to the CPU <NUM> in the computing device <NUM>. In this way, the CPU <NUM> in the computing device <NUM> obtains, based on the second target address, the processing result of the to-be-processed data from the storage space corresponding to the second target address in the first storage resource.

Optionally, the computing device <NUM> may further determine, based on a comparison result between a data volume of the processing result of the to-be-processed data and a preset second threshold, a manner of transmitting the processing result of the to-be-processed data.

For example, the GPU <NUM> in the computing device <NUM> may further compare a data volume of the processing result of the to-be-processed data with the preset second threshold. When the data volume of the processing result of the to-be-processed data (for example, the data volume of the processing result of the to-be-processed data is <NUM> Gbyte) is greater than or equal to the preset second threshold (for example, a value of the preset second threshold is <NUM> Gbyte), the GPU <NUM> in the computing device <NUM> may return the processing result of the to-be-processed data to the computing device <NUM> by using the method in the manner <NUM> in the step S205. Alternatively, when the data volume of the processing result of the to-be-processed data (for example, the data volume of the processing result of the to-be-processed data is <NUM> Kbyte) is less than or equal to the preset second threshold (for example, a value of the preset second threshold is <NUM> Gbyte), the GPU <NUM> in the computing device <NUM> may return the processing result of the to-be-processed data to the computing device <NUM> by using the method in the manner <NUM> in the step S205.

When transmission of the processing result of the to-be-processed data may affect communication performance between the first computing device and the second computing device, the first computing device may store the to-be-processed data in storage space corresponding to a second target address in the first storage resource, and add the second target address to the second packet sent to the second computing device. In this way, the second computing device obtains the processing result of the to-be-processed data from the storage space corresponding to the second target address in the first storage resource. This avoids direct sending of the processing result of the to-be-processed data to the second computing device, thereby improving the communication performance between the first computing device and the second computing device.

It should be noted that the second target address may alternatively be indicated by the computing device <NUM> to the computing device <NUM>. In this case, the computing device <NUM> does not need to notify the computing device <NUM> of the second target address.

It should be further noted that, when the to-be-processed data is the video bitstream data, the processing result of the to-be-processed data that is returned by the computing device <NUM> to the computing device <NUM> should further include the image data corresponding to the video bitstream data obtained after the video bitstream data is decoded.

It should be noted that, when the processing result of the to-be-processed data is directly sent by the computing device <NUM> to the computing device <NUM>, the processing result of the to-be-processed data may be directly sent by the GPU <NUM> in the computing device <NUM> to the CPU <NUM> in the computing device <NUM> in a remote direct memory access (Remote Direct Memory Access, RDMA) manner without passing through the CPU <NUM> in the computing device <NUM>. In a possible implementation, the GPU <NUM> may be a chip that supports an RDMA function. In this case, the GPU <NUM> may directly store the processing result of the to-be-processed data in a memory of the computing device <NUM>. A specific process in which the GPU <NUM> transmits the data in the RDMA manner is not limited in this disclosure.

When the to-be-processed data is directly sent by the computing device <NUM> to the computing device <NUM>, the to-be-processed data may be directly sent by the CPU <NUM> in the computing device <NUM> to the GPU <NUM> in the computing device <NUM> in the RDMA manner without passing through the CPU <NUM> in the computing device <NUM>.

It should be further noted that, in this disclosure, the manner <NUM> and the manner <NUM> in the step S203 and the manner <NUM> and the manner <NUM> in the step S205 are merely examples for description, and do not constitute any limitation on this disclosure. For example, the foregoing four manners may be randomly combined to be corresponding to the following four combination forms. In specific use, an actual application scenario may be considered for selection.

Scenario <NUM>: When the data volume of the to-be-processed data is greater than or equal to the preset first threshold, and the processing result of the to-be-processed data is greater than or equal to the preset second threshold, the computing device <NUM> transmits the to-be-processed data to the computing device <NUM> in the manner <NUM>; and after obtaining the processing result of the to-be-processed data, the computing device <NUM> returns the processing result of the to-be-processed data to the computing device <NUM> in the manner <NUM>.

Scenario <NUM>: When the data volume of the to-be-processed data is less than or equal to the preset first threshold, and the processing result of the to-be-processed data is greater than or equal to the preset second threshold, the computing device <NUM> transmits the to-be-processed data to the computing device <NUM> in the manner <NUM>; and after obtaining the processing result of the to-be-processed data, the computing device <NUM> returns the processing result of the processed data to the computing device <NUM> in the manner <NUM>.

Scenario <NUM>: When the data volume of the to-be-processed data is greater than or equal to the preset first threshold, and the processing result of the to-be-processed data is less than or equal to the preset second threshold, the computing device <NUM> transmits the to-be-processed data to the computing device <NUM> in the manner <NUM>; and after obtaining the processing result of the to-be-processed data, the computing device <NUM> returns the processing result of the processed data to the computing device <NUM> in the manner <NUM>.

Scenario <NUM>: When the data volume of the to-be-processed data is less than or equal to the preset first threshold, and the processing result of the to-be-processed data is less than or equal to the preset second threshold, the computing device <NUM> transmits the to-be-processed data to the computing device <NUM> in the manner <NUM>; and after obtaining the processing result of the to-be-processed data, the computing device <NUM> returns the processing result of the processed data to the computing device <NUM> in the manner <NUM>.

In the data processing method provided in this disclosure, the heterogeneous resource pool includes a plurality of computing devices (for example, a plurality of first computing devices), so that when a plurality of second computing devices simultaneously need heterogeneous resources to assist the plurality of second computing devices in performing service requests, demands of the plurality of second computing devices requesting to be assisted in performing the service requests may be distributed in the heterogeneous resource pool. In this case, the plurality of first computing devices in the heterogeneous resource pool can assist the plurality of second computing devices in performing the corresponding service requests. Therefore, network traffic generated during communication between the second computing device and the heterogeneous resource is distributed in the heterogeneous resource pool, so that communication performance between the second computing device and the heterogeneous resource is improved.

The foregoing describes the data processing method provided in this disclosure with reference to <FIG>. The following describes a data processing apparatus and a computing device provided in the embodiments of this disclosure with reference to <FIG>.

<FIG> is a schematic block diagram of a data processing apparatus <NUM> according to this disclosure. The apparatus <NUM> includes a receiving unit <NUM>, a processing unit <NUM>, and a sending unit <NUM>.

The receiving unit <NUM> is configured to receive a first packet sent by a second computing device, and the data processing apparatus communicates with the second computing device through a network. The apparatus <NUM> is configured to assist the second computing device in performing service processing, and the apparatus <NUM> is a computing device in a heterogeneous resource pool, where the heterogeneous resource pool includes at least one data processing apparatus. The first packet includes an instruction used to request the data processing apparatus to process to-be-processed data.

The processing unit <NUM> is configured to process the to-be-processed data based on the instruction.

The sending unit <NUM> is configured to send a second packet to the second computing device, where the second packet includes a processing result of the to-be-processed data.

Optionally, the first packet includes the to-be-processed data, and the processing unit <NUM> is further configured to: parse the first packet to obtain the to-be-processed data, and process the to-be-processed data based on the instruction.

Optionally, a first storage resource is configured for the second computing device, and the data processing apparatus has access permission of the first storage resource. The first packet carries a first target address, and the first target address is used to indicate a storage address of the to-be-processed data in the first storage resource. The processing unit <NUM> is further configured to: obtain the to-be-processed data from the first storage resource based on the first target address, and process the to-be-processed data based on the instruction.

Optionally, the processing unit <NUM> is further configured to store the processing result of the to-be-processed data to a second target address, where the second target address is a storage address of the first storage resource. The second packet sent by the data processing apparatus to the second computing device includes the second target address. In this way, the second computing device obtains the processing result of the to-be-processed data from the first storage resource based on the second target address.

Optionally, the sending unit <NUM> is further configured to send the second packet carrying data of the processing result to the second computing device.

Optionally, the to-be-processed data is transmitted by the second computing device to the data processing apparatus by using a remote direct memory access RDMA technology.

Optionally, the processing result of the to-be-processed data is transmitted by the data processing apparatus to the second computing device by using the RDMA technology.

Optionally, the to-be-processed data is video bitstream data, and the processing unit is further configured to: decode the video bitstream data, to obtain image data corresponding to the video bitstream data, and process, based on the instruction, the image data corresponding to the video bitstream data. The processing result of the to-be-processed data includes the image data corresponding to the video bitstream data.

Optionally, a storage device configured with the first storage resource includes a file system storage device, a distributed file system storage device, a block storage device, or an object storage device.

Optionally, processing corresponding to the instruction includes artificial intelligence AI processing.

It should be understood that the apparatus <NUM> in this embodiment of this disclosure may be implemented through an application-specific integrated circuit (application-specific integrated circuit, ASIC), or may be implemented through a programmable logic device (programmable logic device, PLD). The PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field programmable gate array (field programmable gate array, FPGA), generic array logic (generic array logic, GAL), or any combination thereof. Alternatively, when the data processing method shown in <FIG> is implemented by software, the apparatus <NUM> and modules of the apparatus <NUM> may be software modules.

The apparatus <NUM> in this disclosure may correspondingly perform the method described in the embodiment of this disclosure, and the foregoing and other operations and/or functions of the modules of the apparatus <NUM> are intended to implement a corresponding procedure executed by the first computing device in the method shown in <FIG>. For brevity, details are not described herein again.

<FIG> is a schematic block diagram of a data processing apparatus <NUM> according to this disclosure. The apparatus <NUM> includes a sending unit <NUM> and a receiving unit <NUM>.

The sending unit <NUM> is configured to send a first packet to a first computing device, and the first computing device communicates with the data processing apparatus through a network. The first computing device is configured to assist the apparatus <NUM> in performing service processing, and the first computing device is a computing device in a heterogeneous resource pool, where the heterogeneous resource pool includes at least one first computing device. The first packet includes an instruction used to request the first computing device to process to-be-processed data.

The receiving unit <NUM> is configured to receive a second packet sent by the first computing device, where the second packet includes a processing result of the to-be-processed data.

Optionally, the first packet includes the to-be-processed data.

Optionally, a first storage resource is configured for the data processing apparatus <NUM>, and the first computing device has access permission of the first storage resource. The first packet carries a first target address, and the first target address is used to indicate a storage address of the to-be-processed data in the first storage resource.

Optionally, the second packet includes a second target address, and the data processing apparatus obtains the processing result of the to-be-processed data from the first storage resource based on the second target address.

Optionally, the receiving unit <NUM> is further configured to receive the second packet that is sent by the first computing device and that carries data of the processing result.

Optionally, the to-be-processed data is transmitted by the data processing apparatus to the first computing device in a remote direct memory access RDMA manner.

Optionally, the processing result of the to-be-processed data is transmitted by the first computing device to the data processing apparatus in the RDMA manner.

Optionally, the processing result of the to-be-processed data includes image data corresponding to video bitstream data.

It should be understood that the apparatus <NUM> in this embodiment of this disclosure may be implemented through an application-specific integrated circuit (application-specific integrated circuit, ASIC), or may be implemented through a programmable logic device (programmable logic device, PLD). The PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field programmable gate array (field-programmable gate array, FPGA), generic array logic (generic array logic, GAL), or any combination thereof. Alternatively, when the data processing method shown in <FIG> is implemented by software, the apparatus <NUM> and modules of the apparatus <NUM> may be software modules.

The apparatus <NUM> in this disclosure may correspondingly perform the method described in the embodiment of this disclosure, and the foregoing and other operations and/or functions of the modules of the apparatus <NUM> are intended to implement a corresponding procedure executed by the second computing device in the method shown in <FIG>. For brevity, details are not described herein again.

<FIG> is a schematic structural diagram of a computing device according to this disclosure. As shown in the figure, the computing device <NUM> includes a first processor <NUM>, a second processor <NUM>, a memory <NUM>, a communications interface <NUM>, and a bus <NUM>. The first processor <NUM>, the second processor <NUM>, the memory <NUM>, and the communications interface <NUM> communicate with each other through the bus <NUM>, or may communicate with each other in another manner such as wireless transmission. The memory <NUM> is configured to store an instruction, and the first processor <NUM> is configured to execute the instruction stored in the memory <NUM>. The memory <NUM> stores program code <NUM>, and the first processor <NUM> may invoke the program code <NUM> stored in the memory <NUM> to perform the data processing method in <FIG>.

It should be understood that in this disclosure, the first processor <NUM> may be a CPU, or may be another general purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or another programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like. The general purpose processor may be a microprocessor or any conventional processor, or the like.

The second processor <NUM> includes at least one of a GPU, an FPGA, an ASIC, or an NPU. The second processor is mainly configured to execute a task of assisting another computing device in performing processing. For example, the second processor may assist the another computing device in processing video bitstream data.

The memory <NUM> may include a read-only memory and a random access memory, and provide an instruction and data to the first processor <NUM>. The memory <NUM> may further include a non-volatile random access memory. The memory <NUM> may be a volatile memory or a nonvolatile memory, or may include a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (read-only memory, ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasable PROM, EPROM), an electrically erasable programmable read-only memory (electrically EPROM, EEPROM), or a flash memory. The volatile memory may be a random access memory (random access memory, RAM), used as an external cache. Through example but not limitative description, many forms of RAMs may be used, for example, a static random access memory (static RAM, SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (synchronous DRAM, SDRAM), a double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), an enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), a synchronous link dynamic random access memory (synchlink DRAM, SLDRAM), and a direct rambus dynamic random access memory (direct rambus RAM, DR RAM).

In addition to a data bus, the bus <NUM> may further include a power bus, a control bus, a status signal bus, and the like. However, for clear description, various types of buses in the figure are marked as the bus <NUM>.

It should be noted that the computing device <NUM> may be corresponding to the computing device <NUM> in the computing system shown in <FIG> or <FIG>. When the computing device <NUM> is corresponding to the computing device <NUM> in the computing system shown in <FIG> or <FIG>, the second processor <NUM> may be used as an optional component, and the computing device <NUM> may include the second processor <NUM>, or may not include the second processor <NUM>.

It should be understood that the computing device <NUM> according to this disclosure may be corresponding to the data processing apparatus <NUM> or the data processing apparatus <NUM> in this disclosure, and may be corresponding to the first computing device or the second computing device in the method shown in <FIG> in this disclosure. In addition, when the computing device <NUM> is corresponding to the first computing device in the method shown in <FIG>, the foregoing and other operations and/or functions of the modules in the computing device <NUM> are used to implement operation steps of the method performed by the first computing device in <FIG>. When the computing device <NUM> is corresponding to the second computing device in the method shown in <FIG>, the foregoing and other operations and/or functions of the modules in the computing device <NUM> are used to implement operation steps of the method performed by the second computing device in <FIG>. For brevity, details are not described herein again.

This disclosure further provides a computer system. The computer system may be the computer system shown in <FIG> or <FIG>. The computer system includes at least two computing devices, and one of the computing devices may be the computing device <NUM> shown in <FIG> or <FIG>. The computing device is configured to perform operation steps of the method performed by the first computing device in the foregoing method <NUM>. Another computing device may be the computing device <NUM> shown in <FIG> or <FIG>. The computing device is configured to perform operation steps of the method performed by the second computing device in the foregoing method <NUM>. For brevity, details are not described herein again.

All or some of the foregoing embodiments may be implemented through software, hardware, firmware, or any combination thereof. When the software is used to implement the embodiments, all or some of the foregoing embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When computer program instruction is loaded and executed on the computer, the procedures or functions according to the embodiments of this disclosure are all or partially generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or another programmable apparatus. The computer instruction may be stored in a computer-readable storage medium or may be transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible by a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium may be a solid-state drive (solid-state drive, SSD).

Whether the functions are performed by hardware or software depends on a particular application and a design constraint condition of the technical solution. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of this disclosure.

It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiment, and details are not described herein again.

In the several embodiments provided in this disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the unit division is merely logical function division and may be other division in an actual implementation. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces.

Claim 1:
A data processing method (<NUM>), comprising:
receiving (<NUM>), by a first computing device (<NUM>), a first packet sent by a second computing device (<NUM>), wherein:
the first computing device (<NUM>) communicates with the second computing device (<NUM>) through a network,
the first computing device (<NUM>) is configured to assist the second computing device (<NUM>) in performing service processing,
the first computing device (<NUM>) is a computing device (<NUM>, <NUM>) in a heterogeneous resource pool, the heterogeneous resource pool comprises at least one first computing device (<NUM>), the first computing device (<NUM>) is a server on which there is configured a central processing unit, CPU (<NUM>), and an assisting processing unit,
the assisting processing unit configured to assist a CPU (<NUM>) in the second computing device (<NUM>) in performing the service processing and comprising at least one of a graphics processing unit, GPU, a field programmable gate array, FPGA, an application-specific integrated circuit, ASIC, or a neural network processing unit, NPU, (<NUM>), and
the first packet comprises an instruction used to request the first computing device (<NUM>) to process to-be-processed data;
processing (<NUM>), by the first computing device (<NUM>), the to-be-processed data based on the instruction; and
sending (<NUM>), by the first computing device (<NUM>), a second packet to the second computing device (<NUM>), wherein the second packet comprises a processing result of the to-be-processed data.