Resource management method, device and medium

By introducing resource management methods into the cluster, dynamic allocation and recycling of storage resources is solved, resource quota management problems in the storage system are achieved, efficient and reasonable allocation and recycling of resources are achieved, and the performance and user experience of the cluster are improved.

CN119271404APending Publication Date: 2025-01-07JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411337003.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The resource quota management of existing storage systems is difficult to effectively manage and utilize storage space, especially in the case of rapid growth in data volume, how to reasonably allocate and recycle resources has become a challenge.

Method used

Introduce resource management methods in the cluster, receive pre-applications from nodes through the cluster controller, and dynamically allocate and recycle according to the remaining resources, including active release and forced recycling mechanisms to ensure that resources are allocated on demand and reduce resource idleness.

Benefits of technology

It improves the fairness of rational use and allocation of resources, enhances the performance and reliability of the cluster, reduces system failures, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271404A_ABST
    Figure CN119271404A_ABST
Patent Text Reader

Abstract

The invention provides a resource management method and device and a medium, and relates to the technical field of resource management, and the method comprises the steps: receiving a pre-application sent by a first node, distributing a target resource for the first node when the remaining application amount of the total resource of a cluster meets a demand, and receiving a life cycle of the first node based on the pre-application, actively releasing residual resources in the target resources; when the demand is not met, the remaining resources in the target resources which are applied by other nodes in the cluster and are not actively released are forcibly recycled, the remaining resources in the target resources which are applied by other nodes in the cluster and are not actively released are allocated to the first node, and the node resources are subjected to life cycle management; and the cluster can also forcibly recover the resources which are not actively released, so that the unused resources can be distributed again, the resources are prevented from being idle, the fairness of carrying out resource distribution on the nodes is improved, the resources are ensured to be distributed as required, and the resource contention is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of resource management technology, and in particular to a resource management method, device and medium. Background Art

[0002] As an efficient resource management method, resource quota management of storage system not only ensures the stability and fairness of the system, but also provides fine-grained control over resources, enhances the rational use of resources, and improves the rational use of resources. Quota management is an important technology in storage systems, which is used to control and limit the use of disk space. Specifically, the quota management of storage systems can limit the maximum usage of disk storage resources by nodes or groups, thereby preventing a single node from occupying too many resources and affecting the normal use of other users. With the rapid development of information technology, the amount of data is growing exponentially, and the storage needs of enterprises and individuals are also increasing. How to effectively manage and utilize storage space has become an urgent problem to be solved. Summary of the invention

[0003] In view of this, embodiments of the present application provide a resource management method, device, and medium to overcome the above problems or at least partially solve the above problems.

[0004] A first aspect of an embodiment of the present application provides a resource management method, which is applied to a cluster controller in a cluster. The method includes:

[0005] receiving a pre-application issued by a first node in the cluster, wherein the pre-application is used to apply for a target resource;

[0006] When the remaining application amount of the total resources of the cluster meets the demand, the target resources are allocated to the first node from the remaining application amount of the total resources of the cluster, and the remaining resources in the target resources actively released by the first node based on the pre-application life cycle are received;

[0007] When the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

[0008] Optionally, each pre-application life cycle includes at least a first stage and a second stage, and the forced recovery of remaining resources in the target resources applied for and not actively released by other nodes in the cluster includes:

[0009] Determine the sum of remaining resources of a plurality of first target resources, where the first target resources are target resources in the second stage applied for by a plurality of nodes included in the cluster, wherein in the second stage, the pre-applied target resources do not change and the remaining resources in the first target resources can be directly called by other pre-applications in the first stage issued by the same node;

[0010] Determine whether the sum of the remaining amounts of the remaining resources in the plurality of first target resources satisfies the resource application amount of the target resource that the first node needs to apply for;

[0011] When the sum of the remaining amounts of the remaining resources in the plurality of first target resources meets the resource application amount of the target resource that the first node needs to apply for, the remaining resources in the plurality of first target resources are forcibly reclaimed.

[0012] Optionally, the forcibly reclaiming remaining resources from the plurality of first target resources includes:

[0013] Sort the remaining resources of the plurality of first target resources in descending order to obtain a first list;

[0014] Traversing the resource remaining amounts of multiple first target resources in the first list, accumulating the traversed first target resources, and determining whether the sum of the resource remaining amounts of the multiple first target resources obtained in the accumulation process satisfies the resource application amount of the target resource;

[0015] When the sum of the remaining resources of the plurality of first target resources obtained in the accumulation process satisfies the resource application amount of the target resource, the traversal of the first list is terminated;

[0016] Recycling the remaining resources corresponding to the sum of the remaining amounts of the multiple first target resources obtained in the accumulation process;

[0017] The allocating remaining resources among target resources applied for and not actively released by other nodes in the cluster to the first node includes: allocating remaining resources corresponding to the sum of resource surplus amounts of multiple first target resources obtained in the accumulation process to the first node.

[0018] Optionally, the method further comprises:

[0019] When the sum of the remaining resources of the plurality of first target resources cannot satisfy the resource application amount of the target resource that the first node needs to apply for, determine the sum of the remaining resources of the plurality of second target resources, where the second target resources are target resources in the first stage applied for by the plurality of nodes included in the cluster, wherein in the first stage, the pre-applied target resources may be changed and the remaining resources in the first target resources may be directly called by other pre-applications in the first stage issued by the same node;

[0020] Calculate a resource application amount difference based on the sum of the remaining amounts of the remaining resources in the plurality of first target resources and the resource application amount of the target resource that the first node needs to apply for;

[0021] Determine whether the sum of the remaining amounts of the remaining resources in the plurality of second target resources satisfies the resource application amount difference;

[0022] When the sum of the remaining amounts of the remaining resources in the plurality of second target resources satisfies the resource application amount difference, the remaining resources in the plurality of second target resources are forcibly reclaimed.

[0023] Optionally, the forcibly reclaiming remaining resources in the plurality of second target resources includes:

[0024] directly reclaiming the remaining resources among the plurality of first target resources;

[0025] Sort the remaining amounts of the remaining resources in the plurality of second target resources in descending order to obtain a second list;

[0026] Traversing the resource remaining amounts of multiple second target resources in the second list, accumulating the traversed second target resources, and determining whether the sum of the resource remaining amounts of the multiple second target resources obtained in the accumulation process satisfies the resource application amount difference;

[0027] When the sum of the remaining amounts of the plurality of second target resources obtained in the accumulation process satisfies the resource application amount difference, the traversal of the second list is terminated;

[0028] Recycling the remaining resources corresponding to the sum of the remaining amounts of the multiple second target resources obtained in the accumulation process;

[0029] The allocating remaining resources among target resources applied for and not actively released by other nodes in the cluster to the first node includes: allocating remaining resources corresponding to the sum of resource surplus amounts of multiple second target resources obtained in the accumulation process to the first node.

[0030] Optionally, after receiving the pre-application sent by the first node, the method further includes:

[0031] Calculate the remaining application amount of the total resources of the cluster;

[0032] Determine the size relationship between the remaining application amount of the total resources of the cluster and the target resources, and determine whether the remaining application amount of the total resources of the cluster meets the demand based on the size relationship;

[0033] The method further comprises: issuing an oversubscription alarm when the remaining application amount of the total resources of the cluster and the remaining resources of the plurality of nodes included in the cluster cannot satisfy the target resources of the first node, and / or the remaining application amount of the total resources of the cluster is zero;

[0034] The method further includes: when there are multiple first nodes issuing multiple pre-applications, responding to the multiple pre-applications according to the order in which the multiple pre-applications are initiated or the priority order of the services to be processed on the multiple first nodes;

[0035] The life cycle also includes a third stage, and the method further includes: receiving remaining resources in the target resources actively released by the first node in the third stage.

[0036] A second aspect of an embodiment of the present application provides a resource management method, which is applied to a first node, where the first node is any node among a plurality of nodes included in a cluster, and the method includes:

[0037] Sending a pre-application to a cluster controller in the cluster, wherein the pre-application is used to apply for target resources;

[0038] receiving the target resources allocated by the cluster, and managing the life cycle of the pre-application, and when the life cycle ends, releasing the remaining resources in the target resources to the cluster, so that the cluster controller adds the remaining resources in the target resources to the remaining application amount of the total resources of the cluster;

[0039] Among them, the target resource is allocated to the first node by the cluster controller in the following manner: when the remaining application amount of the total resources of the cluster meets the demand, the target resource is allocated to the first node from the remaining application amount of the total resources of the cluster; when the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

[0040] Optionally, the life cycle of the pre-application includes at least a first stage, a second stage, and a third stage, and the managing the life cycle of the pre-application includes:

