Resource allocation method and device, electronic equipment and readable storage medium

Through dynamically adjust the amount of resource allocation of the target node, in response to the resource allocation request of the target user, the problem of low hardware resource utilization caused by resource distribution methods in the existing technology has been solved, and more efficient resource utilization is achieved.

CN119376916APending Publication Date: 2025-01-28GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411317429.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The resource allocation method in the prior art leads to a low utilization rate of hardware resources, especially when hardware resource requirements fluctuate during user tasks execution.

Method used

By responding to the resource allocation request of the target user, determine the resource scheduling strategy of the target task, and dynamically adjust the amount of resource allocation of multiple target nodes based on the strategy to ensure that the resource allocation and task requirements are matched.

Benefits of technology

The utilization rate of hardware resources in the resource pool is improved, and the amount of resource allocation is dynamically adjusted to adapt to the changes in resource demand at different stages of target tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376916A_ABST
    Figure CN119376916A_ABST
Patent Text Reader

Abstract

The invention discloses a resource allocation method and device, electronic equipment and a readable storage medium, and belongs to the technical field of resource allocation, and the method comprises the steps: responding to a resource allocation request of a target user for a target task, and determining a resource scheduling strategy corresponding to the target task based on the resource allocation request; based on a resource scheduling strategy, determining first resource allocation quantities corresponding to a plurality of target nodes in a target task running process; determining a second resource allocation amount corresponding to the target node based on an unallocated resource amount corresponding to the target node in the resource pool and the first resource allocation amount; and allocating hardware resources to the target user based on the second resource allocation quantity. According to the embodiment of the invention, the resource allocation quantities can be set for the target nodes in the running process of the target task, and the corresponding resource allocation quantities are allocated to the target nodes, so that the hardware resources allocated to the target task dynamically change along with the running resources of the target task, and the utilization rate of the hardware resources in the resource pool can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of resource allocation, and specifically relates to a resource allocation method, device, electronic device and readable storage medium. Background Art

[0002] With the continuous development of Internet technology, computing cluster technology (such as cloud computing, providing computing services through computing servers) is rapidly becoming popular. Computing cluster technology can enable multiple users to share computer hardware resources in the same resource pool, which can significantly improve resource utilization.

[0003] In the related art, hardware resources are usually allocated to users based on the amount of resources declared by the users. The resources required for user calculation are also allocated based on the tasks that the users need to perform. After the user's task is completed, the hardware resources allocated to the user are recovered.

[0004] However, since the hardware resources required by the user's task at different stages of the execution process usually fluctuate significantly, the above resource allocation method has a low utilization rate of hardware resources. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a resource allocation method, device, electronic device and readable storage medium, which can solve the problem of low utilization of hardware resources in the resource allocation method in the related art.

[0006] In a first aspect, an embodiment of the present application provides a resource allocation method, the method comprising:

[0007] In response to a resource allocation request from a target user for a target task, determining a resource scheduling strategy corresponding to the target task based on the resource allocation request;

[0008] Based on the resource scheduling strategy, determining first resource allocation amounts corresponding to a plurality of target nodes during the running of the target task;

[0009] Determine a second resource allocation amount corresponding to the target node based on an amount of unallocated resources corresponding to the target node in the resource pool and the first resource allocation amount;

[0010] At the target node, hardware resources are allocated to the target user based on the second resource allocation amount.

[0011] Optionally, determining a resource scheduling strategy corresponding to the target task based on the resource allocation request includes:

[0012] Determine the task type corresponding to the target task based on the resource allocation request;

[0013] Obtain a resource scheduling strategy corresponding to the task type of the target user.

[0014] Optionally, the target node includes a target event node, and before determining the resource scheduling policy corresponding to the target task based on the resource allocation request, the method further includes:

[0015] Acquire task running information generated during the running of historical tasks of the target user; wherein the task running information includes resource occupancy information and running event information, and the task types of the historical tasks are all target types;

[0016] Determining a trigger time corresponding to the target event node from the operation event information;

[0017] Determining the task resource requirements corresponding to the target event nodes respectively from the resource occupancy information based on the trigger time;

[0018] A resource scheduling strategy corresponding to the target type is generated based on the task resource demands respectively corresponding to the multiple target nodes.

[0019] Optionally, the method further comprises:

[0020] Determine, based on the resource occupancy information, a plurality of target time points at which a change in resource occupancy is greater than or equal to a first threshold;

[0021] Based on the target time, a target event node corresponding to the target time is matched from the task running information.

[0022] Optionally, determining first resource allocation amounts respectively corresponding to a plurality of target nodes during the running of the target task based on the resource scheduling strategy includes:

[0023] Acquire the resource application amount of the target user for the target task from the resource allocation request;

[0024] Determine the resource occupancy ratio among the multiple target nodes based on the resource scheduling strategy;

[0025] Determine the task resource requirements corresponding to the multiple target nodes respectively based on the resource application amount and the resource occupation ratio between the multiple target nodes;

[0026] The first resource allocation amount is generated based on the task resource requirement amount.

[0027] Optionally, determining the task resource requirements respectively corresponding to the multiple target nodes based on the resource application amount and the resource occupation ratio between the multiple target nodes includes:

[0028] Obtain the maximum resource occupancy and historical resource application amount corresponding to the historical tasks of the target user;

[0029] Determining the historical resource utilization rate of the target user based on the maximum resource occupancy and the historical resource application amount;

[0030] Correct the resource application amount according to the historical resource utilization rate to obtain a corrected resource application amount;

[0031] Based on the resource application correction amount and the resource occupancy ratio between the multiple target nodes, the task resource requirements respectively corresponding to the multiple target nodes are determined.

[0032] Optionally, determining the second resource allocation amount corresponding to the target node based on the unallocated resource amount corresponding to the target node in the resource pool and the first resource allocation amount includes:

[0033] In a case where the amount of unallocated resources is greater than or equal to the amount of first allocated resources, determining the second amount of allocated resources as the first amount of allocated resources;

[0034] In a case where the unallocated resource amount is less than the first resource allocation amount, an unused resource amount is determined from the allocated resources in the resource pool, and the second resource allocation amount is determined based on the unused resource amount and the unallocated resource amount.

[0035] Optionally, after allocating hardware resources to the target user based on the second resource allocation amount, the method further includes:

[0036] Obtaining the actual amount of resources occupied by the target user corresponding to the target node;

[0037] According to the actual resource occupancy amount and the second resource allocation amount of the target node, a resource adjustment amount of the target node is determined, and the hardware resources allocated to the target user are adjusted based on the resource adjustment amount.

[0038] Optionally, the resource adjustment amount includes a resource increase amount or a resource decrease amount, and determining the resource adjustment amount of the target node according to the actual resource occupancy amount and the second resource allocation amount of the target node includes:

[0039] When the difference between the actual resource occupation amount corresponding to the target user at the target node and the second resource allocation amount is less than or equal to a second threshold, determining the resource increase amount of the target node based on the resource application amount of the target user for the target task;

