Resource management method and corresponding device
Patent Information
- Application Number
- CN202280100985.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-05-23
AI Technical Summary
In a cloud computing environment, the management method of heterogeneous computing resources leads to resource fragmentation and low allocation efficiency, resulting in low resource utilization of computing device cards.
Through hierarchical grouping relationship management, resource requests are split into sub-requests, resource nodes are allocated based on resource management information, and grouping relationships are recorded using linked lists or binary tree structures to improve resource allocation speed and efficiency.
It reduces resource fragmentation rate, improves resource allocation efficiency and utilization, and is suitable for cloud service systems, data centers and network systems.
Smart Images

Figure CN120035814A_ABST
Abstract
Description
A resource management method and corresponding device Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a resource management method and corresponding device. Background Art
[0002] Currently, artificial intelligence (AI) or big data tasks often require heterogeneous computing devices such as graphics processing units (GPUs) or neural network processing units (NPUs) to accelerate task execution and shorten task execution time. These tasks are usually run in the cloud. For cloud providers, it is necessary to provide a heterogeneous resource management platform to distribute computing resources such as GPUs and NPUs to tenants to ensure the efficient operation of tenant tasks.
[0003] In a cluster, a single server is typically equipped with multiple computing devices, such as GPUs or NPUs, of the same model. These cards, along with the CPU and memory resources, are requested and used by upper-layer applications. These cards are connected via high-speed interconnects, such as Peripheral Component Interconnect Express (PCIe), to ensure efficient data transmission between them.
[0004] In multi-tenancy scenarios on the cloud, tenant applications have diverse resource requirements. If resources are allocated solely based on affinity, grouping resources for some tasks together to reduce data transmission overhead will cause a small number of computing devices on some servers to miss out on allocations, resulting in a large amount of allocation fragmentation. Consequently, current resource management methods face the problems of high resource fragmentation and low allocation efficiency.
[0005] Summary of the Invention
[0006] The present application provides a resource management method for reducing resource fragmentation and improving resource allocation efficiency. The present application also provides a corresponding device, a computer-readable storage medium, and a computer program product.
[0007] In a first aspect, 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 based on the resource request, the sum of the number of resource nodes corresponding to each of 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 based on 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.
[0008] The resource management method provided in this 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.
[0009] In this application, a resource request can be sent by a tenant through a terminal device to a cloud service system, a data center, or a network system. A tenant can be a resource user.
[0010] 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.
[0011] In the present application, resource management information may include one or more hierarchical grouping relationships, and 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 computing device cards from server 1 according to hierarchical grouping relationship 1, and the number of resource nodes corresponding to sub-request 2 is allocated computing device cards from server 2 according to hierarchical grouping relationship 2.
[0012] In this application, the hierarchical grouping relationship includes multiple levels, and the number of groups in each level is one or more. The number of groups in different levels is different, and the number of resource nodes corresponding to groups in different levels is different. The number of resource nodes corresponding to groups at the same level is the same.
[0013] In this application, "matching the number of resource nodes corresponding to different sub-requests with the number of resource nodes corresponding to one or more groups at the same level or different levels" means: if two sub-requests have the same number of resource nodes, resource nodes can be allocated to the two sub-requests based on the resource nodes corresponding to different groups at the same level. If two sub-requests have different numbers of resource nodes, resource nodes can be allocated to the two sub-requests based on the resource nodes corresponding to groups at different levels.
[0014] In the present application, the method for obtaining at least two sub-requests can be to split the 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, reducing the probability of resource fragmentation and improving resource utilization.
[0015] In one possible implementation, 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.
[0016] In this possible implementation, taking 8 resource nodes and 4 levels as an example, each level corresponds to these 8 resource nodes. The number of groups in each level varies, 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 examples shown here. For example, if 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 1 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 a level, each group corresponds to 1 resource node. This application provides different numbers of groups at different levels, and the number of resource nodes corresponding to different level groups is different, which can improve the speed of allocating resource nodes to sub-requests.
[0017] In a possible implementation, each group at a different level corresponds to an exponential power of 2 resource nodes.
[0018] 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 correspondence between each group at different levels and resource nodes that is an exponential power of 2 is only one approach; alternatively, each group at different levels may correspond to resource nodes that is an exponential power of 3, or each group at different levels may correspond to resource nodes that is a positive integer multiple of m, where m is a positive integer.
[0019] In a possible implementation, each sub-request corresponds to a power-of-two resource node.
[0020] In this possible implementation, when each group 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 group at a certain level. The resource nodes corresponding to the entire group are allocated to one sub-request, which can reduce the probability of resource node fragmentation.
[0021] 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.
[0022] 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. The node identifiers of the resource nodes in different groups are different.
[0023] In this possible implementation, the node identifier of the resource node can uniquely identify the resource node, for example, it can indicate a certain location 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 based on the number of resource nodes corresponding to the sub-requests, thereby increasing the speed of resource node allocation.
[0024] 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.
[0025] In this possible implementation, when allocating resource nodes to sub-requests, the matching target level can be quickly determined based on the number of resource nodes corresponding to the sub-requests, thereby increasing the speed of resource node allocation.
[0026] 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 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 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.
[0027] In this possible implementation, the resource nodes allocated to the first sub-request may also come from multiple groups. 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.
[0028] 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.
[0029] In this possible implementation, a binary tree is a tree-shaped data storage structure, and the nodes in the upper layer can branch out 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 top layer can have 1 group, and this 1 group corresponds to 8 resource nodes. The next layer divides the 1 group of the top layer into 2 groups, and each group corresponds to 4 resource nodes. The next layer divides each group of the previous layer into 2 groups, and 4 groups are obtained, and each group corresponds to 2 resource nodes. The next layer divides each group of the previous layer into 2 groups, and 8 groups are obtained, and each group corresponds to 1 resource node. This layer becomes the last layer. The identifiers of all eight resource nodes can be recorded in the group at the bottom layer. The groups in the upper layers above the bottom layer only need to record the number of corresponding resource nodes. When allocating resource nodes to sub-requests, the node identifiers of the bottom layer can be assigned to the sub-request based on the association between the upper layer and the bottom layer in the binary tree. By recording the hierarchical grouping relationship in the form of a binary tree, only the group at the bottom layer needs to contain the node identifiers of the resource nodes. The other upper layers only need to store the number of resource nodes corresponding to the group, thus reducing the amount of data storage.
[0030] 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.
[0031] In this possible implementation, when allocating resource nodes to subrequests based on the binary tree, we only need to determine the target level based on the number of resource nodes corresponding to the subrequest, and then allocate the node identifier of the last level associated with a group in the target level. This shows that the matching target level can be quickly determined from the binary tree based on the number of resource nodes corresponding to the subrequest, thereby speeding up resource node allocation.
[0032] 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 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 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.
[0033] In this possible implementation, the resource nodes allocated to the second sub-request may also come from multiple target groups. The multiple target 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. It is sufficient that the node identifiers of the last level corresponding to these groups do not overlap.
[0034] In a possible implementation, when at least two sub-requests are each a number of resource nodes corresponding to a sub-request that satisfies an exponential power of 2, the resource request obtains the minimum number of sub-requests.
[0035] In this possible implementation, when there are multiple ways to obtain a resource request, the method 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.
[0036] In a possible implementation, the hierarchical grouping relationship is obtained by dividing multiple resource nodes by level. 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.
[0037] In this possible implementation, a 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 application performs multi-level grouping of resource nodes, it no longer relies on the organizational mode of the high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe) architecture. It is divided according to the communication ring, decoupled from the interconnection architecture of the hardware, compatible with the current mainstream architecture, and highly versatile.
[0038] In one possible implementation, the sum of the bandwidths of the communication rings corresponding to different groups at the same level is the same. 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, where 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.
[0039] In this possible implementation, the sum of the bandwidths of the communication rings formed when the resource nodes are divided is consistent, thereby avoiding inconsistent performance of the communication rings in scenarios with an asymmetric interconnection topology.
[0040] 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, where 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.
[0041] 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.
[0042] 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.
[0043] In this possible implementation, resources in a cloud service system typically provide services to tenants in the form of computing devices or virtual machines. Therefore, in a cloud service system scenario, resource nodes can be computing devices or virtual machines. If resources in a cloud service system provide services to tenants in other forms, resource nodes can be other form factors, not limited to computing devices or virtual machines.
[0044] 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.
[0045] In this possible implementation, data center resources typically provide external services in the form of servers or virtual machines. Therefore, in a data center scenario, resource nodes can be servers or virtual machines. If data center resources provide external services in other forms, resource nodes can be other devices, not limited to servers or virtual machines.
[0046] 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. The network device includes at least one of a firewall, a router, and a switch.
[0047] In this possible implementation, network system resources typically provide external services in the form of firewalls, routers, or switches. Therefore, in the network system scenario, the resource node can be at least one of these. If the network system resources provide external services in other forms, the resource node can be another device, not limited to at least one of firewalls, routers, and switches.
[0048] 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.
[0049] 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.
[0050] In this application, the topology relationship refers to the connection relationship between resource nodes, and each resource node can be connected through a bus. For the communication ring, please refer to the previous introduction for understanding.
[0051] In this possible implementation, when grouping resource nodes into multiple levels, it no longer relies on the organizational method of the high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe) architecture. Instead, it is divided according to communication rings, decoupled from the hardware interconnect architecture, compatible with the current mainstream architecture, and highly versatile.
[0052] 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.
[0053] 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, where 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.
[0054] In a possible implementation, each group at a different level includes a power of 2 of resource nodes.
[0055] 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. The node identifiers of the resource nodes in different groups are different.
[0056] In one possible implementation, 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 group at the upper level includes the number of resource nodes corresponding to the group at the upper level, where the upper level is any level above the end level.
[0057] The features and intended effects of the second aspect and any possible implementation can be understood by referring to the first aspect or any possible implementation of the first aspect.
[0058] A third aspect of the present application provides a resource management device, including:
[0059] The receiving unit is configured to receive a resource request, where the resource request includes the number of requested resource nodes.
[0060] The first processing unit is configured to obtain at least two sub-requests according to the resource request received by the receiving unit, wherein 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.
[0061] 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, where 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.
[0062] In one possible implementation, 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.
[0063] In a possible implementation, each group at a different level corresponds to an exponential power of 2 resource nodes.
[0064] In a possible implementation, each sub-request corresponds to a power-of-two resource node.
[0065] 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. The node identifiers of the resource nodes in different groups are different.
[0066] 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.
[0067] 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 based on the number of resource nodes corresponding to the first sub-request; 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.
[0068] In one possible implementation, 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 group at the upper level includes the number of resource nodes corresponding to the group at the upper level, where the upper level is any level above the end level.
[0069] 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 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, 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.
[0070] 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 the node identifiers of the end-level associated with multiple target groups to the second sub-request based on 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.
[0071] In a possible implementation, when at least two sub-requests are each a number of resource nodes corresponding to a sub-request that satisfies an exponential power of 2, the resource request obtains the minimum number of sub-requests.
[0072] In a possible implementation, the hierarchical grouping relationship is obtained by dividing multiple resource nodes by level. 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.
[0073] 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.
[0074] 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, where 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.
[0075] 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.
[0076] 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.
[0077] 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. The network device includes at least one of a firewall, a router, and a switch.
[0078] A fourth aspect of the present application provides a resource management device, including:
[0079] The first processing unit is configured to obtain a topological relationship between multiple resource nodes, where the topological relationship represents a communication relationship between the multiple resource nodes.
[0080] The second processing unit is used to group the multiple resource nodes according to the topological relationship between the multiple resource nodes in order to obtain a hierarchical grouping relationship of the multiple resource nodes. The hierarchical grouping relationship is obtained by dividing the multiple resource nodes in a hierarchical manner. 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.
[0081] 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.
[0082] 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.
[0083] 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, where 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.
[0084] In a possible implementation, each group at a different level includes a power of 2 of resource nodes.
[0085] 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. The node identifiers of the resource nodes in different groups are different.
[0086] In one possible implementation, 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 group at the upper level includes the number of resource nodes corresponding to the group at the upper level, where the upper level is any level above the end level.
[0087] In a fifth aspect, 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 modules or units 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.
[0088] In a sixth aspect, the present application provides a resource management device 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.
[0089] In a seventh aspect, the present application provides a resource management device. 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 configured to store instructions, the processor is configured to execute the instructions, and the communication interface is configured to communicate with other network elements under the control of the processor. When executed by the processor, the instructions cause the processor to perform the method of the first aspect or any possible implementation of the first aspect.
[0090] 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 configured to store instructions, the processor is configured to execute the instructions, and the communication interface is configured to communicate with other network elements under the control of the processor. When executed by the processor, the instructions cause the processor to perform the method of the second aspect or any possible implementation of the second aspect.
[0091] 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 by 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.
[0092] In the tenth 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 by 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 second aspect or any possible implementation of the second aspect.
[0093] In the eleventh aspect of the present application, a computer-readable storage medium is provided, 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.
[0094] The 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 run on a computer device, the computer device executes the method in the aforementioned second aspect or any possible implementation of the second aspect.
[0095] 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.
[0096] In a fourteenth aspect, 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.
[0097] A fifteenth aspect of the present application provides a resource management system, comprising a resource management device and multiple resource nodes, wherein the resource management device is used in the method of the aforementioned first aspect or any possible implementation of the first aspect.
[0098] A sixteenth aspect of the present application provides a resource management system, comprising a resource management device and multiple resource nodes, wherein the resource management device is used in the method of the aforementioned second aspect or any possible implementation of the second aspect.
[0099] 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. 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.
[0101] FIG1A is a schematic diagram of an architecture of a resource management system provided by an embodiment of the present application;
[0102] FIG1B is a schematic diagram of an architecture of a cloud service system provided in an embodiment of the present application;
[0103] FIG1C is a schematic diagram of an architecture of a data center provided in an embodiment of the present application;
[0104] FIG2 is a schematic diagram of a structure of a resource management device provided in an embodiment of the present application;
[0105] FIG3 is a schematic diagram of an embodiment of a resource management method provided in an embodiment of the present application;
[0106] FIG4 is a schematic diagram of an example of a hierarchical grouping process provided by an embodiment of the present application;
[0107] FIG5A is a schematic diagram illustrating an example of a hierarchical grouping relationship provided by an embodiment of the present application;
[0108] FIG5B is another exemplary schematic diagram of a hierarchical grouping relationship provided by an embodiment of the present application;
[0109] FIG5C is another exemplary schematic diagram of a hierarchical grouping relationship provided by an embodiment of the present application;
[0110] FIG6 is a schematic diagram of an embodiment of a resource management method provided in an embodiment of the present application;
[0111] FIG7A is a schematic diagram of an example scenario of a resource management method provided in an embodiment of the present application;
[0112] FIG7B is a schematic diagram of an updated linked list provided in an embodiment of the present application;
[0113] FIG8A is a schematic diagram of another scenario example of the resource management method provided in an embodiment of the present application;
[0114] FIG8B is a schematic diagram of an updated binary tree provided in an embodiment of the present application;
[0115] FIG9 is another structural diagram of a resource management device provided in an embodiment of the present application;
[0116] FIG10 is another schematic diagram of the structure of the resource management device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0117] The present application provides a resource management method for reducing resource fragmentation and improving resource allocation efficiency. The present application also provides a corresponding device, a computer-readable storage medium, and a computer program product. Detailed descriptions are provided below.
[0118] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0119] FIG1A is a schematic diagram of the structure of a resource management system provided in an embodiment of the present application.
[0120] As shown in FIG1A , the resource management system includes a resource management device and multiple resource nodes. The resource management device can manage the multiple resource nodes. The resource management device can group 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.
[0121] The resource management device stores the hierarchical grouping relationship of multiple resource nodes. Upon receiving a resource request, it can obtain at least two sub-requests (e.g., sub-request 1 and sub-request 2 in FIG1A ) based on the resource request. It then allocates resource nodes to each sub-request based on the hierarchical grouping relationship of the multiple resource nodes in the resource management information. For example, sub-request 1 is allocated a resource node with a node identifier of X, and sub-request 2 is allocated at least two resource nodes with node identifiers of P through Q.
[0122] The resource management device in FIG1A may be an independent device, or may be integrated into a control platform of a resource management system, or integrated into a certain resource node.
[0123] The functions of the resource management device can be implemented by software or hardware.
[0124] 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 geographically close data centers. Typically, a region may include multiple AZs.
[0125] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Inter-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0126] As an example of a hardware functional unit, the resource management device may include at least one computing device, such as a server. Alternatively, the resource management device may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0127] The multiple computing devices included in the resource management device can be distributed in the same zone or in different zones. 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 servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0128] The resource management system provided in the embodiments 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.
[0129] The resource node in FIG1B may be a computing device card or a virtual machine (VM), wherein the computing device card may be at least one of a central processing unit (CPU), a graphics processing unit (GPU), and a neural network processing unit (NPU).
[0130] Among them, when multiple resource nodes in each server are grouped according to the hierarchy, if the hierarchy has at least two groups, then the resource nodes corresponding to each group can constitute a communication ring. A communication ring refers to a ring formed by at least two resource nodes connected 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 present application performs multi-level grouping of resource nodes, it no longer relies on the organizational mode of the high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe) architecture. It is divided according to the communication ring, decoupled from the interconnection architecture of the hardware, compatible with the current mainstream architecture, and has strong versatility.
[0131] 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 also 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.
[0132] The cloud platform scheduler maintains resource management information, which may include one or more hierarchical grouping relationships within each server. If the servers in the cloud service system are considered a cluster, each hierarchical grouping relationship represents a hierarchical grouping of multiple resource nodes in different clusters, or a hierarchical grouping of multiple resource nodes in different subsets within the same cluster.
[0133] 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.
[0134] After receiving the resource request, the cloud platform manager may obtain at least two sub-requests according to the resource request, and then allocate a resource node to each sub-request according to a hierarchical grouping relationship.
[0135] The resource management system provided in the embodiments of the present application can be a data center. As shown in FIG1C , the data center includes a data center management platform, an internal data center network, and multiple servers. Each server comprises a hardware layer and a software layer. The hardware layer includes memory, a network card, a processor, and a disk, which are connected via a bus. The hardware layer provides the hardware resources required for the virtual machines in the software layer to operate. The software layer includes a host operating system and multiple virtual machines. The host operating system can include a data center management platform client that can interact with the data center management platform.
[0136] Virtualization technology, which mainly consists of computing virtualization and input / output (I / O) virtualization, 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 of physical resources.
[0137] Compute virtualization is the process of making a server's computing resources, such as processors and memory, available to virtual instances. For example, virtual machines (VMs) are virtual instances. In other scenarios, these virtual instances are containers or bare metal servers.
[0138] In Figure 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 Figure 1A can be the data center management platform in Figure 1C.
[0139] Among them, virtual machines can also be called cloud servers (Elastic Compute Service, ECS) or elastic instances (different cloud service providers have different names).
[0140] 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.
[0141] The data center management platform can provide an access interface (such as a user interface or application programming interface (API)). Tenants can use a client to remotely access the access interface, register an account and password on 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 use the client to send a resource request to the data center management platform. Based on the resource request, at least two sub-requests are obtained, and virtual machines are allocated to the sub-requests based on the hierarchical grouping relationship stored in the data center management platform. For example, sub-request 1 is assigned the identity of virtual machine 1, and sub-request 2 is assigned the identity of virtual machine 2.
[0142] 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.
[0143] Figure 2 is a possible logical structure diagram of the resource management device provided by an embodiment of the present application. As shown in Figure 2, the resource management device 20 provided by the 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.
[0144] The processor 201 may be a central processing unit (CPU), a general-purpose processor (GPOR), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device (PLD), a transistor logic device (TLD), a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The bus 204 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG. 2 shows only one thick line, but this does not imply that there is only one bus or only one type of bus.
[0145] The resource management method provided by the embodiment of the present application is described below. The content of the method involving the execution of 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.).
[0146] In the embodiment of the present application, the resource management device can manage the resource nodes in the resource management system. One resource management solution is to group multiple resource nodes into multiple levels; another resource management solution is to allocate resource nodes to resource requests. The following are introduced respectively:
[0147] In conjunction with the resource management system described 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 .
[0148] As shown in FIG3 , an embodiment of the resource management method provided in the embodiment of the present application includes:
[0149] 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.
[0150] 302. The resource management device groups the multiple resource nodes according to the topological relationship between the multiple resource nodes, so as to obtain a hierarchical grouping relationship of the multiple resource nodes.
[0151] The hierarchical grouping relationship is obtained by dividing multiple resource nodes according to the hierarchy. The hierarchical grouping relationship includes multiple levels, where each level corresponds to multiple resource nodes. The number of groups at different levels is different, and the number of resource nodes corresponding to groups at different levels is different. Each group at the same level corresponds to the same number of resource nodes.
[0152] The resource management device in this application can obtain the topological relationship of the resource nodes before dividing the resource nodes. For example, taking the cloud service system shown in Figure 1B as an example, the interconnection topology status 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 completed.
[0153] For example, if there are eight resource nodes, in the sequential grouping from the top layer to the bottom layer, the top layer can have one group corresponding to these eight resource nodes. The next layer can divide the eight resource nodes corresponding to the upper group into two equal groups, each corresponding to four resource nodes. The next layer can further divide the four resource nodes corresponding to each of the two upper groups into two equal groups, resulting in four groups, each corresponding to two resource nodes. The next layer can further divide the four upper groups corresponding to the two resource nodes into two equal groups, resulting in eight groups, each corresponding to one resource node. This grouping process can be understood by referring to Figure 4.
[0154] As shown in Figure 4, a server has 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, and 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, each group corresponding to the 4 resource nodes is divided again. If resource node 0 and resource node 1 can form a communication ring, and 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, the 4 groups corresponding to the 2 resource nodes are divided again, and each resource node is divided into a group separately, and the division ends.
[0155] After the eight resource nodes listed above are divided, the resulting hierarchical grouping relationship can include four levels. The number of groups in these four levels can be 1, 2, 4, and 8, respectively. If a level has one group, this group corresponds to 8 resource nodes. If a level has two groups, each group corresponds to 4 resource nodes. If a level has four groups, each group corresponds to 2 resource nodes.
[0156] It should be noted that when dividing resource nodes, it is not necessary to divide them into 8 resource nodes. 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, if 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. If there is one group in a level, this group corresponds to 6 resource nodes. If there are 2 groups in a level, each group corresponds to 3 resource nodes. If there are 6 groups in a level, each group corresponds to 1 resource node.
[0157] The examples listed above all use the binary search method to group multiple resource nodes. If the number of resource nodes is odd and cannot be directly divided into two equal parts, you can first divide most of the resource nodes into a group through a single partition, so that the number of resource nodes in the group is an even number or an exponential power of 2. Subsequent partitioning of the group can use the binary search method. For example: A resource cluster includes 17 resource nodes. During the first partition, 16 resource nodes can be divided into a group, and then the 16 resource nodes in the group can be subsequently partitioned using the binary search method.
[0158] The multi-level grouping process illustrated in FIG4 is based on the premise that at least two resource nodes in each group are divided based on the formation of a communication ring. In this way, when performing multi-level grouping of resource nodes, it no longer relies on the organizational method of the high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe) architecture. The division is based on the communication ring, which is decoupled from the hardware interconnection architecture, compatible with the current mainstream architecture, and highly versatile.
[0159] It should be noted that in the 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 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.
[0160] When grouping resources based on 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. The bandwidth of a communication ring is the sum of the communication bandwidths between the resource nodes that make up the communication ring. For example, if a communication ring includes four resource nodes, where the bandwidth between resource nodes 1 and 2 is 10M, the bandwidth between resource nodes 2 and 3 is 10M, the bandwidth between resource nodes 3 and 4 is 10M, and the bandwidth between resource nodes 4 and 1 is 10M, then the sum of the bandwidths of the communication ring is 10+10+10+10=40M. The consistent sum of the bandwidths of the communication rings formed by resource node division avoids inconsistent communication ring performance in asymmetric interconnection topologies.
[0161] 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 according to 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, the combination method with the largest sum of the bandwidths of the communication ring is selected. For example: if resource node 0, resource node 1, resource node 2, and resource node 3 can form a communication ring, and 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, and in this combination method, the bandwidth of the communication ring is 35M, then a combination method in which resource node 0, resource node 1, resource node 2, and resource node 3 are divided into one group is selected.
[0162] Optionally, the hierarchical grouping relationship provided in the embodiment of the present application can be recorded in the form of a linked list or a binary tree, which are introduced below respectively.
[0163] 1. The hierarchical grouping relationship is recorded in the form of a linked list.
[0164] The hierarchical grouping relationship of the eight resource nodes shown in FIG. 4 can be understood by referring to FIG. 5A .
[0165] As shown in Figure 5A, the eight resource nodes in Figure 4 can be divided into four levels in order from few to many. These four 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. Figure 5A only uses the order from bottom to top as an example for illustration. Among them, each group in Level 1 corresponds to one resource node, each group in Level 2 corresponds to two resource nodes, each group in Level 3 corresponds to four resource nodes, and one group in Level 4 corresponds to eight resource nodes.
[0166] The hierarchical grouping relationship shown in FIG5A is recorded in the form of a linked list. The linked list at each level includes the node identifiers of the resource nodes included in each group at that level. The node identifiers of the resource nodes in different groups are different. The node identifier of a resource node can uniquely identify the resource node. For example, it can indicate the location of the resource node on a certain server, such as computing device card 1 in server 1.
[0167] The linked list may also include the level and / or the number of resource nodes corresponding to each group in the level. The linked list may include a header and groups. The header may be used to record the level. The header and groups, as well as the groups after grouping, may be connected via 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.
[0168] 2. The hierarchical grouping relationship is recorded in the form of a binary tree.
[0169] The hierarchical grouping relationship in the embodiment of the present application can also be recorded in the form of a binary tree.
[0170] A binary tree is a tree-shaped data storage structure in which the nodes in the upper layer can branch 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 top layer can have 1 group, and this 1 group corresponds to 8 resource nodes. The next layer divides the 1 group of the top layer into 2 groups, each of which corresponds to 4 resource nodes. The next layer divides each group of the previous layer into 2 groups, resulting in 4 groups, each of which corresponds to 2 resource nodes. The next layer divides each group of the previous layer into 2 groups, resulting in 8 groups, each of which corresponds to 1 resource node, and this layer becomes the last layer.
[0171] In the embodiment of the present application, the identifiers of the eight resource nodes can be recorded in the group at the end level, or can be recorded in the group at each level. This can be understood by referring to FIG5B and FIG5C respectively.
[0172] 1. The identifier of the resource node is recorded in the group at the end level.
[0173] 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, namely, node identifier 0, ... node identifier 7, 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 (this 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.
[0174] 2. The identification of the resource node is recorded in the grouping of each level.
[0175] The node identifiers of the eight resource nodes can all be recorded in the groups at each level. As shown in FIG5C , each group at the last level of the binary tree (level 1) includes the node identifier of a resource node, namely, node identifier 0, ..., node identifier 7, and the node identifiers in different groups are different. The four groups at level 2 record node identifiers 0, 1, node identifiers 2, 3, node identifiers 4, 5, and node identifiers 6, 7, respectively. The two groups at level 3 record node identifiers 0, 1, 2, 3, and node identifiers 4, 5, 6, and 7, respectively. The one group at level 4 records node identifiers 0, 1, 2, 3, 4, 5, 6, and 7.
[0176] The above describes the resource management solution for dividing resource nodes in a resource cluster. The following describes the resource management solution for allocating resource nodes to tenants' resource requests.
[0177] 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 .
[0178] As shown in FIG6 , an embodiment of the resource management method provided in the embodiment of the present application includes:
[0179] 601. The resource management device receives a resource request, where the resource request includes the number of requested resource nodes.
[0180] In this application, a resource request can be sent by a tenant through a terminal device to a cloud service system, a data center, or a network system. A tenant can be a resource user.
[0181] 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.
[0182] 602. The resource management device obtains at least two sub-requests according to the resource request, and 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.
[0183] For example, if 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, so 1+4=5.
[0184] 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.
[0185] The resource management information may include one or more hierarchical grouping relationships, each hierarchical grouping relationship being used to represent a hierarchical grouping of multiple resource nodes in different clusters. In different application scenarios, the meaning of a cluster may be different. Taking a 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 may be allocated through one hierarchical grouping relationship, or through different hierarchical grouping relationships, such as: the number of resource nodes corresponding to sub-request 1 is allocated computing device cards from server 1 according to hierarchical grouping relationship 1, and the number of resource nodes corresponding to sub-request 2 is allocated computing device cards from server 2 according to hierarchical grouping relationship 2.
[0186] In this application, the hierarchical grouping relationship can be understood by referring to the previous introduction to the resource node grouping part.
[0187] In this application, "matching the number of resource nodes corresponding to different sub-requests with the number of resource nodes corresponding to one or more groups at the same level or different levels" means that if two sub-requests have the same number of resource nodes, resource nodes can be allocated to the two sub-requests based on 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 resource node 1 from the second group to sub-request 2.
[0188] If two sub-requests correspond to different numbers of resource nodes, resource nodes can be allocated to them 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.
[0189] 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, reducing the probability of resource fragmentation and improving resource utilization.
[0190] Optionally, in the embodiment of the present application, in the hierarchical grouping relationship, each group at a different level corresponds to an exponential power of 2 resource nodes. The exponential power of 2 can be expressed as 2 n , where n is a natural number (0, 1, ...).
[0191] It should be noted that each group at different levels corresponds to an exponential power of 2 resource nodes, which is only one way. It can also be that each group at different levels corresponds 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.
[0192] Optionally, when each group at a different level 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 group at a certain level. The resource nodes corresponding to the entire group are allocated to one sub-request, which can reduce the probability of resource node fragmentation.
[0193] 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.
[0194] Optionally, as can be seen from the previous 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 an introduction to the linked list, please refer to the previous content for understanding.
[0195] When the information of each level in the hierarchical grouping relationship is recorded in the form of a linked list, and at least two sub-requests include the first sub-request, step 603 may include: allocating a resource node corresponding to a node identifier of a group from the linked list of the target level to the first sub-request based on 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 this way, when allocating resource nodes to the sub-requests, the matching target level can be quickly determined based on the number of resource nodes corresponding to the sub-requests, thereby speeding up resource node allocation.
[0196] This situation can be understood by referring to FIG7A. As shown in FIG7A, the resource management system includes resource cluster 1 and resource cluster 2. The topological relationships of the resource nodes in resource cluster 1 and resource cluster 2 are 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 machine groups. There are multiple resource nodes in resource cluster 1. The node identification of the resource nodes 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 nodes can start from resource node 200 and be numbered as resource node 201, resource node 202, .... The node identification of the resource nodes is not shown in FIG7A. It can be understood by referring to the markings in FIG5A. Only the numerical values of the node identification are different. Normally, in the scenario shown in FIG7A, the number of resource nodes in each resource cluster is usually a multiple of 8.
[0197] 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.
[0198] 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 represents the hierarchy.
[0199] Link list 2 also has four layers, which are marked as layer 1, layer 2, layer 3 and layer 4 in FIG. 7A , where the layers represent hierarchies.
[0200] In linked list 1 or linked list 2, every 8 resource nodes can obtain a hierarchical grouping relationship such as that shown in Figure 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 through pointers after each level.
[0201] The resource management device receives resource request 1 and resource request 2. Resource request 1 requests 5 resource nodes, indicating that the tenant wants to request 5 resource nodes. Resource request 2 requests 6 resource nodes, indicating that the tenant wants to request 6 resource nodes.
[0202] The resource management device may obtain sub-request 1 and sub-request 2 based on resource request 1, where sub-request 1 is used to request four resource nodes and sub-request 2 is used to request one resource node. The resource management device may obtain sub-request 3 and sub-request 4 based on resource request 2, where sub-request 3 is used to request four resource nodes and sub-request 4 is used to request two resource nodes.
[0203] 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.
[0204] The resource management device can allocate 4 resource nodes from a group in layer 3 to sub-request 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 from a group in layer 2 to sub-request 4, such as resource node 204 and resource node 205 in resource cluster 2.
[0205] 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, based on 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.
[0206] For example, the resource management device may allocate four resource nodes from two groups in layer 2 to sub-request 1 based on linked list 1, such as resource nodes 100, resource nodes 101, resource nodes 102, and resource nodes 103 in resource cluster 1, and allocate one resource node from one group in layer 1 to sub-request 2, such as resource node 104 in resource cluster 1. Alternatively, the resource management device may allocate four resource nodes from four groups in layer 1 to sub-request 1 based on 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 two resource nodes from one group in layer 2 to sub-request 1 based on linked list 1, and allocate two resource nodes from two groups in layer 1 to sub-request 1. Alternatively, the resource management device may allocate two resource nodes from one group in layer 2 to sub-request 1 based on linked list 1, and then allocate two resource nodes from one group in layer 2 to sub-request 1 based on linked list 2. There may be many specific allocations, which are not limited in this application.
[0207] 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 Figure 7B. As shown in Figure 7B, the first five of the original eight resource node positions in layer 1 are eliminated, and the remaining three can still be allocated. Since five of the original 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 both eliminated because five of the first eight resource node positions are allocated. If a sub-request is used to request one or two resource nodes, the resource management device can allocate resource node 105, resource node 106, and resource node 107 for the sub-request.
[0208] In an embodiment of the present application, the resource management device can allocate resource nodes to the sub-requests based on the number of resource nodes corresponding to the sub-requests, from the level that meets the quantity requirement and corresponds to the least number of resource nodes. In this way, the allocation speed of resource nodes can be improved.
[0209] Optionally, when the hierarchical grouping relationship can be recorded in the form of a binary tree, the above-mentioned step 603 may include: according to the number of resource nodes corresponding to the second sub-request, allocating the resource node corresponding to the node identifier of the last level associated with the target group to the second sub-request, 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.
[0210] For an introduction to binary trees, please refer to the previous introduction for understanding.
[0211] Taking the binary tree shown 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 relationships of the resource nodes in resource cluster 1 and resource cluster 2 are 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 machine groups. There are 8 resource nodes in resource cluster 1. The node identifiers of the resource nodes 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 identifiers of the resource nodes can start from resource node 20 and be numbered as resource node 21, resource node 22, ..., resource node 27 in sequence.
[0212] 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 .
[0213] The resource management device receives a resource request, and the number of resource nodes requested in the resource request is 10, indicating that the tenant wants to request 10 resource nodes.
[0214] 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.
[0215] 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.
[0216] 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 the first sub-request, based on the number of resource nodes corresponding to the second sub-request, the resource nodes corresponding to the node identifiers of the end-level associated with multiple target groups are allocated 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.
[0217] Exemplarily, the resource management device may obtain sub-request 1 according to the resource request, where sub-request 1 is used to request 8 resource nodes.
[0218] The resource management device can allocate a total of 8 resource nodes to sub-request 1 from two groups of 4 resource nodes each corresponding to layer 3 based on binary tree 1, such as resource nodes 10 and 11 in resource cluster 1, ... resource node 17, such as resource nodes 20 and 21 in resource cluster 2. Alternatively, 4 resource nodes can be allocated to sub-request 1 from one group in layer 3, and another 4 resource nodes can be allocated from two groups in layer 2 that each correspond to two resource nodes. Of course, other allocation methods can also be used, such as allocating some resource nodes based on binary tree 1 and some resource nodes based on binary tree 2. There are many different specific allocation methods, and this application does not limit this.
[0219] It should be noted that after allocating resource nodes, the resource management device will update the structures 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 other methods can also be used to indicate that the resource node at that position has been allocated.
[0220] In an embodiment of the present application, the resource management device can allocate resource nodes to the sub-requests based on the number of resource nodes corresponding to the sub-requests, from the tree branch at the level that meets the number requirement and has the least number of corresponding resource nodes. In this way, the allocation speed of resource nodes can be improved.
[0221] 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.
[0222] 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 split method with the least number of sub-requests is selected. For example, the resource request in Figure 8A above requests 10 resource nodes. There are multiple ways to split it in the form of an 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 8 and 2 split method is preferred. 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. Of course, if the remaining allocatable resource nodes in the resource management system cannot meet the allocation requirements of the 8 and 2 split method, the 4, 4, and 2 split method can also be used to allocate resource nodes to the tenant from different resource clusters.
[0223] 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.
[0224] As shown in FIG9 , a structure of a resource management device 90 provided in an embodiment of the present application includes:
[0225] The first processing unit 901 is configured to obtain a topological relationship between multiple resource nodes, where the topological relationship represents a communication relationship between the multiple resource nodes. The first processing unit 901 may execute step 301 in the above method embodiment.
[0226] The second processing unit 902 is configured to group the multiple resource nodes according to a hierarchical 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 a hierarchical relationship. The hierarchical grouping relationship includes multiple levels, where each level corresponds to 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. The second processing unit 902 can execute step 302 in the above-mentioned method embodiment.
[0227] 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.
[0228] 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.
[0229] 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.
[0230] Optionally, each group at different levels includes resource nodes that are a power of 2.
[0231] Optionally, 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.
[0232] 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 group at the upper level includes the number of resource nodes corresponding to the group at the upper level, where the upper level is any level above the end level.
[0233] 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 Figures 3 to 8B above, and will not be repeated here.
[0234] As shown in FIG10 , a structure of a resource management device 100 provided in an embodiment of the present application includes:
[0235] 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.
[0236] 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.
[0237] 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, where 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.
[0238] 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.
[0239] Optionally, each group at a different level corresponds to an exponential power of 2 resource nodes.
[0240] Optionally, each sub-request corresponds to a power-of-two resource node.
[0241] Optionally, 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.
[0242] Optionally, at least two sub-requests include a first sub-request, and the 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 the 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.
[0243] 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 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.
[0244] 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 group at the upper level includes the number of resource nodes corresponding to the group at the upper level, where the upper level is any level above the end level.
[0245] 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 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.
[0246] 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 based on 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.
[0247] 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.
[0248] The hierarchical grouping relationship is obtained by dividing multiple resource nodes according to the hierarchy. 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.
[0249] 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.
[0250] 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 grouping at the same level.
[0251] 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.
[0252] 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.
[0253] 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.
[0254] 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 Figures 3 to 8B above, and will not be repeated here.
[0255] In another embodiment of the present application, a computer-readable storage medium is also provided, in which computer-executable instructions are stored. When the processor of the resource management device executes the computer-executable instructions, the resource management device executes the steps performed by the resource management device in Figures 3 to 8B above.
[0256] In another embodiment of the present application, a computer program product is provided. The computer program product includes 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 .
[0257] 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 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 terminal executes the steps performed by the resource management device in the aforementioned 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 can be composed of chips, or it can include chips and other discrete devices.
[0258] In the several embodiments provided in this 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 merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, 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 interface, device or unit, which can be electrical, mechanical or other forms.
[0259] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0260] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in whole or in part through software, hardware, firmware, or any combination thereof.
[0261] When software is used to implement the integrated unit, 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 can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can 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 can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can 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 integrations. The available medium can 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)).
Claims
1. A resource management method, characterized in that: include: 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, wherein 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; 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.
2. The method according to claim 1, 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 each group in the same level corresponds to the same number of resource nodes.
3. The method according to claim 2, characterized in that Each grouping at the different levels corresponds to an exponential power of 2 resource nodes.
4. The method according to claim 3, characterized in that Each sub-request corresponds to an exponential power of 2 resource nodes.
5. The method according to any one of claims 1 to 4, characterized in that 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 node identifiers of resource nodes contained in each group of the level. The node identifiers of resource nodes in different groups are different.
6. The method according to claim 5, characterized in that The at least two sub-requests include a first sub-request, and allocating a corresponding number of resource nodes to each sub-request according to the resource management information includes: 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.
7. The method according to claim 5, characterized in that The at least two sub-requests include a first sub-request, and allocating a corresponding number of resource nodes to each sub-request according to the resource management information includes: 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.
8. 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, wherein each group at the end 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.
9. The method according to claim 8, characterized in that The at least two sub-requests include a second sub-request, and allocating a corresponding number of resource nodes to each sub-request according to the resource management information includes: 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.
10. The method according to claim 8, characterized in that The at least two sub-requests include a second sub-request, and allocating a corresponding number of resource nodes to each sub-request according to the resource management information includes: According to the number of resource nodes corresponding to the second sub-request, resource nodes corresponding to the node identifiers of the end-level associated with multiple target groups are allocated 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.
11. The method according to any one of claims 1 to 10, 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.
12. The method according to any one of claims 1 to 11, characterized in that The hierarchical grouping relationship is obtained by dividing the multiple resource nodes by level. 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.
13. The method according to claim 12, 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.
14. The method according to claim 12 or 13, 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 grouping at the same level.
15. The method according to any one of claims 1 to 14, 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.
16. The method according to any one of claims 1 to 14, 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.
17. The method according to any one of claims 1 to 14, characterized in that The resource node is located in a network system, and the resource node is a network device of the network system. The network device includes at least one of a firewall, a router, and a switch.
18. A resource management method, characterized in that: include: Acquire a topological relationship between a plurality of resource nodes, wherein the topological relationship represents a communication relationship between the plurality of 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, the number of groups at different levels is different, and each group at the same level corresponds to the same number of resource nodes.
19. The method according to claim 18, 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.
20. The method according to claim 19, 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.
21. The method according to claim 19 or 20, 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 grouping at the same level.
22. The method according to any one of claims 18 to 21, characterized in that Each grouping at the different levels includes an exponential power of 2 resource nodes.
23. The method according to any one of claims 18 to 22, characterized in that 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 node identifiers of resource nodes contained in each group of the level. The node identifiers of resource nodes in different groups are different.
24. 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, wherein each group at the end 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.
25. A resource management device, characterized in that: include: 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 programs or instructions are executed by the processor, the client executes the method as described in any one of claims 1-17 or 18-24.
26. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a computer device, the computer device is caused to execute the method according to any one of claims 1 to 17 or 18 to 24.
27. A computer program product, characterized in that The computer program product comprises a computer program code, which, when run on a computer device, causes the computer device to perform the method according to any one of claims 1 to 17 or 18 to 24.
28. A chip system, characterized in that: The chip system includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected by lines; the interface circuits are used to receive signals from the 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 as described in any one of claims 1-17 or 18-24.
29. A resource management system, characterized in that: It comprises a resource management device and a plurality of resource nodes, wherein the resource management device is used to execute the method as described in any one of claims 1-17 or 18-24.