[0041] When the pre-application is in the first stage, preferentially use the remaining resources of the target resources in the second stage in other pre-applications of the first node, and record the resource usage of the remaining resources of the target resources in the second stage in other pre-applications of the first node used by the pre-application in the resource usage record of the first stage in the life cycle of the pre-application;

[0042] When the remaining resources of the target resources in the second stage cannot meet the resource application amount of the target resources that the first node needs to apply for, apply for resources from the cluster again;

[0043] When the pre-application is in the second stage, other pre-application stages in the first stage in the first node are allowed to consume remaining resources of the target resources in the second stage, and the resource usage of the remaining resources consumed by the other pre-application stages in the first stage in the target resources in the second stage is recorded in the resource usage record of the first stage in the life cycle of the other pre-application;

[0044] When the pre-application is in the third stage, releasing the remaining resources of the pre-application target resources to the cluster;

[0045] In the first stage, the resource application amount of the target resource can be changed, and in the second stage and the third stage, the resource application amount of the target resource cannot be changed.

[0046] A third aspect of an embodiment of the present application provides a resource management device, which is applied to a cluster controller in a cluster, and the device includes:

[0047] A pre-application receiving module, used to receive a pre-application issued by a first node in the cluster, wherein the pre-application is used to apply for a target resource;

[0048] an allocation module, configured to allocate the target resource to the first node from the remaining application amount of the total resources of the cluster when the remaining application amount of the total resources of the cluster meets the demand, and receive the remaining resources in the target resource actively released by the first node based on the pre-application life cycle;

[0049] A recovery module is used to forcibly recover the remaining resources of the target resources applied for and not actively released by other nodes in the cluster when the remaining application amount of the total resources of the cluster does not meet the demand, and allocate the remaining resources of the target resources applied for and not actively released by other nodes in the cluster to the first node.

[0050] A fourth aspect of an embodiment of the present application provides a resource management device, which is applied to a first node, where the first node is any node among a plurality of nodes included in a cluster, and the device includes:

[0051] An application module, used for issuing a pre-application to a cluster controller in the cluster, wherein the pre-application is used for applying for target resources;

[0052] A target resource receiving module, used for receiving the target resources allocated by the cluster, managing the life cycle of the pre-application, and releasing the remaining resources in the target resources to the cluster when the life cycle ends, so that the cluster controller adds the remaining resources in the target resources to the remaining application amount of the total resources of the cluster;

[0053] Among them, the target resource is allocated to the first node by the cluster controller in the following manner: when the remaining application amount of the total resources of the cluster meets the demand, the target resource is allocated to the first node from the remaining application amount of the total resources of the cluster; when the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

[0054] A fifth aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the resource management method as described in the first aspect or the second aspect.

[0055] A sixth aspect of an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the resource management method as described in the first aspect or the second aspect is implemented.

[0056] Beneficial effects of this application:

[0057] An embodiment of the present application provides a resource management method, device and medium, which are applied to a cluster controller in a cluster, and the method includes: receiving a pre-application issued by a first node in the cluster, wherein the pre-application is used to apply for a target resource; when the remaining application amount of the total resources of the cluster meets the demand, allocating the target resource to the first node from the remaining application amount of the total resources of the cluster, and receiving the remaining resources in the target resources actively released by the first node based on the life cycle of the pre-application; when the remaining application amount of the total resources of the cluster does not meet the demand, forcibly recovering the remaining resources in the target resources applied for and not actively released by other nodes in the cluster, and allocating the remaining resources in the target resources applied for and not actively released by other nodes in the cluster to the first node.

[0058] Through the technical solution of the present application, the nodes in the cluster can apply for resources from the cluster, and each time the resources applied for are managed in the life cycle. When the life cycle ends, the unused remaining resources are actively released to the cluster so that these released resources can be reallocated again, avoiding idle resources and maximizing resource utilization. When a node needs to apply for resources from the cluster, and the current remaining resources of the cluster cannot meet the needs, the cluster will forcibly recycle the remaining resources of the nodes that have been allocated resources but have not been fully used and have not actively released resources, and give the recovered remaining resources to the nodes that applied for resources, thereby improving the fairness of quota resource allocation, ensuring that resources are allocated on demand, and reducing resource contention. In addition, this resource management method can also improve the flexibility of cluster management, thereby improving the performance and reliability of the cluster, reducing cluster failures, and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.

[0060] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0061] Figure 1 It is a flowchart of a resource management method for a cluster controller in a cluster provided by an embodiment of the present application;

[0062] Figure 2 It is a schematic diagram of two mechanisms of node resource release and cluster forced recovery provided in an embodiment of the present application;

[0063] Figure 3 It is a schematic diagram of three stages of the life cycle provided by an embodiment of the present application;

[0064] Figure 4 is a flowchart of a resource management method applied to a first node provided by an embodiment of the present application;

[0065] Figure 5 It is a schematic diagram of a framework of a resource management device of a cluster controller applied in a cluster provided by an embodiment of the present application;

[0066] Figure 6 It is a schematic diagram of a framework of a resource management device applied to a first node provided by an embodiment of the present application;

[0067] Figure 7 It is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0068] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

[0069] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0070] Figure 1 is a flow chart of a resource management method for a cluster controller in a cluster provided by an embodiment of the present application. Figure 2 is a schematic diagram of two mechanisms of node resource release and cluster forced recovery provided in an embodiment of the present application, Figure 3 It is a schematic diagram of the three stages of the life cycle provided by an embodiment of the present application.

[0071] First, if Figure 1 As shown, an embodiment of the present application provides a resource management method, which is applied to a cluster controller in a cluster, and the method includes:

[0072] In step S101, a pre-application issued by a first node in the cluster is received, where the pre-application is used to apply for a target resource;

[0073] In step S102, when the remaining application amount of the total resources of the cluster meets the demand, the target resources are allocated to the first node from the remaining application amount of the total resources of the cluster, and the remaining resources in the target resources actively released by the first node based on the pre-application life cycle are received;

[0074] In step S103, when the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

[0075] First, the technical solution of the present application is used to manage resource allocation and recovery of each node in the cluster, including a process in which each node in the cluster actively releases resources after using them, and a cluster controller recovers the remaining resources in the total resources of the cluster or from the remaining resources already allocated to the node in order to respond to resource requests from other nodes in the cluster, and allocates them to the node requesting the resource.

[0076] That is to say, for a cluster, the cluster controller of the cluster receives the pre-application of resources from each node in the cluster, allocates resources, and forcibly reclaims and reallocates resources, etc. The execution process of the cluster controller of the cluster is described below with various embodiments.

[0077] In the embodiments of the present application, Figure 2 As shown, for resource management, resource recovery management is performed from two dimensions: cluster (whole) and node (individual), overall macro control and individual fine management are performed to improve the reasonable allocation of resources among multiple nodes.

[0078] Among them, these two types of control correspond to two execution entities, one is the cluster controller, and the other is each node in the cluster. There are two types of resource recall, one is the node's active resource release mechanism, and the other is the cluster's forced resource recovery mechanism. For nodes, target resources can be released according to their own business and life cycle. For a cluster, when the resources required by a node cannot be met, the cluster will select some or a certain node for forced resource recovery based on the resource usage records fed back by other nodes, so that other nodes return resources to the cluster, and these returned resources are then allocated to the required nodes.

[0079] In step S101, each node included in the cluster sends a pre-application for requesting a target resource to the cluster controller of the cluster. The cluster controller receives the pre-application of each node. The pre-application includes information such as the resource application amount of the target resource. The target resource is the resource required by the node that issues the pre-application in order to respond to the business on the node. Here, the node that needs to request the target resource is called the first node. The first node can be any node in the cluster. The cluster controller receives the pre-application issued by the first node in the cluster.

[0080] Further, in step S102, after the cluster controller receives the pre-application of the first node, it determines the resource application amount of the target resource required by the first node based on the pre-application, and judges whether the remaining application amount of the total resources in the cluster can meet the resource application needs of the first node based on the resource application amount.

[0081] One situation in which the cluster controller responds to the pre-application of the first node is: when the remaining application amount of the total resources of the cluster meets the demand, it means that the remaining idle resources in the cluster are sufficient. At this time, the target resources required by the first node can be directly allocated to the first node from the remaining application amount of the total resources of the cluster according to the resource application amount of the target resources.

[0082] The first node can issue multiple pre-applications for requesting target resources. After each application by the first node obtains a target resource, the first node will manage the life cycle of the applied target resource. That is to say, each time the first node obtains the target resource through pre-application, it will start a corresponding life cycle process, such as Figure 2 As shown, the life cycle of each pre-application is used to manage the application, consumption and release processes of the target resources obtained by the pre-application through different clocks.

[0083] Therefore, after the pre-application life cycle indicates that the target resources have been used up, when there are remaining unused resources in the target resources, the first node will actively release the remaining resources in the target resources, so that the cluster controller receives the remaining resources in the target resources actively released by the first node.