[0040] When the difference between the actual resource occupancy of the target user at the target node and the second resource allocation amount is greater than or equal to a third threshold, the resource reduction amount of the target node is determined based on the unallocated resources in the resource pool; wherein the third threshold is greater than the second threshold.

[0041] In a second aspect, an embodiment of the present application provides a resource allocation device, the device comprising:

[0042] A policy module, configured to respond to a resource allocation request from a target user for a target task and determine a resource scheduling policy corresponding to the target task based on the resource allocation request;

[0043] A first resource allocation amount module, used to determine first resource allocation amounts corresponding to a plurality of target nodes during the running of the target task based on the resource scheduling strategy;

[0044] A second resource allocation amount module, configured to determine a second resource allocation amount corresponding to the target node based on an unallocated resource amount corresponding to the target node in a resource pool and the first resource allocation amount;

[0045] An allocation module is used to allocate hardware resources to the target user based on the second resource allocation amount at the target node.

[0046] Optionally, the policy module includes:

[0047] A task type submodule, used to determine the task type corresponding to the target task based on the resource allocation request;

[0048] The strategy acquisition submodule is used to acquire the resource scheduling strategy corresponding to the task type of the target user.

[0049] Optionally, the target node includes a target event node, and the device further includes:

[0050] A task running information module is used to obtain the task running information generated during the running of the target user's historical tasks; wherein the task running information includes resource occupancy information and running event information, and the task types of the historical tasks are all target types;

[0051] A trigger time module, used to determine the trigger time corresponding to the target event node from the running event information;

[0052] A demand module, used to determine the task resource demand corresponding to each of the target event nodes from the resource occupancy information based on the trigger time;

[0053] The strategy generation module is used to generate a resource scheduling strategy corresponding to the target type based on the task resource requirements corresponding to the multiple target nodes.

[0054] Optionally, the device further comprises:

[0055] A target time module, used to determine multiple target times at which the resource occupancy change is greater than or equal to a first threshold based on the resource occupancy information;

[0056] A node module is used to match a target event node corresponding to the target time from the task running information based on the target time.

[0057] Optionally, the first resource allocation module includes:

[0058] A resource application quantum module, used to obtain the resource application amount of the target user for the target task from the resource allocation request;

[0059] A resource occupancy ratio submodule, used to determine the resource occupancy ratio between the multiple target nodes based on the resource scheduling strategy;

[0060] A task resource requirement quantum module, used to determine the task resource requirements corresponding to the multiple target nodes respectively based on the resource application amount and the resource occupancy ratio between the multiple target nodes;

[0061] The first resource allocation amount generating submodule is used to generate the first resource allocation amount based on the task resource requirement.

[0062] Optionally, the task resource requirement quantum module includes:

[0063] An acquisition submodule, used to acquire the maximum resource occupancy and historical resource application amount respectively corresponding to the historical tasks of the target user;

[0064] A utilization submodule, configured to determine the historical resource utilization of the target user based on the maximum resource occupancy and the historical resource application amount;

[0065] A correction quantum module, used for correcting the resource application amount according to the historical resource utilization rate to obtain a resource application correction amount;

[0066] The task resource requirement determination submodule is used to determine the task resource requirements corresponding to the multiple target nodes respectively based on the resource application correction amount and the resource occupancy ratio between the multiple target nodes.

[0067] Optionally, the second resource allocation amount module is further used to determine the second resource allocation amount as the first resource allocation amount when the unallocated resource amount is greater than or equal to the first resource allocation amount; and to determine the unused resource amount from the allocated resources of the resource pool when the unallocated resource amount is less than the first resource allocation amount, and to determine the second resource allocation amount based on the unused resource amount and the unallocated resource amount.

[0068] Optionally, the device further comprises:

[0069] A resource actual occupancy module, used to obtain the actual occupancy of resources corresponding to the target user at the target node;

[0070] The adjustment module is used to determine the resource adjustment amount of the target node according to the actual resource occupancy and the second resource allocation amount of the target node, and adjust the hardware resources allocated to the target user based on the resource adjustment amount.

[0071] Optionally, the resource adjustment amount includes a resource increase amount or a resource decrease amount, and the adjustment module includes:

[0072] a resource increase quantum module, configured to determine the resource increase amount of the target node based on the resource application amount of the target user for the target task, when the difference between the actual resource occupation amount corresponding to the target node by the target user and the second resource allocation amount is less than or equal to a second threshold;

[0073] A resource reduction quantum module is used to determine the resource reduction amount of the target node based on the unallocated resources of the resource pool when the difference between the actual resource occupancy amount of the target user corresponding to the target node and the second resource allocation amount is greater than or equal to a third threshold; wherein the third threshold is greater than the second threshold.

[0074] In a third aspect, an embodiment of the present application provides an electronic device, comprising the resource allocation device as described above, for implementing the resource allocation method as described in the first aspect.

[0075] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the resource allocation method of the first aspect as described above is implemented.

[0076] In an embodiment of the present application, a resource allocation method is provided, including: responding to a resource allocation request of a target user for a target task, determining a resource scheduling strategy corresponding to the target task based on the resource allocation request; determining first resource allocation amounts corresponding to multiple target nodes in the target task running process based on the resource scheduling strategy; determining a second resource allocation amount corresponding to the target node based on the unallocated resource amount corresponding to the target node in the resource pool and the first resource allocation amount; and allocating hardware resources to the target user at the target node based on the second resource allocation amount. Resource allocation amounts can be set for multiple target nodes in the target task running process respectively, and according to the resource allocation amount corresponding to the target node, the hardware resources allocated to the target task change dynamically with the running resources of the target task, which helps to improve the utilization rate of the hardware resources in the resource pool. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 is a flowchart of a resource allocation method provided by an embodiment of the present application;

[0078] Figure 2 This is a model training task resource application flow chart provided in an embodiment of the present application;

[0079] Figure 3 is a flowchart of another resource allocation method provided by an embodiment of the present application;

[0080] Figure 4 This is an additional resource application flow chart provided in an embodiment of the present application;

[0081] Figure 5 It is a logic block diagram of a resource allocation device provided in an embodiment of the present application;

[0082] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0083] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0084] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0085] The resource allocation method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0086] Reference Figure 1 , Figure 1 A flowchart of a resource allocation method provided by an embodiment of the present application is shown. Figure 1 As shown, the specific steps include:

[0087] Step 101 : In response to a resource allocation request from a target user for a target task, a resource scheduling strategy corresponding to the target task is determined based on the resource allocation request.

[0088] In the embodiment of the present application, the target users may include but are not limited to project team users, department users, individual users, enterprise users, etc., and the target tasks may include but are not limited to computing tasks, model training tasks, storage tasks, etc., which are not specifically limited in the embodiment of the present application.

