Cluster resource allocation and recovery method, device, electronic device and storage medium

Through the combination of custom resource queue module and quota observation module, flexible allocation and recycling of cluster resources is achieved, the problems of resource waste and operation and maintenance pressure in the existing technology are solved, and resource utilization rate and administrator work efficiency are improved.

CN113377541BActive Publication Date: 2024-11-15BEIJING UNISOUND INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110693847.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-22
Publication Date
2024-11-15
Estimated Expiration
2041-06-22

AI Technical Summary

Technical Problem

The existing cluster quota mechanism is not flexible enough to automatically adjust according to the actual use of the cluster or users, resulting in increased resource waste and operation and maintenance pressure, and a lack of a pre-borrow task recovery mechanism.

Method used

Define queue information in cluster resources through custom resource queue module, quota observation module updates usage information in real time, resource allocation and recycling module allocates and regains cluster resources based on usage information and queue information, introduces queue concepts, sets priority and preemption mechanisms to Flexible allocation and recycling of resources.

Benefits of technology

It improves the utilization rate of cluster resources, reduces the operation and maintenance workload of administrators, realizes flexible allocation and recycling of resources, and solves the problems of idle resources and inflexible configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113377541B_ABST
    Figure CN113377541B_ABST
Patent Text Reader

Abstract

The present invention relates to a cluster resource allocation and recovery method, device, electronic device and storage medium. The method is applied to a system including a custom resource queue module, a quota observation module, a resource allocation and recovery module, and includes: defining queue information in cluster resources; polling the usage information of each queue quota, and updating the usage information in real time; when receiving a new request task from a first user, allocating cluster resources and recovering cluster resources according to the usage information and queue information. The custom resource queue module introduces global queue custom resources, solves the limitation of namespace quota, and can easily expand the concept of queue to group; the quota observation module determines the usage information in real time, and the resource allocation and recovery module enables users to use the idle resources of the cluster, solving the problem of idle resources; and reasonable allocation and recovery are performed, effectively improving the resource utilization rate of the entire cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cluster resource utilization, and in particular to a cluster resource allocation and recovery method, device, electronic equipment and storage medium. Background Art

[0002] At present, the existing cluster quota mechanism is fixed, and the resources available to each user are fixed. Even when the cluster resources are sufficient, users cannot continue to use the free resources of the cluster if they exceed the limit, resulting in a waste of resources of the entire cluster; the elastic quota mechanism is not flexible enough and cannot be automatically adjusted according to the actual usage of the cluster or users; the existing cluster quota has no concept of group, only the concept of individual, and the configuration management is not flexible enough; there is no better pre-borrowed task recovery mechanism, and resource leasing can only be done through tedious manual adjustments by the administrator, which invisibly increases the pressure on operation and maintenance personnel. Summary of the invention

[0003] The present invention provides a cluster resource allocation and recovery method, device, electronic device and storage medium, which can solve the above-mentioned technical problems of inflexible cluster resource configuration and lack of pre-borrowed task recovery mechanism.

[0004] The technical solution of the present invention to solve the above technical problems is as follows:

[0005] In a first aspect, an embodiment of the present invention provides a cluster resource allocation and recovery method, which is applied to a system including a custom resource queue module, a quota observation module, and a resource allocation and recovery module, including:

[0006] Define the queue information in the cluster resources;

[0007] Polling usage information of each queue quota, and updating the usage information in real time;

[0008] When a new request task from the first user is received, cluster resources are allocated and recovered according to the usage information and the queue information.

[0009] In some embodiments, the queue information includes:

[0010] Each queue, the namespace corresponding to each queue, the maximum quota, the minimum quota, the excess resource ratio weight P of each queue, and each queue has a variable W;

[0011] Wherein, the variable W is used to automatically record the number of excess resources used by each queue;

[0012] The excess resource proportion weight P is used to indicate the usage proportion of resources exceeding the minimum quota.

[0013] In some embodiments, when a new request task of a first user is received in the above cluster resource allocation and recycling method, cluster resources are allocated and cluster resources are recycled according to the usage information, and when there are spare cluster resources, the method includes:

[0014] When the resources of the first user's new request task are less than the minimum quota, cluster resources are allocated normally and the new request task is submitted normally;

[0015] When the first user's new request task resources are greater than the minimum quota and less than the maximum quota, the new request task can be submitted, and the record value of each queue is queried;

[0016] When the first user's newly requested task resources are greater than the maximum quota, the priority of the newly requested task is set to level three;