[0084] Furthermore, in step S103, there is another situation in which the cluster controller responds to the pre-application of the first node:

[0085] When the remaining application amount of the total resources of the cluster does not meet the resource application amount of the target resources required by the pre-application of the first node, the cluster controller will forcibly recycle the remaining resources of the target resources applied for and not actively released by other nodes in the cluster. After the recycling, the recovered remaining resources of the target resources applied for and not actively released by other nodes in the cluster will be allocated to the first node to meet the resource application amount of the target resources required by the pre-application of the first node.

[0086] As an example: Assume that the cluster contains four nodes: Node A, Node B, Node C, and Node D. The total resources in the cluster are 1000 GB, which includes allocated resources and unallocated resources.

[0087] Node A (as the first node) needs to apply for target resources:

[0088] Step S101: Node A sends a pre-application to the cluster controller, where the pre-application requests a target resource of 100 GB.

[0089] When the remaining amount of the total resources in the cluster is 200 GB, it means that the cluster controller has allocated 800 GB to other nodes and other nodes have not actively released resources. 200 GB is greater than 100 GB. Therefore, the remaining amount of the total resources in the cluster meets the pre-application requirements. At this time, step S102 is executed:

[0090] The remaining amount of total resources in the cluster is 200 GB, which is sufficient to meet the resource application requirement of 100 GB for the target resource issued by Node A.

[0091] The cluster controller will allocate 100GB of resources from the remaining 200GB of total resources in the cluster to Node A. Node A uses 100GB of target resources and actively releases unnecessary resources during the life cycle based on actual usage needs. For example, Node A only uses 80GB of 100GB, then the first node returns the remaining 20GB of unused target resources to the cluster.

[0092] For the case where the remaining resources of the total resources of the cluster are insufficient, for example, the remaining resources of the cluster are 50GB, which is insufficient to meet the 100GB demand of Node A, so step S103 is executed.

[0093] The cluster controller will forcibly reclaim the remaining resources that have not been actively released on Node B, Node C, and Node D, that is, the unused resources of Node B, Node C, and Node D. Assume that the remaining resources that have not been released on Node B, Node C, and Node D are 30 GB, 40 GB, and 50 GB, respectively.

[0094] The total reclaimed resources are 120 GB (30 GB + 40 GB + 50 GB), which is enough to meet the 100 GB demand of Node A. The cluster controller reallocates these reclaimed resources to Node A according to the 100 GB demand of the pre-applied target resource resource.

[0095] In addition, the remaining resources of other nodes can also be reclaimed according to the difference in the remaining resource amount of the total resources in the cluster. For example, if the remaining resource amount of the cluster is 50GB, which is insufficient to meet the 100GB requirement of Node A, an additional 50GB needs to be reclaimed. At this time, it can be recovered from the remaining resources of individual nodes (such as directly reclaiming 50GB from node Node D), or the remaining resources of each node can be partially reclaimed in proportion.

[0096] As an example, assume that the cluster includes Node A, Node B, Node C, and Node D. The total resources of the cluster are 500 GB, and the remaining application amount is 20 GB. Node A issues a pre-application, requesting 100 GB of resources.

[0097] The situation of recycling resources according to the difference:

[0098] The remaining application capacity of the cluster is 20 GB, which is insufficient to satisfy the request of node A.

[0099] An additional 80 GB of resources need to be reclaimed.

[0100] 80 GB of resources can be directly reclaimed from node D, or 80 GB of resources can be reclaimed from the remaining resources of all nodes in proportion.

[0101] In the case of recycling resources in proportion, the remaining resources of each node are as follows:

[0102] Node B: The remaining resources are 60 GB;

[0103] Node C: The remaining resources are 90 GB.

[0104] Node D: The remaining resources are 90 GB.

[0105] 80 GB of resources need to be reclaimed from the remaining resources of each node in proportion.

[0106] Node B needs to reclaim 60GB x (60GB / (60GB+90GB+90GB)) = 20GB

[0107] Node C needs to reclaim 90GB x (90GB / (60GB+90GB+90GB)) = 30GB

[0108] Node D needs to reclaim 90GB x (90GB / (60GB+90GB+90GB)) = 30GB

[0109] Resource allocation after recycling:

[0110] The 20 GB of resources recovered from node B are allocated to node A, the 30 GB of resources recovered from node C are allocated to node A, and the 30 GB of resources recovered from node D are allocated to node A.

[0111] Node A now has 80GB+20GB=100GB of resources.

[0112] The remaining resources of node B are 40 GB, the remaining resources of node C are 60 GB, and the remaining resources of node D are 60 GB.

[0113] By sharing resources with the nodes that need resources according to the ratio of their respective remaining resources to the total remaining resources of all nodes that need to share resources, nodes with more remaining resources can contribute more resources, and nodes with fewer remaining resources can contribute fewer resources. This method can ensure that all nodes in the cluster contribute resources fairly while satisfying the pre-application of nodes that need resources.

[0114] Through the above embodiments, nodes in the cluster can apply for resources from the cluster, and each resource applied for is managed in its life cycle. When the life cycle ends, the remaining unused resources are actively released to the cluster so that these released resources can be reallocated again, avoiding idle resources and maximizing resource usage. When a node needs to apply for resources from the cluster, and the current remaining resources of the cluster cannot meet the needs, the cluster will forcibly reclaim the remaining resources of nodes that have been allocated resources but have not been fully used and have not actively released resources, and give the reclaimed remaining resources to the node that applied for the resource, thereby improving the fairness of quota resource allocation, ensuring that resources are allocated on demand, and reducing resource contention.

[0115] In addition, this resource management method can also improve the flexibility of cluster management, thereby improving cluster performance and reliability, reducing system failures, and improving user experience.

[0116] Optionally, each pre-application life cycle includes at least a first stage and a second stage, and the forced recovery of remaining resources in the target resources applied for and not actively released by other nodes in the cluster includes:

[0117] Determine the sum of remaining resources of a plurality of first target resources, where the first target resources are target resources in the second stage applied for by a plurality of nodes included in the cluster, wherein in the second stage, the pre-applied target resources do not change and the remaining resources in the first target resources can be directly called by other pre-applications in the first stage issued by the same node;

[0118] Determine whether the sum of the remaining amounts of the remaining resources in the plurality of first target resources satisfies the resource application amount of the target resource that the first node needs to apply for;

[0119] When the sum of the remaining amounts of the remaining resources in the plurality of first target resources meets the resource application amount of the target resource that the first node needs to apply for, the remaining resources in the plurality of first target resources are forcibly reclaimed.

[0120] Specifically, in one embodiment, in the above step S103, when the remaining amount of total resources does not meet the pre-applied resource application amount of the first node, it is necessary to forcibly reclaim the remaining resources of other nodes. This process is described in detail below.

[0121] First, each time the first node receives a pre-application target resource, it will manage the life cycle of the pre-application target resource, such as Figure 3 As shown, the life cycle of pre-application includes at least the first stage and the second stage. In the first stage, the nodes in the cluster can change (for example, increase) the resource application amount of the target resource, and at the same time, can also use the applied target resources. In the second stage, the nodes can no longer change the resource application amount of the target resource, but can use the applied target resources.

[0122] Meanwhile, in the second phase, except that the target resources of the pre-application do not change but can be consumed, the remaining resources in the target resources can be directly called by other pre-applications in the first phase issued by the same node.

[0123] As an example, the time of the first stage is t1, and the time of the second stage is t2. Assuming that the first node applies for a target resource of 100GB, different stages can be timed by different clocks. When the first node is allocated 100GB of target resources, clock 1 starts timing. Within t1, the first node can change the resource application amount of the target resource. That is to say, the first stage is the growth stage of the life cycle, allowing the first node to apply for and use the target resources. For example, if the first node needs to increase 20GB of resources, the target resources become 120GB.

[0124] After t1, the pre-application life cycle transitions from the first stage to the second stage. Clock 2 times the t2 time of the second stage. During the t2 time, the first node cannot change the resource application amount of the target resource, but can always use the applied target resource. In other words, the second stage is the stable stage of the life cycle. The first node is not allowed to change the resource application amount of the target resource, but can use the target resource.

[0125] At each stage of the life cycle, resource usage information is required to record the resource application amount and resource usage amount of the target resource requested by the first node.

[0126] If the first node needs to apply for the target resources again after the first stage, it needs to initiate a new pre-application. The new pre-application needs to manage the target resources applied for again through a new life cycle. At the same time, it is necessary to record the resource application amount and resource usage information of the new target resources at each stage of the life cycle in the new life cycle.