[0089] When the target user needs to perform the target task, he can send a resource allocation request to the resource management system, and the resource management system can allocate corresponding computer resources to the target user so that the target user can run the target task. Among them, the above-mentioned computer resources can include local resources or cloud resources, and the resource allocation request can at least include the user ID of the target user and the task ID of the target task. The above-mentioned resource allocation request can be written and issued by the target user, or it can be automatically generated when the target user requests to run the target task, which is not specifically limited in the embodiments of the present application.

[0090] Specifically, after receiving the resource allocation request for the target task from the target user, the resource allocation request can be parsed to obtain the user ID of the target user and the task ID of the target task, and the corresponding task type is determined according to the task ID, and the resource scheduling strategy corresponding to the task type is obtained, and the resource scheduling strategy is the resource scheduling strategy corresponding to the target task. Among them, the task type can be flexibly set according to the actual business scenario, and the embodiment of the present application does not make specific limitations. For example, for the model training task, the corresponding task type may include but is not limited to A model training task, B model training task, C model training task, etc.

[0091] In one embodiment, the resource scheduling strategy can be used to indicate the changes in the resource requirements of different tasks during the execution of a task on a computer. For example, a resource scheduling strategy can be: from time T0 to time T1 when the task starts, 2 cores of CPU resources, 3 TFLOPS of GPU resources, and 4 GB of memory resources are occupied; from time T1 to time T2 when the task starts, 4 cores of CPU resources, 10 TFLOPS of GPU resources, and 16 GB of memory resources are occupied; from time T3 to time T4 when the task starts, 1 core of CPU resources, 0 TFLOPS of GPU resources, and 2 GB of memory resources are occupied. The above nodes may include but are not limited to time nodes, event nodes, etc., and are not specifically limited in the embodiments of the present application.

[0092] In another embodiment, the resource scheduling strategy can be used to indicate an occupancy model of the corresponding relationship between the amount of resources required for a task to be executed on a computer and the task running time. The occupancy model may include but is not limited to a function model, a conditional model, a time series model, etc., and is not specifically limited in the embodiments of the present application. The occupancy model can receive the task running time as input and output the corresponding task resource requirement. It should be noted that the task resource requirement may include the corresponding relationship between multiple resource types and resource requirements.

[0093] In an embodiment of the present application, the resource scheduling strategy corresponding to the task type can be pre-generated and stored based on the historical actual resource occupancy of tasks of the task type, or it can be pre-generated and stored based on a simulation analysis of the execution process of the task type. When the target task is received, the corresponding resource scheduling strategy can be directly obtained, thereby improving resource allocation efficiency.

[0094] Step 102: Based on the resource scheduling strategy, determine the first resource allocation amounts corresponding to the plurality of target nodes during the execution of the target task.

[0095] In an embodiment of the present application, first resource allocation amounts corresponding to a plurality of target nodes respectively may be determined according to a resource scheduling strategy, and the first resource allocation amounts may include resource allocation amounts corresponding to a plurality of resource types respectively.

[0096] Specifically, multiple target nodes can be selected or randomly selected according to preset rules, and then the task resource demand corresponding to each target node is determined based on the resource scheduling strategy, and then the first resource allocation corresponding to the target node is determined based on the task resource demand. In one embodiment, the task resource demand corresponding to the target node can be directly used as the first resource allocation of the target node; in another embodiment, the task resource demand corresponding to the target node can also be corrected to obtain the first resource allocation corresponding to the target node. For example, the product of the task resource demand and the first preset coefficient (for example, 1.1), or the sum of the task resource demand and the preset correction value (for example, 1), can be used as the first resource allocation corresponding to the target node, thereby reducing the bottleneck caused by the task resource demand on the operation of the target task due to a certain error.

[0097] The above-mentioned target node can be a time node selected according to a fixed time interval, for example, every 5 minutes from the start of the target task is used as a target node; the target node can also be selected according to the node corresponding to the task resource demand contained in the resource scheduling strategy, for example, the time node or time node corresponding to each task resource demand can be selected as a target node.

[0098] It should be noted that the last target node may be an end node, and the end node is used to indicate the end of the target task, so the first resource allocation amount corresponding to the end node may be 0, indicating that the resources allocated to the target task are completely recovered.

[0099] Step 103: Determine a second resource allocation amount corresponding to the target node based on the unallocated resource amount corresponding to the target node in the resource pool and the first resource allocation amount.

[0100] In an embodiment of the present application, since the system can support the simultaneous execution of multiple tasks, there will be differences in the amount of unallocated resources in the system resource pool at different target nodes. In order to avoid over-allocation of resources, the second resource allocation amount corresponding to the target node can be determined based on the amount of unallocated resources corresponding to the target node in the resource pool and the first resource allocation amount corresponding to the target node, so that the total amount of resources allocated by the resource pool at the target node does not exceed the total amount of resources that the resource pool can allocate at the target node.

[0101] Specifically, if the amount of unallocated resources corresponding to the target node is greater than or equal to the first resource allocation amount corresponding to the target node, the first resource allocation amount can be used as the second resource allocation amount corresponding to the target node; if the amount of unallocated resources corresponding to the target node is less than the first resource allocation amount corresponding to the target node, the unallocated resource amount can be used as the second resource allocation amount corresponding to the target node.

[0102] In an embodiment of the present application, the resource allocation system can integrate all available hardware resources into a resource pool. These hardware resources may include, but are not limited to, CPU resources (e.g., the number of CPU cores of multiple computing nodes), memory resources (e.g., the total memory capacity of computing nodes), GPU resources (e.g., the number of cores or computing power of multiple GPU devices), wherein GPU resources can be used for accelerated training of deep learning models, and disk resources (e.g., high-speed SSD storage and large-capacity HDD storage). These hardware resources can be uniformly configured and registered when the platform is initialized to form a resource pool available for allocation. It should be noted that the resource allocation system of the embodiment of the present application can also provide other services, such as image building and Notebook development support for model training tasks, and users can use the hardware resources managed by the resource allocation system to perform various tasks related to AI model training, including image building and Notebook development. The resource allocation system can provide a complete set of development environment support, including but not limited to deep learning frameworks (e.g., TensorFlow, PyTorch), data processing tools (e.g., Pandas, NumPy), Notebook services (e.g., Jupyter Notebook), etc.

[0103] Reference Figure 2 , Figure 2 A model training task resource application flow chart provided in an embodiment of the present application is shown. Figure 2 As shown, the target user can first use the hardware resources managed by the resource allocation system to build an image and / or develop a notebook to generate a model training task, and then submit a resource allocation request for the model training task to the resource allocation system. The resource allocation system allocates hardware resources to the target user based on the model training task.

[0104] Step 104: At the target node, allocate hardware resources to the target user based on the second resource allocation amount.

[0105] After determining the second resource allocation amount corresponding to each target node of the target task, when the target task reaches the target node, the second resource allocation amount corresponding to the target node can be applied to allocate corresponding hardware resources to the target user so that the target task of the target user can be efficiently executed, and at the same time improve the utilization rate of system resources and the utilization rate of allocated hardware resources.