[0017] In some embodiments, in the above cluster resource allocation and recycling method, when a new request task is received, cluster resources are allocated and the cluster resources are recycled according to the usage information, and when there are no free cluster resources, the method includes:

[0018] When the resources of the new request task of the first user are less than the minimum quota, the cluster resources are recycled so that the queue of the new request task can meet the minimum quota;

[0019] When the resources of the first user's newly requested task reach the minimum quota, no allocation is performed.

[0020] In some embodiments, after querying the record value of each queue in the above cluster resource allocation and recovery method, the method includes:

[0021] The proportion of excess resources used by the first user's new request task resources in the cluster is less than the excess resource proportion weight, and the priority of the first user's new request task is set to level 2;

[0022] The proportion of excess resources used by the first user's new request task resources in the cluster is less than the excess resource proportion weight, and the priority of the first user's new request task is set to level three.

[0023] In some embodiments, reclaiming cluster resources includes:

[0024] The second user who has not exceeded the minimum quota observes whether there are new request task resources with a priority level of three in the cluster. If there are and the new request task resources with a priority level of three include multiple queues, the queue with a higher proportion is recycled;

[0025] If there is no new request task with priority level 3, observe the new request task with priority level 2, and the second user who has not exceeded the minimum quota reclaims the new request task with priority level 2 of the first user and the new request task resource with priority level 3 of the third user who has exceeded the limit;

[0026] If the first queue exceeds the minimum quota but does not reach the maximum quota, the new request tasks with a priority of level 3 in the cluster are recycled and set to new request tasks with a priority of level 2.

[0027] In some embodiments, the second user who has not exceeded the minimum quota reclaims the first user's new request task with a second priority and the third user's new request task resources with a third priority, including:

[0028] The first user and the third user preempt according to the difference between the ratio of the number W of excess resources used by each queue and the ratio of the excess resource proportion weight P.

[0029] In a second aspect, an embodiment of the present invention provides a cluster resource allocation and recovery device, including:

[0030] Custom resource queue module: used to define queue information in cluster resources;

[0031] Quota Observation Module: used to poll the usage information of each queue quota;

[0032] Resource allocation and recovery module: used for allocating cluster resources and recovering cluster resources according to the usage information and the queue information when receiving a new request task from the first user.

[0033] In a third aspect, an embodiment of the present invention further provides an electronic device, including: a processor and a memory;

[0034] The processor is used to execute any one of the cluster resource allocation and recovery methods described above by calling the program or instruction stored in the memory.

[0035] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute any one of the cluster resource allocation and recovery methods described above.

[0036] The beneficial effects of the present invention are: a method applied to a system including a custom resource queue module, a quota observation module, and a resource allocation and recovery module, including: defining queue information in cluster resources; polling the usage information of each queue quota, and updating the usage information in real time; and being used to allocate cluster resources and recover cluster resources according to the usage information and queue information when receiving a new request task from the first user. The custom resource queue module introduces global queue custom resources, which solves the limitations of the original namespace quota and can easily expand the concept of the queue to the group; the quota observation module determines the usage information in real time, and the resource allocation and recovery module enables users to use the idle resources of the cluster, solving the problem of idle resources; and the allocation and use of resources in the cluster can be flexibly realized, effectively improving the resource utilization of the entire cluster and reducing the workload of the administrator's operation and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A diagram of a cluster resource allocation and recovery method provided by an embodiment of the present invention;

[0038] Figure 2 A diagram of a cluster resource allocation and recovery device provided by an embodiment of the present invention;

[0039] Figure 3 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0041] In order to more clearly understand the above-mentioned purpose, features and advantages of the present application, the present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is to be understood that the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. The specific embodiments described herein are merely used to explain the present disclosure, rather than to limit the present application. Based on the described embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0042] It should be noted that, in this document, relational terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0043] Figure 1 A diagram of a cluster resource allocation and recovery method provided by an embodiment of the present invention.

[0044] In a first aspect, an embodiment of the present invention provides a cluster resource allocation and recovery method, which is applied to a system including a custom resource queue module, a quota observation module, and a resource allocation and recovery module, and includes three steps S101, S102 and S103:

[0045] S101: define queue information in cluster resources;

[0046] Specifically, in the embodiment of the present application, queue information in cluster resources is defined by a custom resource queue module.

[0047] S102: polling usage information of each queue quota, and updating the usage information in real time;

[0048] The quota observation module detects the quota usage information in each custom queue. The quota observation module consists of a List-Watch mechanism and an Informer module. By continuously polling the quota usage information of each queue, the usage information will be updated in the cache memory in real time. The usage information includes the current quota of each queue and the value of the variable W included in the cache, which is refreshed and stored in the back-end database at regular intervals.

