WO2024138482A1 - Resource management method and corresponding apparatus - Google Patents
Resource management method and corresponding apparatus Download PDFInfo
- Publication number
- WO2024138482A1 WO2024138482A1 PCT/CN2022/143113 CN2022143113W WO2024138482A1 WO 2024138482 A1 WO2024138482 A1 WO 2024138482A1 CN 2022143113 W CN2022143113 W CN 2022143113W WO 2024138482 A1 WO2024138482 A1 WO 2024138482A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- resource
- resource nodes
- sub
- request
- level
- Prior art date
Links
- 238000007726 management method Methods 0.000 title claims abstract description 164
- 238000000034 method Methods 0.000 claims abstract description 75
- 238000004891 communication Methods 0.000 claims description 120
- 238000004590 computer program Methods 0.000 claims description 17
- 238000013467 fragmentation Methods 0.000 abstract description 9
- 238000006062 fragmentation reaction Methods 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 18
- 230000008569 process Effects 0.000 description 9
- 230000002093 peripheral effect Effects 0.000 description 7
- 206010047289 Ventricular extrasystoles Diseases 0.000 description 5
- 238000005129 volume perturbation calorimetry Methods 0.000 description 5
- 238000013500 data storage Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000008520 organization Effects 0.000 description 4
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 3
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 3
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013468 resource allocation Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000004549 pulsed laser deposition Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
Definitions
- AI artificial intelligence
- big data tasks usually require heterogeneous computing devices such as graphic processing units (GPUs) or neural network processing units (NPUs) to accelerate the running of tasks and shorten the running time of tasks.
- GPUs graphic processing units
- NPUs neural network processing units
- These tasks are usually run on the cloud.
- cloud vendors it is necessary to provide a heterogeneous resource management platform to distribute computing resources such as GPUs or NPUs to tenants to perform tasks in order to ensure the efficient operation of tenant tasks.
- tenant applications In a multi-tenancy scenario on the cloud, tenant applications have various resource demands. If we only consider the affinity between allocated resources and allocate resources of some tasks together to reduce the overhead on the data transmission path, a small number of computing devices on some servers will lose the opportunity to be allocated, resulting in a large amount of allocation fragmentation. Therefore, the current resource management method faces the problem of high resource fragmentation rate and low allocation rate.
- a resource request can be sent by a tenant to a cloud service system, a data center, or a network system through a terminal device.
- a tenant can be a resource user.
- a method for obtaining at least two sub-requests can be to split a resource request into at least two sub-requests, and then allocate resource nodes to the sub-requests. Because the number of resource nodes corresponding to each sub-request is less than the number of resource nodes corresponding to the resource request, resource nodes can be flexibly allocated to the sub-requests, thereby reducing the probability of resource fragmentation and improving resource utilization.
- the sub-requests can be divided into the number of corresponding resource nodes according to the corresponding configuration method.
- the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list.
- the linked list of each level includes the node identifiers of the resource nodes contained in each group of the level.
- the node identifiers of the resource nodes in different groups are different.
- the node identifier of the resource node can uniquely identify the resource node, for example, it can indicate a certain position of the resource node on a certain server, for example, computing device card 1 in server 1.
- the linked list can also include the level or/and the number of resource nodes corresponding to each group in the level.
- the linked list can include a header and a group, and the header can be used to record the level.
- the header and the group, as well as the groups after grouping, can be connected by pointers.
- the number of node identifiers in the group can be used to represent the number of resource nodes corresponding to the group.
- the matching level can be quickly determined from the linked list according to the number of resource nodes corresponding to the sub-requests, thereby increasing the speed of resource node allocation.
- the resource nodes allocated to the first sub-request may also come from multiple groups, and the multiple groups may be located at the same level, may not all be located at the same level, or may all be located at different levels.
- a binary tree is a tree-shaped data storage structure, and the nodes in the upper layer can be divided into two forks.
- the hierarchical grouping relationship in this application can be expressed in the form of a binary tree. Taking 8 resource nodes as an example, the topmost layer can have 1 group, and this 1 group corresponds to 8 resource nodes.
- the next layer divides the 1 group of the topmost layer into 2 groups, each of which corresponds to 4 resource nodes.
- each group of the previous layer is divided into 2 groups, and 4 groups are obtained, each of which corresponds to 2 resource nodes.
- each group of the previous layer is divided into 2 groups, and 8 groups are obtained, each of which corresponds to 1 resource node, and this layer becomes the last layer.
- the identifiers of the eight resource nodes can all be recorded in the grouping of the last level. Only the number of corresponding resource nodes needs to be recorded in the grouping of the upper level above the last level.
- the node identifier of the last level can be allocated to the sub-request based on the association between the upper level and the last level in the binary tree.
- At least two sub-requests include a second sub-request, and a corresponding number of resource nodes are allocated to each sub-request based on resource management information, including: based on the number of resource nodes corresponding to the second sub-request, resource nodes corresponding to the node identifier of the last level associated with the target group are allocated to the second sub-request, where the target group is a group of the target level of the binary tree; wherein the number of node identifiers of the last level associated with each group of the target level is the same as the number of resource nodes corresponding to the second sub-request.
- the way to obtain the resource request with the least number of sub-requests is selected. This can reduce the number of sub-request allocations, improve allocation efficiency, and also improve the affinity between multiple resource nodes corresponding to the same sub-request.
- the hierarchical grouping relationship is obtained by dividing a plurality of resource nodes by level, and when the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
- the resources in the cloud service system usually provide services to tenants in the form of computing device cards or virtual machines. Therefore, in the cloud service system scenario, the resource node can be a computing device card or a virtual machine. If the resources in the cloud service system provide services to tenants in other forms, then the resource node can be other forms of devices, not limited to computing device cards or virtual machines.
- the resources of the network system usually provide services to the outside in the form of firewalls, routers or switches. Therefore, in the network system scenario, the resource node can be at least one of the firewalls, routers and switches. If the resources of the network system provide services to the outside in other forms, then the resource node can be other forms of devices, not limited to at least one of the firewalls, routers and switches.
- the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list.
- the linked list of each level includes the node identifiers of the resource nodes contained in each group of the level, and the node identifiers of the resource nodes in different groups are different.
- the sum of the bandwidths of communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when multiple resource nodes are grouped in different ways according to the number of resource nodes corresponding to the grouping at the same level.
- the second processing unit is used to group the multiple resource nodes according to the hierarchy based on the topological relationship between the multiple resource nodes to obtain a hierarchical grouping relationship of the multiple resource nodes.
- the hierarchical grouping relationship is obtained by dividing the multiple resource nodes according to the hierarchy.
- the hierarchical grouping relationship includes multiple levels, wherein each level corresponds to multiple resource nodes, the number of groups at different levels is different, and each group at the same level corresponds to the same number of resource nodes.
- a resource management device may include at least one processor, a memory, and a communication interface.
- the processor is coupled to the memory and the communication interface.
- the memory is used to store instructions
- the processor is used to execute the instructions
- the communication interface is used to communicate with other network elements under the control of the processor.
- FIG8B is a schematic diagram of an updated binary tree provided in an embodiment of the present application.
- FIG. 1A is a schematic diagram of a structure of a resource management system provided in an embodiment of the present application.
- the resource management system includes a resource management device and a plurality of resource nodes, and the resource management device can manage the plurality of resource nodes.
- the resource management device can group the plurality of resource nodes according to the topological relationship between the plurality of resource nodes according to the hierarchy to obtain a hierarchical grouping relationship of the plurality of resource nodes.
- the hierarchical grouping relationship is obtained by dividing the plurality of resource nodes according to the hierarchy, and the hierarchical grouping relationship includes a plurality of hierarchies, wherein each hierarchy corresponds to a plurality of resource nodes, and the number of groups at different hierarchies is different, and each group at the same hierarchy corresponds to the same number of resource nodes.
- the resource management device saves the hierarchical grouping relationship of multiple resource nodes. After receiving a resource request, at least two sub-requests (such as sub-request 1 and sub-request 2 in FIG. 1A ) can be obtained according to the resource request, and then resource nodes are allocated to each sub-request according to the hierarchical grouping relationship of multiple resource nodes in the resource management information, such as: a resource node with a node identifier of X is allocated to sub-request 1, and at least two resource nodes with node identifiers of P to Q are allocated to sub-request 2.
- sub-requests such as sub-request 1 and sub-request 2 in FIG. 1A
- the resource management device in FIG. 1A may be an independent device, or may be integrated on a control platform of a resource management system, or may be integrated on a certain resource node.
- the functions of the resource management device can be implemented by software or hardware.
- the resource management device may include code running on a computing instance.
- the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container.
- the computing instance may be one or more.
- the resource management device may include code running on multiple hosts/virtual machines/containers.
- the multiple hosts/virtual machines/containers used to run the code may be distributed in the same region or in different regions.
- the multiple hosts/virtual machines/containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with close geographical locations.
- a region may include multiple AZs.
- VPC virtual private cloud
- multiple hosts/virtual machines/containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs.
- VPC virtual private cloud
- a VPC is set up in one region.
- a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
- the resource management device may include at least one computing device, such as a server, etc.
- the resource management device may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
- ASIC application-specific integrated circuit
- PLD programmable logic device
- the PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
- CPLD complex programmable logical device
- FPGA field-programmable gate array
- GAL generic array logic
- the resource management system provided in the embodiment of the present application may be a cloud service system.
- the cloud service system includes a cloud platform and basic resources.
- the cloud platform includes a cloud platform manager, and the resource management device in FIG1A may be the cloud platform manager in FIG1B .
- the basic resources may include multiple servers, each of which may include multiple resource nodes.
- PCIe peripheral component interconnect express
- each server can obtain one or more hierarchical grouping relationships through multi-level grouping.
- the 8 GPUs can obtain a hierarchical grouping relationship
- the 8 NPUs can obtain a hierarchical grouping relationship
- the 8 CPUs can obtain a hierarchical grouping relationship.
- a communication ring can be formed.
- the combination of GPU, NPU and CPU can also obtain a hierarchical grouping relationship, as long as the corresponding computing device cards in different hierarchical grouping relationships are not repeated.
- a resource request may be sent by a tenant to the cloud service system through a terminal device, and the tenant may be a resource user.
- the cloud platform manager can obtain at least two sub-requests according to the resource request, and then allocate a resource node to each sub-request according to the hierarchical grouping relationship.
- Virtualization technology mainly consists of computing virtualization and input/output (I/O) virtualization. It shares a physical server with multiple tenants at the granularity of virtual machines, allowing tenants to use physical resources conveniently and flexibly under the premise of secure isolation, and can greatly improve the utilization rate of physical resources.
- I/O input/output
- the resource management method provided by the embodiment of the present application is described below.
- the content involved in the method being executed by the resource management device can be executed by the resource management device, or by a component of the resource management device (such as a processor, chip, or chip system, etc.).
- the resource management device obtains a topological relationship between multiple resource nodes, where the topological relationship represents a communication relationship between the multiple resource nodes.
- the resource management device groups the multiple resource nodes according to the topological relationship between the multiple resource nodes to obtain a hierarchical grouping relationship of the multiple resource nodes.
- the hierarchical grouping relationship is obtained by dividing multiple resource nodes according to the hierarchy.
- the hierarchical grouping relationship includes multiple levels, wherein each level corresponds to multiple resource nodes, different levels have different numbers of groups, and different levels of groups correspond to different numbers of resource nodes, while each group at the same level corresponds to the same number of resource nodes.
- the resource management device in the present application can obtain the topological relationship of the resource nodes before dividing the resource nodes. For example, taking the cloud service system shown in FIG. 1B as an example, the interconnection topology between the computing device cards on a single server can be obtained through the topology acquisition interface provided by the hardware driver of the computing device card. Then, the resource management device can group multiple resource nodes in multiple levels according to the topological relationship. Multi-level grouping means that multiple resource nodes are grouped at each level, but the number of groups is different. When grouping at each level, the dichotomy method can be used as the basis for the previous level until each group corresponds to a resource node, and the division of the resource nodes is ended.
- the top layer can have 1 group corresponding to these 8 resource nodes.
- the next layer can divide the 8 resource nodes corresponding to the upper layer group into 2 groups, each of which corresponds to 4 resource nodes.
- the next layer can divide the 4 resource nodes corresponding to each of the 2 upper layer groups into 2 groups, obtaining 4 groups, each of which corresponds to 2 resource nodes.
- the next layer can divide the 4 groups corresponding to the 2 resource nodes in the upper layer into 2 groups, obtaining 8 groups, each of which corresponds to 1 resource node.
- the grouping process can be understood by referring to Figure 4.
- resource nodes As shown in Figure 4, take a server with 8 resource nodes as an example, namely resource node 0, resource node 1, ..., resource node 7. If resource node 0, resource node 1, resource node 2 and resource node 3 can form a communication ring, resource node 4, resource node 5, resource node 6 and resource node 7 can form a communication ring, then the 8 resource nodes can be divided into 2 groups, each group corresponding to 4 resource nodes.
- the resulting hierarchical grouping relationship can include 4 levels, and the number of groups in these 4 levels can be 1, 2, 4, and 8 respectively.
- this group corresponds to 8 resource nodes.
- each group corresponds to 4 resource nodes.
- each group corresponds to 2 resource nodes.
- the number of levels in the hierarchical grouping relationship obtained after the division, and the number of resource nodes corresponding to the groups in each level are not limited to the 8 resource nodes in the above example.
- the number of groups in these 3 levels can be 1, 2 and 6 respectively.
- this group corresponds to 6 resource nodes.
- each group corresponds to 3 resource nodes.
- each group corresponds to 1 resource node.
- the examples listed above all use binary search to group multiple resource nodes. If the number of resource nodes is an odd number and cannot be directly divided into two equal parts, most of the resource nodes can be divided into one group through a single division so that the number of resource nodes in the group is an even number or an exponential power of 2.
- the subsequent division of the group can be carried out in the form of binary search.
- a resource cluster includes 17 resource nodes. During the first division, 16 of them can be divided into one group, and then the 16 resource nodes in the group can be subsequently divided by binary search.
- the multi-level grouping process illustrated in the above FIG4 is divided on the premise that at least two resource nodes in each group form a communication ring. In this way, when performing multi-level grouping of resource nodes, it is no longer dependent on the organization of the high-speed serial computer expansion bus (peripheral component interconnect express, PCIe) architecture. Instead, it is divided according to the communication ring, decoupled from the hardware interconnection architecture, compatible with the current mainstream architecture, and highly versatile.
- PCIe peripheral component interconnect express
- the above-mentioned multi-level grouping method can be used to obtain a hierarchical grouping relationship.
- Managing the resource nodes according to the hierarchical grouping relationship can improve the efficiency of resource node management, which is conducive to quickly allocating resource nodes to resource requests after receiving resource requests.
- the bandwidth of the communication ring is the sum of the communication bandwidths between the resource nodes that constitute the communication ring.
- the sum of the bandwidths of the communication rings formed when the resource nodes are divided is consistent, which avoids the situation where the performance of the communication ring is inconsistent in the scenario of an asymmetric interconnection topology architecture.
- the sum of the bandwidths of the communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when multiple resource nodes are grouped in accordance with the number of resource nodes corresponding to the same level and are combined in different ways.
- the combination method select the combination method with the largest sum of the bandwidths of the communication ring.
- resource node 0, resource node 1, resource node 2, and resource node 3 can form a communication ring, in this combination method, the bandwidth of the communication ring is 40M
- resource node 0, resource node 1, resource node 2, and resource node 5 can also form a communication ring, in this combination method, the bandwidth of the communication ring is 35M
- the hierarchical grouping relationship provided in the embodiment of the present application may be recorded in the form of a linked list or in the form of a binary tree, which are respectively introduced below.
- the hierarchical grouping relationship is recorded in the form of a linked list.
- the hierarchical grouping relationship of the eight resource nodes shown in FIG. 4 can be understood by referring to FIG. 5A .
- the 8 resource nodes in FIG4 can be divided into 4 levels, and these 4 levels can be recorded in order from bottom to top as level 1, level 2, level 3 and level 4.
- level 1, level 2, level 3 and level 4 the order of the levels can also be recorded in reverse, and FIG5A is only used as an example to illustrate the order from bottom to top.
- each group of level 1 corresponds to 1 resource node
- each group of level 2 corresponds to 2 resource nodes
- each group of level 3 corresponds to 4 resource nodes
- 1 group of level 4 corresponds to 8 resource nodes.
- the hierarchical grouping relationship shown in FIG5A is recorded in the form of a linked list, and the linked list of each level includes the node identifiers of the resource nodes contained in each group of the level, and the node identifiers of the resource nodes in different groups are different.
- the node identifier of the resource node can uniquely identify the resource node, for example, it can indicate a certain position of the resource node on a certain server, for example, computing device card 1 in server 1.
- the linked list may also include the level or/and the number of resource nodes corresponding to each group in the level.
- the linked list may include a header and a group.
- the header may be used to record the level.
- the header and the group, as well as the groups after grouping, may be connected by pointers.
- the number of node identifiers in a group may be used to represent the number of resource nodes corresponding to the group. Of course, the number of resource nodes corresponding to each group may also be recorded in the header.
- the hierarchical grouping relationship is recorded in the form of a binary tree.
- the hierarchical grouping relationship in the embodiment of the present application can also be recorded in the form of a binary tree.
- a binary tree is a tree-shaped data storage structure, and the nodes in the upper layer can be divided into two forks.
- the hierarchical grouping relationship in this application can be expressed in the form of a binary tree. Taking 8 resource nodes as an example, the topmost layer can have 1 group, and this 1 group corresponds to 8 resource nodes.
- the next layer divides the 1 group of the topmost layer into 2 groups, each of which corresponds to 4 resource nodes.
- each group of the previous layer is divided into 2 groups, and 4 groups are obtained, each of which corresponds to 2 resource nodes.
- each group of the previous layer is divided into 2 groups, and 8 groups are obtained, each of which corresponds to 1 resource node, and this layer becomes the last layer.
- the identifiers of the eight resource nodes may be recorded in the group at the end level, or may be recorded in the group at each level. Please refer to FIG. 5B and FIG. 5C for understanding.
- the identification of the resource node is recorded in the group at the end level.
- each grouping of the last level (level 1) of the binary tree includes a node identifier of a resource node, which are node identifiers 0, ... node identifiers 7, respectively, and the node identifiers in different groups are different;
- the grouping of the upper levels (level 2, level 3, level 4) includes the association relationship between the grouping of the upper levels and the grouping of the last level (the association relationship can be represented by the arrow relationship between the upper level and the lower level in FIG5B ), wherein the upper level is any level above the last level.
- the number of corresponding resource nodes can be recorded in the grouping of the upper levels above the last level. As shown in FIG5B , the number of corresponding resource nodes 2 is recorded in the grouping of level 2, the number of corresponding resource nodes 4 is recorded in the grouping of level 3, and the number of corresponding resource nodes 8 is recorded in the grouping of level 4.
- the identification of the resource node is recorded in each level of grouping.
- each group of the last level (level 1) of the binary tree includes a node identifier of a resource node, which are node identifiers 0, ..., and node identifiers 7, respectively.
- the node identifiers in different groups are different.
- the four groups of level 2 respectively record node identifiers 0, 1, node identifiers 2, 3, node identifiers 4, 5, and node identifiers 6, 7.
- the two groups of level 3 respectively record node identifiers 0, 1, 2, 3, and node identifiers 4, 5, 6, 7.
- the one group of level 4 records node identifiers 0, 1, 2, 3, 4, 5, 6, 7.
- the resource management solution for allocating resource nodes to resource requests may be understood by referring to FIG. 6 .
- an embodiment of the resource management method provided in the embodiment of the present application includes:
- the resource management device receives a resource request, where the resource request includes the number of requested resource nodes.
- a resource request can be sent by a tenant to a cloud service system, a data center, or a network system through a terminal device.
- a tenant can be a resource user.
- the resource management device allocates a corresponding number of resource nodes to each sub-request based on the resource management information, and the resource management information includes a hierarchical grouping relationship of multiple resource nodes; wherein the number of resource nodes corresponding to different sub-requests matches the number of resource nodes corresponding to one or more groups at the same level or different levels in the hierarchical grouping relationship.
- Resource management information may include one or more hierarchical grouping relationships, each hierarchical grouping relationship is used to represent the hierarchical grouping of multiple resource nodes in different clusters. In different application scenarios, the meaning of cluster may be different. Taking the cloud service system as an example, if each server includes 8 computing device cards, then one server is a cluster, and 8 computing device cards are 8 resource nodes. The number of resource nodes corresponding to different sub-requests can be allocated through a hierarchical grouping relationship, or through different hierarchical grouping relationships, such as: the number of resource nodes corresponding to sub-request 1 is allocated from server 1 according to hierarchical grouping relationship 1. The number of resource nodes corresponding to sub-request 2 is allocated from server 2 according to hierarchical grouping relationship 2.
- the hierarchical grouping relationship can be understood by referring to the previous introduction to the resource node grouping part.
- each grouping at a different level corresponds to a number of resource nodes which is an exponential power of 2.
- the exponential power of 2 can be expressed as 2 n , where n is a natural number (0, 1, ).
- the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list, for example, the linked list of each level shown in FIG. 5A .
- a linked list for example, the linked list of each level shown in FIG. 5A .
- the resource management device determines the binary tree 1 of the resource cluster 1 according to the topological relationship of the resource cluster 1 , and determines the binary tree 2 of the resource cluster 2 according to the topological relationship of the resource cluster 2 .
- a structure of a resource management device 100 provided in an embodiment of the present application includes:
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated units may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
- the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
- the computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated.
- the available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present application discloses a resource management method. The method comprises: receiving a resource request, wherein the resource request comprises the number of requested resource nodes; acquiring at least two sub-requests according to the resource request, wherein the sum of the number of resource nodes respectively corresponding to the at least two sub-requests is the number of resource nodes corresponding to the resource request; and allocating a corresponding number of resource nodes to each sub-request according to resource management information, wherein the resource management information comprises a hierarchical grouping relationship of a plurality of resource nodes, and the number of resource nodes corresponding to different sub-requests is matched with the number of resource nodes corresponding to one or more groups of the same hierarchy or different hierarchies in the hierarchical grouping relationship. According to the solution provided by the present application, resource nodes can be allocated to sub-requests, and the number of resource nodes corresponding to the sub-requests is small, so that the resource nodes can be flexibly allocated to the sub-requests, thereby reducing the probability of resource fragmentation, and increasing the resource utilization rate.
Description
本申请涉及通信技术领域,具体涉及一种资源管理方法及相应装置。The present application relates to the field of communication technology, and in particular to a resource management method and corresponding device.
当前人工智能(artificial intelligence,AI)或者大数据类型的任务通常需要图形处理器(graphic processing unit GPU)或者神经网络处理器(network processing unit,NPU)等异构计算设备卡来加速任务的运行,以缩短任务运行时间。这些任务通常都是运行在云上的,对于云厂商来说,需要提供一个异构资源管理平台,来分发GPU或者NPU等这些计算资源给租户执行任务,以保障租户任务的高效运行。Currently, artificial intelligence (AI) or big data tasks usually require heterogeneous computing devices such as graphic processing units (GPUs) or neural network processing units (NPUs) to accelerate the running of tasks and shorten the running time of tasks. These tasks are usually run on the cloud. For cloud vendors, it is necessary to provide a heterogeneous resource management platform to distribute computing resources such as GPUs or NPUs to tenants to perform tasks in order to ensure the efficient operation of tenant tasks.
在集群中,通常一台服务器上都配备着多张同型号的GPU或者NPU等计算设备卡。这些计算设备卡和CPU以及内存资源,被上层应用程序请求并使用。同时,这些计算设备卡之间通过一些高速互联总线(如:高速串行计算机扩展总线(peripheral component interconnect express,PCIe))连接,以保证数据信息在多张计算设备卡之间的高效传递。In a cluster, a server is usually equipped with multiple computing device cards of the same model such as GPUs or NPUs. These computing device cards, CPUs, and memory resources are requested and used by upper-layer applications. At the same time, these computing device cards are connected through some high-speed interconnect buses (such as high-speed serial computer expansion buses (peripheral component interconnect express, PCIe)) to ensure efficient transmission of data information between multiple computing device cards.
在云上多租场景下,租户应用的资源诉求是多种多样的。如果只考虑分配资源间的亲和性,将一些任务的资源分配在一起减少数据传输路径上的开销,就会使得一些服务器上的少量计算设备卡失去被分配的机会,从而产生大量的分配碎片。因此,当前的资源管理方式面临着资源碎片率高、可分配率低的问题。In a multi-tenancy scenario on the cloud, tenant applications have various resource demands. If we only consider the affinity between allocated resources and allocate resources of some tasks together to reduce the overhead on the data transmission path, a small number of computing devices on some servers will lose the opportunity to be allocated, resulting in a large amount of allocation fragmentation. Therefore, the current resource management method faces the problem of high resource fragmentation rate and low allocation rate.
发明内容Summary of the invention
本申请提供一种资源管理方法,用于降低资源碎片化,提高资源分配率。本申请还提供了相应装置、计算机可读存储介质,以及计算机程序产品等。The present application provides a resource management method for reducing resource fragmentation and improving resource allocation rate. The present application also provides a corresponding device, a computer-readable storage medium, and a computer program product.
本申请第一方面提供一种资源管理方法,包括:接收资源请求,资源请求包括所请求资源节点的数量;根据资源请求获得至少两个子请求,至少两个子请求各自对应的资源节点的数量之和为资源请求对应的资源节点的数量;根据资源管理信息,为每个子请求分配对应数量的资源节点,资源管理信息包括多个资源节点的层级化分组关系;其中,不同子请求对应的资源节点的数量,与层级化分组关系中同一层级或不同层级的一个或多个分组对应的资源节点的数量相匹配。A first aspect of the present application provides a resource management method, comprising: receiving a resource request, the resource request including the number of requested resource nodes; obtaining at least two sub-requests according to the resource request, the sum of the numbers of resource nodes corresponding to the at least two sub-requests being the number of resource nodes corresponding to the resource request; allocating a corresponding number of resource nodes to each sub-request according to resource management information, the resource management information including a hierarchical grouping relationship of multiple resource nodes; wherein the number of resource nodes corresponding to different sub-requests matches the number of resource nodes corresponding to one or more groups at the same level or different levels in the hierarchical grouping relationship.
本申请提供的资源管理方法可以应用于云服务系统、数据中心、独立的服务器或者网络系统等场景。资源节点可以是云服务系统中的计算设备卡或者虚拟机(virtual machine,VM)。资源节点可以是数据中心中的计算节点,如:服务器或虚拟机。资源节点可以是服务器中的计算设备卡。资源节点可以是网络系统中的网络装置。其中,计算设备卡可以是中央处理器(central processing unit,CPU)、图形处理器(graphic processing unit GPU)和神经网络处理器(network processing uni t,NPU)中的至少一种。网络装置可以是防火墙、路由器和交换机中的至少一种。The resource management method provided in the present application can be applied to scenarios such as cloud service systems, data centers, independent servers or network systems. A resource node can be a computing device card or a virtual machine (VM) in a cloud service system. A resource node can be a computing node in a data center, such as a server or a virtual machine. A resource node can be a computing device card in a server. A resource node can be a network device in a network system. Among them, the computing device card can be at least one of a central processing unit (CPU), a graphics processing unit (GPU) and a neural network processor (NPU). The network device can be at least one of a firewall, a router and a switch.
本申请中,资源请求可以是租户通过终端设备发送到云服务系统、数据中心或网络系统的。租户可以是资源使用方。In this application, a resource request can be sent by a tenant to a cloud service system, a data center, or a network system through a terminal device. A tenant can be a resource user.
本申请中,所请求资源节点的数量可以理解为是租户请求的服务器的数量,租户请求的计算设备卡的数量等,如:租户请求5个计算设备卡,或者,租户请求8个计算设备卡。In this application, the number of requested resource nodes can be understood as the number of servers requested by the tenant, the number of computing device cards requested by the tenant, etc., such as: the tenant requests 5 computing device cards, or the tenant requests 8 computing device cards.
本申请中,资源管理信息可以包括一个或多个层级化分组关系,每个层级化分组关系用于表示不同集群中的多个资源节点的层级化分组。在不同的应用场景中,集群所表示的含义可以不同,以云服务系统为例,若每台服务器中包括8个计算设备卡,则一台服务器为一个集群,8个计算设备卡为8个资源节点。不同的子请求对应数量的资源节点可以通过一个层级化分组关系来分配,也可以通过不同的层级化分组关系来分配,如:子请求1对应数量的资源节点是根据层级化分组关系1从服务器1中分配计算设备卡,子请求2对应数量的资源节点是根据层级化分组关系2从服务器2中分配计算设备卡。In the present application, resource management information may include one or more hierarchical grouping relationships, each hierarchical grouping relationship is used to represent the hierarchical grouping of multiple resource nodes in different clusters. In different application scenarios, the meaning of the cluster may be different. Taking the cloud service system as an example, if each server includes 8 computing device cards, then one server is a cluster, and 8 computing device cards are 8 resource nodes. The number of resource nodes corresponding to different sub-requests can be allocated through a hierarchical grouping relationship, or through different hierarchical grouping relationships, such as: the number of resource nodes corresponding to sub-request 1 is allocated from server 1 according to hierarchical grouping relationship 1. The computing device card, and the number of resource nodes corresponding to sub-request 2 is allocated from server 2 according to hierarchical grouping relationship 2.
本申请中,层级化分组关系包括多个层级,每个层级的分组数量为一个或多个,不同层级的分组数量不同,不同层级的分组对应的资源节点的数量不同,同一层级的分组对应的资源节点的数量相同。In the present application, the hierarchical grouping relationship includes multiple levels, each level has one or more groups, different levels have different numbers of groups, different levels of groups correspond to different numbers of resource nodes, and the same level of groups correspond to the same number of resource nodes.
本申请中,不同子请求对应的资源节点的数量与同一层级或不同层级的一个或多个分组对应的资源节点的数量相匹配指的是:若两个子请求对应的资源节点的数量相同,可以根据同一层级的不同分组对应的资源节点为这两个子请求分配资源节点。若两个子请求对应的资源节点的数量不同,则可以从不同层级的分组对应的资源节点为这两个子请求分配资源节点。In the present application, the number of resource nodes corresponding to different sub-requests matches the number of resource nodes corresponding to one or more groups at the same level or different levels, which means: if the number of resource nodes corresponding to two sub-requests is the same, resource nodes can be allocated to the two sub-requests according to the resource nodes corresponding to different groups at the same level. If the number of resource nodes corresponding to the two sub-requests is different, resource nodes can be allocated to the two sub-requests from the resource nodes corresponding to groups at different levels.
本申请中,获得至少两个子请求的方式可以是将资源请求拆分为至少两个子请求,然后为子请求分配资源节点,因为每个子请求对应的资源节点的数量少于资源请求对应的资源节点的数量,所以,可以灵活为子请求分配资源节点,降低了资源碎片化发生的几率,提高了资源利用率。In the present application, a method for obtaining at least two sub-requests can be to split a resource request into at least two sub-requests, and then allocate resource nodes to the sub-requests. Because the number of resource nodes corresponding to each sub-request is less than the number of resource nodes corresponding to the resource request, resource nodes can be flexibly allocated to the sub-requests, thereby reducing the probability of resource fragmentation and improving resource utilization.
一种可能的实现方式中,层级化分组关系包括多个层级,其中,每个层级都对应多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。In a possible implementation, the hierarchical grouping relationship includes multiple levels, wherein each level corresponds to multiple resource nodes, the number of groups at different levels is different, and the number of resource nodes corresponding to each group at the same level is the same.
该种可能的实现方式中,以有8个资源节点,4个层级为例,每个层级都对应这8个资源节点。每个层级的分组数量不同,这4个层级的分组数量可以依次为1、2、4和8。一个层级有1个分组时,这一个分组对应8个资源节点。一个层级有2个分组时,每个分组各对应4个资源节点。一个层级有4个分组时,每个分组各对应2个资源节点。一个层级有8个分组时,每个分组各对应1个资源节点。需要说明的是,层级化分组关系中层级的数量,以及每个层级中的分组对应的资源节点的数量不限于这里示例的方式,如:有6个资源节点时,可以有3个层级、这3个层级分组数量可以依次为1、2和6。一个层级有一个分组时,这一个分组对应6个资源节点。一个层级有2个分组时,每个分组各对应3个资源节点。一个层级有6个分组时,每个分组各对应1个资源节点。本申请在不同层级提供了不同数量的分组,不同层级分组对应的资源节点的数量不同,可以提高为子请求分配资源节点的速度。In this possible implementation, take 8 resource nodes and 4 levels as an example, each level corresponds to these 8 resource nodes. The number of groups in each level is different, and the number of groups in these 4 levels can be 1, 2, 4 and 8 respectively. When a level has 1 group, this group corresponds to 8 resource nodes. When a level has 2 groups, each group corresponds to 4 resource nodes. When a level has 4 groups, each group corresponds to 2 resource nodes. When a level has 8 groups, each group corresponds to 1 resource node. It should be noted that the number of levels in the hierarchical grouping relationship and the number of resource nodes corresponding to the groups in each level are not limited to the example here, such as: when there are 6 resource nodes, there can be 3 levels, and the number of groups in these 3 levels can be 1, 2 and 6 respectively. When a level has one group, this group corresponds to 6 resource nodes. When a level has 2 groups, each group corresponds to 3 resource nodes. When there are 6 groups at one level, each group corresponds to 1 resource node. The present application provides different numbers of groups at different levels, and the number of resource nodes corresponding to groups at different levels is different, which can improve the speed of allocating resource nodes to sub-requests.
一种可能的实现方式中,不同层级的每个分组对应2的指数幂个资源节点。In a possible implementation, each grouping at a different level corresponds to an exponential power of 2 resource nodes.
该种可能的实现方式中,2的指数幂可以表示为2
n,其中,n为自然数(0、1,…)。需要说明的是,不同层级的每个分组对应2的指数幂个资源节点只是一种方式,也可以是 不同层级的每个分组对应3的指数幂个资源节点,或者,不同层级的每个分组对应m的正整数倍的资源节点,m为正整数。
In this possible implementation, the exponential power of 2 can be expressed as 2 n , where n is a natural number (0, 1, ...). It should be noted that the exponential power of 2 corresponding to each group at different levels is only one way, and each group at different levels can also correspond to an exponential power of 3 resource nodes, or each group at different levels corresponds to a positive integer multiple of m resource nodes, where m is a positive integer.
一种可能的实现方式中,每个子请求对应2的指数幂个资源节点。In a possible implementation, each sub-request corresponds to a power-of-two resource node.
该种可能的实现方式中,当不同层级的每个分组对应2的指数幂个资源节点时,每个子请求对应2的指数幂个资源节点,可以使子请求对应的资源节点的数量能与某个层级的分组对应的资源节点的数量相匹配,整个分组对应的资源节点都分配给一个子请求,可以降低资源节点碎片化的几率。In this possible implementation, when each grouping at different levels corresponds to an exponential power of 2 resource nodes, each sub-request corresponds to an exponential power of 2 resource nodes, so that the number of resource nodes corresponding to the sub-request can match the number of resource nodes corresponding to the grouping at a certain level, and the resource nodes corresponding to the entire group are allocated to one sub-request, which can reduce the probability of resource node fragmentation.
需要说明的是,当不同层级的每个分组对应的资源节点的数量是按照其他方式配置时,子请求按照对应的配置方式划分对应的资源节点的数量即可。It should be noted that when the number of resource nodes corresponding to each group at different levels is configured in other ways, the sub-requests can be divided into the number of corresponding resource nodes according to the corresponding configuration method.
一种可能的实现方式中,层级化分组关系中每个层级的信息通过链表的形式记录,每个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。In a possible implementation, the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list. The linked list of each level includes the node identifiers of the resource nodes contained in each group of the level. The node identifiers of the resource nodes in different groups are different.
该种可能的实现方式中,资源节点的节点标识可以唯一标识该资源节点,例如:可以指示该资源节点在某个服务器上的某个位置,例如:服务器1中的计算设备卡1。链表中还可以包括层级或者/和该层级中每个分组对应的资源节点的数量。链表可以包括表头和分组,表头可以用于记录层级,表头与分组,以及分组后分组之间可以通过指针连接。分组中可以用节点标识的个数来表示该分组对应资源节点的数量。通过链表的形式记录层级化分组关系中每个层级的信息,在为子请求分配资源节点时,可以根据子请求对应的资源节点的数量,从链表中快速的确定匹配的层级,从而可以提高资源节点分配的速度。In this possible implementation, the node identifier of the resource node can uniquely identify the resource node, for example, it can indicate a certain position of the resource node on a certain server, for example, computing device card 1 in server 1. The linked list can also include the level or/and the number of resource nodes corresponding to each group in the level. The linked list can include a header and a group, and the header can be used to record the level. The header and the group, as well as the groups after grouping, can be connected by pointers. The number of node identifiers in the group can be used to represent the number of resource nodes corresponding to the group. By recording the information of each level in the hierarchical grouping relationship in the form of a linked list, when allocating resource nodes to sub-requests, the matching level can be quickly determined from the linked list according to the number of resource nodes corresponding to the sub-requests, thereby increasing the speed of resource node allocation.
一种可能的实现方式中,至少两个子请求包括第一子请求,根据资源管理信息,为每个子请求分配对应数量的资源节点,包括:根据第一子请求对应的资源节点的数量,从目标层级的链表中,为第一子请求分配一个分组的节点标识对应的资源节点;其中,目标层级的每个分组中节点标识的数量,与第一子请求对应的资源节点的数量相同。In one possible implementation, at least two sub-requests include a first sub-request, and a corresponding number of resource nodes are allocated to each sub-request based on resource management information, including: based on the number of resource nodes corresponding to the first sub-request, a resource node corresponding to a node identifier of a group is allocated to the first sub-request from a linked list of the target level; wherein the number of node identifiers in each group of the target level is the same as the number of resource nodes corresponding to the first sub-request.
该种可能的实现方式中,在为子请求分配资源节点时,可以根据子请求对应的资源节点的数量,快速的确定匹配的目标层级,从而可以提高资源节点分配的速度。In this possible implementation, when allocating resource nodes to sub-requests, the matching target level can be quickly determined according to the number of resource nodes corresponding to the sub-requests, thereby increasing the speed of resource node allocation.
一种可能的实现方式中,至少两个子请求包括第一子请求,根据资源管理信息,为每个子请求分配对应数量的资源节点,包括:根据第一子请求对应的资源节点的数量,从一个或多个层级的链表中,为第一子请求分配多个分组的节点标识对应的资源节点;其中,多个分组中节点标识对应的资源节点的数量之和,与第一子请求对应的资源节点的数量相同,多个分组属于相同的层级,或者多个分组中的至少两个分组属于不同的层级。In one possible implementation, at least two sub-requests include a first sub-request, and a corresponding number of resource nodes are allocated to each sub-request based on resource management information, including: based on the number of resource nodes corresponding to the first sub-request, resource nodes corresponding to node identifiers of multiple groups are allocated to the first sub-request from a linked list of one or more levels; wherein the sum of the numbers of resource nodes corresponding to the node identifiers in the multiple groups is the same as the number of resource nodes corresponding to the first sub-request, the multiple groups belong to the same level, or at least two of the multiple groups belong to different levels.
该种可能的实现方式中,为第一子请求分配的资源节点也可以来自多个分组,多个分组可以位于同一层级,也可以不全位于同一层级,或者都位于不同层级。In this possible implementation, the resource nodes allocated to the first sub-request may also come from multiple groups, and the multiple groups may be located at the same level, may not all be located at the same level, or may all be located at different levels.
一种可能的实现方式中,层级化分组关系通过二叉树的形式记录,二叉树的最末端层级的每个分组包括一个资源节点的节点标识,不同分组中的节点标识不同;上层层级的分组中包括上层层级的分组与最末端层级的分组的关联关系,其中,上层层级为最末端层级之上的任意一个层级。In one possible implementation, the hierarchical grouping relationship is recorded in the form of a binary tree, and each group at the end level of the binary tree includes a node identifier of a resource node, and the node identifiers in different groups are different; the grouping of the upper level includes the association relationship between the grouping of the upper level and the grouping of the end level, wherein the upper level is any level above the end level.
该种可能的实现方式中,二叉树是树形的数据存储结构,上层的节点可以分出两个叉。 本申请中的层级化分组关系可以表示为二叉树的形式。还以8个资源节点为例,最顶端层级可以有1个分组,这1个分组对应8个资源节点。接下来的层级将最顶端层级的1个分组分成2个分组,每个分组对应4个资源节点。再接下来的层级,将上一层级每个分组分成2个分组,就得到4个分组,每个分组对应2个资源节点。再接下来的层级,将上一层级每个分组分成2个分组,就得到8个分组,每个分组对应1个资源节点,这个层级就成为最末端层级。8个资源节点的标识可以都记录在最末端层级的分组中,最末端层级之上的上层层级的分组中只需要记录对应的资源节点的数量,在为子请求分配资源节点时,可以根据该上层层级与最末端层级在二叉树中的关联关系,将最末端层级的节点标识分配给该子请求。通过二叉树的形式记录层级化分组关系,只需要最末端层级的分组包含资源节点的节点标识,其他上层层级,只存储该分组对应的资源节点的数量即可,从而可以减少数据存储量。In this possible implementation, a binary tree is a tree-shaped data storage structure, and the nodes in the upper layer can be divided into two forks. The hierarchical grouping relationship in this application can be expressed in the form of a binary tree. Taking 8 resource nodes as an example, the topmost layer can have 1 group, and this 1 group corresponds to 8 resource nodes. The next layer divides the 1 group of the topmost layer into 2 groups, each of which corresponds to 4 resource nodes. In the next layer, each group of the previous layer is divided into 2 groups, and 4 groups are obtained, each of which corresponds to 2 resource nodes. In the next layer, each group of the previous layer is divided into 2 groups, and 8 groups are obtained, each of which corresponds to 1 resource node, and this layer becomes the last layer. The identifiers of the eight resource nodes can all be recorded in the grouping of the last level. Only the number of corresponding resource nodes needs to be recorded in the grouping of the upper level above the last level. When allocating resource nodes to sub-requests, the node identifier of the last level can be allocated to the sub-request based on the association between the upper level and the last level in the binary tree. By recording the hierarchical grouping relationship in the form of a binary tree, only the grouping of the last level needs to contain the node identifier of the resource node, and the other upper levels only need to store the number of resource nodes corresponding to the grouping, thereby reducing the amount of data storage.
一种可能的实现方式中,至少两个子请求包括第二子请求,根据资源管理信息,为每个子请求分配对应数量的资源节点,包括:根据第二子请求对应的资源节点的数量,为第二子请求分配目标分组所关联的最末端层级的节点标识对应的资源节点,目标分组为二叉树的目标层级的一个分组;其中,目标层级的每个分组所关联的最末端层级的节点标识的数量,与第二子请求对应的资源节点的数量相同。In one possible implementation, at least two sub-requests include a second sub-request, and a corresponding number of resource nodes are allocated to each sub-request based on resource management information, including: based on the number of resource nodes corresponding to the second sub-request, resource nodes corresponding to the node identifier of the last level associated with the target group are allocated to the second sub-request, where the target group is a group of the target level of the binary tree; wherein the number of node identifiers of the last level associated with each group of the target level is the same as the number of resource nodes corresponding to the second sub-request.
该种可能的实现方式中,根据二叉树为子请求分配资源节点时,只需要根据子请求所对应的资源节点的数量确定目标层级,然后再分配该目标层级的一个分组所关联的最末端层级的节点标识即可。由此可见,可以根据子请求对应的资源节点的数量,从二叉树中快速的确定匹配的目标层级,从而可以提高资源节点分配的速度。In this possible implementation, when allocating resource nodes for sub-requests according to the binary tree, it is only necessary to determine the target level according to the number of resource nodes corresponding to the sub-request, and then allocate the node identifier of the last level associated with a group of the target level. It can be seen that the matching target level can be quickly determined from the binary tree according to the number of resource nodes corresponding to the sub-request, thereby improving the speed of resource node allocation.
一种可能的实现方式中,至少两个子请求包括第二子请求,根据资源管理信息,为每个子请求分配对应数量的资源节点,包括:根据第二子请求对应的资源节点的数量,为第二子请求分配多个目标分组所关联的最末端层级的节点标识对应的资源节点,多个目标分组属于相同的层级,或者多个分组中的至少两个分组属于不同的层级;其中,多个目标分组所关联的最末端层级的节点标识不重复,且多个目标分组所关联的最末端层级的节点标识的数量之和,与第二子请求对应的资源节点的数量相同。In one possible implementation, at least two sub-requests include a second sub-request, and a corresponding number of resource nodes are allocated to each sub-request based on resource management information, including: based on the number of resource nodes corresponding to the second sub-request, resource nodes corresponding to the node identifiers of the last level associated with multiple target groups are allocated to the second sub-request, the multiple target groups belong to the same level, or at least two of the multiple groups belong to different levels; wherein the node identifiers of the last level associated with the multiple target groups are not repeated, and the sum of the number of node identifiers of the last level associated with the multiple target groups is the same as the number of resource nodes corresponding to the second sub-request.
该种可能的实现方式中,为第二子请求分配的资源节点也可以来自多个目标分组,多个目标分组可以位于同一层级,也可以不全位于同一层级,或者都位于不同层级。这些分组对应的最末端层级的节点标识不重复即可。In this possible implementation, the resource nodes allocated to the second sub-request may also come from multiple target groups, which may be located at the same level, or may not all be located at the same level, or may all be located at different levels. The node identifiers of the last level corresponding to these groups do not need to be repeated.
一种可能的实现方式中,至少两个子请求为每个子请求对应的资源节点的数量都满足2的指数幂时,资源请求得到的最少数量的子请求。In a possible implementation, when at least two sub-requests are each corresponding to a number of resource nodes that satisfies an exponential power of 2, the resource request obtains the minimum number of sub-requests.
该种可能的实现方式中,当资源请求有多种得到方式时,选择最少数量的子请求的得到方式,这样,可以减少子请求的分配次数,提高分配效率,而且,还可以提高同一子请求对应的多个资源节点间的亲和性。In this possible implementation, when there are multiple ways to obtain a resource request, the way to obtain the resource request with the least number of sub-requests is selected. This can reduce the number of sub-request allocations, improve allocation efficiency, and also improve the affinity between multiple resource nodes corresponding to the same sub-request.
一种可能的实现方式中,层级化分组关系是按层级划分多个资源节点得到,当任意一个层级的分组对应的资源节点的数量大于2时,该分组对应的至少两个资源节点构成通信环。In a possible implementation, the hierarchical grouping relationship is obtained by dividing a plurality of resource nodes by level, and when the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
该种可能的实现方式中,通信环指的是至少两个资源节点之间首尾相连形成的环。即数据在一个资源节点上被发送后,可以遍历环中的所有其他的资源节点,最终回到初始的资源节点。本申请在对资源节点进行多层级分组时,不再依赖于高速串行计算机扩展总线(peripheral component interconnect express,PCIe)架构的组织方式,按照通信环进行划分,和硬件的互联架构解耦,兼容当前主流架构,通用性强。In this possible implementation, the communication ring refers to a ring formed by connecting at least two resource nodes end to end. That is, after data is sent on a resource node, it can traverse all other resource nodes in the ring and eventually return to the initial resource node. When the resource nodes are grouped in multiple levels, the present application no longer relies on the organization of the high-speed serial computer expansion bus (peripheral component interconnect express, PCIe) architecture, but is divided according to the communication ring, decoupled from the hardware interconnection architecture, compatible with the current mainstream architecture, and highly versatile.
一种可能的实现方式中,同一层级的不同分组对应的通信环的带宽之和相同,通信环的带宽为构成通信环的资源节点之间通信带宽之和,如:通信环包括4个资源节点,其中,资源节点1和资源节点2之间的带宽是10M,资源节点2和资源节点3之间的带宽是10M,资源节点3和资源节点4之间的带宽是10M,资源节点4和资源节点1之间的带宽是10M,则该通信环的带宽之和=10+10+10+10=40M。In one possible implementation, the sum of the bandwidths of the communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of the communication bandwidths between the resource nodes constituting the communication ring. For example, the communication ring includes 4 resource nodes, among which the bandwidth between resource node 1 and resource node 2 is 10M, the bandwidth between resource node 2 and resource node 3 is 10M, the bandwidth between resource node 3 and resource node 4 is 10M, and the bandwidth between resource node 4 and resource node 1 is 10M. Then the sum of the bandwidths of the communication ring = 10+10+10+10 = 40M.
该种可能的实现方式中,资源节点划分时形成的通信环的带宽之和一致,避免了非对称的互联拓扑架构的场景下通信环性能不一致的情况。In this possible implementation, the sum of the bandwidths of the communication rings formed when the resource nodes are divided is consistent, thereby avoiding the situation where the performance of the communication rings is inconsistent in the scenario of an asymmetric interconnection topology architecture.
一种可能的实现方式中,同一层级的通信环的带宽之和是至少两个第一带宽和中最大的,其中,第一带宽和是多个资源节点按照同一层级的分组对应资源节点的数量,进行不同组合时得到的通信环的带宽之和。In one possible implementation, the sum of the bandwidths of communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when multiple resource nodes are grouped in different ways according to the number of resource nodes corresponding to the grouping at the same level.
该种可能的实现方式中,若对同一层级对应的资源节点在有多种组合成通信环的方式时,选择通信环的带宽之和最大的组合方式,可以提高通信环的性能。In this possible implementation, if there are multiple ways to combine resource nodes corresponding to the same level into a communication ring, selecting a combination with the largest sum of bandwidths of the communication ring can improve the performance of the communication ring.
一种可能的实现方式中,资源节点位于云服务系统,资源节点为云服务系统中的计算设备卡或者虚拟机。In a possible implementation, the resource node is located in a cloud service system, and the resource node is a computing device card or a virtual machine in the cloud service system.
该种可能的实现方式中,云服务系统中的资源通常是以计算设备卡或者虚拟机形式对外向租户提供服务的,所以,在云服务系统场景,资源节点可以是计算设备卡或者虚拟机。如果,云服务系统中的资源是以其他形式对外向租户提供服务,那么资源节点可以是其他形态的装置,不限于计算设备卡或者虚拟机。In this possible implementation, the resources in the cloud service system usually provide services to tenants in the form of computing device cards or virtual machines. Therefore, in the cloud service system scenario, the resource node can be a computing device card or a virtual machine. If the resources in the cloud service system provide services to tenants in other forms, then the resource node can be other forms of devices, not limited to computing device cards or virtual machines.
一种可能的实现方式中,资源节点位于数据中心,资源节点为数据中心的计算节点,计算节点为服务器或虚拟机。In a possible implementation, the resource node is located in a data center, the resource node is a computing node of the data center, and the computing node is a server or a virtual machine.
该种可能的实现方式中,数据中心的资源通常是以服务器或虚拟机形式对外提供服务的,所以,在数据中心场景,资源节点可以是服务器或虚拟机。如果,数据中心的资源是以其他形式对外提供服务,那么资源节点可以是其他形态的装置,不限于服务器或虚拟机。In this possible implementation, the resources of the data center usually provide services to the outside in the form of servers or virtual machines. Therefore, in the data center scenario, the resource nodes can be servers or virtual machines. If the resources of the data center provide services to the outside in other forms, then the resource nodes can be other forms of devices, not limited to servers or virtual machines.
一种可能的实现方式中,资源节点位于网络系统,资源节点为网络系统的网络装置,网络装置包括防火墙、路由器和交换机中的至少一种。In a possible implementation, the resource node is located in a network system, and the resource node is a network device of the network system, and the network device includes at least one of a firewall, a router, and a switch.
该种可能的实现方式中,网络系统的资源通常是以防火墙、路由器或交换机的形式对外提供服务的,所以,在网络系统场景,资源节点可以是防火墙、路由器和交换机中的至少一种。如果,网络系统的资源是以其他形式对外提供服务,那么资源节点可以是其他形态的装置,不限于防火墙、路由器和交换机中的至少一种。In this possible implementation, the resources of the network system usually provide services to the outside in the form of firewalls, routers or switches. Therefore, in the network system scenario, the resource node can be at least one of the firewalls, routers and switches. If the resources of the network system provide services to the outside in other forms, then the resource node can be other forms of devices, not limited to at least one of the firewalls, routers and switches.
本申请第二方面提供一种资源管理方法,包括:获取多个资源节点之间的拓扑关系,拓扑关系表示多个资源节点之间的通信关系;根据多个资源节点之间的拓扑关系,对多个资源节点按照层级进行分组,以得到多个资源节点的层级化分组关系,层级化分组关系是 按层级划分多个资源节点得到,层级化分组关系包括多个层级,其中,每个层级都对应多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。The second aspect of the present application provides a resource management method, including: obtaining a topological relationship between multiple resource nodes, the topological relationship representing the communication relationship between the multiple resource nodes; grouping the multiple resource nodes according to the topological relationship between the multiple resource nodes to obtain a hierarchical grouping relationship of the multiple resource nodes, the hierarchical grouping relationship is obtained by dividing the multiple resource nodes according to the hierarchy, the hierarchical grouping relationship includes multiple hierarchies, wherein each hierarchy corresponds to multiple resource nodes, the number of groups at different hierarchies is different, and each group at the same hierarchy corresponds to the same number of resource nodes.
一种可能的实现方式中,当任意一个层级的分组对应的资源节点的数量大于2时,该分组对应的至少两个资源节点构成通信环。In a possible implementation, when the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
本申请中,拓扑关系指的是资源节点之间的连接关系,各资源节点之间可以通过总线连接。关于通信环可以参阅前面的介绍进行理解。In this application, the topological relationship refers to the connection relationship between resource nodes, and each resource node can be connected through a bus. The communication ring can be understood by referring to the above introduction.
该种可能的实现方式中,在对资源节点进行多层级分组时,不再依赖于高速串行计算机扩展总线(peripheral component interconnect express,PCIe)架构的组织方式,按照通信环进行划分,和硬件的互联架构解耦,兼容当前主流架构,通用性强。In this possible implementation, when performing multi-level grouping of resource nodes, it no longer relies on the organization of the high-speed serial computer expansion bus (peripheral component interconnect express, PCIe) architecture. Instead, it is divided according to the communication ring, decoupled from the hardware interconnection architecture, compatible with the current mainstream architecture, and highly versatile.
一种可能的实现方式中,同一层级的不同分组对应的通信环的带宽之和相同,通信环的带宽为构成通信环的资源节点之间通信带宽之和。In a possible implementation, the sum of bandwidths of communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of communication bandwidths between resource nodes constituting the communication ring.
一种可能的实现方式中,同一层级的通信环的带宽之和是至少两个第一带宽和中最大的,其中,第一带宽和是多个资源节点按照同一层级的分组对应资源节点的数量,进行不同组合时得到的通信环的带宽之和。In one possible implementation, the sum of the bandwidths of communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when multiple resource nodes are grouped in different ways according to the number of resource nodes corresponding to the grouping at the same level.
一种可能的实现方式中,不同层级的每个分组中包含2的指数幂个资源节点。In a possible implementation, each group at a different level contains a power-of-two resource node.
一种可能的实现方式中,层级化分组关系中每个层级的信息通过链表的形式记录,每个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。In a possible implementation, the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list. The linked list of each level includes the node identifiers of the resource nodes contained in each group of the level. The node identifiers of the resource nodes in different groups are different.
一种可能的实现方式中,层级化分组关系通过二叉树的形式记录,二叉树的最末端层级的每个分组包括一个资源节点的节点标识,不同分组中的节点标识不同;上层层级的分组中包括上层层级的分组对应的资源节点的数量,其中,上层层级为最末端层级之上的任意一个层级。In one possible implementation, the hierarchical grouping relationship is recorded in the form of a binary tree, and each group at the end level of the binary tree includes a node identifier of a resource node, and the node identifiers in different groups are different; the grouping of the upper level includes the number of resource nodes corresponding to the grouping of the upper level, wherein the upper level is any level above the end level.
关于第二方面以及任一可能的实现方式中的特征以及有意效果可以参阅前面第一方面或第一方面任一可能的实现方式进行理解。The features and intended effects of the second aspect and any possible implementation manner may be understood by referring to the first aspect or any possible implementation manner of the first aspect.
本申请第三方面提供一种资源管理装置,包括:A third aspect of the present application provides a resource management device, including:
接收单元,用于接收资源请求,资源请求包括所请求资源节点的数量。The receiving unit is used to receive a resource request, where the resource request includes the number of requested resource nodes.
第一处理单元,用于根据接收单元接收的资源请求获得至少两个子请求,至少两个子请求各自对应的资源节点的数量之和为资源请求对应的资源节点的数量。The first processing unit is used to obtain at least two sub-requests according to the resource request received by the receiving unit, and the sum of the numbers of resource nodes corresponding to the at least two sub-requests is the number of resource nodes corresponding to the resource request.
第二处理单元,用于根据资源管理信息,为第一处理单元得到的每个子请求分配对应数量的资源节点,资源管理信息包括多个资源节点的层级化分组关系;其中,不同子请求对应的资源节点的数量,与层级化分组关系中同一层级或不同层级的一个或多个分组对应的资源节点的数量相匹配。The second processing unit is used to allocate a corresponding number of resource nodes to each sub-request obtained by the first processing unit according to resource management information, and the resource management information includes a hierarchical grouping relationship of multiple resource nodes; wherein the number of resource nodes corresponding to different sub-requests matches the number of resource nodes corresponding to one or more groups at the same level or different levels in the hierarchical grouping relationship.
一种可能的实现方式中,层级化分组关系包括多个层级,其中,每个层级都对应多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。In a possible implementation, the hierarchical grouping relationship includes multiple levels, wherein each level corresponds to multiple resource nodes, the number of groups at different levels is different, and the number of resource nodes corresponding to each group at the same level is the same.
一种可能的实现方式中,不同层级的每个分组对应2的指数幂个资源节点。In a possible implementation, each grouping at a different level corresponds to an exponential power of 2 resource nodes.
一种可能的实现方式中,每个子请求对应2的指数幂个资源节点。In a possible implementation, each sub-request corresponds to a power-of-two resource node.
一种可能的实现方式中,层级化分组关系中每个层级的信息通过链表的形式记录,每 个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。In one possible implementation, the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list. The linked list of each level includes the node identifiers of the resource nodes contained in each group of the level, and the node identifiers of the resource nodes in different groups are different.
一种可能的实现方式中,至少两个子请求包括第一子请求,第二处理单元,具体用于根据第一子请求对应的资源节点的数量,从目标层级的链表中,为第一子请求分配一个分组的节点标识对应的资源节点;其中,目标层级的每个分组中节点标识的数量,与第一子请求对应的资源节点的数量相同。In one possible implementation, at least two sub-requests include a first sub-request and a second processing unit, which is specifically used to allocate a resource node corresponding to a node identifier of a group to the first sub-request from a linked list of the target level according to the number of resource nodes corresponding to the first sub-request; wherein the number of node identifiers in each group of the target level is the same as the number of resource nodes corresponding to the first sub-request.
一种可能的实现方式中,至少两个子请求包括第一子请求,第二处理单元,具体用于根据第一子请求对应的资源节点的数量,从一个或多个层级的链表中,为第一子请求分配多个分组的节点标识对应的资源节点;其中,多个分组中节点标识对应的资源节点的数量之和,与第一子请求对应的资源节点的数量相同,多个分组属于相同的层级,或者多个分组中的至少两个分组属于不同的层级。In one possible implementation, at least two sub-requests include a first sub-request and a second processing unit, which is specifically used to allocate resource nodes corresponding to node identifiers of multiple groups to the first sub-request from a linked list of one or more levels according to the number of resource nodes corresponding to the first sub-request; wherein the sum of the numbers of resource nodes corresponding to the node identifiers in the multiple groups is the same as the number of resource nodes corresponding to the first sub-request, the multiple groups belong to the same level, or at least two of the multiple groups belong to different levels.
一种可能的实现方式中,层级化分组关系通过二叉树的形式记录,二叉树的最末端层级的每个分组包括一个资源节点的节点标识,不同分组中的节点标识不同;上层层级的分组中包括上层层级的分组对应的资源节点的数量,其中,上层层级为最末端层级之上的任意一个层级。In one possible implementation, the hierarchical grouping relationship is recorded in the form of a binary tree, and each group at the end level of the binary tree includes a node identifier of a resource node, and the node identifiers in different groups are different; the grouping of the upper level includes the number of resource nodes corresponding to the grouping of the upper level, wherein the upper level is any level above the end level.
一种可能的实现方式中,至少两个子请求包括第二子请求,第二处理单元,具体用于根据第二子请求对应的资源节点的数量,为第二子请求分配目标分组所关联的最末端层级的节点标识对应的资源节点,目标分组为二叉树的目标层级的一个分组;其中,目标层级的每个分组所关联的最末端层级的节点标识的数量,与第二子请求对应的资源节点的数量相同。In one possible implementation, at least two sub-requests include a second sub-request, and a second processing unit is specifically used to allocate a resource node corresponding to the node identifier of the last level associated with the target group to the second sub-request based on the number of resource nodes corresponding to the second sub-request, and the target group is a group of the target level of the binary tree; wherein the number of node identifiers of the last level associated with each group of the target level is the same as the number of resource nodes corresponding to the second sub-request.
一种可能的实现方式中,至少两个子请求包括第二子请求,第二处理单元,具体用于根据第二子请求对应的资源节点的数量,为第二子请求分配多个目标分组所关联的最末端层级的节点标识对应的资源节点,多个目标分组属于相同的层级,或者多个分组中的至少两个分组属于不同的层级;其中,多个目标分组所关联的最末端层级的节点标识不重复,且多个目标分组所关联的最末端层级的节点标识的数量之和,与第二子请求对应的资源节点的数量相同。In one possible implementation, at least two sub-requests include a second sub-request, and a second processing unit is specifically used to allocate resource nodes corresponding to node identifiers of the last level associated with multiple target groups to the second sub-request according to the number of resource nodes corresponding to the second sub-request, and the multiple target groups belong to the same level, or at least two of the multiple groups belong to different levels; wherein the node identifiers of the last level associated with the multiple target groups are not repeated, and the sum of the number of node identifiers of the last level associated with the multiple target groups is the same as the number of resource nodes corresponding to the second sub-request.
一种可能的实现方式中,至少两个子请求为每个子请求对应的资源节点的数量都满足2的指数幂时,资源请求得到的最少数量的子请求。In a possible implementation, when at least two sub-requests are each corresponding to a number of resource nodes that satisfies an exponential power of 2, the resource request obtains the minimum number of sub-requests.
一种可能的实现方式中,层级化分组关系是按层级划分多个资源节点得到,当任意一个层级的分组对应的资源节点的数量大于2时,该分组对应的至少两个资源节点构成通信环。In a possible implementation, the hierarchical grouping relationship is obtained by dividing a plurality of resource nodes by level, and when the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
一种可能的实现方式中,同一层级的不同分组对应的通信环的带宽之和相同,通信环的带宽为构成通信环的资源节点之间通信带宽之和。In a possible implementation, the sum of bandwidths of communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of communication bandwidths between resource nodes constituting the communication ring.
一种可能的实现方式中,同一层级的通信环的带宽之和是至少两个第一带宽和中最大的,其中,第一带宽和是多个资源节点按照同一层级的分组对应资源节点的数量,进行不同组合时得到的通信环的带宽之和。In one possible implementation, the sum of the bandwidths of communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when multiple resource nodes are grouped in different ways according to the number of resource nodes corresponding to the grouping at the same level.
一种可能的实现方式中,资源节点位于云服务系统,资源节点为云服务系统中的计算 设备卡或者虚拟机。In one possible implementation, the resource node is located in the cloud service system, and the resource node is a computing device card or a virtual machine in the cloud service system.
一种可能的实现方式中,资源节点位于数据中心,资源节点为数据中心的计算节点,计算节点为服务器或虚拟机。In a possible implementation, the resource node is located in a data center, the resource node is a computing node of the data center, and the computing node is a server or a virtual machine.
一种可能的实现方式中,资源节点位于网络系统,资源节点为网络系统的网络装置,网络装置包括防火墙、路由器和交换机中的至少一种。In a possible implementation, the resource node is located in a network system, and the resource node is a network device of the network system, and the network device includes at least one of a firewall, a router, and a switch.
本申请第四方面提供一种资源管理装置,包括:A fourth aspect of the present application provides a resource management device, including:
第一处理单元,用于获取多个资源节点之间的拓扑关系,拓扑关系表示多个资源节点之间的通信关系。The first processing unit is used to obtain a topological relationship between multiple resource nodes, where the topological relationship represents a communication relationship between the multiple resource nodes.
第二处理单元,用于根据多个资源节点之间的拓扑关系,对多个资源节点按照层级进行分组,以得到多个资源节点的层级化分组关系,层级化分组关系是按层级划分多个资源节点得到,层级化分组关系包括多个层级,其中,每个层级都对应多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。The second processing unit is used to group the multiple resource nodes according to the hierarchy based on the topological relationship between the multiple resource nodes to obtain a hierarchical grouping relationship of the multiple resource nodes. The hierarchical grouping relationship is obtained by dividing the multiple resource nodes according to the hierarchy. The hierarchical grouping relationship includes multiple levels, wherein each level corresponds to multiple resource nodes, the number of groups at different levels is different, and each group at the same level corresponds to the same number of resource nodes.
一种可能的实现方式中,当任意一个层级的分组对应的资源节点的数量大于2时,该分组对应的至少两个资源节点构成通信环。In a possible implementation, when the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
一种可能的实现方式中,同一层级的不同分组对应的通信环的带宽之和相同,通信环的带宽为构成通信环的资源节点之间通信带宽之和。In a possible implementation, the sum of bandwidths of communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of communication bandwidths between resource nodes constituting the communication ring.
一种可能的实现方式中,同一层级的通信环的带宽之和是至少两个第一带宽和中最大的,其中,第一带宽和是多个资源节点按照同一层级的分组对应资源节点的数量,进行不同组合时得到的通信环的带宽之和。In one possible implementation, the sum of the bandwidths of communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when multiple resource nodes are grouped in different ways according to the number of resource nodes corresponding to the grouping at the same level.
一种可能的实现方式中,不同层级的每个分组中包含2的指数幂个资源节点。In a possible implementation, each group at a different level contains a power-of-two resource node.
一种可能的实现方式中,层级化分组关系中每个层级的信息通过链表的形式记录,每个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。In a possible implementation, the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list. The linked list of each level includes the node identifiers of the resource nodes contained in each group of the level. The node identifiers of the resource nodes in different groups are different.
一种可能的实现方式中,层级化分组关系通过二叉树的形式记录,二叉树的最末端层级的每个分组包括一个资源节点的节点标识,不同分组中的节点标识不同;上层层级的分组中包括上层层级的分组对应的资源节点的数量,其中,上层层级为最末端层级之上的任意一个层级。In one possible implementation, the hierarchical grouping relationship is recorded in the form of a binary tree, and each group at the end level of the binary tree includes a node identifier of a resource node, and the node identifiers in different groups are different; the grouping of the upper level includes the number of resource nodes corresponding to the grouping of the upper level, wherein the upper level is any level above the end level.
本申请第五方面提供一种资源管理装置,用于执行上述第一方面或第一方面的任意可能的实现方式中的方法。具体地,该资源管理装置包括用于执行上述第一方面或第一方面的任意可能的实现方式中的方法的模块或单元,如:接收单元、第一处理单元和第二处理单元。The fifth aspect of the present application provides a resource management device for executing the method in the first aspect or any possible implementation of the first aspect. Specifically, the resource management device includes a module or unit for executing the method in the first aspect or any possible implementation of the first aspect, such as: a receiving unit, a first processing unit, and a second processing unit.
本申请第六方面提供一种资源管理装置,用于执行上述第二方面或第二方面的任意可能的实现方式中的方法。具体地,该资源管理装置包括用于执行上述第二方面或第二方面的任意可能的实现方式中的方法的模块或单元,如:第一处理单元和第二处理单元。In a sixth aspect of the present application, a resource management device is provided for executing the method in the second aspect or any possible implementation of the second aspect. Specifically, the resource management device includes a module or unit for executing the method in the second aspect or any possible implementation of the second aspect, such as a first processing unit and a second processing unit.
本申请第七方面,提供了一种资源管理装置。该资源管理装置可以包括至少一个处理器、存储器和通信接口。处理器与存储器和通信接口耦合。存储器用于存储指令,处理器用于执行该指令,通信接口用于在处理器的控制下与其他网元进行通信。该指令在被处理 器执行时,使处理器执行第一方面或第一方面的任意可能的实现方式中的方法。In a seventh aspect of the present application, a resource management device is provided. The resource management device may include at least one processor, a memory, and a communication interface. The processor is coupled to the memory and the communication interface. The memory is used to store instructions, the processor is used to execute the instructions, and the communication interface is used to communicate with other network elements under the control of the processor. When the instructions are executed by the processor, the processor executes the method in the first aspect or any possible implementation of the first aspect.
本申请第八方面,提供了一种资源管理装置。该资源管理装置可以包括至少一个处理器、存储器和通信接口。处理器与存储器和通信接口耦合。存储器用于存储指令,处理器用于执行该指令,通信接口用于在处理器的控制下与其他网元进行通信。该指令在被处理器执行时,使处理器执行第二方面或第二方面的任意可能的实现方式中的方法。In an eighth aspect of the present application, a resource management device is provided. The resource management device may include at least one processor, a memory, and a communication interface. The processor is coupled to the memory and the communication interface. The memory is used to store instructions, the processor is used to execute the instructions, and the communication interface is used to communicate with other network elements under the control of the processor. When the instructions are executed by the processor, the processor executes the method in the second aspect or any possible implementation of the second aspect.
本申请第九方面提供了一种芯片系统,该芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从资源管理装置的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,资源管理装置执行前述第一方面或第一方面的任意可能的实现方式中的方法。In the ninth aspect of the present application, a chip system is provided, which includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected through lines; the interface circuits are used to receive signals from the memory of the resource management device and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the resource management device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.
本申请第十方面提供了一种芯片系统,该芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从资源管理装置的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,资源管理装置执行前述第二方面或第二方面的任意可能的实现方式中的方法。The tenth aspect of the present application provides a chip system, which includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected by lines; the interface circuit is used to receive signals from the memory of the resource management device and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the resource management device executes the method in the aforementioned second aspect or any possible implementation of the second aspect.
本申请第十一方面提供了一种计算机可读存储介质,其上存储有计算机程序或指令,当计算机程序或指令在计算机设备上运行时,使得计算机设备执行前述第一方面或第一方面的任意可能的实现方式中的方法。The eleventh aspect of the present application provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed on a computer device, the computer device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.
本申请第十二方面提供了一种计算机可读存储介质,其上存储有计算机程序或指令,当计算机程序或指令在计算机设备上运行时,使得计算机设备执行前述第二方面或第二方面的任意可能的实现方式中的方法。A twelfth aspect of the present application provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed on a computer device, the computer device executes the method in the aforementioned second aspect or any possible implementation of the second aspect.
本申请第十三方面提供了一种计算机设备程序产品,该计算机设备程序产品包括计算机设备程序代码,当计算机设备程序代码在计算机设备上执行时,使得计算机设备执行前述第一方面或第一方面的任意可能的实现方式中的方法。The thirteenth aspect of the present application provides a computer device program product, which includes a computer device program code. When the computer device program code is executed on a computer device, the computer device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.
本申请第十四方面提供了一种计算机设备程序产品,该计算机设备程序产品包括计算机设备程序代码,当计算机设备程序代码在计算机设备上执行时,使得计算机设备执行前述第二方面或第二方面的任意可能的实现方式中的方法。A fourteenth aspect of the present application provides a computer device program product, which includes a computer device program code. When the computer device program code is executed on a computer device, the computer device executes the method in the aforementioned second aspect or any possible implementation of the second aspect.
本申请第十五方面提供了一种资源管理系统,包括资源管理装置和多个资源节点,其中,资源管理装置用于前述第一方面或第一方面的任意可能的实现方式中的方法。A fifteenth aspect of the present application provides a resource management system, including a resource management device and multiple resource nodes, wherein the resource management device is used in the method in the aforementioned first aspect or any possible implementation of the first aspect.
本申请第十六方面提供了一种资源管理系统,包括资源管理装置和多个资源节点,其中,资源管理装置用于前述第二方面或第二方面的任意可能的实现方式中的方法。A sixteenth aspect of the present application provides a resource management system, including a resource management device and multiple resource nodes, wherein the resource management device is used in the method in the aforementioned second aspect or any possible implementation of the second aspect.
其中,第二方面至第十六方面或者其中任一种可能实现方式所带来的技术效果可参见第一方面或第一方面不同可能实现方式所带来的技术效果,此处不再赘述。Among them, the technical effects brought about by the second to sixteenth aspects or any possible implementation methods thereof can refer to the technical effects brought about by the first aspect or different possible implementation methods of the first aspect, and will not be repeated here.
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
图1A是本申请实施例提供的资源管理系统的一架构示意图;FIG1A is a schematic diagram of an architecture of a resource management system provided in an embodiment of the present application;
图1B是本申请实施例提供的云服务系统的一架构示意图;FIG1B is a schematic diagram of an architecture of a cloud service system provided in an embodiment of the present application;
图1C是本申请实施例提供的数据中心的一架构示意图;FIG1C is a schematic diagram of an architecture of a data center provided in an embodiment of the present application;
图2是本申请实施例提供的资源管理装置的一结构示意图;FIG2 is a schematic diagram of a structure of a resource management device provided in an embodiment of the present application;
图3是本申请实施例提供的资源管理方法的一实施例示意图;FIG3 is a schematic diagram of an embodiment of a resource management method provided in an embodiment of the present application;
图4是本申请实施例提供的层级化分组过程的一示例示意图;FIG4 is a schematic diagram of an example of a hierarchical grouping process provided by an embodiment of the present application;
图5A是本申请实施例提供的层级化分组关系的一示例示意图;FIG5A is a schematic diagram showing an example of a hierarchical grouping relationship provided by an embodiment of the present application;
图5B是本申请实施例提供的层级化分组关系另一示例示意图;FIG5B is another exemplary schematic diagram of a hierarchical grouping relationship provided in an embodiment of the present application;
图5C是本申请实施例提供的层级化分组关系另一示例示意图;FIG5C is another exemplary schematic diagram of a hierarchical grouping relationship provided in an embodiment of the present application;
图6是本申请实施例提供的资源管理方法的一实施例示意图;FIG6 is a schematic diagram of an embodiment of a resource management method provided in an embodiment of the present application;
图7A是本申请实施例提供的资源管理方法的一场景示例的示意图;FIG7A is a schematic diagram of a scenario example of a resource management method provided in an embodiment of the present application;
图7B是本申请实施例提供的更新后的链表的一示意图;FIG7B is a schematic diagram of an updated linked list provided in an embodiment of the present application;
图8A是本申请实施例提供的资源管理方法的另一场景示例的示意图;FIG8A is a schematic diagram of another scenario example of the resource management method provided in an embodiment of the present application;
图8B是本申请实施例提供的更新后的二叉树的一示意图;FIG8B is a schematic diagram of an updated binary tree provided in an embodiment of the present application;
图9是本申请实施例提供的资源管理装置的另一结构示意图;FIG9 is another schematic diagram of the structure of the resource management device provided in an embodiment of the present application;
图10是本申请实施例提供的资源管理装置的另一结构示意图。FIG. 10 is another schematic diagram of the structure of the resource management device provided in an embodiment of the present application.
本申请实施例提供一种资源管理方法,用于降低资源碎片化,提高资源分配率。本申请还提供了相应装置、计算机可读存储介质,以及计算机程序产品等。以下分别进行详细说明。The embodiment of the present application provides a resource management method for reducing resource fragmentation and improving resource allocation rate. The present application also provides a corresponding device, a computer-readable storage medium, and a computer program product, etc. The following are detailed descriptions.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
图1A为本申请实施例提供的资源管理系统的一结构示意图。FIG. 1A is a schematic diagram of a structure of a resource management system provided in an embodiment of the present application.
如图1A所示,该资源管理系统包括资源管理装置和多个资源节点,资源管理装置可以管理多个资源节点。资源管理装置可以根据多个资源节点之间的拓扑关系,对多个资源节点按照层级进行分组,以得到多个资源节点的层级化分组关系。层级化分组关系是按层级划分多个资源节点得到,层级化分组关系包括多个层级,其中,每个层级都对应多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。As shown in FIG1A , the resource management system includes a resource management device and a plurality of resource nodes, and the resource management device can manage the plurality of resource nodes. The resource management device can group the plurality of resource nodes according to the topological relationship between the plurality of resource nodes according to the hierarchy to obtain a hierarchical grouping relationship of the plurality of resource nodes. The hierarchical grouping relationship is obtained by dividing the plurality of resource nodes according to the hierarchy, and the hierarchical grouping relationship includes a plurality of hierarchies, wherein each hierarchy corresponds to a plurality of resource nodes, and the number of groups at different hierarchies is different, and each group at the same hierarchy corresponds to the same number of resource nodes.
资源管理装置会保存多个资源节点的层级化分组关系。在接收到资源请求后,可以根据资源请求获得至少两个子请求(如:图1A中的子请求1和子请求2),然后根据资源管理信息中的多个资源节点的层级化分组关系为每个子请求分配资源节点,如:为子请求1分配节点标识为X的一个资源节点,为子请求2分配节点标识为P至Q的至少两个资源节点。The resource management device saves the hierarchical grouping relationship of multiple resource nodes. After receiving a resource request, at least two sub-requests (such as sub-request 1 and sub-request 2 in FIG. 1A ) can be obtained according to the resource request, and then resource nodes are allocated to each sub-request according to the hierarchical grouping relationship of multiple resource nodes in the resource management information, such as: a resource node with a node identifier of X is allocated to sub-request 1, and at least two resource nodes with node identifiers of P to Q are allocated to sub-request 2.
图1A中的资源管理装置可以为独立的设备,也可以集成在资源管理系统的控制平台上,或者集成在某个资源节点上。The resource management device in FIG. 1A may be an independent device, or may be integrated on a control platform of a resource management system, or may be integrated on a certain resource node.
资源管理装置的功能可以通过软件或硬件来实现。The functions of the resource management device can be implemented by software or hardware.
资源管理装置作为软件功能单元的一种举例,资源管理装置可以包括运行在计算实例 上的代码。其中,计算实例可以包括物理主机(计算设备)、虚拟机、容器中的至少一种。进一步地,上述计算实例可以是一台或者多台。例如,资源管理装置可以包括运行在多个主机/虚拟机/容器上的代码。需要说明的是,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的区域(region)中,也可以分布在不同的region中。进一步地,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的可用区(availability zone,AZ)中,也可以分布在不同的AZ中,每个AZ包括一个数据中心或多个地理位置相近的数据中心。其中,通常一个region可以包括多个AZ。As an example of a software functional unit, the resource management device may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the resource management device may include code running on multiple hosts/virtual machines/containers. It should be noted that the multiple hosts/virtual machines/containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts/virtual machines/containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with close geographical locations. Generally, a region may include multiple AZs.
同样,用于运行该代码的多个主机/虚拟机/容器可以分布在同一个虚拟私有云(virtual private cloud,VPC)中,也可以分布在多个VPC中。其中,通常一个VPC设置在一个区域内,同一区域内两个VPC之间,以及不同区域的VPC之间跨区通信需在每个VPC内设置通信网关,经通信网关实现VPC之间的互连。Similarly, multiple hosts/virtual machines/containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in one region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
资源管理装置作为硬件功能单元的一种举例,资源管理装置可以包括至少一个计算设备,如服务器等。或者,资源管理装置也可以是利用专用集成电路(application-specific integrated circuit,ASIC)实现、或可编程逻辑器件(programmable logic device,PLD)实现的设备等。其中,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD)、现场可编程门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合实现。As an example of a hardware functional unit, the resource management device may include at least one computing device, such as a server, etc. Alternatively, the resource management device may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
资源管理装置包括的多个计算设备可以分布在相同的区域中,也可以分布在不同的区域中。资源管理装置包括的多个计算设备可以分布在相同的AZ中,也可以分布在不同的AZ中。同样,资源管理装置包括的多个计算设备可以分布在同一个VPC中,也可以分布在多个VPC中。其中,所述多个计算设备可以是服务器、ASIC、PLD、CPLD、FPGA和GAL等计算设备的任意组合。The multiple computing devices included in the resource management device can be distributed in the same area or in different areas. The multiple computing devices included in the resource management device can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the resource management device can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
本申请实施例提供的资源管理系统可以为云服务系统,在云服务系统中,如图1B所示,云服务系统包括云平台和基础资源。云平台包括云平台管理器,图1A中的资源管理装置可以为图1B中的云平台管理器。基础资源可以包括多个服务器,其中,每个服务器都可以包括多个资源节点。The resource management system provided in the embodiment of the present application may be a cloud service system. In the cloud service system, as shown in FIG1B , the cloud service system includes a cloud platform and basic resources. The cloud platform includes a cloud platform manager, and the resource management device in FIG1A may be the cloud platform manager in FIG1B . The basic resources may include multiple servers, each of which may include multiple resource nodes.
在图1B中的资源节点可以是计算设备卡或者虚拟机(virtual machine,VM)。其中,计算设备卡可以是中央处理器(central processing unit,CPU)、图形处理器(graphic processing unit GPU)和神经网络处理器(network processing unit,NPU)中的至少一种。The resource node in FIG1B may be a computing device card or a virtual machine (VM). The computing device card may be at least one of a central processing unit (CPU), a graphics processing unit (GPU), and a neural network processor (NPU).
其中,每个服务器中的多个资源节点在按照层级进行分组时,如果该层级有至少两个分组,那么每个分组对应的资源节点都可以构成通信环。通信环指的是至少两个资源节点之间首尾相连形成的环。即数据在一个资源节点上被发送后,可以遍历环中的所有其他的资源节点,最终回到初始的资源节点。本申请在对资源节点进行多层级分组时,不再依赖于高速串行计算机扩展总线(peripheral component interconnect express,PCIe)架构的组织方式,按照通信环进行划分,和硬件的互联架构解耦,兼容当前主流架构,通用性强。Among them, when multiple resource nodes in each server are grouped according to the hierarchy, if there are at least two groups in the hierarchy, then the resource nodes corresponding to each group can form a communication ring. A communication ring refers to a ring formed by at least two resource nodes connected end to end. That is, after the data is sent on a resource node, it can traverse all other resource nodes in the ring and finally return to the initial resource node. When the present application performs multi-level grouping of resource nodes, it no longer relies on the organization of the high-speed serial computer expansion bus (peripheral component interconnect express, PCIe) architecture, but is divided according to the communication ring, decoupled from the hardware interconnection architecture, compatible with the current mainstream architecture, and has strong versatility.
另外,每个服务器中的资源节点通过多层级分组都可以得到一个或多个层级化分组关系,如:一台服务器中包括8个GPU、8个NPU和8个CPU,则8个GPU可以得到一个层级化分组关系,8个NPU可以得到一个层级化分组关系,8个CPU可以得到一个层级化分组关系,若GPU、NPU和CPU之间也有连接,可以形成通信环,GPU、NPU和CPU组合也可以得到层级化分组关系,只要不同的层级化分组关系中对应的计算设备卡不重复即可。In addition, the resource nodes in each server can obtain one or more hierarchical grouping relationships through multi-level grouping. For example, if a server includes 8 GPUs, 8 NPUs and 8 CPUs, the 8 GPUs can obtain a hierarchical grouping relationship, the 8 NPUs can obtain a hierarchical grouping relationship, and the 8 CPUs can obtain a hierarchical grouping relationship. If there is a connection between the GPU, NPU and CPU, a communication ring can be formed. The combination of GPU, NPU and CPU can also obtain a hierarchical grouping relationship, as long as the corresponding computing device cards in different hierarchical grouping relationships are not repeated.
云平台调度器中会维护资源管理信息,该资源管理信息可以包括每个服务器中的一个或多个层级化分组关系。如果将该云服务系统中的服务器理解为是一个集群,则每个层级化分组关系用于表示不同集群中的多个资源节点的层级化分组,或者表示同一个集群中,不同子集中的多个资源节点的层级化分组。The cloud platform scheduler maintains resource management information, which may include one or more hierarchical grouping relationships in each server. If the server in the cloud service system is understood as a cluster, each hierarchical grouping relationship is used to represent the hierarchical grouping of multiple resource nodes in different clusters, or the hierarchical grouping of multiple resource nodes in different subsets in the same cluster.
在云服务系统中,资源请求可以是租户通过终端设备发送到云服务系统的,租户可以是资源使用方。In a cloud service system, a resource request may be sent by a tenant to the cloud service system through a terminal device, and the tenant may be a resource user.
云平台管理器接收到资源请求后,可以根据资源请求获得至少两个子请求,然后为根据层级化分组关系为每个子请求分配资源节点。After receiving the resource request, the cloud platform manager can obtain at least two sub-requests according to the resource request, and then allocate a resource node to each sub-request according to the hierarchical grouping relationship.
本申请实施例提供的资源管理系统可以为数据中心,在数据中心中,如图1C所示,数据中心包括数据中心管理平台、数据中心内部网络和多个服务器。其中,每个服务器都包括硬件层和软件层,硬件层包括内存、网卡、处理器和磁盘,内存、网卡、处理器和磁盘通过总线连接。硬件层为软件层的虚拟机提供运行所需的硬件资源。软件层包括宿主机操作系统和多个虚拟机,宿主机操作系统可以包括数据中心管理平台客户端,可以与数据中心管理平台交互。The resource management system provided in the embodiment of the present application can be a data center. In the data center, as shown in FIG1C , the data center includes a data center management platform, an internal network of the data center, and multiple servers. Each server includes a hardware layer and a software layer. The hardware layer includes a memory, a network card, a processor, and a disk. The memory, the network card, the processor, and the disk are connected through a bus. The hardware layer provides the hardware resources required for the operation of the virtual machines in the software layer. The software layer includes a host operating system and multiple virtual machines. The host operating system may include a data center management platform client, which can interact with the data center management platform.
虚拟化技术,其主要由计算虚拟化、输入/输出(input/output,I/O)虚拟化组成,它以虚拟机为粒度将一台物理服务器共享给多个租户使用,使租户能在安全隔离的前提下方便灵活地使用物理资源,并且能极大提升物理资源的利用率。Virtualization technology mainly consists of computing virtualization and input/output (I/O) virtualization. It shares a physical server with multiple tenants at the granularity of virtual machines, allowing tenants to use physical resources conveniently and flexibly under the premise of secure isolation, and can greatly improve the utilization rate of physical resources.
计算虚拟化是将服务器的处理器和内存等计算资源提供给虚拟实例使用,虚拟实例例如为虚拟机,在其他场景中,虚拟实例为容器、裸金属服务器。Computing virtualization is the process of providing computing resources such as the server's processor and memory to virtual instances. For example, virtual instances are virtual machines. In other scenarios, virtual instances are containers and bare metal servers.
图1C中每个服务器通过虚拟化技术得到多个虚拟机,每个虚拟机可以理解为是一个资源节点。图1A中的资源管理装置可以为图1C中的数据中心管理平台。In Fig. 1C, each server obtains multiple virtual machines through virtualization technology, and each virtual machine can be understood as a resource node. The resource management device in Fig. 1A can be the data center management platform in Fig. 1C.
其中,虚拟机也可称为云服务器(Elastic Compute Service,ECS)、弹性实例(不同的云服务提供商有不同的叫法)。Among them, virtual machines can also be called cloud servers (Elastic Compute Service, ECS) and elastic instances (different cloud service providers have different names).
其中,每个服务器中的多个虚拟机都可以按照层级进行分组时,得到层级化分组关系,用于在后续租户请求资源时使用。Among them, when multiple virtual machines in each server can be grouped according to levels, a hierarchical grouping relationship is obtained for use when subsequent tenants request resources.
数据中心管理平台可以提供访问接口(如界面或应用程序变成接口(application programming interface,API)),租户可操作客户端远程接入访问接口在数据中心管理平台注册账号和密码,并登录数据中心管理平台。数据中心管理平台对账号和密码鉴权成功后,租户可以通过客户端向数据中心管理平台发送资源请求,然后根据资源请求获得至少两个子请求,根据数据中心管理平台中保存的层级化分组关系为子请求分配虚拟机。如为子请求1分为虚拟机1的标识,为子请求2分配虚拟机2的标识。The data center management platform can provide an access interface (such as an interface or an application programming interface (API)). The tenant can operate the client remote access access interface to register an account and password in the data center management platform and log in to the data center management platform. After the data center management platform successfully authenticates the account and password, the tenant can send a resource request to the data center management platform through the client, and then obtain at least two sub-requests based on the resource request, and allocate virtual machines to the sub-requests based on the hierarchical grouping relationship stored in the data center management platform. For example, the identifier of virtual machine 1 is allocated to sub-request 1, and the identifier of virtual machine 2 is allocated to sub-request 2.
另外,本申请实施例提供的资源管理系统可以为网络系统,在网络系统中,网络系统 中的资源节点为网络装置,网络装置可以是防火墙、路由器和交换机中的至少一种。In addition, the resource management system provided in the embodiment of the present application can be a network system. In the network system, the resource nodes in the network system are network devices, and the network devices can be at least one of a firewall, a router and a switch.
图2为本申请的实施例提供的资源管理装置的一种可能的逻辑结构示意图。如图2所示,本申请实施例提供的资源管理装置20包括:处理器201、通信接口202、存储器203以及总线204。处理器201、通信接口202以及存储器203通过总线204相互连接。在本申请的实施例中,处理器201用于对资源管理装置20的动作进行控制管理,例如,处理器201用于执行确定音频广告过程。通信接口202用于支持资源管理装置20进行通信,例如:通信接口202可以执行接收广告请求和发送音频广告的步骤。存储器203,用于存储资源管理装置20的程序代码和数据。FIG2 is a possible logical structure diagram of a resource management device provided in an embodiment of the present application. As shown in FIG2 , the resource management device 20 provided in an embodiment of the present application includes: a processor 201, a communication interface 202, a memory 203 and a bus 204. The processor 201, the communication interface 202 and the memory 203 are interconnected via the bus 204. In an embodiment of the present application, the processor 201 is used to control and manage the actions of the resource management device 20, for example, the processor 201 is used to execute the process of determining audio advertisements. The communication interface 202 is used to support the resource management device 20 to communicate, for example: the communication interface 202 can execute the steps of receiving advertisement requests and sending audio advertisements. The memory 203 is used to store the program code and data of the resource management device 20.
其中,处理器201可以是中央处理器单元,通用处理器,数字信号处理器,专用集成电路,现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理器和微处理器的组合等等。总线204可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图2中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Among them, the processor 201 can be a central processing unit, a general processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The bus 204 can be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in Figure 2, but it does not mean that there is only one bus or one type of bus.
下面对本申请实施例提供的资源管理方法进行描述。该方法中涉及到资源管理装置执行的内容可以由资源管理装置执行,也可以由资源管理装置的部件(例如处理器、芯片、或芯片系统等)执行。The resource management method provided by the embodiment of the present application is described below. The content involved in the method being executed by the resource management device can be executed by the resource management device, or by a component of the resource management device (such as a processor, chip, or chip system, etc.).
本申请实施例中,资源管理装置可以对资源管理系统中的资源节点进行管理,一种资源管理方案为:对多个资源节点进行多层级分组;另一种资源管理方案为:为资源请求分配资源节点。下面分别进行介绍:In the embodiment of the present application, the resource management device can manage the resource nodes in the resource management system. One resource management scheme is: multi-level grouping of multiple resource nodes; another resource management scheme is: allocating resource nodes to resource requests. The following are introduced respectively:
结合图1A至图1C所介绍的资源管理系统,关于对资源节点进行多层级分组的资源管理方案可以参阅图3进行理解。In conjunction with the resource management system introduced in FIG. 1A to FIG. 1C , the resource management solution for multi-level grouping of resource nodes can be understood by referring to FIG. 3 .
如图3所示,本申请实施例提供的资源管理方法的一实施例包括:As shown in FIG3 , an embodiment of the resource management method provided in the embodiment of the present application includes:
301.资源管理装置获取多个资源节点之间的拓扑关系,拓扑关系表示多个资源节点之间的通信关系。301. The resource management device obtains a topological relationship between multiple resource nodes, where the topological relationship represents a communication relationship between the multiple resource nodes.
302.资源管理装置根据多个资源节点之间的拓扑关系,对多个资源节点按照层级进行分组,以得到多个资源节点的层级化分组关系。302. The resource management device groups the multiple resource nodes according to the topological relationship between the multiple resource nodes to obtain a hierarchical grouping relationship of the multiple resource nodes.
层级化分组关系是按层级划分多个资源节点得到,层级化分组关系包括多个层级,其中,每个层级都对应多个资源节点,不同层级的分组数量不同,不同层级的分组对应的资源节点的数量不同,同一层级的每个分组对应资源节点的数量相同。The hierarchical grouping relationship is obtained by dividing multiple resource nodes according to the hierarchy. The hierarchical grouping relationship includes multiple levels, wherein each level corresponds to multiple resource nodes, different levels have different numbers of groups, and different levels of groups correspond to different numbers of resource nodes, while each group at the same level corresponds to the same number of resource nodes.
本申请中的资源管理装置在划分资源节点前可以获取资源节点的拓扑关系,如:以图1B所示的云服务系统为例,可以通过计算设备卡的硬件驱动提供的拓扑获取接口,获取单台服务器上的计算设备卡之间的互联拓扑状况。然后,资源管理装置可以按照拓扑关系对多个资源节点进行多层级的分组。多层级的分组指的是,在每个层级都对多个资源节点进 行分组,只是分组的数量不同。每个层级在分组时,可以以上一个层级为基础,采用二分法进行分组,直到每个分组对应一个资源节点,结束资源节点的划分。The resource management device in the present application can obtain the topological relationship of the resource nodes before dividing the resource nodes. For example, taking the cloud service system shown in FIG. 1B as an example, the interconnection topology between the computing device cards on a single server can be obtained through the topology acquisition interface provided by the hardware driver of the computing device card. Then, the resource management device can group multiple resource nodes in multiple levels according to the topological relationship. Multi-level grouping means that multiple resource nodes are grouped at each level, but the number of groups is different. When grouping at each level, the dichotomy method can be used as the basis for the previous level until each group corresponds to a resource node, and the division of the resource nodes is ended.
以有8个资源节点为例,从上层到下层的顺序分组中,最上层级可以有1个分组,对应这8个资源节点。接下来的层级可以将上层分组对应的8个资源节点等分成2个分组,每个分组对应4个资源节点。再接下来的层级可以将上层2个分组各自对应的4个资源节点再各自等分成2个分组,得到4个分组,每个分组对应2个资源节点。再接下来的层级可以将上层对应2个资源节点的4个分组再做二等分,得到8个分组,每个分组对应1个资源节点。该分组过程可以参阅图4进行理解。Taking 8 resource nodes as an example, in the sequential grouping from the upper layer to the lower layer, the top layer can have 1 group corresponding to these 8 resource nodes. The next layer can divide the 8 resource nodes corresponding to the upper layer group into 2 groups, each of which corresponds to 4 resource nodes. The next layer can divide the 4 resource nodes corresponding to each of the 2 upper layer groups into 2 groups, obtaining 4 groups, each of which corresponds to 2 resource nodes. The next layer can divide the 4 groups corresponding to the 2 resource nodes in the upper layer into 2 groups, obtaining 8 groups, each of which corresponds to 1 resource node. The grouping process can be understood by referring to Figure 4.
如图4所示,以一台服务器中有8个资源节点为例,分别为资源节点0、资源节点1,…,资源节点7。若资源节点0、资源节点1、资源节点2和资源节点3可以形成通信环,资源节点4、资源节点5、资源节点6和资源节点7可以形成通信环,则可以将8个资源节点划分为2个分组,每个分组对应4个资源节点。然后再将对应4个资源节点的每个分组进行划分,若资源节点0和资源节点1可以形成通信环,资源节点2和资源节点3可以形成通信环,则将资源节点0和资源节点1划分到一个分组,资源节点2和资源节点3划分到一个分组。同理,对应资源节点4、资源节点5、资源节点6和资源节点7的分组也可以作此划分,将资源节点4和资源节点5划分到一个分组,资源节点6和资源节点7划分到一个分组。然后,在针对对应2个资源节点的4个分组再次进行划分,将每个资源节点都单独划分为一个分组,划分结束。As shown in Figure 4, take a server with 8 resource nodes as an example, namely resource node 0, resource node 1, ..., resource node 7. If resource node 0, resource node 1, resource node 2 and resource node 3 can form a communication ring, resource node 4, resource node 5, resource node 6 and resource node 7 can form a communication ring, then the 8 resource nodes can be divided into 2 groups, each group corresponding to 4 resource nodes. Then divide each group corresponding to the 4 resource nodes, if resource node 0 and resource node 1 can form a communication ring, resource node 2 and resource node 3 can form a communication ring, then resource node 0 and resource node 1 are divided into one group, and resource node 2 and resource node 3 are divided into one group. Similarly, the group corresponding to resource node 4, resource node 5, resource node 6 and resource node 7 can also be divided in this way, resource node 4 and resource node 5 are divided into one group, and resource node 6 and resource node 7 are divided into one group. Then, divide again for the 4 groups corresponding to the 2 resource nodes, and divide each resource node into a group separately, and the division ends.
以上所列举的8个资源节点在划分后,得到的层级化分组关系中可以包括4个层级,这4个层级的分组数量可以依次为1、2、4和8。一个层级有1个分组时,这一个分组对应8个资源节点。一个层级有2个分组时,每个分组各对应4个资源节点。一个层级有4个分组时,每个分组各对应2个资源节点。After the 8 resource nodes listed above are divided, the resulting hierarchical grouping relationship can include 4 levels, and the number of groups in these 4 levels can be 1, 2, 4, and 8 respectively. When a level has 1 group, this group corresponds to 8 resource nodes. When a level has 2 groups, each group corresponds to 4 resource nodes. When a level has 4 groups, each group corresponds to 2 resource nodes.
需要说明的是,在划分资源节点时,不一定是对8个资源节点做划分,也可以对其他数量的资源节点做划分,所以,划分后得到的层级化分组关系中层级的数量,以及每个层级中的分组对应的资源节点的数量不限于上述示例的8个资源节点的方式,如:有6个资源节点时,可以有3个层级、这3个层级分组数量可以依次为1、2和6。一个层级有一个分组时,这一个分组对应6个资源节点。一个层级有2个分组时,每个分组各对应3个资源节点。一个层级有6个分组时,每个分组各对应1个资源节点。It should be noted that when dividing resource nodes, it is not necessary to divide them into 8 resource nodes, and other numbers of resource nodes can also be divided. Therefore, the number of levels in the hierarchical grouping relationship obtained after the division, and the number of resource nodes corresponding to the groups in each level are not limited to the 8 resource nodes in the above example. For example, when there are 6 resource nodes, there can be 3 levels, and the number of groups in these 3 levels can be 1, 2 and 6 respectively. When a level has one group, this group corresponds to 6 resource nodes. When a level has 2 groups, each group corresponds to 3 resource nodes. When a level has 6 groups, each group corresponds to 1 resource node.
上述列举的示例都是采用二分法的形式对多个资源节点进行分组,如果资源节点的数量是奇数,不能直接二等分,可以先通过一次划分将大部分资源节点划分到一组,使该组中的资源节点数量是偶数或者符合2的指数幂个,针对该组的后续划分可以采用二分法的形式,如:一个资源集群包括17个资源节点,第一次划分时,可以划分出16个到一组,然后针对该组的16个资源节点采用二分法的方式进行后续划分。The examples listed above all use binary search to group multiple resource nodes. If the number of resource nodes is an odd number and cannot be directly divided into two equal parts, most of the resource nodes can be divided into one group through a single division so that the number of resource nodes in the group is an even number or an exponential power of 2. The subsequent division of the group can be carried out in the form of binary search. For example, a resource cluster includes 17 resource nodes. During the first division, 16 of them can be divided into one group, and then the 16 resource nodes in the group can be subsequently divided by binary search.
上述图4所示例的多层级分组的过程是在每个分组的至少两个资源节点以构成通信环为前提划分的,这样,在对资源节点进行多层级分组时,不再依赖于高速串行计算机扩展总线(peripheral component interconnect express,PCIe)架构的组织方式,按照通信环进行划分,和硬件的互联架构解耦,兼容当前主流架构,通用性强。The multi-level grouping process illustrated in the above FIG4 is divided on the premise that at least two resource nodes in each group form a communication ring. In this way, when performing multi-level grouping of resource nodes, it is no longer dependent on the organization of the high-speed serial computer expansion bus (peripheral component interconnect express, PCIe) architecture. Instead, it is divided according to the communication ring, decoupled from the hardware interconnection architecture, compatible with the current mainstream architecture, and highly versatile.
需要说明的是,本申请实施例中,即使一个分组中的资源节点不能组成通信环,也可以采用上述多层级的分组方式得到层级化分组关系,根据层级化分组关系管理资源节点,可以提高资源节点管理的效率,有利于在收到资源请求后,可以快速的为资源请求分配资源节点。It should be noted that in an embodiment of the present application, even if the resource nodes in a group cannot form a communication ring, the above-mentioned multi-level grouping method can be used to obtain a hierarchical grouping relationship. Managing the resource nodes according to the hierarchical grouping relationship can improve the efficiency of resource node management, which is conducive to quickly allocating resource nodes to resource requests after receiving resource requests.
当按照满足构成通信环的条件分组时,同一层级的不同分组对应的通信环的带宽之和相同,通信环的带宽为构成通信环的资源节点之间通信带宽之和。如:通信环包括4个资源节点,其中,资源节点1和资源节点2之间的带宽是10M,资源节点2和资源节点3之间的带宽是10M,资源节点3和资源节点4之间的带宽是10M,资源节点4和资源节点1之间的带宽是10M,则该通信环的带宽之和=10+10+10+10=40M。资源节点划分时形成的通信环的带宽之和一致,避免了非对称的互联拓扑架构的场景下通信环性能不一致的情况。When grouping according to the conditions for forming a communication ring, the sum of the bandwidths of the communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of the communication bandwidths between the resource nodes that constitute the communication ring. For example: the communication ring includes 4 resource nodes, among which the bandwidth between resource node 1 and resource node 2 is 10M, the bandwidth between resource node 2 and resource node 3 is 10M, the bandwidth between resource node 3 and resource node 4 is 10M, and the bandwidth between resource node 4 and resource node 1 is 10M, then the sum of the bandwidth of the communication ring = 10+10+10+10 = 40M. The sum of the bandwidths of the communication rings formed when the resource nodes are divided is consistent, which avoids the situation where the performance of the communication ring is inconsistent in the scenario of an asymmetric interconnection topology architecture.
可选地,本申请实施例中,同一层级的通信环的带宽之和是至少两个第一带宽和中最大的,其中,第一带宽和是多个资源节点按照同一层级的分组对应资源节点的数量,进行不同组合时得到的通信环的带宽之和。也就是说,若对同一层级对应的资源节点有多种组合成通信环的方式时,选择通信环的带宽之和最大的组合方式。例如:若资源节点0、资源节点1、资源节点2和资源节点3可以组成通信环,该种组合方式时,通信环的带宽为40M,资源节点0、资源节点1、资源节点2和资源节点5也可以组成通信环,该种组合方式时,通信环的带宽为35M,则选择资源节点0、资源节点1、资源节点2和资源节点3划分到一个分组的组合方式。Optionally, in an embodiment of the present application, the sum of the bandwidths of the communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when multiple resource nodes are grouped in accordance with the number of resource nodes corresponding to the same level and are combined in different ways. In other words, if there are multiple ways to combine the resource nodes corresponding to the same level into a communication ring, select the combination method with the largest sum of the bandwidths of the communication ring. For example: if resource node 0, resource node 1, resource node 2, and resource node 3 can form a communication ring, in this combination method, the bandwidth of the communication ring is 40M, resource node 0, resource node 1, resource node 2, and resource node 5 can also form a communication ring, in this combination method, the bandwidth of the communication ring is 35M, then select a combination method in which resource node 0, resource node 1, resource node 2, and resource node 3 are divided into one group.
可选地,本申请实施例提供的层级化分组关系可以采用链表的形式记录,或者采用二叉树的形式记录,下面分别进行介绍。Optionally, the hierarchical grouping relationship provided in the embodiment of the present application may be recorded in the form of a linked list or in the form of a binary tree, which are respectively introduced below.
一、层级化分组关系采用链表的形式记录。1. The hierarchical grouping relationship is recorded in the form of a linked list.
如图4所示的8个资源节点的层级化分组关系可以参阅图5A进行理解。The hierarchical grouping relationship of the eight resource nodes shown in FIG. 4 can be understood by referring to FIG. 5A .
如图5A所示,按照资源节点从少到多的顺序,上述图4中的8个资源节点可以划分为4个层级,这4个层级按照从下到上的顺序可以依次记录为层级1、层级2、层级3和层级4。当然,层级的顺序也可以反过来记录,图5A中只是以从下到上的顺序为例进行说明。其中,层级1的每个分组对应1个资源节点,层级2的每个分组对应2个资源节点,层级3的每个分组对应4个资源节点,层级4的1个分组对应8个资源节点。As shown in FIG5A, according to the order of resource nodes from few to many, the 8 resource nodes in FIG4 can be divided into 4 levels, and these 4 levels can be recorded in order from bottom to top as level 1, level 2, level 3 and level 4. Of course, the order of the levels can also be recorded in reverse, and FIG5A is only used as an example to illustrate the order from bottom to top. Among them, each group of level 1 corresponds to 1 resource node, each group of level 2 corresponds to 2 resource nodes, each group of level 3 corresponds to 4 resource nodes, and 1 group of level 4 corresponds to 8 resource nodes.
图5A所示的层级化分组关系通过链表的形式记录,每个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。资源节点的节点标识可以唯一标识该资源节点,例如:可以指示该资源节点在某个服务器上的某个位置,例如:服务器1中的计算设备卡1。The hierarchical grouping relationship shown in FIG5A is recorded in the form of a linked list, and the linked list of each level includes the node identifiers of the resource nodes contained in each group of the level, and the node identifiers of the resource nodes in different groups are different. The node identifier of the resource node can uniquely identify the resource node, for example, it can indicate a certain position of the resource node on a certain server, for example, computing device card 1 in server 1.
链表中还可以包括层级或者/和该层级中每个分组对应的资源节点的数量。链表可以包括表头和分组,表头可以用于记录层级,表头与分组,以及分组后分组之间可以通过指针连接。分组中可以用节点标识的个数来表示该分组对应资源节点的数量,当然,也可以在表头中记录每个分组对应的资源节点的数量。The linked list may also include the level or/and the number of resource nodes corresponding to each group in the level. The linked list may include a header and a group. The header may be used to record the level. The header and the group, as well as the groups after grouping, may be connected by pointers. The number of node identifiers in a group may be used to represent the number of resource nodes corresponding to the group. Of course, the number of resource nodes corresponding to each group may also be recorded in the header.
二、层级化分组关系采用二叉树的形式记录。2. The hierarchical grouping relationship is recorded in the form of a binary tree.
本申请实施例中的层级化分组关系还可以采用二叉树的形式记录。The hierarchical grouping relationship in the embodiment of the present application can also be recorded in the form of a binary tree.
二叉树是树形的数据存储结构,上层的节点可以分出两个叉。本申请中的层级化分组关系可以表示为二叉树的形式。还以8个资源节点为例,最顶端层级可以有1个分组,这1个分组对应8个资源节点。接下来的层级将最顶端层级的1个分组分成2个分组,每个分组对应4个资源节点。再接下来的层级,将上一层级每个分组分成2个分组,就得到4个分组,每个分组对应2个资源节点。再接下来的层级,将上一层级每个分组分成2个分组,就得到8个分组,每个分组对应1个资源节点,这个层级就成为最末端层级。A binary tree is a tree-shaped data storage structure, and the nodes in the upper layer can be divided into two forks. The hierarchical grouping relationship in this application can be expressed in the form of a binary tree. Taking 8 resource nodes as an example, the topmost layer can have 1 group, and this 1 group corresponds to 8 resource nodes. The next layer divides the 1 group of the topmost layer into 2 groups, each of which corresponds to 4 resource nodes. In the next layer, each group of the previous layer is divided into 2 groups, and 4 groups are obtained, each of which corresponds to 2 resource nodes. In the next layer, each group of the previous layer is divided into 2 groups, and 8 groups are obtained, each of which corresponds to 1 resource node, and this layer becomes the last layer.
本申请实施例中,8个资源节点的标识可以记录在最末端层级的分组中,也可以在每个层级的分组中都记录。可以分别参阅图5B和图5C进行理解。In the embodiment of the present application, the identifiers of the eight resource nodes may be recorded in the group at the end level, or may be recorded in the group at each level. Please refer to FIG. 5B and FIG. 5C for understanding.
1.资源节点的标识记录在最末端层级的分组中。1. The identification of the resource node is recorded in the group at the end level.
8个资源节点的节点标识可以都记录在最末端层级的分组中,如图5B所示,二叉树的最末端层级(层级1)的每个分组包括一个资源节点的节点标识,分别为节点标识0,…节点标识7,不同分组中的节点标识不同;上层层级(层级2、层级3、层级4)的分组中包括上层层级的分组与最末端层级的分组的关联关系(该关联关系可以通过图5B中上层层级与下层层级之间的箭头关系来表示),其中,上层层级为最末端层级之上的任意一个层级。最末端层级之上的上层层级的分组中可以记录对应的资源节点的数量,如图5B中,层级2的分组中记录有对应的资源节点数量2,层级3的分组中记录有对应的资源节点数量4,层级4的分组中记录有对应的资源节点数量8。The node identifiers of the eight resource nodes can all be recorded in the grouping of the last level. As shown in FIG5B , each grouping of the last level (level 1) of the binary tree includes a node identifier of a resource node, which are node identifiers 0, ... node identifiers 7, respectively, and the node identifiers in different groups are different; the grouping of the upper levels (level 2, level 3, level 4) includes the association relationship between the grouping of the upper levels and the grouping of the last level (the association relationship can be represented by the arrow relationship between the upper level and the lower level in FIG5B ), wherein the upper level is any level above the last level. The number of corresponding resource nodes can be recorded in the grouping of the upper levels above the last level. As shown in FIG5B , the number of corresponding resource nodes 2 is recorded in the grouping of level 2, the number of corresponding resource nodes 4 is recorded in the grouping of level 3, and the number of corresponding resource nodes 8 is recorded in the grouping of level 4.
2.资源节点的标识记录每个层级的分组中。2. The identification of the resource node is recorded in each level of grouping.
8个资源节点的节点标识可以都记录在每个层级的分组中,如图5C所示,二叉树的最末端层级(层级1)的每个分组包括一个资源节点的节点标识,分别为节点标识0,…节点标识7,不同分组中的节点标识不同。层级2的4个分组中分别记录有节点标识0、1,节点标识2、3,节点标识4、5,节点标识6、7。层级3的2个分组中分别记录有节点标识0、1、2、3,以及节点标识4、5、6、7。层级4的1分组中记录有节点标识0、1、2、3、4、5、6、7。The node identifiers of the eight resource nodes can be recorded in the groups of each level. As shown in FIG5C , each group of the last level (level 1) of the binary tree includes a node identifier of a resource node, which are node identifiers 0, ..., and node identifiers 7, respectively. The node identifiers in different groups are different. The four groups of level 2 respectively record node identifiers 0, 1, node identifiers 2, 3, node identifiers 4, 5, and node identifiers 6, 7. The two groups of level 3 respectively record node identifiers 0, 1, 2, 3, and node identifiers 4, 5, 6, 7. The one group of level 4 records node identifiers 0, 1, 2, 3, 4, 5, 6, 7.
以上介绍了划分资源集群中的资源节点的资源管理方案,下面介绍为租户的资源请求分配资源节点的资源管理方案。The above describes a resource management solution for dividing resource nodes in a resource cluster. The following describes a resource management solution for allocating resource nodes to tenants' resource requests.
结合图1A至图1C所介绍的资源管理系统,关于为资源请求分配资源节点的资源管理方案可以参阅图6进行理解。In conjunction with the resource management system described in FIG. 1A to FIG. 1C , the resource management solution for allocating resource nodes to resource requests may be understood by referring to FIG. 6 .
如图6所示,本申请实施例提供的资源管理方法的一实施例包括:As shown in FIG6 , an embodiment of the resource management method provided in the embodiment of the present application includes:
601.资源管理装置接收资源请求,资源请求包括所请求资源节点的数量。601. The resource management device receives a resource request, where the resource request includes the number of requested resource nodes.
本申请中,资源请求可以是租户通过终端设备发送到云服务系统、数据中心或网络系统的。租户可以是资源使用方。In this application, a resource request can be sent by a tenant to a cloud service system, a data center, or a network system through a terminal device. A tenant can be a resource user.
所请求资源节点的数量可以理解为是租户请求的服务器的数量,租户请求的计算设备卡的数量等,如:租户请求5个计算设备卡,或者,租户请求8个计算设备卡。The number of resource nodes requested can be understood as the number of servers requested by the tenant, the number of computing device cards requested by the tenant, etc. For example, the tenant requests 5 computing device cards, or the tenant requests 8 computing device cards.
602.资源管理装置根据资源请求获得至少两个子请求,至少两个子请求各自对应的资源节点的数量之和为资源请求对应的资源节点的数量。602. The resource management device obtains at least two sub-requests according to the resource request, and the sum of the numbers of resource nodes corresponding to the at least two sub-requests is the number of resource nodes corresponding to the resource request.
如:资源请求对应的资源节点数量为5,根据资源请求获得子请求1和子请求2,子请 求1对应1个资源节点,子请求2对应4个资源节点,1+4=5。For example, the number of resource nodes corresponding to the resource request is 5. Sub-request 1 and sub-request 2 are obtained according to the resource request. Sub-request 1 corresponds to 1 resource node, and sub-request 2 corresponds to 4 resource nodes. 1+4=5.
603.资源管理装置根据资源管理信息,为每个子请求分配对应数量的资源节点,资源管理信息包括多个资源节点的层级化分组关系;其中,不同子请求对应的资源节点的数量,与层级化分组关系中同一层级或不同层级的一个或多个分组对应的资源节点的数量相匹配。603. The resource management device allocates a corresponding number of resource nodes to each sub-request based on the resource management information, and the resource management information includes a hierarchical grouping relationship of multiple resource nodes; wherein the number of resource nodes corresponding to different sub-requests matches the number of resource nodes corresponding to one or more groups at the same level or different levels in the hierarchical grouping relationship.
资源管理信息可以包括一个或多个层级化分组关系,每个层级化分组关系用于表示不同集群中的多个资源节点的层级化分组。在不同的应用场景中,集群所表示的含义可以不同,以云服务系统为例,若每台服务器中包括8个计算设备卡,则一台服务器为一个集群,8个计算设备卡为8个资源节点。不同的子请求对应数量的资源节点可以通过一个层级化分组关系来分配,也可以通过不同的层级化分组关系来分配,如:子请求1对应数量的资源节点是根据层级化分组关系1从服务器1中分配计算设备卡,子请求2对应数量的资源节点是根据层级化分组关系2从服务器2中分配计算设备卡。Resource management information may include one or more hierarchical grouping relationships, each hierarchical grouping relationship is used to represent the hierarchical grouping of multiple resource nodes in different clusters. In different application scenarios, the meaning of cluster may be different. Taking the cloud service system as an example, if each server includes 8 computing device cards, then one server is a cluster, and 8 computing device cards are 8 resource nodes. The number of resource nodes corresponding to different sub-requests can be allocated through a hierarchical grouping relationship, or through different hierarchical grouping relationships, such as: the number of resource nodes corresponding to sub-request 1 is allocated from server 1 according to hierarchical grouping relationship 1. The number of resource nodes corresponding to sub-request 2 is allocated from server 2 according to hierarchical grouping relationship 2.
本申请中,关于层级化分组关系可以参阅前面对资源节点分组部分的介绍进行理解。In this application, the hierarchical grouping relationship can be understood by referring to the previous introduction to the resource node grouping part.
本申请中,不同子请求对应的资源节点的数量与同一层级或不同层级的一个或多个分组对应的资源节点的数量相匹配指的是:若两个子请求对应的资源节点的数量相同,可以根据同一层级的不同分组对应的资源节点为这两个子请求分配资源节点。如:若两个子请求对应的资源节点的数量都是1,则可以从同一层级的两个不同分组为这两个子请求分配资源节点,如:为子请求1从第一个分组分配资源节点0,为子请求2从第二个分组分配资源节点1。In the present application, the number of resource nodes corresponding to different sub-requests matches the number of resource nodes corresponding to one or more groups at the same level or different levels, which means: if the number of resource nodes corresponding to two sub-requests is the same, resource nodes can be allocated to the two sub-requests according to the resource nodes corresponding to different groups at the same level. For example, if the number of resource nodes corresponding to two sub-requests is 1, resource nodes can be allocated to the two sub-requests from two different groups at the same level, such as: allocating resource node 0 from the first group to sub-request 1, and allocating resource node 1 from the second group to sub-request 2.
若两个子请求对应的资源节点的数量不同,则可以从不同层级的分组对应的资源节点为这两个子请求分配资源节点。如:子请求1对应的资源节点的数量是1,子请求2对应的资源节点的数量是4,则可以从层级1的第一个分组为子请求1分配资源节点0,为子请求2从层级3分配第二个分组的资源节点4、5、6、7。If the number of resource nodes corresponding to two sub-requests is different, resource nodes can be allocated to the two sub-requests from resource nodes corresponding to groups at different levels. For example, if the number of resource nodes corresponding to sub-request 1 is 1 and the number of resource nodes corresponding to sub-request 2 is 4, resource node 0 can be allocated to sub-request 1 from the first group at level 1, and resource nodes 4, 5, 6, and 7 from the second group at level 3 can be allocated to sub-request 2.
本申请实施例提供的方案,可以根据资源请求获得至少两个子请求,然后为子请求分配资源节点,因为每个子请求对应的资源节点的数量少于资源请求对应的资源节点的数量,所以,可以灵活为子请求分配资源节点,降低了资源碎片化发生的几率,提高了资源利用率。The solution provided in the embodiment of the present application can obtain at least two sub-requests based on the resource request, and then allocate resource nodes to the sub-requests. Because the number of resource nodes corresponding to each sub-request is less than the number of resource nodes corresponding to the resource request, resource nodes can be flexibly allocated to the sub-requests, thereby reducing the probability of resource fragmentation and improving resource utilization.
可选地,本申请实施例中,层级化分组关系中,不同层级的每个分组对应2的指数幂个资源节点。2的指数幂可以表示为2
n,其中,n为自然数(0、1,…)。
Optionally, in the embodiment of the present application, in the hierarchical grouping relationship, each grouping at a different level corresponds to a number of resource nodes which is an exponential power of 2. The exponential power of 2 can be expressed as 2 n , where n is a natural number (0, 1, ...).
需要说明的是,不同层级的每个分组对应2的指数幂个资源节点只是一种方式,也可以是不同层级的每个分组对应3的指数幂个资源节点,或者,不同层级的每个分组对应m的正整数倍的资源节点,m为正整数。It should be noted that each group at different levels corresponds to an exponential power of 2 resource nodes, which is only one way. Each group at different levels can also correspond to an exponential power of 3 resource nodes, or each group at different levels can correspond to a positive integer multiple of m resource nodes, where m is a positive integer.
可选地,当不同层级的每个分组对应2的指数幂个资源节点时,每个子请求对应2的指数幂个资源节点,可以使子请求对应的资源节点的数量能与某个层级的分组对应的资源节点的数量相匹配,整个分组对应的资源节点都分配给一个子请求,可以降低资源节点碎片化的几率。Optionally, when each grouping at different levels corresponds to an exponential power of 2 resource nodes, each sub-request corresponds to an exponential power of 2 resource nodes, so that the number of resource nodes corresponding to the sub-request can match the number of resource nodes corresponding to the grouping at a certain level, and the resource nodes corresponding to the entire group are allocated to one sub-request, which can reduce the probability of resource node fragmentation.
需要说明的是,当不同层级的每个分组对应的资源节点的数量是按照其他方式配置时, 子请求按照对应的配置方式划分对应的资源节点的数量即可。It should be noted that, when the number of resource nodes corresponding to each group at different levels is configured in other ways, the sub-requests may be divided into the number of corresponding resource nodes according to the corresponding configuration methods.
可选地,由前面的描述可知,层级化分组关系中每个层级的信息通过链表的形式记录例如:图5A所示的每个层级的链表,关于链表的介绍可以参阅前面的内容进行理解。Optionally, as can be seen from the foregoing description, the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list, for example, the linked list of each level shown in FIG. 5A . For the introduction of the linked list, please refer to the foregoing content for understanding.
当层级化分组关系中每个层级的信息通过链表的形式记录时,至少两个子请求包括第一子请求,上述步骤603可以包括:根据第一子请求对应的资源节点的数量,从目标层级的链表中,为第一子请求分配一个分组的节点标识对应的资源节点;其中,目标层级的每个分组中节点标识的数量,与第一子请求对应的资源节点的数量相同。这样,在为子请求分配资源节点时,可以根据子请求对应的资源节点的数量,快速的确定匹配的目标层级,从而可以提高资源节点分配的速度。When the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list, at least two sub-requests include the first sub-request, and the above step 603 may include: according to the number of resource nodes corresponding to the first sub-request, from the linked list of the target level, assigning a resource node corresponding to the node identifier of a group to the first sub-request; wherein the number of node identifiers in each group of the target level is the same as the number of resource nodes corresponding to the first sub-request. In this way, when assigning resource nodes to the sub-requests, the matching target level can be quickly determined according to the number of resource nodes corresponding to the sub-requests, thereby improving the speed of resource node assignment.
该种情况可以参阅图7A进行理解,如图7A所示,资源管理系统包括资源集群1和资源集群2,资源集群1和资源集群2中资源节点的拓扑关系不同,可以将资源集群1和资源集群2理解为是异构集群。资源集群1和资源集群2可以是两个服务器,也可以是两个机组。资源集群1中有多个资源节点,资源节点的节点标识可以从资源节点100开始,依次编号为资源节点101、资源节点102,…,同理,资源集群2中,资源节点的身份可以从资源节点200开始,依次编号为资源节点201、资源节点202,…。资源节点的节点标识在图7A中没有示意出,可以参阅图5A的标记进行理解,只是节点标识的数值不同。通常情况下,在图7A所示的场景中,每个资源集群中资源节点的数量通常为8个倍数。This situation can be understood by referring to FIG. 7A. As shown in FIG. 7A, the resource management system includes resource cluster 1 and resource cluster 2. The topological relationship of the resource nodes in resource cluster 1 and resource cluster 2 is different. Resource cluster 1 and resource cluster 2 can be understood as heterogeneous clusters. Resource cluster 1 and resource cluster 2 can be two servers or two units. There are multiple resource nodes in resource cluster 1. The node identification of the resource node can start from resource node 100 and be numbered as resource node 101, resource node 102, ..., and similarly, in resource cluster 2, the identity of the resource node can start from resource node 200 and be numbered as resource node 201, resource node 202, .... The node identification of the resource node is not illustrated in FIG. 7A. It can be understood by referring to the mark of FIG. 5A, except that the value of the node identification is different. Usually, in the scenario shown in FIG. 7A, the number of resource nodes in each resource cluster is usually a multiple of 8.
资源管理装置根据资源集群1的拓扑关系,确定该资源集群1的链表1,根据资源集群2的拓扑关系,确定该资源集群2的链表2。The resource management device determines linked list 1 of resource cluster 1 according to the topological relationship of resource cluster 1 , and determines linked list 2 of resource cluster 2 according to the topological relationship of resource cluster 2 .
链表1中有四个层级,在图7A中分别标记为层1、层2、层3和层4,该处的层表示层级。There are four levels in the linked list 1, which are marked as level 1, level 2, level 3 and level 4 in FIG. 7A, where the level indicates the level.
链表2也有四个层,在图7A中分别标记为层1、层2、层3和层4,该处的层表示层级。 Link list 2 also has four layers, which are marked as layer 1, layer 2, layer 3 and layer 4 in FIG. 7A , respectively, where the layers represent the hierarchy.
在链表1或链表2中,每8个资源节点就可以得到一个例如图5A所示的层级化分组关系,在资源集群1和资源集群2中都包括多组8个资源节点的拓扑,在链表1或链表2中,可以将每8个资源节点得到的层级化分组关系在每个层级后通过指针连接。In linked list 1 or linked list 2, every 8 resource nodes can obtain a hierarchical grouping relationship such as that shown in FIG. 5A. Both resource cluster 1 and resource cluster 2 include topologies of multiple groups of 8 resource nodes. In linked list 1 or linked list 2, the hierarchical grouping relationship obtained for every 8 resource nodes can be connected by pointers after each level.
资源管理装置接收到资源请求1和资源请求2,资源请求1请求的资源节点的数量为5,表示该租户要请求5个资源节点。资源请求2请求的资源节点的数量为6,表示该租户要请求6个资源节点。The resource management device receives resource request 1 and resource request 2. The number of resource nodes requested by resource request 1 is 5, indicating that the tenant wants to request 5 resource nodes. The number of resource nodes requested by resource request 2 is 6, indicating that the tenant wants to request 6 resource nodes.
资源管理装置可以根据资源请求1获得子请求1和子请求2,其中,子请求1用于请求4个资源节点,子请求2用于请求1个资源节点。资源管理装置可以根据资源请求2获得子请求3和子请求4,子请求3用于请求4个资源节点,子请求4用于请求2个资源节点。The resource management device may obtain sub-request 1 and sub-request 2 according to resource request 1, wherein sub-request 1 is used to request 4 resource nodes, and sub-request 2 is used to request 1 resource node. The resource management device may obtain sub-request 3 and sub-request 4 according to resource request 2, wherein sub-request 3 is used to request 4 resource nodes, and sub-request 4 is used to request 2 resource nodes.
资源管理装置可以根据链表1,从层3的一个分组中为子请求1分配4个资源节点,如:资源集群1中的资源节点100、资源节点101、资源节点102和资源节点103,从层1中的一个分组中为子请求2分配1个资源节点,如:资源集群1中的资源节点104。The resource management device can allocate 4 resource nodes to sub-request 1 from a group in layer 3 according to linked list 1, such as: resource node 100, resource node 101, resource node 102 and resource node 103 in resource cluster 1, and allocate 1 resource node to sub-request 2 from a group in layer 1, such as: resource node 104 in resource cluster 1.
资源管理装置可以根据链表2,从层3的一个分组中为子请求3分配4个资源节点, 如:资源集群2中的资源节点200、资源节点201、资源节点202和资源节点203,从层2的一个分组中为子请求4分配2个资源节点,如:资源集群2中的资源节点204和资源节点205。The resource management device can allocate 4 resource nodes to sub-request 3 from a group of layer 3 according to linked list 2, such as: resource node 200, resource node 201, resource node 202 and resource node 203 in resource cluster 2, and allocate 2 resource nodes to sub-request 4 from a group of layer 2, such as: resource node 204 and resource node 205 in resource cluster 2.
以上示例介绍的是从同一个分组中为子请求分配资源节点的情况,实际上,也可以从多个分组为子请求分配资源节点,该过程可以是:至少两个子请求包括第一子请求时,根据第一子请求对应的资源节点的数量,从一个或多个层级的链表中,为第一子请求分配多个分组的节点标识对应的资源节点;其中,多个分组中节点标识对应的资源节点的数量之和,与第一子请求对应的资源节点的数量相同,多个分组属于相同的层级,或者多个分组中的至少两个分组属于不同的层级。The above example introduces the case of allocating resource nodes to sub-requests from the same group. In fact, resource nodes can also be allocated to sub-requests from multiple groups. The process can be: when at least two sub-requests include a first sub-request, according to the number of resource nodes corresponding to the first sub-request, resource nodes corresponding to the node identifiers of multiple groups are allocated to the first sub-request from one or more levels of linked lists; wherein the sum of the number of resource nodes corresponding to the node identifiers in the multiple groups is the same as the number of resource nodes corresponding to the first sub-request, the multiple groups belong to the same level, or at least two of the multiple groups belong to different levels.
示例性的,资源管理装置可以根据链表1,从层2的两个分组中为子请求1分配4个资源节点,如:资源集群1中的资源节点100、资源节点101、资源节点102和资源节点103,从层1中的一个分组中为子请求2分配1个资源节点,如:资源集群1中的资源节点104。还可以是,资源管理装置可以根据链表1,从层1的四个分组中为子请求1分配4个资源节点,如:资源集群1中的资源节点100、资源节点101、资源节点102和资源节点103。或者,资源管理装置可以根据链表1,从层2的一个分组中为子请求1分配2个资源节点,从层1的两个分组中为子请求1分配2个资源节点。还可以是,根据链表1从层2的一个分组中为子请求1分配2个资源节点,再根据链表2从层2的一个分组中为子请求1分配2个资源节点。具体的分配可以有多种,本申请对此不作限定。Exemplarily, the resource management device may allocate 4 resource nodes to sub-request 1 from two groups in layer 2 according to linked list 1, such as resource nodes 100, resource nodes 101, resource nodes 102, and resource nodes 103 in resource cluster 1, and allocate 1 resource node to sub-request 2 from one group in layer 1, such as resource node 104 in resource cluster 1. Alternatively, the resource management device may allocate 4 resource nodes to sub-request 1 from four groups in layer 1 according to linked list 1, such as resource nodes 100, resource nodes 101, resource nodes 102, and resource nodes 103 in resource cluster 1. Alternatively, the resource management device may allocate 2 resource nodes to sub-request 1 from one group in layer 2 according to linked list 1, and allocate 2 resource nodes to sub-request 1 from two groups in layer 1. Alternatively, the resource management device may allocate 2 resource nodes to sub-request 1 from one group in layer 2 according to linked list 1, and then allocate 2 resource nodes to sub-request 1 from one group in layer 2 according to linked list 2. There may be many specific allocations, which are not limited in this application.
需要说明的是,在分配资源节点后,资源管理装置可以更新链表1和链表2的结构,以链表1为例,更新后的链表1的结构可以参阅图7B进行理解,如图7B所示,层1中原来的前八个表示资源节点的位置中的前五个被消除,后面三个还可以继续分配,层2中原来的前八个表示资源节点的位置中因为五个被分配,前三个两个资源节点的组合被消除,只剩一个表示两个资源节点的组合的一个组,层3和层4都因为前八个表示资源节点的位置中因为五个被分配而消除。若有子请求用于请求1个或2个资源节点,则资源管理装置可以为该子请求分配资源节点105、资源节点106和资源节点107。It should be noted that after allocating resource nodes, the resource management device can update the structures of linked lists 1 and 2. Taking linked list 1 as an example, the updated structure of linked list 1 can be understood by referring to FIG. 7B. As shown in FIG. 7B, the first five of the original first eight resource node positions in layer 1 are eliminated, and the last three can continue to be allocated. Because five of the original first eight resource node positions in layer 2 are allocated, the first three combinations of two resource nodes are eliminated, leaving only one group representing a combination of two resource nodes. Layers 3 and 4 are eliminated because five of the first eight resource node positions are allocated. If there is a sub-request for requesting 1 or 2 resource nodes, the resource management device can allocate resource node 105, resource node 106 and resource node 107 for the sub-request.
本申请实施例中,资源管理装置可以根据子请求对应的资源节点的数量,从满足该数量需求的,且对应资源节点的数量最少的层次为子请求分配资源节点,这样,可以提高对资源节点的分配速度。In an embodiment of the present application, the resource management device can allocate resource nodes to the sub-requests according to the number of resource nodes corresponding to the sub-requests, from the level that meets the number requirement and corresponds to the least number of resource nodes. In this way, the allocation speed of resource nodes can be improved.
可选地,层级化分组关系可以通过二叉树的形式记录时,层级化分组关系可以通过二叉树的形式记录,上述步骤603可以包括:根据第二子请求对应的资源节点的数量,为第二子请求分配目标分组所关联的最末端层级的节点标识对应的资源节点,目标分组为二叉树的目标层级的一个分组;其中,目标层级的每个分组所关联的最末端层级的节点标识的数量,与第二子请求对应的资源节点的数量相同。Optionally, when the hierarchical grouping relationship can be recorded in the form of a binary tree, the above step 603 may include: according to the number of resource nodes corresponding to the second sub-request, allocating to the second sub-request the resource node corresponding to the node identifier of the last level associated with the target group, the target group being a group of the target level of the binary tree; wherein the number of node identifiers of the last level associated with each group of the target level is the same as the number of resource nodes corresponding to the second sub-request.
关于二叉树的介绍可以参阅前面的介绍进行理解。For the introduction of binary trees, please refer to the previous introduction for understanding.
以图5B所示例的二叉树的形式为例,该种情况的资源节点的分配过程可以参阅图8A进行理解,如图8A所示,资源管理系统包括资源集群1和资源集群2,资源集群1和资源集群2中资源节点的拓扑关系不同,可以将资源集群1和资源集群2理解为是异构集群。 资源集群1和资源集群2可以是两个服务器,也可以是两个机组。资源集群1中有8个资源节点,资源节点的节点标识可以从资源节点10开始,依次编号为资源节点11、资源节点12,…,资源节点17,同理,资源集群2中,资源节点的节点标识可以从资源节点20开始,依次编号为资源节点21、资源节点22,…,资源节点27。Taking the binary tree form illustrated in FIG5B as an example, the resource node allocation process in this case can be understood by referring to FIG8A. As shown in FIG8A, the resource management system includes resource cluster 1 and resource cluster 2. The topological relationship of the resource nodes in resource cluster 1 and resource cluster 2 is different. Resource cluster 1 and resource cluster 2 can be understood as heterogeneous clusters. Resource cluster 1 and resource cluster 2 can be two servers or two units. There are 8 resource nodes in resource cluster 1. The node identification of the resource node can start from resource node 10 and be numbered as resource node 11, resource node 12, ..., resource node 17 in sequence. Similarly, in resource cluster 2, the node identification of the resource node can start from resource node 20 and be numbered as resource node 21, resource node 22, ..., resource node 27 in sequence.
资源管理装置根据资源集群1的拓扑关系,确定该资源集群1的二叉树1,根据资源集群2的拓扑关系,确定该资源集群2的二叉树2。The resource management device determines the binary tree 1 of the resource cluster 1 according to the topological relationship of the resource cluster 1 , and determines the binary tree 2 of the resource cluster 2 according to the topological relationship of the resource cluster 2 .
资源管理装置接收到资源请求,资源请求所请求的资源节点的数量为10,表示该租户要请求10个资源节点。The resource management device receives a resource request, and the number of resource nodes requested by the resource request is 10, indicating that the tenant wants to request 10 resource nodes.
资源管理装置可以根据资源请求获得子请求1和子请求2,其中,子请求1用于请求8个资源节点,子请求2用于请求2个资源节点。The resource management device may obtain sub-request 1 and sub-request 2 according to the resource request, wherein sub-request 1 is used to request 8 resource nodes, and sub-request 2 is used to request 2 resource nodes.
资源管理装置可以根据二叉树1,从层级4中为子请求1分配8个资源节点,如:资源集群1中的资源节点10、资源节点11,…资源节点17,从二叉树2的层级2中为子请求2分配2个资源节点,如:资源集群2中的资源节点20、资源节点21。The resource management device can allocate 8 resource nodes to sub-request 1 from level 4 based on binary tree 1, such as resource node 10, resource node 11,... resource node 17 in resource cluster 1, and allocate 2 resource nodes to sub-request 2 from level 2 of binary tree 2, such as resource node 20 and resource node 21 in resource cluster 2.
以上示例介绍的是从同一个目标分组中为子请求分配资源节点的情况,实际上,也可以从多个目标分组为子请求分配资源节点,该过程可以是:至少两个子请求包括第一子请求时,根据第二子请求对应的资源节点的数量,为第二子请求分配多个目标分组所关联的最末端层级的节点标识对应的资源节点,多个目标分组属于相同的层级,或者多个分组中的至少两个分组属于不同的层级;其中,多个目标分组所关联的最末端层级的节点标识不重复,且多个目标分组所关联的最末端层级的节点标识的数量之和,与第二子请求对应的资源节点的数量相同。The above example introduces the case of allocating resource nodes to sub-requests from the same target group. In fact, resource nodes can also be allocated to sub-requests from multiple target groups. The process can be: when at least two sub-requests include a first sub-request, resource nodes corresponding to node identifiers of the most terminal levels associated with multiple target groups are allocated to the second sub-request based on the number of resource nodes corresponding to the second sub-request. The multiple target groups belong to the same level, or at least two of the multiple groups belong to different levels; wherein the node identifiers of the most terminal levels associated with the multiple target groups are not repeated, and the sum of the number of node identifiers of the most terminal levels associated with the multiple target groups is the same as the number of resource nodes corresponding to the second sub-request.
示例性的,资源管理装置可以根据资源请求获得子请求1,其中,子请求1用于请求8个资源节点。Exemplarily, the resource management device may obtain sub-request 1 according to the resource request, wherein sub-request 1 is used to request 8 resource nodes.
资源管理装置可以根据二叉树1,从层级3的各自对应4个资源节点的两个分组中为子请求1共分配8个资源节点,如:资源集群1中的资源节点10、资源节点11,…资源节点17如:资源集群2中的资源节点20、资源节点21。还可以是从层级3的一个分组中为子请求1分配4个资源节点,从层2都对应两个资源节点的两个分组中再分配另外的4个资源节点。当然,还可以采用其他分配方式,也可以一部分资源节点根据二叉树1分配,一分部资源节点根据二叉树2分配,具体的分配可以有多种,本申请对此不作限定。The resource management device can allocate a total of 8 resource nodes to sub-request 1 from two groups of level 3 that each correspond to 4 resource nodes, such as resource nodes 10 and 11 in resource cluster 1, ... resource nodes 17 such as resource nodes 20 and 21 in resource cluster 2, according to binary tree 1. It is also possible to allocate 4 resource nodes to sub-request 1 from a group of level 3, and allocate another 4 resource nodes from two groups of level 2 that each correspond to two resource nodes. Of course, other allocation methods can also be used, and some resource nodes can also be allocated according to binary tree 1, and some resource nodes can be allocated according to binary tree 2. There can be many specific allocations, and this application does not limit this.
需要说明的是,在分配资源节点后,资源管理装置会更新二叉树1和二叉树2的结构,更新后的二叉树1和二叉树2可以参阅图8B进行理解,如图8B所示,二叉树1中的八个表示资源节点的位置被置位灰色,表示已分配,二叉树2中的前两个表示资源节点的位置被置位灰色,表示已分配。当然,本申请中不限于置位灰色,也可以是通过其他方式表示该位置的资源节点已分配。It should be noted that after allocating resource nodes, the resource management device will update the structure of binary tree 1 and binary tree 2. The updated binary tree 1 and binary tree 2 can be understood by referring to FIG8B. As shown in FIG8B, the eight positions representing resource nodes in binary tree 1 are set to gray, indicating that they have been allocated, and the first two positions representing resource nodes in binary tree 2 are set to gray, indicating that they have been allocated. Of course, the present application is not limited to setting gray, and it can also be indicated by other means that the resource node at the position has been allocated.
本申请实施例中,资源管理装置可以根据子请求对应的资源节点的数量,从满足该数量需求的,且对应资源节点的数量最少的层级的树杈为子请求分配资源节点,这样,可以提高对资源节点的分配速度。In an embodiment of the present application, the resource management device can allocate resource nodes to the sub-requests according to the number of resource nodes corresponding to the sub-requests, from the tree branch at the level that meets the number requirement and corresponds to the least number of resource nodes. In this way, the allocation speed of resource nodes can be improved.
可选地,至少两个子请求为每个子请求对应的资源节点的数量都满足2的指数幂时, 资源请求获得的最少数量的子请求。Optionally, the at least two sub-requests are the minimum number of sub-requests obtained by the resource request when the number of resource nodes corresponding to each sub-request satisfies an exponential power of 2.
以拆分资源请求得到至少两个子请求为例,当资源请求有多种拆分方式时,选择最少数量的子请求的拆分方式,如上述图8A中的资源请求要请求10个资源节点,满足2的指数幂的形式可以有多种拆分方法,例如:可以拆分为8和2,也可以拆分为4、4和2,优先选择8和2的拆分方式,这样,可以减少子请求的分配次数,提高分配效率,而且,还可以提高同一子请求对应的多个资源节点间的亲和性。当然,如果资源管理系统中剩余的可分配的资源节点无法满足8和2的拆分方式的分配,也可以使用4、4和2的拆分方式,从不同的资源集群中为该租户分配资源节点。Taking the example of splitting a resource request to obtain at least two sub-requests, when there are multiple ways to split a resource request, the splitting method with the least number of sub-requests is selected. For example, the resource request in FIG8A above requests 10 resource nodes, and there are multiple ways to split in the form of exponential power of 2, for example: it can be split into 8 and 2, or it can be split into 4, 4 and 2. The splitting method of 8 and 2 is preferred. In this way, the number of sub-request allocations can be reduced, the allocation efficiency can be improved, and the affinity between multiple resource nodes corresponding to the same sub-request can be improved. Of course, if the remaining allocatable resource nodes in the resource management system cannot meet the allocation of the splitting method of 8 and 2, the splitting method of 4, 4 and 2 can also be used to allocate resource nodes to the tenant from different resource clusters.
以上介绍了资源管理方法,下面结合附图介绍本申请实施例中的资源管理装置。The resource management method is introduced above. The resource management device in the embodiment of the present application is introduced below with reference to the accompanying drawings.
如图9所示,本申请实施例提供的资源管理装置90的一结构包括:As shown in FIG9 , a structure of a resource management device 90 provided in an embodiment of the present application includes:
第一处理单元901,用于获取多个资源节点之间的拓扑关系,拓扑关系表示多个资源节点之间的通信关系。该第一处理单元901可以执行上述方法实施例中的步骤301。The first processing unit 901 is used to obtain a topological relationship between multiple resource nodes, where the topological relationship represents a communication relationship between multiple resource nodes. The first processing unit 901 can execute step 301 in the above method embodiment.
第二处理单元902,用于根据多个资源节点之间的拓扑关系,对多个资源节点按照层级进行分组,以得到多个资源节点的层级化分组关系,层级化分组关系是按层级划分多个资源节点得到,层级化分组关系包括多个层级,其中,每个层级都对应多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。该第二处理单元902可以执行上述方法实施例中的步骤302。The second processing unit 902 is used to group the multiple resource nodes according to the hierarchical relationship between the multiple resource nodes to obtain a hierarchical grouping relationship of the multiple resource nodes, wherein the hierarchical grouping relationship is obtained by dividing the multiple resource nodes according to the hierarchical relationship, and the hierarchical grouping relationship includes multiple levels, wherein each level corresponds to multiple resource nodes, and the number of groups at different levels is different, and each group at the same level corresponds to the same number of resource nodes. The second processing unit 902 can execute step 302 in the above method embodiment.
可选地,当任意一个层级的分组对应的资源节点的数量大于2时,该分组对应的至少两个资源节点构成通信环。Optionally, when the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
可选地,同一层级的不同分组对应的通信环的带宽之和相同,通信环的带宽为构成通信环的资源节点之间通信带宽之和。Optionally, the sum of bandwidths of communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of communication bandwidths between resource nodes constituting the communication ring.
可选地,同一层级的不同分组对应的通信环的带宽之和相同,通信环的带宽为构成通信环的资源节点之间通信带宽之和。Optionally, the sum of bandwidths of communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of communication bandwidths between resource nodes constituting the communication ring.
可选地,不同层级的每个分组中包含2的指数幂个资源节点。Optionally, each group at a different level contains a power-of-two number of resource nodes.
可选地,层级化分组关系中每个层级的信息通过链表的形式记录,每个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。Optionally, the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list, and the linked list of each level includes the node identifiers of the resource nodes contained in each group of the level, and the node identifiers of the resource nodes in different groups are different.
可选地,层级化分组关系通过二叉树的形式记录,二叉树的最末端层级的每个分组包括一个资源节点的节点标识,不同分组中的节点标识不同;上层层级的分组中包括上层层级的分组对应的资源节点的数量,其中,上层层级为最末端层级之上的任意一个层级。Optionally, the hierarchical grouping relationship is recorded in the form of a binary tree, where each group at the end level of the binary tree includes a node identifier of a resource node, and the node identifiers in different groups are different; the groups at the upper levels include the number of resource nodes corresponding to the groups at the upper levels, wherein the upper levels are any level above the end level.
本申请实施例中,资源管理装置90中各单元所执行的操作与前述图3至图8B所示实施例中描述的类似,此处不再赘述。In the embodiment of the present application, the operations performed by each unit in the resource management device 90 are similar to those described in the embodiments shown in the aforementioned Figures 3 to 8B, and will not be repeated here.
如图10所示,本申请实施例提供的资源管理装置100的一结构包括:As shown in FIG. 10 , a structure of a resource management device 100 provided in an embodiment of the present application includes:
接收单元1001,用于接收资源请求,资源请求包括所请求资源节点的数量。该接收单元1001可以执行上述方法实施例中的步骤601。The receiving unit 1001 is configured to receive a resource request, wherein the resource request includes the number of requested resource nodes. The receiving unit 1001 may execute step 601 in the above method embodiment.
第一处理单元1002,用于根据接收单元1001接收的资源请求获得至少两个子请求,至少两个子请求各自对应的资源节点的数量之和为资源请求对应的资源节点的数量。该第一处理单元1002可以执行上述方法实施例中的步骤602。The first processing unit 1002 is configured to obtain at least two sub-requests according to the resource request received by the receiving unit 1001, wherein the sum of the number of resource nodes corresponding to the at least two sub-requests is the number of resource nodes corresponding to the resource request. The first processing unit 1002 may execute step 602 in the above method embodiment.
第二处理单元1003,用于根据资源管理信息,为第一处理单元602得到的每个子请求分配对应数量的资源节点,资源管理信息包括多个资源节点的层级化分组关系;其中,不同子请求对应的资源节点的数量,与层级化分组关系中同一层级或不同层级的一个或多个分组对应的资源节点的数量相匹配。The second processing unit 1003 is used to allocate a corresponding number of resource nodes to each sub-request obtained by the first processing unit 602 according to the resource management information, and the resource management information includes a hierarchical grouping relationship of multiple resource nodes; wherein the number of resource nodes corresponding to different sub-requests matches the number of resource nodes corresponding to one or more groups at the same level or different levels in the hierarchical grouping relationship.
可选地,层级化分组关系包括多个层级,其中,每个层级都对应多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。Optionally, the hierarchical grouping relationship includes multiple levels, wherein each level corresponds to multiple resource nodes, the number of groups in different levels is different, and each group in the same level corresponds to the same number of resource nodes.
可选地,不同层级的每个分组对应2的指数幂个资源节点。Optionally, each grouping at a different level corresponds to an exponential power of 2 resource nodes.
可选地,每个子请求对应2的指数幂个资源节点。Optionally, each sub-request corresponds to a power-of-two resource node.
可选地,层级化分组关系中每个层级的信息通过链表的形式记录,每个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。Optionally, the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list, and the linked list of each level includes the node identifiers of the resource nodes contained in each group of the level, and the node identifiers of the resource nodes in different groups are different.
可选地,至少两个子请求包括第一子请求,第二处理单元1003,具体用于根据第一子请求对应的资源节点的数量,从目标层级的链表中,为第一子请求分配一个分组的节点标识对应的资源节点;其中,目标层级的每个分组中节点标识的数量,与第一子请求对应的资源节点的数量相同。Optionally, at least two sub-requests include a first sub-request, and a second processing unit 1003 is specifically used to allocate a resource node corresponding to a node identifier of a group to the first sub-request from a linked list of the target level according to the number of resource nodes corresponding to the first sub-request; wherein the number of node identifiers in each group of the target level is the same as the number of resource nodes corresponding to the first sub-request.
可选地,至少两个子请求包括第一子请求,第二处理单元1003,具体用于根据第一子请求对应的资源节点的数量,从一个或多个层级的链表中,为第一子请求分配多个分组的节点标识对应的资源节点;其中,多个分组中节点标识对应的资源节点的数量之和,与第一子请求对应的资源节点的数量相同,多个分组属于相同的层级,或者多个分组中的至少两个分组属于不同的层级。Optionally, at least two sub-requests include a first sub-request, and the second processing unit 1003 is specifically used to allocate resource nodes corresponding to node identifiers of multiple groups to the first sub-request from a linked list of one or more levels according to the number of resource nodes corresponding to the first sub-request; wherein the sum of the numbers of resource nodes corresponding to the node identifiers in the multiple groups is the same as the number of resource nodes corresponding to the first sub-request, the multiple groups belong to the same level, or at least two of the multiple groups belong to different levels.
可选地,层级化分组关系通过二叉树的形式记录,二叉树的最末端层级的每个分组包括一个资源节点的节点标识,不同分组中的节点标识不同;上层层级的分组中包括上层层级的分组对应的资源节点的数量,其中,上层层级为最末端层级之上的任意一个层级。Optionally, the hierarchical grouping relationship is recorded in the form of a binary tree, where each group at the end level of the binary tree includes a node identifier of a resource node, and the node identifiers in different groups are different; the groups at the upper levels include the number of resource nodes corresponding to the groups at the upper levels, wherein the upper levels are any level above the end level.
可选地,至少两个子请求包括第二子请求,第二处理单元1003,具体用于根据第二子请求对应的资源节点的数量,为第二子请求分配目标分组所关联的最末端层级的节点标识对应的资源节点,目标分组为二叉树的目标层级的一个分组;其中,目标层级的每个分组所关联的最末端层级的节点标识的数量,与第二子请求对应的资源节点的数量相同。Optionally, at least two sub-requests include a second sub-request, and the second processing unit 1003 is specifically used to allocate resource nodes corresponding to the node identifier of the last level associated with the target group to the second sub-request according to the number of resource nodes corresponding to the second sub-request, and the target group is a group of the target level of the binary tree; wherein the number of node identifiers of the last level associated with each group of the target level is the same as the number of resource nodes corresponding to the second sub-request.
可选地,至少两个子请求包括第二子请求,第二处理单元1003,具体用于根据第二子请求对应的资源节点的数量,为第二子请求分配多个目标分组所关联的最末端层级的节点标识对应的资源节点,多个目标分组属于相同的层级,或者多个分组中的至少两个分组属于不同的层级;其中,多个目标分组所关联的最末端层级的节点标识不重复,且多个目标分组所关联的最末端层级的节点标识的数量之和,与第二子请求对应的资源节点的数量相同。Optionally, at least two sub-requests include a second sub-request, and the second processing unit 1003 is specifically used to allocate resource nodes corresponding to the node identifiers of the end-level associated with multiple target groups to the second sub-request according to the number of resource nodes corresponding to the second sub-request, and the multiple target groups belong to the same level, or at least two of the multiple groups belong to different levels; wherein the node identifiers of the end-level associated with the multiple target groups are not repeated, and the sum of the number of node identifiers of the end-level associated with the multiple target groups is the same as the number of resource nodes corresponding to the second sub-request.
可选地,至少两个子请求为每个子请求对应的资源节点的数量都满足2的指数幂时,资源请求得到的最少数量的子请求。Optionally, when at least two sub-requests are each of the resource nodes corresponding to a number that satisfies an exponential power of 2, the resource request obtains the minimum number of sub-requests.
层级化分组关系是按层级划分多个资源节点得到,当任意一个层级的分组对应的资源节点的数量大于2时,该分组对应的至少两个资源节点构成通信环。The hierarchical grouping relationship is obtained by dividing a plurality of resource nodes according to the levels. When the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
可选地,同一层级的不同分组对应的通信环的带宽之和相同,通信环的带宽为构成通 信环的资源节点之间通信带宽之和。Optionally, the sum of the bandwidths of the communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of the communication bandwidths between the resource nodes constituting the communication ring.
可选地,同一层级的通信环的带宽之和是至少两个第一带宽和中最大的,其中,第一带宽和是多个资源节点按照同一层级的分组对应资源节点的数量,进行不同组合时得到的通信环的带宽之和。Optionally, the sum of the bandwidths of communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when multiple resource nodes are grouped in different ways according to the number of resource nodes corresponding to the same level.
可选地,资源节点位于云服务系统,资源节点为云服务系统中的计算设备卡或者虚拟机。Optionally, the resource node is located in a cloud service system, and the resource node is a computing device card or a virtual machine in the cloud service system.
可选地,资源节点位于数据中心,资源节点为数据中心的计算节点,计算节点为服务器或虚拟机。Optionally, the resource node is located in a data center, the resource node is a computing node of the data center, and the computing node is a server or a virtual machine.
可选地,资源节点位于网络系统,资源节点为网络系统的网络装置,网络装置包括防火墙、路由器和交换机中的至少一种。Optionally, the resource node is located in a network system, and the resource node is a network device of the network system, and the network device includes at least one of a firewall, a router, and a switch.
本申请实施例中,资源管理装置100中各单元所执行的操作与前述图3至图8B所示实施例中描述的类似,此处不再赘述。In the embodiment of the present application, the operations performed by each unit in the resource management device 100 are similar to those described in the embodiments shown in the aforementioned Figures 3 to 8B, and will not be repeated here.
在本申请的另一实施例中,还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,当资源管理装置的处理器执行该计算机执行指令时,资源管理装置执行上述图3至图8B中资源管理装置所执行的步骤。In another embodiment of the present application, a computer-readable storage medium is also provided, in which computer execution instructions are stored. When the processor of the resource management device executes the computer execution instructions, the resource management device executes the steps performed by the resource management device in Figures 3 to 8B above.
在本申请的另一实施例中,还提供一种计算机程序产品,该计算机程序产品包括计算机程序代码,当计算机程序代码在计算机上执行时,计算机设备执行上述图3至图8B中资源管理装置所执行的步骤。In another embodiment of the present application, a computer program product is provided. The computer program product includes a computer program code. When the computer program code is executed on a computer, the computer device executes the steps executed by the resource management apparatus in FIG. 3 to FIG. 8B .
在本申请的另一实施例中,还提供一种芯片系统,该芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从资源管理装置的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,终端执行前述上述图3至图8B中资源管理装置所执行的步骤。在一种可能的设计中,芯片系统还可以包括存储器,存储器,用于保存控制设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。In another embodiment of the present application, a chip system is also provided, which includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive signals from the memory of the resource management device and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the terminal executes the steps performed by the resource management device in the above-mentioned Figures 3 to 8B. In one possible design, the chip system may also include a memory, which is used to store program instructions and data necessary for the control device. The chip system may be composed of chips, or may include chips and other discrete devices.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated units may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
当使用软件实现所述集成的单元时,可以全部或部分地以计算机程序产品的形式实现。 所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。When the integrated unit is implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
Claims (29)
- 一种资源管理方法,其特征在于,包括:A resource management method, characterized by comprising:接收资源请求,所述资源请求包括所请求资源节点的数量;receiving a resource request, the resource request including a number of requested resource nodes;根据所述资源请求获得至少两个子请求,所述至少两个子请求各自对应的资源节点的数量之和为所述资源请求对应的资源节点的数量;Obtain at least two sub-requests according to the resource request, the sum of the numbers of resource nodes corresponding to the at least two sub-requests being the number of resource nodes corresponding to the resource request;根据资源管理信息,为每个子请求分配对应数量的资源节点,所述资源管理信息包括多个资源节点的层级化分组关系;其中,不同子请求对应的资源节点的数量,与所述层级化分组关系中同一层级或不同层级的一个或多个分组对应的资源节点的数量相匹配。According to resource management information, a corresponding number of resource nodes are allocated to each sub-request, and the resource management information includes a hierarchical grouping relationship of multiple resource nodes; wherein the number of resource nodes corresponding to different sub-requests matches the number of resource nodes corresponding to one or more groups at the same level or different levels in the hierarchical grouping relationship.
- 根据权利要求1所述的方法,其特征在于,所述层级化分组关系包括多个层级,其中,每个层级都对应所述多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。The method according to claim 1 is characterized in that the hierarchical grouping relationship includes multiple levels, wherein each level corresponds to the multiple resource nodes, the number of groups in different levels is different, and the number of resource nodes corresponding to each group in the same level is the same.
- 根据权利要求2所述的方法,其特征在于,所述不同层级的每个分组对应2的指数幂个资源节点。The method according to claim 2 is characterized in that each grouping of the different levels corresponds to an exponential power of 2 resource nodes.
- 根据权利要求3所述的方法,其特征在于,所述每个子请求对应2的指数幂个资源节点。The method according to claim 3 is characterized in that each sub-request corresponds to an exponential power of 2 resource nodes.
- 根据权利要求1-4任一项所述的方法,其特征在于,所述层级化分组关系中每个层级的信息通过链表的形式记录,所述每个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。The method according to any one of claims 1-4 is characterized in that the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list, and the linked list of each level includes the node identifiers of the resource nodes contained in each group of the level, and the node identifiers of the resource nodes in different groups are different.
- 根据权利要求5所述的方法,其特征在于,所述至少两个子请求包括第一子请求,所述根据资源管理信息,为每个子请求分配对应数量的资源节点,包括:The method according to claim 5, wherein the at least two sub-requests include a first sub-request, and the allocating a corresponding number of resource nodes to each sub-request according to the resource management information comprises:根据所述第一子请求对应的资源节点的数量,从目标层级的链表中,为所述第一子请求分配一个分组的节点标识对应的资源节点;其中,所述目标层级的每个分组中节点标识对应的资源节点的数量,与所述第一子请求对应的资源节点的数量相同。According to the number of resource nodes corresponding to the first sub-request, a resource node corresponding to the node identifier of a group is allocated to the first sub-request from the linked list of the target layer; wherein the number of resource nodes corresponding to the node identifier in each group of the target layer is the same as the number of resource nodes corresponding to the first sub-request.
- 根据权利要求5所述的方法,其特征在于,所述至少两个子请求包括第一子请求,所述根据资源管理信息,为每个子请求分配对应数量的资源节点,包括:The method according to claim 5, wherein the at least two sub-requests include a first sub-request, and the allocating a corresponding number of resource nodes to each sub-request according to the resource management information comprises:根据所述第一子请求对应的资源节点的数量,从一个或多个层级的链表中,为所述第一子请求分配多个分组的节点标识对应的资源节点;其中,所述多个分组中节点标识对应的资源节点的数量之和,与所述第一子请求对应的资源节点的数量相同,所述多个分组属于相同的层级,或者所述多个分组中的至少两个分组属于不同的层级。According to the number of resource nodes corresponding to the first sub-request, resource nodes corresponding to the node identifiers of multiple groups are allocated to the first sub-request from a linked list of one or more levels; wherein the sum of the numbers of resource nodes corresponding to the node identifiers in the multiple groups is the same as the number of resource nodes corresponding to the first sub-request, the multiple groups belong to the same level, or at least two of the multiple groups belong to different levels.
- 根据权利要求1-4任一项所述的方法,其特征在于,所述层级化分组关系通过二叉树的形式记录,所述二叉树的最末端层级的每个分组包括一个资源节点的节点标识,不同分组中的节点标识不同;The method according to any one of claims 1 to 4, characterized in that the hierarchical grouping relationship is recorded in the form of a binary tree, each group at the end level of the binary tree includes a node identifier of a resource node, and the node identifiers in different groups are different;上层层级的分组中包括所述上层层级的分组对应的资源节点的数量,其中,所述上层层级为所述最末端层级之上的任意一个层级。The grouping of the upper level includes the number of resource nodes corresponding to the grouping of the upper level, wherein the upper level is any level above the last level.
- 根据权利要求8所述的方法,其特征在于,所述至少两个子请求包括第二子请求,所述根据资源管理信息,为每个子请求分配对应数量的资源节点,包括:The method according to claim 8, wherein the at least two sub-requests include a second sub-request, and the allocating a corresponding number of resource nodes to each sub-request according to the resource management information comprises:根据所述第二子请求对应的资源节点的数量,为所述第二子请求分配目标分组所关联 的所述最末端层级的节点标识对应的资源节点,所述目标分组为所述二叉树的目标层级的一个分组;其中,所述目标层级的每个分组所关联的所述最末端层级的节点标识的数量,与所述第二子请求对应的资源节点的数量相同。According to the number of resource nodes corresponding to the second sub-request, the resource node corresponding to the node identifier of the last level associated with the target group is allocated to the second sub-request, and the target group is a group of the target level of the binary tree; wherein the number of node identifiers of the last level associated with each group of the target level is the same as the number of resource nodes corresponding to the second sub-request.
- 根据权利要求8所述的方法,其特征在于,所述至少两个子请求包括第二子请求,所述根据资源管理信息,为每个子请求分配对应数量的资源节点,包括:The method according to claim 8, wherein the at least two sub-requests include a second sub-request, and the allocating a corresponding number of resource nodes to each sub-request according to the resource management information comprises:根据所述第二子请求对应的资源节点的数量,为所述第二子请求分配多个目标分组所关联的所述最末端层级的节点标识对应的资源节点,所述多个目标分组属于相同的层级,或者所述多个分组中的至少两个分组属于不同的层级;其中,所述多个目标分组所关联的所述最末端层级的节点标识不重复,且所述多个目标分组所关联的所述最末端层级的节点标识的数量之和,与所述第二子请求对应的资源节点的数量相同。According to the number of resource nodes corresponding to the second sub-request, resource nodes corresponding to the node identifiers of the most-end level associated with multiple target groups are allocated to the second sub-request, the multiple target groups belong to the same level, or at least two of the multiple groups belong to different levels; wherein the node identifiers of the most-end level associated with the multiple target groups are not repeated, and the sum of the number of node identifiers of the most-end level associated with the multiple target groups is the same as the number of resource nodes corresponding to the second sub-request.
- 根据权利要求1-10任一项所述的方法,其特征在于,所述至少两个子请求为所述每个子请求对应的资源节点的数量都满足2的指数幂时,所述资源请求得到的最少数量的子请求。The method according to any one of claims 1-10 is characterized in that the at least two sub-requests are the minimum number of sub-requests obtained by the resource request when the number of resource nodes corresponding to each sub-request satisfies the exponential power of 2.
- 根据权利要求1-11任一项所述的方法,其特征在于,所述层级化分组关系是按层级划分所述多个资源节点得到,当任意一个层级的分组对应的资源节点的数量大于2时,该分组对应的至少两个资源节点构成通信环。The method according to any one of claims 1-11 is characterized in that the hierarchical grouping relationship is obtained by dividing the multiple resource nodes in layers, and when the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
- 根据权利要求12所述的方法,其特征在于,同一层级的不同分组对应的通信环的带宽之和相同,所述通信环的带宽为构成所述通信环的资源节点之间通信带宽之和。The method according to claim 12 is characterized in that the sum of the bandwidths of the communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of the communication bandwidths between the resource nodes constituting the communication ring.
- 根据权利要求12或13所述的方法,其特征在于,所述同一层级的通信环的带宽之和是至少两个第一带宽和中最大的,其中,所述第一带宽和是所述多个资源节点按照所述同一层级的分组对应资源节点的数量,进行不同组合时得到的通信环的带宽之和。The method according to claim 12 or 13 is characterized in that the sum of the bandwidths of the communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when the multiple resource nodes are combined in different ways according to the number of resource nodes corresponding to the groupings at the same level.
- 根据权利要求1-14任一项所述的方法,其特征在于,所述资源节点位于云服务系统,所述资源节点为所述云服务系统中的计算设备卡或者虚拟机。The method according to any one of claims 1-14 is characterized in that the resource node is located in a cloud service system, and the resource node is a computing device card or a virtual machine in the cloud service system.
- 根据权利要求1-14任一项所述的方法,其特征在于,所述资源节点位于数据中心,所述资源节点为所述数据中心的计算节点,所述计算节点为服务器或虚拟机。The method according to any one of claims 1-14 is characterized in that the resource node is located in a data center, the resource node is a computing node of the data center, and the computing node is a server or a virtual machine.
- 根据权利要求1-14任一项所述的方法,其特征在于,所述资源节点位于网络系统,所述资源节点为所述网络系统的网络装置,所述网络装置包括防火墙、路由器和交换机中的至少一种。The method according to any one of claims 1-14 is characterized in that the resource node is located in a network system, the resource node is a network device of the network system, and the network device includes at least one of a firewall, a router and a switch.
- 一种资源管理方法,其特征在于,包括:A resource management method, characterized by comprising:获取多个资源节点之间的拓扑关系,所述拓扑关系表示多个资源节点之间的通信关系;Acquire a topological relationship between multiple resource nodes, where the topological relationship represents a communication relationship between the multiple resource nodes;根据所述多个资源节点之间的拓扑关系,对所述多个资源节点按照层级进行分组,以得到所述多个资源节点的层级化分组关系,所述层级化分组关系是按层级划分所述多个资源节点得到,所述层级化分组关系包括多个层级,其中,每个层级都对应所述多个资源节点,不同层级的分组数量不同,同一层级的每个分组对应资源节点的数量相同。According to the topological relationship between the multiple resource nodes, the multiple resource nodes are grouped according to levels to obtain a hierarchical grouping relationship of the multiple resource nodes. The hierarchical grouping relationship is obtained by dividing the multiple resource nodes according to levels. The hierarchical grouping relationship includes multiple levels, wherein each level corresponds to the multiple resource nodes, different levels have different numbers of groups, and each group at the same level corresponds to the same number of resource nodes.
- 根据权利要求18所述的方法,其特征在于,当任意一个层级的分组对应的资源节点的数量大于2时,该分组对应的至少两个资源节点构成通信环。The method according to claim 18 is characterized in that when the number of resource nodes corresponding to a group at any level is greater than 2, at least two resource nodes corresponding to the group constitute a communication ring.
- 根据权利要求19所述的方法,其特征在于,同一层级的不同分组对应的通信环的 带宽之和相同,所述通信环的带宽为构成所述通信环的资源节点之间通信带宽之和。The method according to claim 19 is characterized in that the sum of the bandwidths of the communication rings corresponding to different groups at the same level is the same, and the bandwidth of the communication ring is the sum of the communication bandwidths between the resource nodes constituting the communication ring.
- 根据权利要求19或20所述的方法,其特征在于,所述同一层级的通信环的带宽之和是至少两个第一带宽和中最大的,其中,所述第一带宽和是所述多个资源节点按照所述同一层级的分组对应资源节点的数量,进行不同组合时得到的通信环的带宽之和。The method according to claim 19 or 20 is characterized in that the sum of the bandwidths of the communication rings at the same level is the largest of at least two first bandwidth sums, wherein the first bandwidth sum is the sum of the bandwidths of the communication rings obtained when the multiple resource nodes are combined in different ways according to the number of resource nodes corresponding to the groupings at the same level.
- 根据权利要求18-21任一项所述的方法,其特征在于,所述不同层级的每个分组中包含2的指数幂个资源节点。The method according to any one of claims 18-21 is characterized in that each group of the different levels contains an exponential power of 2 resource nodes.
- 根据权利要求18-22任一项所述的方法,其特征在于,所述层级化分组关系中每个层级的信息通过链表的形式记录,所述每个层级的链表包括该层级的每个分组包含的资源节点的节点标识,不同分组中的资源节点的节点标识不同。The method according to any one of claims 18-22 is characterized in that the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list, and the linked list of each level includes the node identifiers of the resource nodes contained in each group of the level, and the node identifiers of the resource nodes in different groups are different.
- 根据权利要求18-22任一项所述的方法,其特征在于,所述层级化分组关系通过二叉树的形式记录,所述二叉树的最末端层级的每个分组包括一个资源节点的节点标识,不同分组中的节点标识不同;The method according to any one of claims 18 to 22, characterized in that the hierarchical grouping relationship is recorded in the form of a binary tree, each group at the end level of the binary tree includes a node identifier of a resource node, and the node identifiers in different groups are different;上层层级的分组中包括所述上层层级的分组对应的资源节点的数量,其中,所述上层层级为所述最末端层级之上的任意一个层级。The grouping of the upper level includes the number of resource nodes corresponding to the grouping of the upper level, wherein the upper level is any level above the last level.
- 一种资源管理装置,其特征在于,包括:通信接口、处理器和存储器,所述通信接口和所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得所述客户端执行如权利要求1-17或18-24中任一项所述的方法。A resource management device, characterized in that it includes: a communication interface, a processor and a memory, wherein the communication interface and the processor are coupled to the memory, and the memory is used to store programs or instructions. When the program or instructions are executed by the processor, the client executes the method described in any one of claims 1-17 or 18-24.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在计算机设备上运行时,使得所述计算机设备执行如权利要求1-17或18-24中任一项所述的方法。A computer-readable storage medium, characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes the method as described in any one of claims 1-17 or 18-24.
- 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序代码,当所述计算机程序代码在计算机设备上运行时,使得所述计算机设备执行如权利要求1-17或18-24中任一项所述的方法。A computer program product, characterized in that the computer program product comprises computer program code, and when the computer program code is run on a computer device, the computer device executes the method as described in any one of claims 1-17 or 18-24.
- 一种芯片系统,其特征在于,所述芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从客户端的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,芯片系统执行如权利要求1-17或18-24中任一项所述的方法。A chip system, characterized in that the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive signals from a client's memory and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the chip system executes the method described in any one of claims 1-17 or 18-24.
- 一种资源管理系统,其特征在于,包括资源管理装置和多个资源节点,所述资源管理装置用于执行上述如权利要求1-17或18-24中任一项所述的方法。A resource management system, characterized in that it includes a resource management device and multiple resource nodes, and the resource management device is used to execute the method described in any one of claims 1-17 or 18-24.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/143113 WO2024138482A1 (en) | 2022-12-29 | 2022-12-29 | Resource management method and corresponding apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/143113 WO2024138482A1 (en) | 2022-12-29 | 2022-12-29 | Resource management method and corresponding apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024138482A1 true WO2024138482A1 (en) | 2024-07-04 |
Family
ID=91715934
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/143113 WO2024138482A1 (en) | 2022-12-29 | 2022-12-29 | Resource management method and corresponding apparatus |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2024138482A1 (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190324816A1 (en) * | 2018-04-20 | 2019-10-24 | EMC IP Holding Company LLC | Method, apparatus, and computer program product for processing computing task |
CN111338758A (en) * | 2020-02-24 | 2020-06-26 | 华云数据(厦门)网络有限公司 | Resource management method and device and electronic equipment |
CN112148467A (en) * | 2019-06-28 | 2020-12-29 | 微软技术许可有限责任公司 | Dynamic allocation of computing resources |
-
2022
- 2022-12-29 WO PCT/CN2022/143113 patent/WO2024138482A1/en unknown
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190324816A1 (en) * | 2018-04-20 | 2019-10-24 | EMC IP Holding Company LLC | Method, apparatus, and computer program product for processing computing task |
CN112148467A (en) * | 2019-06-28 | 2020-12-29 | 微软技术许可有限责任公司 | Dynamic allocation of computing resources |
CN111338758A (en) * | 2020-02-24 | 2020-06-26 | 华云数据(厦门)网络有限公司 | Resource management method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110809760B (en) | Resource pool management method and device, resource pool control unit and communication equipment | |
US5920703A (en) | Systems and methods for managing the processing of relatively large data objects in a communications stack | |
CN110098946B (en) | Method and device for deploying virtualized network element equipment | |
US20180293108A1 (en) | Data Processing Method and Apparatus, and System | |
JPH10301873A (en) | System and method for controlling transmission of relatively large data objects in a communication system | |
CN112087332B (en) | A virtual network performance optimization system under cloud-edge collaboration | |
JP2022105146A (en) | Acceleration system, acceleration method, and computer program | |
JP7506096B2 (en) | Dynamic allocation of computing resources | |
CN115292280A (en) | Cross-region data scheduling method, device, equipment and storage medium | |
CN115129621B (en) | Memory management method, device, medium and memory management module | |
US11360824B2 (en) | Customized partitioning of compute instances | |
CN114281516A (en) | A NUMA attribute-based resource allocation method and device | |
CN113691575A (en) | Communication method, device and system | |
WO2024138482A1 (en) | Resource management method and corresponding apparatus | |
CN117880281A (en) | Data transmission method and computing device | |
CN118426937A (en) | Port resource allocation method, device, equipment, storage medium and program product | |
CN116383240A (en) | FPGA-based multi-database accelerated query method, device, equipment and medium | |
WO2023108716A1 (en) | Data center resource awareness-oriented virtual network mapping method | |
CN108196786B (en) | Method and management device for storage system partitioning | |
CN113535370A (en) | Method and equipment for realizing multiple RDMA network card virtualization of load balancing | |
US12224903B2 (en) | Acceleration resource scheduling method and apparatus, and acceleration system | |
CN105874757A (en) | Data processing method and multi-core processor system | |
US20190278625A1 (en) | Rule-based reallocation of hosted compute resources | |
WO2024131368A1 (en) | Method and apparatus for scheduling virtual machine, and chip and computer-readable storage medium | |
WO2024055660A1 (en) | Data computing method and apparatus, and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22969633 Country of ref document: EP Kind code of ref document: A1 |