[0106] Exemplarily, a target task of a target user determines four target nodes (target nodes 1 to 4), wherein target node 1 can execute the target task at the 0th second (task start), target node 2 can execute the target task at the 100th second, target node 3 can execute the target task at the 300th second, and target node 4 can execute the target task at the 800th second (task end). The second resource allocation corresponding to target node 1 can be 2 cores of CPU resources, 3 TFLOPS of GPU resources, and 4 GB of memory resources; the second resource allocation corresponding to target node 2 can be 4 cores of CPU resources, 10 TFLOPS of GPU resources, and 16 GB of memory resources; the second resource allocation corresponding to target node 3 can be 1 core of CPU resources, 5 TFLOPS of GPU resources, and 2 GB of memory resources; the second resource allocation corresponding to target node 4 can be 0 cores of CPU resources, 0 TFLOPS of GPU resources, and 0 GB of memory resources. At the beginning of the target task, computing resources of 2 cores of CPU resources, 3 TFLOPS of GPU resources, and 4 GB of memory resources can be allocated to the target user. When the target task runs for 100 seconds, computing resources of 4 cores of CPU resources, 10 TFLOPS of GPU resources, and 16 GB of memory resources can be allocated to the target user. When the target task runs for 300 seconds, computing resources of 1 core of CPU resources, 5 TFLOPS of GPU resources, and 2 GB of memory resources can be allocated to the target user. When the target task runs for 800 seconds, computing resources of 2 cores of CPU resources, 3 TFLOPS of GPU resources, and 4 GB of memory resources can be allocated to the target user.

[0107] In summary, a resource allocation method provided by an embodiment of the present application includes: responding to a resource allocation request of a target user for a target task, determining a resource scheduling strategy corresponding to the target task based on the resource allocation request; determining first resource allocation amounts corresponding to multiple target nodes in the target task running process based on the resource scheduling strategy; determining a second resource allocation amount corresponding to the target node based on the unallocated resource amount and the first resource allocation amount corresponding to the target node in the resource pool; and allocating hardware resources to the target user at the target node based on the second resource allocation amount. The resource allocation amount can be set for multiple target nodes in the target task running process respectively, and according to the resource allocation amount corresponding to the target node, the hardware resources allocated to the target task change dynamically with the running resources of the target task, which helps to improve the utilization rate of the hardware resources in the resource pool.

[0108] like Figure 3 As shown, Figure 3 A flowchart of another resource allocation method provided in an embodiment of the present application, the method may include:

[0109] Step 201: Determine the task type corresponding to the target task based on the resource allocation request.

[0110] In an embodiment of the present application, the task type corresponding to the target task can be determined based on the resource allocation request. In one embodiment, the task information of the target task can be matched with a preset task type database to obtain the task type corresponding to the target task. In another embodiment, since the target task may be a new task, the task information of the target task cannot be identified, that is, the task information of the target task cannot be matched in the database, then the task information of the target task can be determined to be similar to the preset task information in the task type database, and the task type corresponding to the preset task information with the highest similarity is determined as the task type corresponding to the target task.

[0111] Step 202: Obtain a resource scheduling policy corresponding to the task type of the target user.

[0112] In the embodiment of the present application, since different target users have different usage habits and task processing requirements, the same task type of different target users can correspond to different resource scheduling strategies, that is, the resource scheduling strategy corresponds to a combination of a target user and a task type. This improves the adaptability of the resource scheduling strategy to the target task and improves the accuracy of determining the resource allocation amount based on the resource scheduling strategy.

[0113] Optionally, the resource scheduling strategy may be determined based on the following steps A1 to A4:

[0114] Step A1, obtaining the task running information generated during the running of the historical tasks of the target user; wherein the task running information includes resource occupancy information and running event information, and the task types of the historical tasks are all target types.

[0115] In an embodiment of the present application, the task running information generated during the operation of the historical task of the target user can be obtained, and the task running information may include resource occupancy information and running event information. Among them, the resource occupancy information includes the correspondence between multiple moments and resource occupancy, and the resource occupancy of a historical task can represent the hardware resources actually occupied by the historical task at the corresponding moment. The running event information may include the correspondence between multiple moments and event nodes, and the event node may represent the key events that occurred at the corresponding moment during the execution of the historical task, such as task initialization events, data loading events, forward propagation start events, loss calculation events, data loading completion events, process start events, etc., which are not specifically limited in the embodiment of the present application.

[0116] For example, a task running information may include 4 moments: T0-T4, where the resource usage corresponding to T0 may be "occupying 2 cores of CPU resources, 3 TFLOPS of GPU resources, and 4 GB of memory resources"; the resource usage corresponding to T1 may be "occupying 4 cores of CPU resources, 10 TFLOPS of GPU resources, and 16 GB of memory resources"; the resource usage corresponding to T2 may be "occupying 1 core of CPU resources, 0 TFLOPS of GPU resources, and 2 GB of memory resources"; the resource usage corresponding to T3 may be "occupying 0 cores of CPU resources, 0 TFLOPS of GPU resources, and 0 GB of memory resources". A running event information may include 4 moments: T0-T4, where the event node corresponding to T0 is the task initialization event, the event node corresponding to T1 is the data loading event, the event node corresponding to T2 is the model training event, and the event node corresponding to T3 is the training completion event.

[0117] Step A2: determining the trigger time corresponding to the target event node from the running event information.

[0118] In an embodiment of the present application, the trigger time corresponding to the target event node can be determined from the operation event information. Specifically, the event node in the operation event information can be determined as the target event node, and the time corresponding to each target event node can be obtained from the operation event information as the trigger time. It should be noted that the above-mentioned target event node can also be pre-set, and target tasks of different task types can correspond to different target event nodes.

[0119] Step A3: determining the task resource requirements corresponding to the target event nodes respectively from the resource occupancy information based on the trigger time.

[0120] In an embodiment of the present application, based on the triggering time of the above-mentioned target event node, the resource occupancy at the corresponding moment can be matched from the resource occupancy information to obtain the task resource demand corresponding to the target event node.

[0121] Step A4: generating a resource scheduling strategy corresponding to the target type based on the task resource requirements corresponding to the multiple target nodes.

[0122] In the embodiment of the present application, after obtaining the task resource requirements corresponding to the multiple target nodes of the target task, a resource scheduling strategy corresponding to the target task can be generated according to the task resource requirements. Specifically, a corresponding relationship between the target node and the task resource requirements can be established to obtain the resource scheduling strategy.

[0123] By obtaining the task running information generated during the historical task running of the target user; wherein the task running information includes resource occupancy information and running event information; determining the trigger time corresponding to the target event node from the running event information; determining the task resource demand amounts corresponding to the target event nodes respectively from the resource occupancy information based on the trigger time; generating a resource scheduling strategy based on the task resource demand amounts corresponding to multiple target nodes respectively, the accuracy of the generated resource scheduling strategy can be improved, and more accurate resources can be allocated to the target user according to the resource scheduling strategy.