[0049] S103: When a new request task from the first user is received, cluster resources are allocated and cluster resources are recovered according to the usage information and the queue information.

[0050] Specifically, in the embodiment of the present application, the current quota usage information is managed through the resource allocation and recovery module, and when the first user submits a new task, it is responsible for allocating cluster resources and determining whether to recover cluster resources.

[0051] In some embodiments, the queue information includes:

[0052] Each queue, the namespace corresponding to each queue, the maximum quota, the minimum quota, the excess resource ratio weight P of each queue, and each queue has a variable W;

[0053] Wherein, the variable W is used to automatically record the number of excess resources used by each queue;

[0054] The excess resource proportion weight P is used to indicate the usage proportion of resources exceeding the minimum quota.

[0055] Specifically, each resource in the cluster in the embodiment of the present application is isolated according to the namespace. Each namespace will have resources such as CPU / GPU. The user defines the maximum quota Qmax and the minimum quota Qmin, the weight P of the excess resource ratio, and the usage ratio formula of each queue in the excess resources, that is, the resources exceeding Qmin, is set to: [max-min] / s+min, s is a variable parameter that is different for each queue. There is also a variable W in the queue, which is used to automatically record the number of excess resources used by each queue.

[0056] It should be understood that the user's operations on the queue in the cluster are controlled by the controller. The role of the controller is to maintain the customized state so that it meets the user's set requirements. When an event occurs, compare the current resource state with the expected state to see if it is consistent. If not, correct it.

[0057] In some embodiments, in the above cluster resource allocation and recycling method, when a new request task of the first user is received, cluster resources are allocated and recycled according to the usage information. When there are spare resources in the cluster resources, the following three situations are included:

[0058] Case 1: When the resources of the first user's new request task are less than the minimum quota, cluster resources are allocated normally and the new request task is submitted normally;

[0059] The second case: when the first user's new request task resources are greater than the minimum quota and less than the maximum quota, the new request task can be submitted, and the record value of each queue is queried;

[0060] The third case: when the resources of the new request task of the first user are greater than the maximum quota, the priority of the new request task is set to level three.

[0061] Specifically, when there are spare resources in the cluster, different allocation methods are adopted by comparing the new requested task resources of the first user with the size of the maximum quota and the minimum quota. Firstly, users can use the idle resources of the cluster to solve the problem of idle resources. Secondly, cluster resources are allocated in different ways, making the allocation of cluster resources more flexible and effective.

[0062] In some embodiments, in the above cluster resource allocation and recycling method, when a new request task is received and there are no free cluster resources, cluster resources are allocated and recycled according to the usage information, including the following two situations:

[0063] Case 1: When the resources of the first user's new request task are less than the minimum quota, cluster resources are recycled so that the queue of the new request task can meet the minimum quota;

[0064] The second situation: when the resources of the first user's newly requested task reach the minimum quota, no allocation is performed.

[0065] Specifically, when the cluster resources have no spare resources, by comparing the size of the first user's new request task resources with the minimum quota, it is determined whether to recycle or not to allocate. It should be understood that when recycling, the resources borrowed by the cluster can be reclaimed immediately. When the cluster resources have no spare resources, when the first user's new request task resources reach the minimum quota, allocation is prohibited.

[0066] In some embodiments, after querying the record value of each queue in the above cluster resource allocation and recovery method, the method includes:

[0067] The proportion of excess resources used by the first user's new request task resources in the cluster is less than the excess resource proportion weight, and the priority of the first user's new request task is set to level 2;

[0068] The proportion of excess resources used by the first user's new request task resources in the cluster is less than the excess resource proportion weight, and the priority of the first user's new request task is set to level three.

[0069] Specifically, when there are spare resources in the cluster, by comparing the newly requested task resources of the first user with the size of the maximum quota and the minimum quota, if the new requested task resources of the first user are greater than the minimum quota and less than the maximum quota, the proportion of excess resources used by the new requested task resources in the cluster and the size of the weight of the excess resources proportion are further determined, thereby setting the new requested task of the first user to different priority levels so that it can be recycled according to different priorities when it is recycled.

[0070] In some embodiments, reclaiming cluster resources includes the following three situations:

[0071] The first case: the second user who has not exceeded the minimum quota observes whether there are new request task resources with a priority level of three in the cluster. If there are and the new request task resources with a priority level of three include multiple queues, the queue with a higher proportion is recycled;