[0127] In the new life cycle, since the pre-applications are all issued by the same first node, the new target resources requested by the new pre-application will be allocated preferentially from the remaining resources of the target resources whose life cycle is in the second stage in the pre-applications originally issued by the first node; when the remaining resources of the target resources whose life cycle is in the second stage in the pre-applications originally issued by the first node are insufficient, they will be allocated from the remaining resources of the total resources of the cluster.

[0128] As an example, the first node has issued two pre-applications, namely pre-application A and pre-application B, and the interval between the two pre-applications is t1. That is to say, after the target resources applied for by pre-application A enter the second stage, the first node issues pre-application B again. Then, the target resources required by pre-application B will be allocated from the remaining resources of the target resources already allocated by pre-application A, that is, resource scheduling between the same nodes is prioritized. Only when the remaining resources of the target resources in pre-application A issued by the first node cannot be met, will they be allocated from the remaining resources of the total resources of the cluster.

[0129] In the process of forcibly reclaiming the remaining resources of target resources applied for and not actively released by other nodes in the cluster, in order to ensure the continuity of the services of each node, priority is given to target resources in the second stage of the pre-application life cycle. In the second stage, the resource usage of the node has stabilized, and the remaining resources in the target resources at this time do not change much. Reclaiming this part of the remaining resources will not cause the node to crash. Therefore, priority is given to the recycling of the remaining resources of target resources in the second stage. Here, the target resources in the second stage are called the first target resources.

[0130] And determine the sum of the remaining resources in the multiple first target resources in the cluster, that is, the sum of the remaining resources in the target resources in the second stage in the multiple pre-applications issued by the multiple nodes in the cluster. Then judge whether the sum of the remaining resources in the multiple first target resources meets the resource application amount of the target resources that the first node needs to apply for. When the sum of the remaining resources in the multiple first target resources meets the resource application amount of the target resources that the first node needs to apply for, the remaining resources in the multiple first target resources are forcibly recovered.

[0131] As an example, assume that the cluster contains five nodes: Node E, Node F, Node G, Node H, and Node I.

[0132] Time 1: Node E issues a pre-application and obtains the target resource E1 (at this time, the target resource E1 is in the first stage);

[0133] Time 2: Node F issues a pre-application and obtains target resource F. At the same time, Node G issues a pre-application and obtains target resource G. Node E issues a second pre-application and obtains target resource E2 (at this time, target resource E1 is in the second stage, and target resources F, target resource G, and target resource E2 are in the first stage);

[0134] Time 3: Node H issues a pre-application and obtains target resource H (at this time, the life cycle of target resource E1 ends, target resources F, target resource G, and target resource E2 are in the second stage, and target resource H is in the first stage).

[0135] If at time 3, Node I needs to issue a pre-application for 100GB of target resources, and the remaining amount of total resources (20GB) cannot meet the pre-application of Node I, it is necessary to forcibly recycle the remaining resources of the target resources in Node E, Node F, and Node G in the second stage. Therefore, since the target resources in the second stage at time 3 are target resource F, target resource G, and target resource E2, only the remaining resources corresponding to target resource F, target resource G, and target resource E2 are recycled.

[0136] At this time, before recycling, it is first determined whether the remaining resources of the target resources F, target resources G, and target resources E2 in the second stage meet the pre-application requirement of 100 GB of target resources.

[0137] Assuming that the remaining resources of target resource F, target resource G, and target resource E2 in the second stage are 30 GB, 40 GB, and 50 GB respectively, totaling 120 GB, the 100 GB required for the pre-application is satisfied.

[0138] Therefore, the remaining resources of the target resources in Node E, Node F, and Node G in the second stage can be forcibly recovered, and then the recovered remaining resources can be allocated to NodeI according to the resource demand of the target resources required by Node I's pre-application. Since the target resource H is in the first stage, the remaining resources of target resource H will not be recovered to ensure the business on Node I, while avoiding the waste of the remaining resources corresponding to the target resources F, target resources G, and target resources E2.

[0139] Through the above embodiment, when the remaining resource amount of the total resources of the cluster does not meet the pre-applied resource demand, the remaining resources in the target resources of the second node can be preferentially recovered and allocated to the pre-applied node, thereby avoiding the waste of the remaining resources in the second node and improving the utilization rate of the cluster resources.

[0140] Optionally, the forcibly reclaiming remaining resources from the plurality of first target resources includes:

[0141] Sort the remaining resources of the plurality of first target resources in descending order to obtain a first list;

[0142] Traversing the resource remaining amounts of multiple first target resources in the first list, accumulating the traversed first target resources, and determining whether the sum of the resource remaining amounts of the multiple first target resources obtained in the accumulation process satisfies the resource application amount of the target resource;

[0143] When the sum of the remaining resources of the plurality of first target resources obtained in the accumulation process satisfies the resource application amount of the target resource, the traversal of the first list is terminated;

[0144] Recycling the remaining resources corresponding to the sum of the remaining amounts of the multiple first target resources obtained in the accumulation process;

[0145] The allocating remaining resources among target resources applied for and not actively released by other nodes in the cluster to the first node includes: allocating remaining resources corresponding to the sum of resource surplus amounts of multiple first target resources obtained in the accumulation process to the first node.

[0146] Specifically, in one embodiment, how to forcibly reclaim the remaining resources among the plurality of first target resources is specifically described.

[0147] First, the remaining resources in multiple first target resources are sorted from large to small to obtain a first list. The first list contains the remaining resources of all target resources in the second stage. The remaining resources with larger remaining resources in the first target resources are arranged at the front of the first list, and the remaining resources with smaller remaining resources in the first target resources are arranged at the back of the first list.

[0148] For example, the first list is:

[0149] First target resource 1: 40GB;

[0150] First target resource 2: 40GB;

[0151] First target resource 3: 30GB;

[0152] First target resource 4: 25GB;

[0153] First target resource 5: 10GB;

[0154] First target resource 6: 5GB.

[0155] Furthermore, the resource remaining amounts of multiple first target resources in the first list are traversed from the beginning. During this process, the traversed first target resources are accumulated. For each traversal, the sum of the resource remaining amounts of multiple first target resources obtained during the accumulation process is compared with the resource application amount of the target resource of the first node to determine whether the sum of the resource remaining amounts of multiple first target resources obtained during the accumulation process meets the resource application amount of the target resource.

[0156] Furthermore, when the sum of the remaining resources of the plurality of first target resources obtained in the accumulation process satisfies the resource application amount of the target resource, the traversal of the first list is terminated.

[0157] For example, when the resource application amount of the target resource of the first node is 100GB, first traverse the first target resource 1, 40GB is less than 100GB, then continue to traverse the first target resource 2, 40GB+40GB=80GB, 80GB is less than 100GB, continue to traverse the first target resource 3, 40GB+40GB+30GB=110GB, 110GB is greater than 100GB, and stop traversing.

[0158] Furthermore, the remaining resources corresponding to the sum of the remaining amounts of the multiple first target resources obtained in the accumulation process are recycled.

[0159] For example, to force a collection:

[0160] First target resource 1: 40GB;

[0161] First target resource 2: 40GB;

[0162] First target resource 3: 30 GB.

[0163] Finally, the remaining resources corresponding to the sum of the remaining amounts of the multiple first target resources obtained in the accumulation process are allocated to the first node.

[0164] Through the above-mentioned embodiments, it is ensured that the forced recovery and allocation of resources are efficient, and the traversal is performed in order from large to small in terms of the remaining resources, thereby reducing the number of traversals. At the same time, resources with a larger remaining amount are used preferentially to minimize the impact on other nodes and meet the pre-applied resource requirements.

[0165] Optionally, the method further comprises:

[0166] When the sum of the remaining resources of the plurality of first target resources cannot satisfy the resource application amount of the target resource that the first node needs to apply for, determine the sum of the remaining resources of the plurality of second target resources, where the second target resources are target resources in the first stage applied for by the plurality of nodes included in the cluster, wherein in the first stage, the pre-applied target resources may be changed and the remaining resources in the first target resources may be directly called by other pre-applications in the first stage issued by the same node;

[0167] Calculate a resource application amount difference based on the sum of the remaining amounts of the remaining resources in the plurality of first target resources and the resource application amount of the target resource that the first node needs to apply for;

[0168] Determine whether the sum of the remaining amounts of the remaining resources in the plurality of second target resources satisfies the resource application amount difference;

[0169] When the sum of the remaining amounts of the remaining resources in the plurality of second target resources satisfies the resource application amount difference, the remaining resources in the plurality of second target resources are forcibly reclaimed.