[0124] Optionally, the target event node may be determined based on the following steps B1 to B2:

[0125] Step B1, determining multiple target moments at which a resource occupancy change is greater than or equal to a first threshold based on the resource occupancy information.

[0126] In an embodiment of the present application, the resource occupancy change corresponding to each moment can be determined based on the resource occupancy information. The moment represents the moment corresponding to the resource occupancy in the resource occupancy information. Each moment may correspond to a resource occupancy change, which may represent the change in resource occupancy at that moment compared to the previous moment. Exemplarily, if the resource occupancy at moment T1 is 100 and the resource occupancy change at moment T2 is 150, the resource occupancy change corresponding to moment T2 may be 150-100=50. It should be noted that the resource occupancy change corresponding to moment T0 (starting moment) may be the resource occupancy corresponding to that moment.

[0127] The first threshold may be a preset value, and the first threshold may be used to screen out a plurality of target moments whose resource occupancy change is greater than or equal to the first threshold from all moments included in the resource occupancy information.

[0128] Step B2: matching a target event node corresponding to the target time from the task running information based on the target time.

[0129] In an embodiment of the present application, after obtaining the target time, the target time can be matched with the time corresponding to each event node in the task running information to determine the target event node whose occurrence time is closest to the target time.

[0130] By determining multiple target moments at which the change in resource occupancy is greater than or equal to a first threshold based on the resource occupancy information, and matching the target event nodes corresponding to the target moments from the task running information based on the target moments, it is possible to screen out target event nodes at which the change in resource occupancy is large, so that the resources of the target users can be adjusted at these target event nodes, which can reduce the frequency of system resource adjustments to a certain extent, improve system stability, and reduce the decline in target task running efficiency caused by the reduction in resource adjustment frequency.

[0131] Step 203: Acquire the resource application amount of the target user for the target task from the resource allocation request.

[0132] In the embodiment of the present application, the resource allocation request may also include the resource application amount of the target user for the target task, and the resource application amount indicates the resource amount expected to be obtained by running the target task specified by the target user. The resource application amount may be manually instructed by the target user, or may be automatically generated by the target user through an algorithm, which is not specifically limited in the embodiment of the present application.

[0133] For example, an initial resource allocation can be set for each user so that the user can perform tasks without submitting a resource allocation request. When the user believes that the initial resource allocation cannot meet the task operation requirements, the user can submit a resource allocation request through the resource application interface of the resource allocation system platform. The system will dynamically adjust resource allocation according to the current resource pool usage. The resource application amount can be provided by the user by filling in the resource requirement form, indicating the required number of CPU cores, memory capacity, number of GPUs, and disk space.

[0134] Step 204: Determine the resource occupancy ratio among the multiple target nodes based on the resource scheduling strategy.

[0135] In the case where the resource scheduling strategy includes resource occupancy corresponding to multiple target nodes, the resource occupancy ratio between the multiple target nodes can be calculated according to the resource occupancy corresponding to the multiple target nodes. In addition, the resource scheduling strategy can also directly record the pre-calculated resource occupancy ratio between the multiple target nodes. The embodiments of the present application are not specifically limited.

[0136] It should be noted that, since a resource scheduling strategy may include multiple resource types, each resource type may correspond to a resource occupancy ratio, and each resource type may correspond to a resource application amount.

[0137] Step 205: Determine the task resource requirements corresponding to the multiple target nodes respectively based on the resource application amount and the resource occupation ratio between the multiple target nodes.

[0138] In an embodiment of the present application, since the resource application amount can usually reflect the maximum amount of resources that the user wishes to request, the resource application amount can be used as the maximum limit of the task resource demand. The task resource demand corresponding to each target node is determined according to the resource occupancy ratio, so that the task resource demand corresponding to each target node conforms to the resource occupancy ratio and is less than or equal to the resource application amount.

[0139] For example, if there are target nodes 1 to 4, the corresponding GPU type resource occupancy ratio is 1:2:5:1, and the resource application amount corresponding to the GPU type is 10TFLOPS, then based on the resource application amount and the above resource occupancy ratio, it can be determined that the task resource requirements corresponding to the above target nodes 1 to 4 are 2TFLOPS, 4TFLOPS, 10TFLOPS, and 2TFLOPS respectively.

[0140] Optionally, step 205 may include:

[0141] Step 2051, obtaining the maximum resource occupancy and historical resource application amount corresponding to the historical tasks of the target user.

[0142] Different target users may have different task application habits, which may lead to significant differences in resource utilization rates for different target users. In order to further improve resource utilization, the maximum resource occupancy and historical resource application amounts corresponding to multiple historical tasks of the target user may be obtained. Specifically, the resource occupancy information and historical resource application amounts corresponding to a preset number of historical tasks before the target task may be obtained, or the resource occupancy information and historical resource application amounts corresponding to all historical tasks before the target task may be obtained. Among them, the maximum resource occupancy represents the maximum value of the resources actually occupied by the historical task during the actual execution.

[0143] Step 2052: Determine the historical resource utilization rate of the target user based on the maximum resource occupancy and the historical resource application amount.

[0144] According to the maximum resource occupancy of the above historical tasks and the historical resource application amount of the historical tasks, the historical resource utilization rate of the target user can be determined. Specifically, the ratio between the maximum resource occupancy of a historical task and the historical resource application amount of the historical task can be calculated to obtain the historical resource utilization rate corresponding to the historical task, and then the historical resource utilization rates corresponding to all historical tasks can be averaged to obtain the historical resource utilization rate corresponding to the target user.

[0145] Step 2053: Correct the resource application amount according to the historical resource utilization rate to obtain a corrected resource application amount.

[0146] After obtaining the historical resource utilization rate, the product of the historical resource utilization rate and the resource application amount of the target user for the target task can be calculated to obtain the resource application correction amount.

[0147] Step 2054: Determine the task resource requirements corresponding to each of the multiple target nodes based on the resource application correction amount and the resource occupancy ratio between the multiple target nodes.

[0148] By obtaining the maximum resource occupancy and historical resource application amounts corresponding to the target user's historical tasks; determining the target user's historical resource utilization rate based on the maximum resource occupancy and historical resource application amounts; correcting the resource application amount according to the historical resource utilization rate to obtain the resource application correction amount; and determining the task resource requirements corresponding to multiple target nodes based on the resource application correction amount and the resource occupancy ratio between multiple target nodes, it is possible to avoid resource waste caused by excessive resource application amounts provided by the target user to a certain extent, which helps to further improve the utilization rate of resources in the resource pool.

[0149] Step 206: Generate the first resource allocation based on the task resource requirement.

[0150] In one embodiment, the task resource demand corresponding to the target node can be directly used as the first resource allocation amount of the target node; in another embodiment, the task resource demand corresponding to the target node can also be corrected to obtain the first resource allocation amount corresponding to the target node. For example, the product of the task resource demand and a first preset coefficient (for example, 1.1), or the sum of the task resource demand and a preset correction value (for example, 1) can be used as the first resource allocation amount corresponding to the target node, thereby reducing the bottleneck caused by a certain error in the task resource demand on the operation of the target task.

