Computing power task data exchange method and device of intelligent computing center
The implementation of a method and device that utilizes a network interface card (NIC) to allocate interface resources for direct passthrough to containers or virtual machines, enabling them to access the network directly for data exchange through physical function (PF) or virtual function (VF) based on configuration information.
Patent Information
- Application Number
- CN202411215217.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-27
AI Technical Summary
The existing intelligent computing centers face inefficiencies in data exchange between containers and virtual machines due to their inability to directly communicate, requiring data to be stored in specified locations before exchange.
The implementation of a method and device that utilizes a network interface card (NIC) to allocate interface resources for direct passthrough to containers or virtual machines, enabling them to access the network directly for data exchange through physical function (PF) or virtual function (VF) based on configuration information.
This solution enables efficient data exchange between containers and virtual machines.
Smart Images

Figure CN119211168A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computing power technology of an intelligent computing center, and in particular to a computing power task data exchange method and device of an intelligent computing center. Background Art
[0002] "Intelligent computing center" refers to a facility that provides the required computing power, data and algorithms for artificial intelligence applications (such as artificial intelligence deep learning model development, model training and model reasoning) by using large-scale heterogeneous computing resources, including general computing power and intelligent computing power. The intelligent computing center covers facilities, hardware, and software, and can provide full-stack capabilities from bottom-level computing power to top-level application enablement.
[0003] An intelligent computing center usually has multiple containers (pods) or multiple virtual machines (VMs), which are used to perform different tasks, such as training different learning models.
[0004] At present, after executing different tasks, multiple containers or multiple virtual machines in the intelligent computing center store the relevant data of the task in a specified location. The intelligent computing center reads the relevant data in the specified location and then exchanges data with other tasks. Containers or virtual machines cannot directly exchange data with other containers or virtual machines, resulting in low efficiency of data exchange between containers or virtual machines.
[0005] It can be seen that the related technology has the problem of low efficiency of data exchange between containers or virtual machines. Summary of the invention
[0006] The embodiments of the present invention provide a method and device for exchanging computing task data of an intelligent computing center to solve the problem of low efficiency of data exchange between containers or virtual machines in the related art.
[0007] To solve the above problems, the present invention is achieved as follows:
[0008] In a first aspect, an embodiment of the present invention provides a method for exchanging computing task data of an intelligent computing center, wherein the intelligent computing center is configured with a network interface card NIC, and the method comprises:
[0009] Step S1: when the computing task needs to exchange data, obtain configuration information corresponding to the container or virtual machine, and the computing task is a computing task carried by the container or virtual machine;
[0010] Step S2: Allocate interface resources of the NIC based on the configuration information, and the interface resources of the NIC are used for the computing tasks carried by the container or virtual machine to access the network through the physical function PF direct passthrough or the virtual function VF direct passthrough, and the network is used for data exchange.
[0011] In one embodiment, the NIC includes at least one interface resource, and when the container carries a computing task, the configuration information includes a network namespace corresponding to the container;
[0012] The step S2 comprises:
[0013] Step S21, allocate target interface resources, and switch the namespace of the target interface resources to the network namespace corresponding to the container, so that the computing power tasks carried by the container can access the network through the PF direct access or the VF direct access based on the target interface resources, and the target interface resource is one of the at least one interface resource.
[0014] In one embodiment, the target interface resource of the NIC corresponds to a plurality of containers;
[0015] The step S21 comprises:
[0016] Step S211: Obtain occupation information of the target interface resource, where the occupation information is used to indicate whether the target interface resource is occupied;
[0017] Step S212: When the occupancy information indicates that the target interface resource is not occupied, the namespace of the target interface resource is switched to the network namespace corresponding to the container, so that the computing power task carried by the container can access the network through the VF directly based on the target interface resource.
[0018] In one embodiment, the step S21 further includes:
[0019] Step S213: When the occupancy information indicates that the target interface resource is occupied, continuously obtain the occupancy information based on a set interval until the occupancy information indicates that the target interface resource is not occupied.
[0020] In one embodiment, when the virtual machine carries a computing task, the configuration information includes a serial number corresponding to an interface resource of the NIC;
[0021] The step S2 comprises:
[0022] Step S22: Allocate the interface resources of the NIC corresponding to the number so that the computing task carried by the virtual machine accesses the network through the PF direct access or the VF direct access based on the interface resources of the NIC.
[0023] In one embodiment, the interface resource of the NIC corresponds to a plurality of virtual machines, and the configuration information corresponding to each of the plurality of virtual machines includes a serial number corresponding to the interface resource of the NIC;
[0024] The step S22 comprises:
[0025] Step S221, obtaining the occupancy information of the interface resources of the NIC;
[0026] Step S222: When the occupancy information indicates that the interface resources of the NIC are not occupied, allocate the interface resources of the NIC so that the virtual machine carrying the computing task can directly access the network through the VF based on the interface resources of the NIC.
[0027] In one embodiment, the step S22 further includes:
[0028] Step S223: When the occupancy information indicates that the interface resource of the NIC is occupied, continuously obtain the occupancy information based on a set interval until the occupancy information indicates that the interface resource of the NIC is not occupied.
[0029] In a second aspect, an embodiment of the present invention further provides a computing task data exchange device for an intelligent computing center, comprising:
[0030] An acquisition module, used to acquire configuration information corresponding to a container or a virtual machine when the computing task requires data exchange, and the computing task is a computing task carried by the container or the virtual machine;
[0031] An allocation module is used to allocate interface resources of the NIC based on the configuration information, and the interface resources of the NIC are used for the computing tasks carried by the container or virtual machine to access the network through the physical function PF direct pass or the virtual function VF direct pass, and the network is used for data exchange.
[0032] In a third aspect, an embodiment of the present invention further provides an electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps in the method for exchanging computing power task data of an intelligent computing center as described in the first aspect above are implemented.
[0033] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the method for exchanging computing power task data of an intelligent computing center as described in the first aspect above are implemented.
[0034] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps in the method for exchanging computing power task data of an intelligent computing center as described in the first aspect above.
[0035] In an embodiment of the present invention, when the computing power tasks carried by the container or virtual machine need to exchange data, the configuration information corresponding to the container or virtual machine is obtained, and the interface resources of the NIC are allocated based on the configuration information, so that the computing power tasks carried by the container or virtual machine can be directly connected to the network through PF direct or VF direct to realize data exchange between different computing power tasks, and no longer need to be stored in a designated location, and the intelligent computing center reads and then communicates, thereby improving the efficiency of data exchange between containers or virtual machines. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0037] Figure 1 It is a flow chart of a method for exchanging computing task data of an intelligent computing center provided by an embodiment of the present invention;
[0038] Figure 2 It is a schematic diagram of a computing task access network of a container and a virtual machine of an intelligent computing center provided by an embodiment of the present invention;
[0039] Figure 3 is a schematic diagram of switching network namespaces provided by an embodiment of the present invention;
[0040] Figure 4 It is a structural diagram of a computing task data exchange device of an intelligent computing center provided by an embodiment of the present invention;
[0041] Figure 5 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] The "computing power" mentioned in the present invention is the ability of computer equipment or computing / data center to process information. It is the ability of computer hardware and software to work together to execute certain computing requirements. It is the computing power to achieve target result output by processing information data. It is a new type of productivity that integrates information computing power, network carrying capacity, and data storage capacity. It mainly provides services to the society through computing power infrastructure.
[0044] The "computing power" (Computational Power, CP) described in the present invention is the ability of a data center server to process data and output results. It is a comprehensive indicator to measure the computing power of a data center, including general computing power, super computing power and intelligent computing power. The commonly used unit of measurement is the number of floating point operations performed per second (FLOPS: Floating Point Operations Per Second, 1EFLOPS = 10^18FLOPS). The larger the value, the stronger the comprehensive computing power. According to calculations, 1EFLOPS is approximately the computing power output of 5 Tianhe-2A or 500,000 mainstream server CPUs or 2 million mainstream notebooks. The calculation formula is: CP = CP 通用 +CP 智能 +CP 超级 .
[0045] The "Network Power" (NP) described in the present invention is a manifestation of the data transmission capability of computing facilities, including comprehensive capabilities such as network architecture, network bandwidth, transmission latency, intelligent management and scheduling, etc. The carrying capacity involves network transmission within and between data centers, and is a comprehensive indicator for measuring network transmission scheduling capabilities. In the embodiment of the present invention, the carrying capacity uses the memory bandwidth.
[0046] The "Storage Power" (SP) described in the present invention is the comprehensive ability of a data center in terms of data storage capacity, performance, safety and reliability, and green and low-carbon. It is a comprehensive indicator for measuring the data storage capacity of a data center, including external storage devices such as storage arrays and server built-in storage devices. The commonly used unit of measurement for storage capacity is exabyte (EB, 1EB = 2^60bytes), and the commonly used unit of measurement for performance is the number of reads and writes per second per unit capacity (IOPS / TB, Input / Output Operations Per Second / TB). The disaster recovery ratio is an important manifestation of safety and reliability.
[0047] The "computing power infrastructure" described in the present invention is a new type of information infrastructure that integrates information computing power, network carrying capacity, and data storage capacity. It can realize centralized computing, storage, transmission and application of information, and presents characteristics such as diversity and ubiquity, intelligence and agility, safety and reliability, green and low-carbon. It is of great significance to promote industrial transformation and upgrading, enable my country's scientific and technological innovation, meet people's better life and realize high-efficiency social governance.
[0048] The “computing power” mentioned in the present invention includes general computing power, intelligent computing power and super computing power.
[0049] The “general computing power” mentioned in the present invention refers to the computing power provided by a server based on a central processing unit (CPU) chip, which is used to support basic general computing such as cloud computing and edge computing.
[0050] The "intelligent computing power" described in the present invention is a computing platform for large-scale deployment of special chips such as graphics processing units (GPUs), field programmable gate arrays (FPGAs), and application-specific integrated circuits (ASICs) for various innovative applications of artificial intelligence, such as natural language processing and machine vision.
[0051] The "super computing power" mentioned in the present invention is mainly the computing power provided by high-performance computing clusters such as supercomputers. It utilizes the centralized computing resources of multiple computer systems working in parallel and uses a dedicated operating system to handle extremely complex or data-intensive problems. It is mainly used for calculations in cutting-edge scientific fields, such as planetary simulation, drug molecule design, and gene analysis.
[0052] The "intelligent computing center" described in the present invention refers to a facility that provides the required computing power, data and algorithms for artificial intelligence applications (such as artificial intelligence deep learning model development, model training and model reasoning scenarios) by using large-scale heterogeneous computing power resources, including general computing power (CPU: Central Processing Unit) and intelligent computing power (GPU: Graphics Processing Unit, FPGA: Field Programmable Gate Array, ASIC: Application Specific Integrated Circuit, etc.). The intelligent computing center covers facilities, hardware, and software, and can provide full-stack capabilities from bottom-level computing power to top-level application enablement.
[0053] The "computing resources" mentioned in the present invention refer to the technologies and facilities with information calculation, transmission, storage and application capabilities required for the development of the digital society, including but not limited to computing resources such as CPU (Central Processing Unit), GPU (Graphics Processing Unit), network resources such as switches and routers, storage resources such as storage arrays and distributed storage, security resources such as firewalls and intrusion detection systems, as well as supporting and guarantee resources such as wind, fire, water and electricity.
[0054] The "network interface card" described in the present invention is computer hardware designed to allow computers to communicate on a computer network. A computer is connected to a computer network via a network interface card (NIC). The network interface card has at least one physical interface, each physical interface corresponds to an interface resource, and when the computer communicates, the computer network is connected via the physical interface corresponding to the interface resource.
[0055] The "pod" described in the present invention refers to a series of processes or tasks that are isolated from the rest of the system. All files required to run these processes or tasks are provided by another image, that is, the container is portable and consistent throughout the entire process from development to testing to production. Containers provide isolation between processes or tasks, and can divide the resources managed by computers, servers, or intelligent computing centers into isolated groups, resolving conflicts in resource usage between isolated groups.
[0056] The "virtual machine" described in the present invention is a computer system with complete hardware system functions simulated by software, which runs in a completely isolated environment. A virtual machine (VM) can be created on a physical computer, server or intelligent computing center, and a part of the hard disk and memory capacity of the physical computer, server or intelligent computing center is allocated to the virtual machine as its hard disk and memory capacity. Each virtual machine can perform the same operations as a physical computer. Virtual machine technology allows multiple operating systems to run simultaneously on a physical computer without interfering with each other.
[0057] The "physical function (PF)" described in the present invention is used to support the peripheral component interconnect (PCI) function in single root input / output virtualization (SR-IOV). As defined in the SR-IOV specification, PF includes a SR-IOV function configuration structure for managing the SR-IOV function. PF is a full-featured peripheral component interconnect Express (PCIe) function that can be discovered, managed, and processed like any other PCIe device. PF has fully configured resources and can be used to configure or control PCIe devices. The PF passthrough in the present invention is a physical function transmission channel corresponding to the physical interface of the network interface card, and a PF channel can correspond to a container or a virtual machine.
[0058] The "Virtual Function (VF)" described in the present invention is a lightweight PCIe function associated with a PF, which can share one or more physical resources with the PF and other VFs associated with the same PF. VF is only allowed to have configuration resources for its own behavior. In the present invention, the PF passthrough is associated with one or more VF passthroughs, and different virtual machines or containers correspond to a VF passthrough respectively, and the network is connected through the PF passthrough associated with the VF passthrough.
[0059] See also Figure 1 , Figure 1 is a flow chart of a method for exchanging computing task data of an intelligent computing center provided by an embodiment of the present invention. The intelligent computing center is configured with a network interface card NIC, such as Figure 1 As shown, the method comprises the following steps:
[0060] Step S1: when the computing task needs to exchange data, obtain configuration information corresponding to the container or virtual machine, and the computing task is a computing task carried by the container or virtual machine;
[0061] Step S2: Allocate interface resources of the NIC based on the configuration information, and the interface resources of the NIC are used for the computing tasks carried by the container or virtual machine to access the network through the physical function PF direct passthrough or the virtual function VF direct passthrough, and the network is used for data exchange.
[0062] In an embodiment of the present invention, when the computing power tasks carried by the container or virtual machine need to exchange data, the configuration information corresponding to the container or virtual machine is obtained, and the interface resources of the NIC are allocated based on the configuration information, so that the computing power tasks carried by the container or virtual machine can be directly connected to the network through PF direct or VF direct to realize data exchange between different computing power tasks, and no longer need to be stored in a designated location, and the intelligent computing center reads and then communicates, thereby improving the efficiency of data exchange between containers or virtual machines.
[0063] In the embodiment of the present invention, the configuration information is information pre-confirmed when the container or virtual machine is created, that is, the configuration information is set according to user requirements when the container or virtual machine is created. Specifically, the configuration information may include the task content of the computing task that the container or virtual machine needs to perform, the network interface card information for the container or virtual machine to communicate, or the hardware resource information of the container or virtual machine.
[0064] For example, Figure 2 As shown, containers and virtual machines are created in the intelligent computing center. By allocating different NIC interface resources, the container is directly connected to network one through PF, and the virtual machine is directly connected to network two through VF (including VF1 and VF2 in the figure).
[0065] It should be noted that a virtual machine can also be directly connected to the network through PF passthrough, and multiple containers can also be connected to the network through VF passthrough. Among them, each PF passthrough can only correspond to one container or virtual machine, and the number of PF passthroughs is the same as the number of NIC interface resources; each VF passthrough corresponds to one container or virtual machine, and one NIC interface resource can be associated with multiple VF passthroughs.
[0066] In one embodiment, the NIC includes at least one interface resource, and when the container carries a computing task, the configuration information includes a network namespace corresponding to the container;
[0067] The step S2 comprises:
[0068] Step S21, allocate target interface resources, and switch the namespace of the target interface resources to the network namespace corresponding to the container, so that the computing power tasks carried by the container can access the network through the PF direct access or the VF direct access based on the target interface resources, and the target interface resource is one of the at least one interface resource.
[0069] In an embodiment of the present invention, by allocating target interface resources and switching the namespace of the target interface resources to the network namespace corresponding to the container, the computing tasks carried by the container can access the network through PF direct or VF direct based on the target interface resources, thereby realizing data exchange.
[0070] It should be noted that when a container is created, it is configured with routing tables, network card devices, protocol stacks, and the network namespace of the container. The network namespaces of different containers are different, such as Figure 3 As shown, the namespace of the NIC (usually the default namespace) is switched to the network namespace of the container, thereby transferring the NIC to the network namespace of the container, so that the computing tasks carried by the container can access the network through PF direct or VF direct.
[0071] Among them, when the computing power tasks carried by the container are directly connected to the network through PF, the target interface resource corresponds to only one container. At this time, the namespace of the target interface resource can continue to be maintained as the network namespace of the container, so that the computing power tasks carried by the container can be directly connected to the network through PF for a long time.
[0072] When the computing tasks carried by containers are connected to the network through VF direct access, the target interface resources can be associated with multiple containers. In order to realize the network access requirements of computing tasks carried by different containers, the namespace of the target interface resources needs to be switched to the network namespace of different containers, so that the computing tasks carried by different containers can be connected to the network through VF direct access.
[0073] In one embodiment, the target interface resource of the NIC corresponds to a plurality of containers;
[0074] The step S21 comprises:
[0075] Step S211: Obtain occupation information of the target interface resource, where the occupation information is used to indicate whether the target interface resource is occupied;
[0076] Step S212: When the occupancy information indicates that the target interface resource is not occupied, the namespace of the target interface resource is switched to the network namespace corresponding to the container, so that the computing power task carried by the container can access the network through the VF directly based on the target interface resource.
[0077] In an embodiment of the present invention, by obtaining the occupancy information of the target interface resources, the occupancy information is used to indicate whether the target interface resources are occupied, and when the occupancy information indicates that the target interface resources are not occupied, the namespace of the target interface resources is switched to the network namespace corresponding to the container, thereby enabling computing tasks carried by different containers to access the network through VF direct access.
[0078] It should be noted that when the target interface resources correspond to multiple objects (that is, the target interface resources correspond to multiple containers), the computing tasks carried by multiple containers cannot access the network at the same time. When the computing tasks carried by the container need to access the network, they need to first occupy the idle target interface resources and then access the network through VF direct access. When the target interface resources are occupied, there are no idle target interface resources. At this time, the computing tasks carried by other containers corresponding to the target interface resources occupy the target interface resources to access the network for data exchange, and need to wait until the target interface resources are no longer occupied before accessing the network.
[0079] Specifically, the step S21 further includes:
[0080] Step S213: When the occupancy information indicates that the target interface resource is occupied, continuously obtain the occupancy information based on a set interval until the occupancy information indicates that the target interface resource is not occupied.
[0081] In an embodiment of the present invention, when the occupancy information indicates that the target interface resource is occupied, the occupancy information is continuously obtained based on the set interval until the occupancy information indicates that the target interface resource is not occupied. At this time, the target interface resource is in an idle state, and any container corresponding to the target interface resource can occupy the target interface resource, thereby enabling the computing power tasks carried by the container to access the network through VF direct passthrough.
[0082] In the embodiment of the present invention, the setting interval can be set according to demand, for example, occupancy information is obtained once every 2 seconds.
[0083] In some implementations, a queue can be set up. When the computing power tasks carried by the container need to access the network but the target interface resources are occupied, the network namespace corresponding to the container is set in the queue; when the target interface resources are no longer occupied, the network namespace is obtained from the queue in the order of joining the queue, and the namespace of the target interface resources is switched to the obtained network namespace, thereby enabling the computing power tasks carried by other containers to access the network.
[0084] It should be noted that in the present invention, the computing power tasks carried by the container are directly connected to the network through VF. After the data transmission is completed, the container no longer occupies the target interface resources. At this time, the target interface resources change from an occupied state to an unoccupied state (or called an idle state), so that the computing power tasks carried by other containers can be directly connected to the network through VF.
[0085] In one embodiment, when the virtual machine carries a computing task, the configuration information includes a serial number corresponding to an interface resource of the NIC;
[0086] The step S2 comprises:
[0087] Step S22: Allocate the interface resources of the NIC corresponding to the number so that the computing task carried by the virtual machine accesses the network through the PF direct access or the VF direct access based on the interface resources of the NIC.
[0088] In the embodiment of the present invention, by allocating the interface resources of the NIC corresponding to the number, the computing tasks carried by the virtual machine can access the network through PF direct or VF direct based on the interface resources of the NIC.
[0089] It should be noted that there is a difference in the configuration information for accessing the network between the computing tasks carried by containers and those carried by virtual machines. For containers, the namespace of the NIC interface resources needs to be changed, while for virtual machines, it is only necessary to add the number corresponding to the NIC interface resources in the configuration information when creating the virtual machine. After starting the virtual machine, the NIC interface resources can be determined through the configuration information, so that the computing tasks carried by the virtual machine can access the network through PF direct or VF direct based on the NIC interface resources.
[0090] The number corresponding to the interface resource may be a PCI number, and the configuration information may be information in a configuration file when the virtual machine is created. Exemplarily, the configuration information may be as follows:
[0091]
[0092]
[0093] The code corresponding to the interface resource is written into the configuration file through the above code, so that the computing tasks carried by the virtual machine can access the network through PF direct or VF direct based on the interface resources of the NIC.
[0094] It should be noted that the interface resources can correspond to one or more virtual machines. When the interface resources correspond to one virtual machine, the computing tasks carried by the virtual machine can access the network through PF direct or VF direct. When the interface resources correspond to multiple virtual machines, the computing tasks carried by multiple virtual machines can access the network through VF direct.
[0095] Among them, when computing tasks carried by multiple virtual machines are connected to the network through VF direct access, different virtual machines cannot access the network at the same time. It is necessary to design a network for computing tasks carried by multiple virtual machines to be connected to the network through VF direct access.
[0096] Specifically, the interface resource of the NIC corresponds to a plurality of virtual machines, and the configuration information corresponding to each of the plurality of virtual machines includes a serial number corresponding to the interface resource of the NIC;
[0097] The step S22 comprises:
[0098] Step S221, obtaining the occupancy information of the interface resources of the NIC;
[0099] Step S222: When the occupancy information indicates that the interface resources of the NIC are not occupied, allocate the interface resources of the NIC so that the virtual machine carrying the computing task can directly access the network through the VF based on the interface resources of the NIC.
[0100] In an embodiment of the present invention, the occupancy information of the interface resources of the NIC is obtained, and when the occupancy information indicates that the interface resources of the NIC are not occupied, the interface resources of the NIC are allocated. In this way, the computing tasks carried by the virtual machine can access the network through VF direct access based on the interface resources of the NIC when the interface resources are not occupied.
[0101] At the same time, the step S22 also includes:
[0102] Step S223: When the occupancy information indicates that the interface resource of the NIC is occupied, continuously obtain the occupancy information based on a set interval until the occupancy information indicates that the interface resource of the NIC is not occupied.
[0103] In an embodiment of the present invention, when the occupancy information indicates that the interface resources of the NIC are occupied, the occupancy information is continuously obtained based on the set interval until the interface resources of the NIC indicated by the occupancy information are not occupied. In this way, when computing tasks carried by multiple virtual machines need to access the network, it is determined whether the network can be accessed through VF direct access through the occupancy information. When the occupancy information indicates that the interface resources of the NIC are not occupied, the network can be accessed through VF direct access, thereby enabling computing tasks carried by different virtual machines to access the network when there are multiple virtual machines corresponding to the interface resources.
[0104] In the embodiment of the present invention, the setting interval can be set according to demand, for example, occupancy information is obtained once every 2 seconds.
[0105] See also Figure 4 , Figure 4 is a structural diagram of a computing task data exchange device for an intelligent computing center provided by an embodiment of the present invention, such as Figure 4 As shown, the computing task data exchange device 400 of the intelligent computing center includes:
[0106] An acquisition module 401 is used to acquire configuration information corresponding to a container or a virtual machine when the computing task requires data exchange, and the computing task is a computing task carried by the container or the virtual machine;
[0107] The allocation module 402 is used to allocate the interface resources of the NIC based on the configuration information, and the interface resources of the NIC are used for the computing tasks carried by the container or virtual machine to access the network through the physical function PF direct pass or the virtual function VF direct pass, and the network is used for data exchange.
[0108] In one embodiment, the NIC includes at least one interface resource, the NIC includes at least one interface resource, and when the container carries a computing task, the configuration information includes a network namespace corresponding to the container;
[0109] The allocation module 402 includes:
[0110] The first sharding unit is used to allocate a target interface resource and switch the namespace of the target interface resource to the network namespace corresponding to the container, so that the computing power task carried by the container can access the network through the PF direct access or the VF direct access based on the target interface resource, and the target interface resource is one of the at least one interface resource.
[0111] In one embodiment, the target interface resource of the NIC corresponds to a plurality of containers;
[0112] The first allocation unit comprises:
[0113] A first acquisition subunit is used to acquire the occupancy information of the target interface resource, where the occupancy information is used to indicate whether the target interface resource is occupied;
[0114] The switching subunit is used to switch the namespace of the target interface resource to the network namespace corresponding to the container when the occupancy information indicates that the target interface resource is not occupied, so that the computing power task carried by the container can directly access the network through the VF based on the target interface resource.
[0115] In one embodiment, the first allocation unit further includes:
[0116] The second acquisition subunit is configured to, when the occupancy information indicates that the target interface resource is occupied, continuously acquire the occupancy information based on a set interval until the occupancy information indicates that the target interface resource is not occupied.
[0117] In one embodiment, when the virtual machine carries a computing task, the configuration information includes a serial number corresponding to an interface resource of the NIC;
[0118] The allocation module 402 includes:
[0119] The second allocation unit is used to allocate the interface resources of the NIC corresponding to the number so that the computing task carried by the virtual machine can access the network through the PF direct access or the VF direct access based on the interface resources of the NIC.
[0120] In one embodiment, the interface resource of the NIC corresponds to a plurality of virtual machines, and the configuration information corresponding to each of the plurality of virtual machines includes a serial number corresponding to the interface resource of the NIC;
[0121] The second allocation unit comprises:
[0122] A third acquisition subunit is used to obtain the occupation information of the interface resources of the NIC;
[0123] The allocation subunit is used to allocate the interface resources of the NIC when the occupancy information indicates that the interface resources of the NIC are not occupied, so that the virtual machine carrying the computing task can directly access the network through the VF based on the interface resources of the NIC.
[0124] In one embodiment, the second allocation unit further includes:
[0125] The fourth acquisition subunit is configured to, when the occupancy information indicates that the interface resource of the NIC is occupied, continuously acquire the occupancy information based on a set interval until the occupancy information indicates that the interface resource of the NIC is not occupied.
[0126] The computing power task data exchange device for the intelligent computing center provided in the embodiment of the present invention can realize the various processes of the various embodiments of the computing power task data exchange method of the above-mentioned intelligent computing center. The technical features correspond one to one and can achieve the same technical effect. To avoid repetition, they will not be repeated here.
[0127] It should be noted that the computing task data exchange device of the intelligent computing center in the embodiment of the present invention can be a device, or a component, integrated circuit, or chip in an electronic device.
[0128] The embodiment of the present invention further provides an electronic device, see Figure 5 , Figure 5 is a schematic diagram of the structure of an electronic device provided by the present invention, the electronic device includes a memory 501, a processor 502 and a program or instruction stored in the memory 501 and running on the memory 501. When the program or instruction is executed by the processor 502, Figure 1 Any steps in the corresponding intelligent computing center computing power task data exchange embodiment and the same beneficial effects are achieved will not be repeated here.
[0129] The processor 502 may be a CPU, an ASIC, an FPGA or a GPU.
[0130] A person skilled in the art can understand that all or part of the steps of the embodiment of the computing task data exchange method for the above-mentioned intelligent computing center can be completed by hardware related to program instructions, and the program can be stored in a readable medium.
[0131] The embodiment of the present invention further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the above-mentioned Figure 1 The corresponding steps in the embodiment of the computing power task data exchange method of the intelligent computing center can achieve the same technical effect. To avoid repetition, they are not repeated here. The storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0132] The embodiment of the present invention also provides a computer program product, including computer instructions, which can achieve the above-mentioned Figure 1 Any steps in the corresponding implementation method of the computing power task data exchange method of the intelligent computing center can achieve the same technical effect and will not be repeated here to avoid repetition.
[0133] The terms "first", "second" etc. in the embodiments of the present invention are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. In addition, the terms "include" and "have" and any variation thereof are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. In addition, "and / or" is used in the present application to represent at least one of the connected objects, such as A and / or B and / or C, indicating that A alone, B alone, C alone, and A and B all exist, B and C all exist, A and C all exist, and 7 situations in which A, B and C all exist.
[0134] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a second terminal device, etc.) to execute the methods of each embodiment of the present application.
[0136] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for exchanging computing task data of an intelligent computing center, wherein the intelligent computing center is equipped with a network interface card NIC, characterized in that: The method comprises: Step S1: when the computing task needs to exchange data, obtain configuration information corresponding to the container or virtual machine, and the computing task is a computing task carried by the container or virtual machine; Step S2: Allocate interface resources of the NIC based on the configuration information, and the interface resources of the NIC are used for the computing tasks carried by the container or virtual machine to access the network through the physical function PF direct passthrough or the virtual function VF direct passthrough, and the network is used for data exchange.
2. The method according to claim 1, characterized in that The NIC includes at least one interface resource, and when the container carries a computing task, the configuration information includes a network namespace corresponding to the container; The step S2 comprises: Step S21, allocate target interface resources, and switch the namespace of the target interface resources to the network namespace corresponding to the container, so that the computing power tasks carried by the container can access the network through the PF direct access or the VF direct access based on the target interface resources, and the target interface resource is one of the at least one interface resource.
3. The method according to claim 2, characterized in that The target interface resource of the NIC corresponds to multiple containers; The step S21 comprises: Step S211: Obtain occupation information of the target interface resource, where the occupation information is used to indicate whether the target interface resource is occupied; Step S212: When the occupancy information indicates that the target interface resource is not occupied, the namespace of the target interface resource is switched to the network namespace corresponding to the container, so that the computing power task carried by the container can access the network through the VF directly based on the target interface resource.
4. The method according to claim 3, characterized in that The step S21 further includes: Step S213: When the occupancy information indicates that the target interface resource is occupied, continuously obtain the occupancy information based on a set interval until the occupancy information indicates that the target interface resource is not occupied.
5. The method according to claim 1, characterized in that In the case where the virtual machine carries a computing task, the configuration information includes a number corresponding to an interface resource of the NIC; The step S2 comprises: Step S22: Allocate the interface resources of the NIC corresponding to the number so that the computing task carried by the virtual machine accesses the network through the PF direct access or the VF direct access based on the interface resources of the NIC.
6. The method according to claim 5, characterized in that The interface resource of the NIC corresponds to a plurality of virtual machines, and the configuration information corresponding to each of the plurality of virtual machines includes a serial number corresponding to the interface resource of the NIC; The step S22 comprises: Step S221, obtaining the occupancy information of the interface resources of the NIC; Step S222: When the occupancy information indicates that the interface resources of the NIC are not occupied, allocate the interface resources of the NIC so that the virtual machine carrying the computing task can directly access the network through the VF based on the interface resources of the NIC.
7. The method according to claim 6, characterized in that The step S22 further includes: Step S223: When the occupancy information indicates that the interface resource of the NIC is occupied, continuously obtain the occupancy information based on a set interval until the occupancy information indicates that the interface resource of the NIC is not occupied.
8. A computing task data exchange device for an intelligent computing center, characterized in that: include: An acquisition module, used to acquire configuration information corresponding to a container or a virtual machine when the computing task requires data exchange, and the computing task is a computing task carried by the container or the virtual machine; An allocation module is used to allocate interface resources of the NIC based on the configuration information, and the interface resources of the NIC are used for the computing tasks carried by the container or virtual machine to access the network through the physical function PF direct pass or the virtual function VF direct pass, and the network is used for data exchange.
9. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the method for exchanging computing task data of an intelligent computing center as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for exchanging computing task data of an intelligent computing center as described in any one of claims 1 to 7.
11. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, implement the steps of the method for exchanging computing task data of an intelligent computing center as described in any one of claims 1 to 7.
Citation Information
Cited By
Method and apparatus for intelligent computing center to provide computing power resource by means of computing power package
WO2026184504A1