[0170] Specifically, in one embodiment, when the sum of the remaining amounts of the remaining resources in multiple first target resources cannot meet the resource application amount of the target resources that the first node needs to apply for, that is, the sum of the remaining amounts of the remaining resources of all the first target resources is less than the resource application amount of the target resources that the first node needs to apply for, the difference between the sum of the remaining amounts of the remaining resources of all the first target resources and the resource application amount of the target resources that the first node needs to apply for is calculated, so as to determine how many remaining resources the cluster controller needs to forcibly recycle in addition to the sum of the remaining amounts of the remaining resources of the first target resources to meet the resource application amount of the target resources that the first node needs to apply for, and this part of the remaining resources of the second target resources that need to be forcibly reclaimed is the resource application amount difference.

[0171] Further, determine whether the sum of the remaining amounts of the remaining resources in multiple second target resources meets the resource application amount difference, that is, the sum of the remaining amounts of the remaining resources in multiple second target resources needs to be no less than the resource application amount difference. When the sum of the remaining amounts of the remaining resources in multiple second target resources meets the resource application amount difference, the remaining resources in the multiple second target resources can be directly forced to be recovered.

[0172] It should be noted that the amount of remaining resources among the multiple second target resources that are forcibly recovered is equal to the difference between the resource application amount.

[0173] Through the above embodiment, when the sum of the remaining resources of the remaining resources of the first target resource does not meet the resource application amount of the target resource that needs to be applied for by the first node, it is possible to confirm how many remaining resources of the second target font need to be obtained, and forcibly recycle the second target resources to meet the resource application amount of the target resource that needs to be applied for by the first node.

[0174] Optionally, the forcibly reclaiming remaining resources in the plurality of second target resources includes:

[0175] directly reclaiming the remaining resources among the plurality of first target resources;

[0176] Sort the remaining amounts of the remaining resources in the plurality of second target resources in descending order to obtain a second list;

[0177] Traversing the resource remaining amounts of multiple second target resources in the second list, accumulating the traversed second target resources, and determining whether the sum of the resource remaining amounts of the multiple second target resources obtained in the accumulation process satisfies the resource application amount difference;

[0178] When the sum of the remaining amounts of the plurality of second target resources obtained in the accumulation process satisfies the resource application amount difference, the traversal of the second list is terminated;

[0179] Recycling the remaining resources corresponding to the sum of the remaining amounts of the multiple second target resources obtained in the accumulation process;

[0180] The allocating remaining resources among target resources applied for and not actively released by other nodes in the cluster to the first node includes: allocating remaining resources corresponding to the sum of resource surplus amounts of multiple second target resources obtained in the accumulation process to the first node.

[0181] Specifically, in one embodiment, the process of forcibly reclaiming the remaining resources among the plurality of second target resources includes the following steps.

[0182] First, since the remaining amount of the remaining resources of the first target resources is less than the resource application amount of the target resources that the first node needs to apply for, the remaining resources of the first target resources do not need to be recycled in the above-mentioned traversal and accumulation manner, but all the remaining resources of the first target resources can be directly recycled, thereby improving the recycling speed of the first target resources.

[0183] Furthermore, for the recovery of the second target resources, similar to the recovery process of the first target resources in the embodiment shown above, it is necessary to first sort the resource remaining amounts of the remaining resources in the multiple second target resources from large to small to obtain a second list. In the second list, the resource remaining amounts of all the target resources in the first stage applied for by the multiple nodes included in the cluster are listed. The remaining resources in the second target resources with larger resource remaining amounts are ranked at the front of the second list, and the remaining resources in the second target resources with smaller resource remaining amounts are ranked at the back of the second list.

[0184] For example, the second list is:

[0185] Second target resource 1: 35GB;

[0186] Second target resource 2: 30GB;

[0187] Second target resource 3: 25GB;

[0188] Second target resource 4: 20GB;

[0189] Second target resource 5: 10GB;

[0190] Second target resource 6: 5GB.

[0191] Furthermore, the resource remaining amounts of multiple second target resources in the second list are traversed from the beginning. In this process, the traversed second target resources are accumulated. For each traversal, the sum of the resource remaining amounts of the multiple second target resources obtained in the accumulation process is compared with the resource application amount difference to determine whether the sum of the resource remaining amounts of the multiple first target resources obtained in the accumulation process satisfies the resource application amount difference.

[0192] Furthermore, when the sum of the remaining amounts of the multiple first target resources obtained in the accumulation process satisfies the resource application amount difference, the traversal of the second list is terminated.

[0193] For example, when the resource application amount of the target resource of the first node is 100GB, the corresponding resource remaining amount of the remaining resources of the first target resource is 30GB. Therefore, the difference in resource application amount is 100GB-35GB=65GB. At this time, it is necessary to obtain 65GB of remaining resources of the second target font. Therefore, first traverse the second target resource 1. If 35GB is less than 65GB, continue to traverse the second target resource 2. 35GB+30GB=65GB. 65GB is equal to the difference in resource application amount. Stop traversal at this time.

[0194] Furthermore, the remaining resources corresponding to the sum of the remaining amounts of the multiple second target resources obtained in the accumulation process are recycled.

[0195] For example, to force a collection:

[0196] Second target resource 1: 35GB;

[0197] Second target resource 2: 30 GB.

[0198] Finally, the remaining resources corresponding to the sum of the remaining resources of all first target resources and the sum of the remaining resources of multiple second target resources obtained in the accumulation process are allocated to the first node.

[0199] Through the above embodiment, when the sum of the remaining resources of all the first target resources does not meet the resource application amount of the target resources of the first node, the first target resources can be directly recycled, and the remaining resources of the second target resources can be traversed and accumulated in sequence until the resource application amount difference is met. The remaining resources of the traversed second target resources can be recycled to meet the resource application demand of the first node, thereby avoiding the idleness and waste of the remaining resources of other nodes.

[0200] Optionally, after receiving the pre-application sent by the first node, the method further includes:

[0201] Calculate the remaining application amount of the total resources of the cluster;

[0202] Determine the size relationship between the remaining application amount of the total resources of the cluster and the target resources, and determine whether the remaining application amount of the total resources of the cluster meets the demand based on the size relationship;

[0203] The method further comprises: issuing an oversubscription alarm when the remaining application amount of the total resources of the cluster and the remaining resources of the plurality of nodes included in the cluster cannot satisfy the target resources of the first node, and / or the remaining application amount of the total resources of the cluster is zero;

[0204] The method further includes: when there are multiple first nodes issuing multiple pre-applications, responding to the multiple pre-applications according to the order in which the multiple pre-applications are initiated or the priority order of the services to be processed on the multiple first nodes;

[0205] The life cycle also includes a third stage, and the method further includes: receiving remaining resources in the target resources actively released by the first node in the third stage.

[0206] Specifically, in one embodiment, after receiving the pre-application issued by the first node, it is necessary to calculate the remaining application amount of the total resources of the cluster, and determine whether the remaining application amount of the total resources of the cluster can directly meet the resource application demand of the first node based on the relationship between the remaining application amount of the total resources of the cluster and the target resources. When the remaining application amount of the total resources of the cluster can be met, the target resources are directly allocated to the first node from the remaining application amount of the total resources of the cluster, rather than from the remaining resources of other nodes, to ensure the resource redundancy of other nodes.

[0207] For example, when the total resources of the cluster are 1000GB and the resource application amount of the target resources of the first node is 100GB, when the cluster controller of the cluster has allocated 850GB of resources to each node, it means that the remaining application amount of the total resources of the cluster is 1000GB-850GB=150GB>100GB. Therefore, the remaining application amount of the total resources of the cluster can meet the resource application amount of the target resources of the first node, and 100GB is directly allocated to the first node from the remaining application amount of 150GB of the total resources of the cluster.

[0208] When the cluster controller of the cluster has allocated 950GB of resources to each node, it means that the remaining application amount of the total resources of the cluster is 1000GB-950GB=50GB<100GB. Therefore, the remaining application amount of the total resources of the cluster cannot meet the resource application amount of the target resources of the first node. At this time, it is necessary to obtain resources from the remaining resources of each node to allocate to the first node.

[0209] There is another situation, when the remaining application amount of the total resources of the cluster and the remaining resources of multiple nodes contained in the cluster cannot meet the target resources of the first node, or the remaining application amount of the total resources of the cluster is zero, it is necessary to issue an oversubscription alarm to the cluster administrator to inform the cluster manager that it is currently unable to recall resources to meet the resource application needs of the first node.

[0210] In addition, the resource recovery process is mutually exclusive locked to avoid multiple nodes recovering resources at the same time. In this process, a single-threaded queue polling recall can be used.

[0211] When there are multiple first nodes that issue multiple pre-applications, that is, multiple nodes need to reclaim resources, at this time, the cluster controller of the cluster allocates target resources to each first node in the order in which the multiple pre-applications are initiated, or it can add them to the queue in the order of priority of the services that need to be processed on the multiple first nodes, and respond to the multiple pre-applications in the queue in turn, where the priority order of the services on the nodes is pre-set. According to the above strategy, the nodes and clusters perform overall and local resource control, which is independent of each other and mutually constrained, which can effectively enhance the rationality of multi-node resource allocation, optimize quota resource recovery, improve the fairness of quota resource allocation, and enhance the competitiveness of products.