[0072] It should be understood that the number of resources used by each queue in the embodiment of the present application will be converted into a ratio. For example, if the three-level tasks are A (0.9), B (0.2), and C (0.4), the one that is recycled is A.

[0073] The second situation: if there is no new request task with priority level 3, observe the new request task with priority level 2, and the second user who has not exceeded the minimum quota reclaims the new request task with priority level 2 of the first user and the new request task resources with priority level 3 of the third user who exceeds the limit.

[0074] Specifically, in the embodiment of the present application, the first user and the third user preempt according to the difference between the ratio of the number W of excess resources used by each queue and the ratio of the excess resource proportion weight P.

[0075] It should be understood that P is an adjustable parameter, which represents the ratio of each queue exceeding the minimum quota. The ratio is a fixed value, and the value of each queue can be different. For example, the maximum quota and the minimum quota of the first user queue A are [5,20], and P can be defined as [20-5] / s1+5, s1 is 3, then p is 10; the quota of queue C is [5,30], and the P of the third user queue C can be set to [30-5] / S2+5, S2 is 5, then P is 10; the resource level of tasks that exceed the minimum quota but have not reached P is set to the second priority. If the first user queue A uses 8 quotas and the third user queue C also uses 8, queue A 8 / 15, queue C 8 / 25, obviously A>C, then A is recycled.

[0076] The third case: When the first queue exceeds the minimum quota but does not reach the maximum quota, the new request tasks with a priority of level 3 in the cluster are recycled and set to new request tasks with a priority of level 2.

[0077] Specifically, in the embodiment of the present application, different priorities are set for the tasks of the borrowed resources, and low-priority tasks are recycled first during recycling, thereby protecting the user's important training tasks and complying with the borrowing principle.

[0078] Figure 2 A diagram of a cluster resource allocation and recovery device provided by an embodiment of the present invention;

[0079] In a second aspect, an embodiment of the present invention provides a cluster resource allocation and recovery device, including:

[0080] Custom resource queue module 201: used to define queue information in cluster resources;

[0081] Specifically, in the embodiment of the present application, the queue information in the cluster resources is defined by the custom resource queue module 201 .

[0082] The quota observation module 202 is used to poll the usage information of each queue quota.

[0083] Specifically, in the embodiment of the present application, the quota observation module 202 detects the quota usage information in each custom queue. The quota observation module 202 is composed of a List-Watch mechanism and an Informer module. By continuously polling the quota usage information of each queue, the usage information is updated in the cache memory in real time. The usage information includes the current quota of each queue, and the value of the variable W is included in the cache, and is periodically refreshed to the back-end database for storage.

[0084] Resource allocation and recovery module 203: configured to allocate cluster resources and recover cluster resources according to the usage information and the queue information when receiving a new request task from the first user.

[0085] Specifically, in the embodiment of the present application, the current quota usage information is managed through the resource allocation and recovery module 203, and when the first user submits a new task, it is responsible for allocating cluster resources and determining whether to recover cluster resources.

[0086] In a third aspect, an embodiment of the present invention further provides an electronic device, including: a processor and a memory;

[0087] The processor is used to execute any one of the cluster resource allocation and recovery methods described above by calling the program or instruction stored in the memory.

[0088] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute any one of the cluster resource allocation and recovery methods described above.

[0089] Figure 3 It is a schematic block diagram of an electronic device provided by an embodiment of the present disclosure.

[0090] like Figure 3 As shown, the electronic device includes: at least one processor 301, at least one memory 302 and at least one communication interface 303. The various components in the electronic device are coupled together through a bus system 304. The communication interface 303 is used to transmit information between external devices. It can be understood that the bus system 304 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 304 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 3 Various buses are labeled as bus system 304 .

[0091] It can be understood that the memory 302 in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.

[0092] In some implementations, the memory 302 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system and application programs.

[0093] The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. A program that implements any method of a cluster resource allocation and recovery method provided in an embodiment of the present application can be included in the application.

[0094] In an embodiment of the present application, the processor 301 calls a program or instruction stored in the memory 302, specifically, a program or instruction stored in an application, and the processor 301 is used to execute the steps of each embodiment of a cluster resource allocation and recovery method provided in an embodiment of the present application.

[0095] Define the queue information in the cluster resources;

[0096] Polling usage information of each queue quota, and updating the usage information in real time;

[0097] When a new request task from the first user is received, cluster resources are allocated and recovered according to the usage information and the queue information.