[0151] By obtaining the target user's resource application amount for the target task from the resource allocation request; determining the resource occupancy ratio among multiple target nodes based on the resource scheduling strategy; determining the task resource requirements corresponding to the multiple target nodes respectively based on the resource application amount and the resource occupancy ratio among the multiple target nodes; generating the first resource allocation amount based on the task resource requirements, the resource allocation amount can be reasonably generated for each target node according to the target user's resource application amount, and resource waste can be effectively avoided while meeting the target user's needs.

[0152] Step 207: Determine a second resource allocation amount corresponding to the target node based on the unallocated resource amount corresponding to the target node in the resource pool and the first resource allocation amount.

[0153] Optionally, step 207 may include:

[0154] Sub-step 2071: when the unallocated resource amount is greater than or equal to the first resource allocation amount, determine the second resource allocation amount as the first resource allocation amount.

[0155] If the amount of unallocated resources in the resource pool at the target node is greater than or equal to the first resource allocation amount corresponding to the target node, it means that the amount of unallocated resources in the resource pool at the target node is sufficient, and the first resource allocation amount corresponding to the target node can be directly used as the second resource allocation amount corresponding to the target node.

[0156] Sub-step 2072, when the unallocated resource amount is less than the first resource allocation amount, determine the unused resource amount from the allocated resources of the resource pool, and determine the second resource allocation amount based on the unused resource amount and the unallocated resource amount.

[0157] If the amount of unallocated resources in the resource pool at the target node is less than the first resource allocation amount corresponding to the target node, it means that the amount of unallocated resources in the resource pool at the target node is insufficient. At this time, the amount of unused resources can be determined from the amount of allocated resources in the resource pool, and the second resource allocation amount can be determined based on the amount of unused resources and the amount of unallocated resources. Among them, the amount of unused resources means the amount of resources that have been allocated to a certain user but are not used by the user's task. For example, at a certain target node, the amount of resources allocated to user A is 10, but the amount of resources actually used by user A at this time is 4, then the amount of unused resources of user A at the target node is 6. In an embodiment of the present application, the amount of unused resources of all users of the target node can be counted.

[0158] If the sum of the unused resource amount and the unallocated resource amount of the target node is greater than or equal to the second resource allocation amount of the target node, the first resource allocation amount corresponding to the target node can be directly used as the second resource allocation amount corresponding to the target node. If the sum of the unused resource amount and the unallocated resource amount of the target node is less than the second resource allocation amount of the target node, the sum of the unused resource amount and the unallocated resource amount of the target node can be directly used as the second resource allocation amount corresponding to the target node.

[0159] It should be noted that after the unused resources are reallocated, the unused resources can be recovered, that is, the resource allocation amount corresponding to the user who generated the unused resources can be adjusted.

[0160] By determining the second resource allocation amount as the first resource allocation amount when the unallocated resource amount is greater than or equal to the first resource allocation amount; and determining the unused resource amount from the allocated resources of the resource pool when the unallocated resource amount is less than the first resource allocation amount, and determining the second resource allocation amount based on the unused resource amount and the unallocated resource amount, the unused resource amount can also be involved in resource allocation, which helps to reduce idle resources in the resource pool and further improve the utilization rate of resources in the resource pool.

[0161] Step 208: At the target node, allocate hardware resources to the target user based on the second resource allocation amount.

[0162] This step can be referred to as step 104, and will not be described in detail in this embodiment of the present application.

[0163] Optionally, after step 208, the resources allocated to the target user may be adjusted based on the following steps C1 to C2.

[0164] Step C1, obtaining the actual resource occupancy corresponding to the target user at the target node.

[0165] During the execution of the target task, the resource allocation of the target user at the target node can also be adjusted in real time and dynamically, thereby further improving the utilization rate of resources in the resource pool. Specifically, the actual resource occupancy of the target user at the target node can be obtained, and the actual resource occupancy of the target node is the amount of resources actually used by the target user in the time period from the target node to the next target node.

[0166] Step C2: determining a resource adjustment amount of the target node according to the actual resource occupancy amount and the second resource allocation amount of the target node, and adjusting the hardware resources allocated to the target user based on the resource adjustment amount.

[0167] After obtaining the actual resource occupancy of the target node, the resource adjustment amount of the target node can be determined according to the actual resource occupancy, and then the hardware resources allocated to the target user can be adjusted based on the resource adjustment amount. Specifically, the difference between the second resource allocation amount and the actual resource occupancy of the target node can be directly calculated to obtain the resource adjustment amount of the target node, and the hardware resources allocated to the target user can be reduced based on the resource adjustment amount.

[0168] By obtaining the actual resource occupancy of the target user at the target node; determining the resource adjustment amount of the target node according to the actual resource occupancy, and adjusting the hardware resources allocated to the target user based on the resource adjustment amount, the amount of hardware resources allocated to the target user can be optimized to a certain extent, further improving the utilization rate of hardware resources.

[0169] Optionally, step C2 may include:

[0170] Sub-step C21, when the difference between the actual resource occupancy of the target user corresponding to the target node and the second resource allocation amount is less than or equal to a second threshold, determines the resource increase amount of the target node based on the resource application amount of the target user for the target task.

[0171] In an embodiment of the present application, the actual resource occupancy of the target user at the target node and the difference between the second resource allocation amount can also be calculated. The difference can reflect the gap between the actual resource occupancy and the actually allocated second resource allocation amount. The smaller the difference, the better the target user is utilizing the resources at this time. Therefore, a second threshold can be set. If the difference is less than or equal to the second threshold, the resource increase of the target node can be determined based on the resource application amount of the target user for the target task.

[0172] Specifically, in one embodiment, the difference between the resource application amount of the target user and the actual resource occupancy amount corresponding to the target node can be directly calculated to obtain the resource increase amount of the target node. In another embodiment, the actual resource occupancy amount of the target node can be multiplied by a second preset coefficient (e.g., 1.2), and when the multiplication result is less than or equal to the resource application amount, the multiplication result is determined as the resource increase amount of the target node, and when the multiplication result is greater than the resource application amount, the resource application amount is used as the resource increase amount of the target node.

[0173] Sub-step C22, when the difference between the actual resource occupancy of the target user corresponding to the target node and the second resource allocation amount is greater than or equal to a third threshold, determines the resource reduction amount of the target node based on the unallocated resources in the resource pool; wherein the third threshold is greater than the second threshold.