[0212] In addition, the life cycle also includes a third stage, which is shorter and starts after the second stage. The third stage is the resource release stage. Therefore, when the pre-application third stage arrives, the first node will automatically release the remaining unused resources in the target resources so that the cluster receives the remaining resources in the target resources actively released by the first node in the third stage.

[0213] Through the above-mentioned embodiments, when the target resources cannot be allocated to the first node, an oversubscription alarm can be promptly issued to the administrator of the cluster to ensure the normal operation of each node in the cluster, and when multiple pre-applications appear, they can be processed in sequence according to different strategies. In addition, since the remaining resources are unused resources of the first node, it is necessary to avoid being occupied by the first node all the time. Therefore, a third stage is added to the life cycle to ensure that the first node can actively release the remaining resources in the target resources when the third stage arrives, thereby avoiding the first node from occupying the remaining resources and ensuring that these recovered remaining resources can be reasonably used by other nodes.

[0214] Figure 4 is a flow chart of a resource management method applied to a first node provided by an embodiment of the present application, such as Figure 4 shown.

[0215] Based on the same inventive concept, an embodiment of the present application further provides a resource management method, which is applied to a first node, where the first node is any node among a plurality of nodes included in a cluster, and the method includes:

[0216] Step S201, issuing a pre-application to a cluster controller in the cluster, wherein the pre-application is used to apply for target resources;

[0217] Step S202, receiving the target resources allocated by the cluster, and managing the life cycle of the pre-application, and when the life cycle ends, releasing the remaining resources in the target resources to the cluster, so that the cluster controller adds the remaining resources in the target resources to the remaining application amount of the total resources of the cluster;

[0218] Among them, the target resource is allocated to the first node by the cluster controller in the following manner: when the remaining application amount of the total resources of the cluster meets the demand, the target resource is allocated to the first node from the remaining application amount of the total resources of the cluster; when the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

[0219] The steps executed by the first node are described below, wherein the first node is any node among a plurality of nodes included in the cluster, and can send a pre-application to a cluster controller of the cluster to apply for a target resource.

[0220] First, in step S201, when the first node needs a target resource, it needs to send a pre-application to the cluster controller in the cluster for applying for the target resource from the cluster.

[0221] Further, in step S202, after issuing the pre-application, if the cluster can meet the resource application amount of the target resource required by the pre-application of the first node, the target resource will be allocated to the first node. The first node will receive the target resource allocated by the cluster and then manage the life cycle of the pre-application. The life cycle of each pre-application is essentially the life cycle management of the target resource obtained by the pre-application. The process of this life cycle management includes resource application, consumption (use), and release.

[0222] When the pre-application life cycle ends, the first node releases the remaining unused resources in the target resources to the cluster, so that the cluster controller adds the remaining resources in the target resources to the remaining application amount of the total resources of the cluster as resources allocated to other nodes.

[0223] Among them, the target resources are allocated to the first node by the cluster controller in the following manner: when the remaining application amount of the total resources of the cluster meets the demand, the target resources are allocated to the first node from the remaining application amount of the total resources of the cluster; when the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources in the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources in the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

[0224] Through the above embodiment, the first node can issue a pre-application for resources to the cluster and accept resources, and manage the life cycle of the pre-application to ensure that the target resources are not always occupied by the first node. When the first node reaches a balance in using the target resources, it can actively release the unused remaining resources to the cluster and add them to the remaining application amount of the total resources of the cluster. In this way, the cluster controller of the cluster can allocate resources to other nodes, ensure the rationality of resource use, and avoid resource idleness and waste caused by continuous occupation of resources.

[0225] Optionally, the life cycle of the pre-application includes at least a first stage, a second stage, and a third stage, and the managing the life cycle of the pre-application includes:

[0226] When the pre-application is in the first stage, preferentially use the remaining resources of the target resources in the second stage in other pre-applications of the first node, and record the resource usage of the remaining resources of the target resources in the second stage in other pre-applications of the first node used by the pre-application in the resource usage record of the first stage in the life cycle of the pre-application;

[0227] When the remaining resources of the target resources in the second stage cannot meet the resource application amount of the target resources that the first node needs to apply for, apply for resources from the cluster again;

[0228] When the pre-application is in the second stage, other pre-application stages in the first stage in the first node are allowed to consume remaining resources of the target resources in the second stage, and the resource usage of the remaining resources consumed by the other pre-application stages in the first stage in the target resources in the second stage is recorded in the resource usage record of the first stage in the life cycle of the other pre-application;

[0229] When the pre-application is in the third stage, releasing the remaining resources of the pre-application target resources to the cluster;

[0230] In the first stage, the resource application amount of the target resource can be changed, and in the second stage and the third stage, the resource application amount of the target resource cannot be changed.

[0231] Specifically, Figure 3 As shown, in one embodiment, the life cycle of the pre-application includes at least a first stage, a second stage and a third stage, and the first node manages the life cycle of the pre-application according to these three stages.

[0232] Phase 1 (growth phase): allows application and consumption of resources. When resources are insufficient, priority is given to using the remaining resources of other pre-applications on the same node in the second phase (stable phase). If insufficient, resources are applied for from the cluster again.

[0233] The second stage (stable stage): resource application is not allowed, but resource consumption is allowed. When there are surplus resources, other pre-applications of the same node in the first stage (growth stage) are allowed to consume its surplus resources;

[0234] Phase 3 (elimination phase): neither application for resources nor consumption of resources is allowed. Instead, the remaining resources are immediately released and returned to the cluster.

[0235] Specifically, in the first stage, the resource application amount of the target resource can be changed, that is, the first node can add or reduce the resource application amount of the target resource at any time, and can also use the target resource. The first stage is a growth stage, which allows the first node to flexibly adjust its resource requirements. In the second and third stages, the first node has adjusted its resource requirements, so the resource application amount of the target resource cannot be changed.

[0236] Moreover, in the three stages, the resource application amount and resource usage of the target resources in this pre-application of the first node will be recorded in the resource usage record, that is, how many target resources are applied for and how many target resources are used in each stage, so that the remaining resource amount of the target resources in each stage can be obtained.

[0237] Among them, when the pre-application is in the first stage, the first node will give priority to using the remaining resources of the target resources in the second stage in other pre-applications of the first node as target resources. That is to say, the cluster controller will give priority to the remaining resources that have been applied for by the first node before issuing the pre-application and have not been recycled or actively released in the target resources in the second stage as the target resources for this pre-application, rather than allocating them to the first node from the remaining resources of the total resources of the cluster or the remaining resources of other nodes. This method can speed up the efficiency of allocating resources to the first node.

[0238] For example, before issuing the second pre-application, the first node has already issued the first pre-application to the cluster controller of the cluster, in which 100GB of resources are applied for as the target resources of the first pre-application, and the life cycle of the first pre-application is in the second stage, among which 40GB of resources out of 100GB are remaining resources. Therefore, this part of 40GB of remaining resources will be directly used as the target resources of the second pre-application, instead of allocating resources to the first node from the remaining resources of the total resources of the cluster or the remaining resources of other nodes.

[0239] At the same time, since the remaining resources of other pre-applications of the first node before this pre-application are used, for the usage record of this part of the remaining resources, it is necessary to record the resource usage of the remaining resources of the target resources in the second stage in other pre-applications of the first node used by the pre-application in the resource usage record of the first stage in the life cycle of this pre-application, and it is also necessary to modify the resource usage records of the second stage of other pre-applications accordingly.

[0240] Only when the remaining resources of the target resources in the second stage cannot meet the resource application amount of the target resources that the first node needs to apply for, it is necessary to apply for resources from the cluster again.

[0241] The cluster may allocate resources to the first node from the remaining resources of the total resources or the remaining resources of other nodes.

[0242] When the pre-application is in the second stage, this pre-application can also be used as the previous pre-application of other pre-applications, that is, other pre-applications in the first stage in the first node are allowed to consume the remaining resources of the target resources in the second stage of the pre-application, and the resource usage of the remaining resources of the target resources in the second stage consumed by other pre-applications in the first stage is recorded in the resource usage record of other pre-applications in the first stage at the first node.

[0243] For example, when this pre-application is the second pre-application, and when the pre-application of this application transitions to the second stage, the first node issues a third pre-application. At this time, the third pre-application is in the first stage. Then, the target resources required for the third pre-application can be obtained from the remaining resources of the target resources in the second pre-application in priority. That is, priority is given to resource transfer within the node, rather than applying for resources from the cluster first. When the resources within the node cannot be met, resource allocation outside the node is performed.