[0098] Any method in a cluster resource allocation and recovery method provided in an embodiment of the present application can be applied to the processor 301, or implemented by the processor 301. The processor 301 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 701 or an instruction in the form of software. The above-mentioned processor 701 can be a general-purpose processor, a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0099] The steps of any method of a cluster resource allocation and recovery method provided in an embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software units in a decoding processor. The software unit can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 302, and the processor 301 reads the information in the memory 302, and completes the steps of a cluster resource allocation and recovery method in combination with its hardware.

[0100] Those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present application and to form different embodiments.

[0101] Those skilled in the art will appreciate that the description of each embodiment has its own emphasis, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0102] Although the embodiments of the present application are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations all fall within the scope defined by the attached claims. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

[0103] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A cluster resource allocation and recovery method, characterized in that: Applied to a system including a custom resource queue module, a quota observation module, and a resource allocation and recovery module, the method includes: Define the queue information in the cluster resources; Polling usage information of each queue quota, and updating the usage information in real time; When receiving a new request task from the first user, allocating cluster resources and reclaiming cluster resources according to the usage information and the queue information; The queue information includes: Each queue, the namespace corresponding to each queue, the maximum quota, the minimum quota, the excess resource ratio weight P of each queue, and each queue has a variable W; Wherein, the variable W is used to automatically record the number of excess resources used by each queue; The excess resource proportion weight P is used to indicate the usage proportion of resources exceeding the minimum quota; When a new request task is received, cluster resources are allocated and the cluster resources are recovered according to the usage information. When there are no free cluster resources, the steps include: When the resources of the new request task of the first user are less than the minimum quota, cluster resources are recycled so that the queue of the new request task can meet the minimum quota; When the first user's newly requested task resources reach the minimum quota, no allocation is made; The reclaiming of cluster resources comprises: The second user who has not exceeded the minimum quota determines whether there is a new request task with a priority level of three in the cluster. If there is and the new request task resource with a priority level of three includes multiple queues, the queue with a higher proportion is recycled; If it is determined that there is no new request task with the third priority in the cluster, a new request task with the second priority is determined, and the second user who has not exceeded the minimum quota reclaims the new request task with the second priority of the first user and the new request task resources with the third priority of the third user who exceeds the limit; If the first queue exceeds the minimum quota but does not reach the maximum quota, reclaim the new request task with the third priority level in the cluster, and set the new request task with the third priority level to a new request task with the second priority level; The number of resources used by each queue is converted into a ratio. P is an adjustable parameter, which represents the ratio of each queue exceeding the minimum quota. The ratio is a fixed value, which is different for each queue. The resource level of tasks that exceed the minimum quota but have not reached P is set to priority level 2. When a new request task of the first user is received, cluster resources are allocated and the cluster resources are recovered according to the usage information, and when there are spare resources in the cluster resources, the method includes: When the resources of the new requested task of the first user are less than the minimum quota, the cluster resources are allocated normally and the new requested task is submitted normally; When the first user's newly requested task resources are greater than the minimum quota and less than the maximum quota, the newly requested task can be submitted, and the record value of each queue is queried; When the newly requested task resources of the first user are greater than the maximum quota, the priority of the newly requested task is set to level three.

2. The cluster resource allocation and recovery method according to claim 1, characterized in that: After querying the record values ​​of each queue, the method further includes: If the proportion of excess resources used by the first user's new request task resources in the cluster is less than the excess resource proportion weight P, the priority of the first user's new request task is set to level 2; If the proportion of excess resources used by the first user's new request task resources in the cluster is less than the excess resource proportion weight P, the priority of the first user's new request task is set to level three.

3. The cluster resource allocation and recovery method according to claim 1, characterized in that: The second user who has not exceeded the minimum quota reclaims the first user's new request task with a second priority and the third user's new request task resources with a third priority, including: The first user and the third user preempt according to the difference between the ratio of the number W of excess resources used by each queue and the ratio of the excess resource proportion weight P.

4. A cluster resource allocation and recovery device, using the cluster resource allocation and recovery method according to any one of claims 1 to 3, characterized in that: The device comprises: Define custom resource queue module: used to define queue information in cluster resources; Quota Observation Module: used to poll the usage information of each queue quota; Resource allocation and recovery module: used for allocating cluster resources and recovering cluster resources according to the usage information and the queue information when receiving a new request task from the first user.

5. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute the cluster resource allocation and recovery method according to any one of claims 1 to 3 by calling the program or instruction stored in the memory.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a cluster resource allocation and recovery method as claimed in any one of claims 1 to 3.