[0174] In an embodiment of the present application, the larger the difference between the actual resource occupancy of the target user at the target node and the second resource allocation amount, the worse the resource utilization of the target user is at this time. Therefore, a third threshold value can be set. If the difference is greater than or equal to the third threshold value, the resource reduction amount of the target node can be determined based on the unallocated resources in the resource pool, so that the smaller the unallocated resources, the greater the resource reduction amount. It should be noted that the resource reduction amount must be less than or equal to the difference between the actual resource occupancy of the target user at the target node and the second resource allocation amount to avoid reducing the impact of the allocated resources on the operation of the target task.

[0175] Specifically, the target ratio between the amount of unallocated resources in the resource pool and the preset recommended amount of unallocated resources can be calculated. If the target ratio is greater than or equal to 1, it means that the amount of unallocated resources is sufficient. The resource reduction amount can be set to 0, and the unused resources of the target user will not be reclaimed temporarily to ensure the stability of the target task operation. If the target ratio is less than 1, it means that the amount of unallocated resources does not reach the recommended amount of unallocated resources. At this time, the amount of unallocated resources is insufficient. The difference between the actual resource occupancy corresponding to the target node and the second resource allocation amount can be calculated, and the product of the difference and (1-target ratio) is calculated to obtain the resource reduction amount of the target node.

[0176] In an embodiment of the present application, when the actual resource occupancy is significantly different from the second resource allocation amount corresponding to the target node, the hardware resources allocated to it can be reduced, thereby further improving the utilization rate of the hardware resources; and when the actual resource occupancy is close to or reaches the second resource allocation amount corresponding to the target node, the hardware resources allocated to it can be increased, thereby avoiding performance bottlenecks in the target task operation and improving the task operation efficiency.

[0177] Optionally, during the target task execution, the target user can also apply for additional resources, see Figure 4 , Figure 4 A flowchart of applying for additional resources provided by an embodiment of the present application is shown. Figure 4 As shown, during the execution of the target task, the target user initiates an additional resource application to the resource management system. The resource management system receives the additional resource application and reviews it. The review may include manual review or automatic review, wherein the automatic review may be based on the resource utilization of the target user. If the resource utilization is high (for example, greater than or equal to the preset utilization, the review is passed, otherwise it is rejected), after the application is reviewed and approved, the hardware resources allocated to the target user are dynamically adjusted based on the additional resource application.

[0178] In summary, another resource allocation method provided by an embodiment of the present application includes, in response to a resource allocation request of a target user for a target task, determining a resource scheduling strategy corresponding to the target task based on the resource allocation request; determining first resource allocation amounts corresponding to multiple target nodes in the target task running process based on the resource scheduling strategy; determining a second resource allocation amount corresponding to the target node based on the unallocated resource amount and the first resource allocation amount corresponding to the target node in the resource pool; and allocating hardware resources to the target user at the target node based on the second resource allocation amount. Resource allocation amounts can be set for multiple target nodes in the target task running process respectively, and according to the resource allocation amount corresponding to the target node, the hardware resources allocated to the target task change dynamically with the running resources of the target task, which helps to improve the utilization rate of hardware resources in the resource pool.

[0179] like Figure 5 As shown, Figure 5 A logical block diagram of a resource allocation device provided in an embodiment of the present application, the resource allocation device 500 may include:

[0180] A policy module 501 is used to respond to a resource allocation request from a target user for a target task and determine a resource scheduling policy corresponding to the target task based on the resource allocation request;

[0181] A first resource allocation amount module 502, configured to determine first resource allocation amounts corresponding to a plurality of target nodes during the running of the target task based on the resource scheduling strategy;

[0182] A second resource allocation amount module 503, configured to determine a second resource allocation amount corresponding to the target node based on an unallocated resource amount corresponding to the target node in the resource pool and the first resource allocation amount;

[0183] The allocation module 504 is configured to allocate hardware resources to the target user at the target node based on the second resource allocation amount.

[0184] Optionally, the policy module includes:

[0185] A task type submodule, used to determine the task type corresponding to the target task based on the resource allocation request;

[0186] The strategy acquisition submodule is used to acquire the resource scheduling strategy corresponding to the task type of the target user.

[0187] Optionally, the target node includes a target event node, and the device further includes:

[0188] A task running information module is used to obtain the task running information generated during the running of the target user's historical tasks; wherein the task running information includes resource occupancy information and running event information, and the task types of the historical tasks are all target types;

[0189] A trigger time module, used to determine the trigger time corresponding to the target event node from the running event information;

[0190] A demand module, used to determine the task resource demand corresponding to each of the target event nodes from the resource occupancy information based on the trigger time;

[0191] The strategy generation module is used to generate a resource scheduling strategy corresponding to the target type based on the task resource requirements corresponding to the multiple target nodes.

[0192] Optionally, the device further comprises:

[0193] A target time module, used to determine multiple target times at which the resource occupancy change is greater than or equal to a first threshold based on the resource occupancy information;

[0194] A node module is used to match a target event node corresponding to the target time from the task running information based on the target time.

[0195] Optionally, the first resource allocation module includes:

[0196] A resource application quantum module, used to obtain the resource application amount of the target user for the target task from the resource allocation request;

[0197] A resource occupancy ratio submodule, used to determine the resource occupancy ratio between the multiple target nodes based on the resource scheduling strategy;

[0198] A task resource requirement quantum module, used to determine the task resource requirements corresponding to the multiple target nodes respectively based on the resource application amount and the resource occupancy ratio between the multiple target nodes;

[0199] The first resource allocation amount generating submodule is used to generate the first resource allocation amount based on the task resource requirement.

[0200] Optionally, the task resource requirement quantum module includes:

[0201] An acquisition submodule, used to acquire the maximum resource occupancy and historical resource application amount respectively corresponding to the historical tasks of the target user;

[0202] A utilization submodule, configured to determine the historical resource utilization of the target user based on the maximum resource occupancy and the historical resource application amount;

[0203] A correction quantum module, used for correcting the resource application amount according to the historical resource utilization rate to obtain a resource application correction amount;

[0204] The task resource requirement determination submodule is used to determine the task resource requirements corresponding to the multiple target nodes respectively based on the resource application correction amount and the resource occupancy ratio between the multiple target nodes.

[0205] Optionally, the second resource allocation amount module is further used to determine the second resource allocation amount as the first resource allocation amount when the unallocated resource amount is greater than or equal to the first resource allocation amount; and to determine the unused resource amount from the allocated resources of the resource pool when the unallocated resource amount is less than the first resource allocation amount, and to determine the second resource allocation amount based on the unused resource amount and the unallocated resource amount.

[0206] Optionally, the device further comprises:

[0207] A resource actual occupancy module, used to obtain the actual occupancy of resources corresponding to the target user at the target node;

[0208] The adjustment module is used to determine the resource adjustment amount of the target node according to the actual resource occupancy and the second resource allocation amount of the target node, and adjust the hardware resources allocated to the target user based on the resource adjustment amount.

[0209] Optionally, the resource adjustment amount includes a resource increase amount or a resource decrease amount, and the adjustment module includes:

[0210] a resource increase quantum module, configured to determine the resource increase amount of the target node based on the resource application amount of the target user for the target task, when the difference between the actual resource occupation amount corresponding to the target node by the target user and the second resource allocation amount is less than or equal to a second threshold;