[0244] At the same time, the resource usage and resource application amount of the remaining resources in the target resources of the second pre-application obtained by the third pre-application will be recorded in the resource usage record of the third pre-application at the first node. At the same time, the resource usage record of the second pre-application will be modified accordingly.

[0245] When the pre-application is in the third stage, the first node actively releases the remaining resources of the pre-application target resources to the cluster. In this way, the cluster will be able to manage and allocate these actively released remaining resources to other nodes with resource needs.

[0246] Through the above embodiment, the first node can manage the complete life cycle of each pre-applied target resource, which is convenient for the node to perform individual control of resources, fine management and resource recovery processes, reflecting the flexibility of resource management.

[0247] To sum up, the innovation / invention of the present application is as follows: it can manage the recycling of quota resources from both the overall and individual dimensions. Individual nodes are transformed according to the life cycle, and different resource management is performed at different stages of each life cycle. Nodes are individually controlled, and resources are managed and recycled in a refined manner. The entire cluster performs mandatory resource recycling, and different nodes send requests to the cluster according to weights or priorities. The cluster selects a recall strategy based on its demand to meet the needs of the nodes. The individual nodes and the overall cluster are independent of and constrained from each other, and macro control is combined with refined control to effectively recycle resources. By dynamically recycling resources, the waste and idleness of resources among multiple nodes are reduced, and resources are rationally recycled and fairly distributed.

[0248] Figure 5 is a schematic diagram of a resource management device for a cluster controller in a cluster provided by an embodiment of the present application. Figure 5 shown.

[0249] Based on the same inventive concept, an embodiment of the present application further provides a resource management device, which is applied to a cluster controller in a cluster, and the device includes:

[0250] A pre-application receiving module 11 is used to receive a pre-application issued by a first node in the cluster, wherein the pre-application is used to apply for a target resource;

[0251] An allocation module 12, configured to allocate the target resource to the first node from the remaining application amount of the total resources of the cluster when the remaining application amount of the total resources of the cluster meets the demand, and receive the remaining resources in the target resource actively released by the first node based on the pre-application life cycle;

[0252] The recovery module 13 is used to forcibly recover the remaining resources in the target resources applied for and not actively released by other nodes in the cluster when the remaining application amount of the total resources of the cluster does not meet the demand, and allocate the remaining resources in the target resources applied for and not actively released by other nodes in the cluster to the first node.

[0253] Optionally, each pre-application life cycle includes at least a first stage and a second stage, and the recycling module 13 includes:

[0254] a first target resource margin determining unit, configured to determine the sum of the resource margins of the remaining resources in a plurality of first target resources, wherein the first target resources are target resources in the second stage applied for by a plurality of nodes included in the cluster, wherein in the second stage, the pre-applied target resources do not change and the remaining resources in the first target resources can be directly called by other pre-applications in the first stage issued by the same node;

[0255] A first judging unit, configured to judge whether the sum of the remaining amounts of the remaining resources in the plurality of first target resources satisfies the resource application amount of the target resource that the first node needs to apply for;

[0256] The first recycling unit is used to forcibly recycle the remaining resources among the multiple first target resources when the sum of the remaining amounts of the remaining resources among the multiple first target resources meets the resource application amount of the target resource that the first node needs to apply for.

[0257] Optionally, the first recovery unit comprises:

[0258] A first list acquisition unit, configured to sort the remaining amounts of the remaining resources in the plurality of first target resources in descending order to obtain a first list;

[0259] A first traversal unit is used to traverse the resource remaining amounts of multiple first target resources in the first list, accumulate the traversed first target resources, and determine whether the sum of the resource remaining amounts of the multiple first target resources obtained in the accumulation process meets the resource application amount of the target resource;

[0260] A first execution unit, configured to terminate the traversal of the first list when the sum of the remaining resources of the plurality of first target resources obtained in the accumulation process satisfies the resource application amount of the target resource;

[0261] A first recycling subunit, used for recycling the remaining resources corresponding to the sum of the remaining amounts of the multiple first target resources obtained in the accumulation process;

[0262] The recycling module 13 includes: a first allocation unit, configured to allocate the remaining resources corresponding to the sum of the remaining amounts of the multiple first target resources obtained in the accumulation process to the first node.

[0263] Optionally, the device further comprises:

[0264] a second target resource margin determination unit, configured to determine the sum of the resource margins of the remaining resources in a plurality of second target resources when the sum of the resource margins of the remaining resources in the plurality of first target resources cannot satisfy the resource application amount of the target resource that the first node needs to apply for, wherein the second target resources are target resources in the first stage applied for by a plurality of nodes included in the cluster, wherein in the first stage, the pre-applied target resources may be changed and the remaining resources in the first target resources may be directly called by other pre-applications in the first stage issued by the same node;

[0265] A resource application amount difference calculation unit, configured to calculate a resource application amount difference based on the sum of the remaining resource amounts of the remaining resources in the plurality of first target resources and the resource application amount of the target resource that the first node needs to apply for;

[0266] A second judgment unit is used to judge whether the sum of the remaining amounts of the remaining resources in the plurality of second target resources satisfies the resource application amount difference;

[0267] The second recycling unit is used to forcibly recycle the remaining resources among the multiple second target resources when the sum of the remaining amounts of the remaining resources among the multiple second target resources meets the resource application amount difference.

[0268] Optionally, the second recovery unit comprises:

[0269] A direct recovery unit, used for directly recovering the remaining resources among the plurality of first target resources;

[0270] A second list acquisition unit, configured to sort the remaining amounts of the remaining resources in the plurality of second target resources in descending order to obtain a second list;

[0271] A second traversal unit is used to traverse the resource remaining amounts of multiple second target resources in the second list, accumulate the traversed second target resources, and determine whether the sum of the resource remaining amounts of the multiple second target resources obtained in the accumulation process meets the resource application amount difference;

[0272] A second execution unit, configured to terminate the traversal of the second list when the sum of the remaining resources of the plurality of second target resources obtained in the accumulation process satisfies the resource application amount difference;

[0273] A second recycling subunit, used for recycling the remaining resources corresponding to the sum of the remaining amounts of the multiple second target resources obtained in the accumulation process;

[0274] The recycling module 13 includes: a second allocation unit, configured to allocate remaining resources corresponding to the sum of the remaining resources of the plurality of second target resources obtained in the accumulation process to the first node.

[0275] Optionally, the device further comprises:

[0276] A module for calculating the remaining application amount of total resources, configured to calculate the remaining application amount of the total resources of the cluster after receiving the pre-application sent by the first node;

[0277] A judgment module, used to judge the size relationship between the remaining application amount of the total resources of the cluster and the target resources, and determine whether the remaining application amount of the total resources of the cluster meets the demand based on the size relationship;

[0278] The device further comprises: an alarm module, configured to issue an oversubscription alarm when the remaining application amount of the total resources of the cluster and the remaining resources of the plurality of nodes included in the cluster cannot satisfy the target resources of the first node, and / or the remaining application amount of the total resources of the cluster is zero;

[0279] The device further comprises: a sequential response module, for responding to the multiple pre-applications according to the order in which the multiple pre-applications are initiated or the priority order of the services to be processed on the multiple first nodes when multiple pre-applications are issued by multiple first nodes;

[0280] The life cycle also includes a third stage, and the device also includes: a receiving module, configured to receive remaining resources in the target resources actively released by the first node in the third stage.

[0281] Figure 6 is a schematic diagram of a framework of a resource management device applied to a first node provided by an embodiment of the present application, such as Figure 6 shown.

[0282] Based on the same inventive concept, an embodiment of the present application further provides a resource management device, which is applied to a first node, where the first node is any node among a plurality of nodes included in a cluster, and the device includes:

[0283] An application module 21, configured to issue a pre-application to a cluster controller in the cluster, wherein the pre-application is used to apply for target resources;

[0284] A target resource receiving module 22 is used to receive the target resources allocated by the cluster and manage the life cycle of the pre-application. When the life cycle ends, the remaining resources in the target resources are released to the cluster so that the cluster controller adds the remaining resources in the target resources to the remaining application amount of the total resources of the cluster.

[0285] Among them, the target resource is allocated to the first node by the cluster controller in the following manner: when the remaining application amount of the total resources of the cluster meets the demand, the target resource is allocated to the first node from the remaining application amount of the total resources of the cluster; when the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

[0286] Optionally, the pre-application life cycle includes at least a first stage, a second stage and a third stage, and the target resource receiving module 22 includes:

[0287] a priority use unit, configured to, when the pre-application is in the first stage, preferentially use the remaining resources of the target resources in the second stage in other pre-applications of the first node, and record the resource usage of the remaining resources of the target resources in the second stage in other pre-applications of the first node used by the pre-application in the resource usage record of the first stage in the life cycle of the pre-application;

[0288] a re-applying unit, configured to apply for resources from the cluster again when the remaining resources of the target resources in the second stage cannot satisfy the resource application amount of the target resources that the first node needs to apply for;

[0289] a usage allowing unit, configured to allow other pre-application stages in the first stage in the first node to consume remaining resources of the target resources in the second stage when the pre-application is in the second stage, and record the resource usage amount of the remaining resources consumed by the other pre-application stages in the first stage in the resource usage record of the first stage in the life cycle of the other pre-application;

[0290] a releasing unit, configured to release remaining resources of the pre-application target resources to the cluster when the pre-application is in the third stage;

[0291] In the first stage, the resource application amount of the target resource can be changed, and in the second stage and the third stage, the resource application amount of the target resource cannot be changed.

[0292] Based on the same inventive concept, another embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the resource management method as described in any of the above embodiments.

[0293] Among them, electronic equipment refers to Figure 7 , Figure 7 is a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 7 As shown, the electronic device 700 includes: a memory 710 and a processor 720. The memory 710 and the processor 720 are connected via a bus communication. A computer program is stored in the memory 710. The computer program can be run on the processor 720 to implement the steps in the resource management method disclosed in the above embodiment of the present application.

[0294] Based on the same inventive concept, another embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to implement the resource management method described in any of the above embodiments.

[0295] Based on the same inventive concept, another embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, wherein when the program is executed by a processor, the resource management method as described in any of the above embodiments is implemented.

[0296] As for the device, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0297] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0298] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0299] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0300] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0301] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0302] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0303] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0304] The above is a detailed introduction to a resource management method, device and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A resource management method, characterized in that: Applied to a cluster controller in a cluster, the method comprises: receiving a pre-application issued by a first node in the cluster, wherein the pre-application is used to apply for a target resource; When the remaining application amount of the total resources of the cluster meets the demand, the target resources are allocated to the first node from the remaining application amount of the total resources of the cluster, and the remaining resources in the target resources actively released by the first node based on the pre-application life cycle are received; When the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

2. The resource management method according to claim 1, characterized in that: The life cycle of each pre-application includes at least the first stage and the second stage, wherein the forced recovery of the remaining resources in the target resources applied for and not actively released by other nodes in the cluster includes: Determine the sum of remaining resources of a plurality of first target resources, where the first target resources are target resources in the second stage applied for by a plurality of nodes included in the cluster, wherein in the second stage, the pre-applied target resources do not change and the remaining resources in the first target resources can be directly called by other pre-applications in the first stage issued by the same node; Determine whether the sum of the remaining amounts of the remaining resources in the plurality of first target resources satisfies the resource application amount of the target resource that the first node needs to apply for; When the sum of the remaining amounts of the remaining resources in the plurality of first target resources meets the resource application amount of the target resource that the first node needs to apply for, the remaining resources in the plurality of first target resources are forcibly reclaimed.

3. The resource management method according to claim 2, characterized in that: The forcibly reclaiming the remaining resources in the plurality of first target resources comprises: Sort the remaining resources of the plurality of first target resources in descending order to obtain a first list; Traversing the resource remaining amounts of multiple first target resources in the first list, accumulating the traversed first target resources, and determining whether the sum of the resource remaining amounts of the multiple first target resources obtained in the accumulation process satisfies the resource application amount of the target resource; When the sum of the remaining resources of the plurality of first target resources obtained in the accumulation process satisfies the resource application amount of the target resource, the traversal of the first list is terminated; Recycling the remaining resources corresponding to the sum of the remaining amounts of the multiple first target resources obtained in the accumulation process; The allocating remaining resources among target resources applied for and not actively released by other nodes in the cluster to the first node includes: allocating remaining resources corresponding to the sum of resource surplus amounts of multiple first target resources obtained in the accumulation process to the first node.

4. The resource management method according to claim 2, characterized in that: The method further comprises: When the sum of the remaining resources of the plurality of first target resources cannot satisfy the resource application amount of the target resource that the first node needs to apply for, determine the sum of the remaining resources of the plurality of second target resources, where the second target resources are target resources in the first stage applied for by the plurality of nodes included in the cluster, wherein in the first stage, the pre-applied target resources may be changed and the remaining resources in the first target resources may be directly called by other pre-applications in the first stage issued by the same node; Calculate a resource application amount difference based on the sum of the remaining amounts of the remaining resources in the plurality of first target resources and the resource application amount of the target resource that the first node needs to apply for; Determine whether the sum of the remaining amounts of the remaining resources in the plurality of second target resources satisfies the resource application amount difference; When the sum of the remaining amounts of the remaining resources in the plurality of second target resources satisfies the resource application amount difference, the remaining resources in the plurality of second target resources are forcibly reclaimed.

5. The resource management method according to claim 4, characterized in that: The forcibly reclaiming the remaining resources in the plurality of second target resources comprises: directly reclaiming the remaining resources among the plurality of first target resources; Sort the remaining amounts of the remaining resources in the plurality of second target resources in descending order to obtain a second list; Traversing the resource remaining amounts of multiple second target resources in the second list, accumulating the traversed second target resources, and determining whether the sum of the resource remaining amounts of the multiple second target resources obtained in the accumulation process satisfies the resource application amount difference; When the sum of the remaining amounts of the plurality of second target resources obtained in the accumulation process satisfies the resource application amount difference, the traversal of the second list is terminated; Recycling the remaining resources corresponding to the sum of the remaining amounts of the multiple second target resources obtained in the accumulation process; The allocating remaining resources among target resources applied for and not actively released by other nodes in the cluster to the first node includes: allocating remaining resources corresponding to the sum of resource surplus amounts of multiple second target resources obtained in the accumulation process to the first node.

6. The resource management method according to any one of claims 1 to 5, characterized in that: After receiving the pre-application sent by the first node, the method further includes: Calculate the remaining application amount of the total resources of the cluster; Determine the size relationship between the remaining application amount of the total resources of the cluster and the target resources, and determine whether the remaining application amount of the total resources of the cluster meets the demand based on the size relationship; The method further comprises: issuing an oversubscription alarm when the remaining application amount of the total resources of the cluster and the remaining resources of the plurality of nodes included in the cluster cannot satisfy the target resources of the first node, and / or the remaining application amount of the total resources of the cluster is zero; The method further includes: when there are multiple first nodes issuing multiple pre-applications, responding to the multiple pre-applications according to the order in which the multiple pre-applications are initiated or the priority order of the services to be processed on the multiple first nodes; The life cycle also includes a third stage, and the method further includes: receiving remaining resources in the target resources actively released by the first node in the third stage.

7. A resource management method, characterized in that: Applied to a first node, where the first node is any node among a plurality of nodes included in a cluster, the method comprises: Sending a pre-application to a cluster controller in the cluster, wherein the pre-application is used to apply for target resources; receiving the target resources allocated by the cluster, and managing the life cycle of the pre-application, and when the life cycle ends, releasing the remaining resources in the target resources to the cluster, so that the cluster controller adds the remaining resources in the target resources to the remaining application amount of the total resources of the cluster; Among them, the target resource is allocated to the first node by the cluster controller in the following manner: when the remaining application amount of the total resources of the cluster meets the demand, the target resource is allocated to the first node from the remaining application amount of the total resources of the cluster; when the remaining application amount of the total resources of the cluster does not meet the demand, the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are forcibly recovered, and the remaining resources of the target resources applied for and not actively released by other nodes in the cluster are allocated to the first node.

8. The resource management method according to claim 7, characterized in that: The life cycle of the pre-application includes at least a first stage, a second stage, and a third stage. The management of the life cycle of the pre-application includes: When the pre-application is in the first stage, preferentially use the remaining resources of the target resources in the second stage in other pre-applications of the first node, and record the resource usage of the remaining resources of the target resources in the second stage in other pre-applications of the first node used by the pre-application in the resource usage record of the first stage in the life cycle of the pre-application; When the remaining resources of the target resources in the second stage cannot meet the resource application amount of the target resources that the first node needs to apply for, apply for resources from the cluster again; When the pre-application is in the second stage, other pre-application stages in the first stage in the first node are allowed to consume remaining resources of the target resources in the second stage, and the resource usage of the remaining resources consumed by the other pre-application stages in the first stage in the target resources in the second stage is recorded in the resource usage record of the first stage in the life cycle of the other pre-application; When the pre-application is in the third stage, releasing the remaining resources of the pre-application target resources to the cluster; In the first stage, the resource application amount of the target resource can be changed, and in the second stage and the third stage, the resource application amount of the target resource cannot be changed.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the resource management method according to any one of claims 1 to 6 or claims 7 to 8.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the resource management method according to any one of claims 1-6 or claims 7-8 is implemented.