[0211] A resource reduction quantum module is used to determine the resource reduction amount of the target node based on the unallocated resources of the resource pool when the difference between the actual resource occupancy amount of the target user corresponding to the target node and the second resource allocation amount is greater than or equal to a third threshold; wherein the third threshold is greater than the second threshold.

[0212] In summary, a resource allocation device provided in an embodiment of the present application can set resource allocation amounts for multiple target nodes during the operation of a target task, and allocate corresponding resource allocation amounts to the target nodes, so that the hardware resources allocated to the target task change dynamically with the running resources of the target task, which helps to improve the utilization rate of hardware resources in the resource pool.

[0213] The resource allocation device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0214] The resource allocation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, a Linux operating system, a Windows operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0215] The resource allocation device provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0216] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device M00, including a processor M01 and a memory M02, wherein the memory M02 stores programs or instructions that can be executed on the processor M01, and when the program or instructions are executed by the processor M01, the various steps of the above-mentioned resource allocation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0217] In an embodiment of the present application, the memory M02 can be used to store software programs and various data. The memory M02 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory M02 may include a volatile memory or a non-volatile memory, or the memory x09 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory M02 in the embodiment of the present application includes but is not limited to these and any other suitable types of memories.

[0218] The processor M01 may include one or more processing units; optionally, the processor M01 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor M01.

[0219] An embodiment of the present application also provides an electronic device, including the resource allocation device and refrigerant circulation device as described above, to implement the various processes of the above resource allocation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0220] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned resource allocation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0221] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0222] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned resource allocation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0223] It should be understood that the chip involved in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0224] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned resource allocation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0225] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0226] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0227] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A resource allocation method, characterized in that: The method comprises: In response to a resource allocation request from a target user for a target task, determining a resource scheduling strategy corresponding to the target task based on the resource allocation request; Based on the resource scheduling strategy, determining first resource allocation amounts corresponding to a plurality of target nodes during the running of the target task; Determine a second resource allocation amount corresponding to the target node based on an amount of unallocated resources corresponding to the target node in the resource pool and the first resource allocation amount; At the target node, hardware resources are allocated to the target user based on the second resource allocation amount.

2. The method according to claim 1, characterized in that The determining the resource scheduling strategy corresponding to the target task based on the resource allocation request includes: Determine the task type corresponding to the target task based on the resource allocation request; Obtain a resource scheduling strategy corresponding to the task type of the target user.

3. The method according to claim 2, characterized in that The target node includes a target event node. Before determining the resource scheduling strategy corresponding to the target task based on the resource allocation request, the method further includes: Acquire task running information generated during the running of historical tasks of the target user; wherein the task running information includes resource occupancy information and running event information, and the task types of the historical tasks are all target types; Determining a trigger time corresponding to the target event node from the operation event information; Determining the task resource requirements corresponding to the target event nodes respectively from the resource occupancy information based on the trigger time; A resource scheduling strategy corresponding to the target type is generated based on the task resource demands respectively corresponding to the multiple target nodes.

4. The method according to claim 3, characterized in that The method further comprises: Determine, based on the resource occupancy information, a plurality of target time points at which a change in resource occupancy is greater than or equal to a first threshold; Based on the target time, a target event node corresponding to the target time is matched from the task running information.

5. The method according to claim 1, characterized in that The determining, based on the resource scheduling strategy, first resource allocation amounts respectively corresponding to a plurality of target nodes during the running of the target task includes: Acquire the resource application amount of the target user for the target task from the resource allocation request; Determine the resource occupancy ratio among the multiple target nodes based on the resource scheduling strategy; Determine the task resource requirements corresponding to the multiple target nodes respectively based on the resource application amount and the resource occupation ratio between the multiple target nodes; The first resource allocation amount is generated based on the task resource requirement amount.

6. The method according to claim 5, characterized in that The determining, based on the resource application amount and the resource occupation ratio between the multiple target nodes, the task resource requirements respectively corresponding to the multiple target nodes comprises: Obtain the maximum resource occupancy and historical resource application amount corresponding to the historical tasks of the target user; Determining the historical resource utilization rate of the target user based on the maximum resource occupancy and the historical resource application amount; Correct the resource application amount according to the historical resource utilization rate to obtain a corrected resource application amount; Based on the resource application correction amount and the resource occupancy ratio between the multiple target nodes, the task resource requirements respectively corresponding to the multiple target nodes are determined.

7. The method according to claim 1, characterized in that The determining, based on the amount of unallocated resources corresponding to the target node in the resource pool and the first amount of allocated resources, a second amount of allocated resources corresponding to the target node, comprises: In a case where the amount of unallocated resources is greater than or equal to the amount of first allocated resources, determining the second amount of allocated resources as the first amount of allocated resources; In a case where the unallocated resource amount is less than the first resource allocation amount, an unused resource amount is determined from the allocated resources in the resource pool, and the second resource allocation amount is determined based on the unused resource amount and the unallocated resource amount.

8. The method according to claim 1, characterized in that After allocating hardware resources to the target user based on the second resource allocation amount, the method further includes: Obtaining the actual amount of resources occupied by the target user corresponding to the target node; According to the actual resource occupancy amount and the second resource allocation amount of the target node, a resource adjustment amount of the target node is determined, and the hardware resources allocated to the target user are adjusted based on the resource adjustment amount.

9. The method according to claim 8, characterized in that The resource adjustment amount includes a resource increase amount or a resource decrease amount, and determining the resource adjustment amount of the target node according to the actual resource occupancy amount and the second resource allocation amount of the target node includes: When the difference between the actual resource occupation amount corresponding to the target user at the target node and the second resource allocation amount is less than or equal to a second threshold, determining the resource increase amount of the target node based on the resource application amount of the target user for the target task; When the difference between the actual resource occupancy of the target user at the target node and the second resource allocation amount is greater than or equal to a third threshold, the resource reduction amount of the target node is determined based on the unallocated resources in the resource pool; wherein the third threshold is greater than the second threshold.

10. A resource allocation device, characterized in that: The device comprises: A policy module, configured to respond to a resource allocation request from a target user for a target task and determine a resource scheduling policy corresponding to the target task based on the resource allocation request; A first resource allocation amount module, used to determine first resource allocation amounts corresponding to a plurality of target nodes during the running of the target task based on the resource scheduling strategy; A second resource allocation amount module, configured to determine a second resource allocation amount corresponding to the target node based on an unallocated resource amount corresponding to the target node in a resource pool and the first resource allocation amount; An allocation module is used to allocate hardware resources to the target user based on the second resource allocation amount at the target node.

11. An electronic device, characterized in that: It comprises the resource allocation device as claimed in claim 10, used to implement the resource allocation method as claimed in any one of claims 1 to 9.

12. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the resource allocation method according to any one of claims 1 to 9 is implemented.