Resource allocation method and device, equipment and storage medium

Through the duration prediction model and preset functions, the task priority is calculated and resources are dynamically allocated, which solves the problem of unreasonable task allocation in the existing technology, and improves the resource utilization rate and task execution efficiency of the server cluster.

CN119248487AInactive Publication Date: 2025-01-03HEFEI ZHONGKE LEINAO INTELLIGENCE TECH CO LTD

Patent Information

Application Number
CN202411310010.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, server clusters determine task priority based on experience when allocating tasks, resulting in unreasonable resource allocation, low resource utilization, and inability to dynamically adapt to the changes in resources required for the task, resulting in wasted or insufficient resources.

Method used

By obtaining task information, including task type, data quantity, deadline and estimated resource quantity, input it to the duration prediction model to predict the task, and combine the current time and available resources, use preset functions to calculate task priority, dynamically Allocate resources.

Benefits of technology

It realizes more accurate task priority determination, improves resource utilization, avoids resource waste and insufficient resources, and optimizes the task execution efficiency of server clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248487A_ABST
    Figure CN119248487A_ABST
Patent Text Reader

Abstract

The invention discloses a resource allocation method and device, equipment and a storage medium, and the method comprises the steps: obtaining a first task type, a first task data amount and deadline of a target to-be-executed task, an estimated resource amount for completing the target to-be-executed task, and an available resource amount of a server cluster; inputting the first task type, the first task data quantity and the estimated resource quantity into a duration prediction model to obtain a first duration; acquiring current time; processing the current time, the estimated resource quantity, the deadline, the available resource quantity and the first duration by using a preset function to obtain the priority of the target to-be-executed task; and allocating resources to the target to-be-executed task based on the priority, the estimated resource quantity and the available resource quantity. And determining the priority of the task by using the information related to the target to-be-executed task, and allocating resources for the task by using the priority. Therefore, the accuracy of the priority is improved, the resources allocated to the tasks are more reasonable, and the resource utilization rate of the server cluster is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of information processing technology, and in particular, relates to a resource allocation method, device, equipment and storage medium. Background Art

[0002] In the prior art, when a server cluster allocates server resources in the server cluster to a task, a resource allocation method commonly used is: for a task with a high priority, the server resources required by the task are allocated first. However, the priority of a task in the prior art is determined based on the experience of relevant personnel, so the priority of the task is not determined accurately enough, resulting in unreasonable resource allocation to the task based on the priority, and low resource utilization of the server cluster. Summary of the invention

[0003] The embodiment of the present application provides an implementation scheme different from the prior art to solve the technical problems of unreasonable resource allocation to tasks based on priority and low resource utilization of the server cluster.

[0004] In a first aspect, the present application provides a resource allocation method applicable to a server cluster, comprising: obtaining task information of a target task to be executed, the task information comprising: a first task type, a first task data volume, a deadline, an estimated amount of resources for completing the target task to be executed, and the available resources of the server cluster; inputting the first task type, the first task data volume, and the estimated amount of resources into a duration prediction model to obtain a first duration, wherein the duration prediction model is used to predict the duration required to complete the target task to be executed; obtaining the current time; using a preset function to process the current time, the estimated amount of resources, the deadline, the available amount of resources, and the first duration to obtain the priority of the target task to be executed; and allocating resources to the target task to be executed based on the priority, the estimated amount of resources, and the available amount of resources.

[0005] In a second aspect, the present application provides a resource allocation device, which is applicable to a server cluster, comprising: a first acquisition unit, used to acquire task information of a target task to be executed, the task information comprising: a first task type, a first task data volume, a deadline, an estimated amount of resources for completing the target task to be executed, and the available resources of the server cluster; an input unit, used to input the first task type, the first task data volume, and the estimated amount of resources into a duration prediction model to obtain a first duration, wherein the duration prediction model is used to predict the duration required to complete the target task to be executed; a second acquisition unit, used to acquire the current time; a processing unit, used to process the current time, the estimated amount of resources, the deadline, the available amount of resources, and the first duration using a preset function to obtain the priority of the target task to be executed; an allocation unit, used to allocate resources to the target task to be executed based on the priority, the estimated amount of resources, and the available amount of resources.

[0006] In a third aspect, the present application provides an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any method in the first aspect or any possible implementation manner of the first aspect by executing the executable instructions.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements any method in the first aspect or any possible implementation manner of the first aspect.

[0008] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect or any possible implementation manner of the first aspect.

[0009] The solution provided by the present application is to obtain the task information of the target task to be executed, wherein the task information includes: a first task type, a first task data volume, a deadline, an estimated resource volume for completing the target task to be executed, and the available resource volume of the server cluster; input the first task type, the first task data volume, and the estimated resource volume into a duration prediction model to obtain a first duration, wherein the duration prediction model is used to predict the duration required to complete the target task to be executed; obtain the current time; use a preset function to process the current time, the estimated resource volume, the deadline, the available resource volume, and the first duration to obtain the priority of the target task to be executed; and allocate resources to the target task to be executed based on the priority, the estimated resource volume, and the available resource volume. The priority of the task is determined using the task information, and a more accurate priority is obtained, so that it is more reasonable to allocate resources to the task based on the priority, and reasonable allocation of resources improves the resource utilization of the server cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0011] Figure 1 A schematic diagram of a flow chart of a resource allocation method provided in an embodiment of the present application;

[0012] Figure 2 A schematic diagram of an execution process of a target task to be executed is provided for an embodiment of the present application;

[0013] Figure 3 A schematic diagram of the structure of a resource allocation device provided in one embodiment of the present application;

[0014] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0015] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, but cannot be understood as limiting the present application.

[0016] The terms "first" and "second" etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0017] In the prior art, when a server cluster allocates server resources in the server cluster to a task, a resource allocation method commonly used is: for a task with a high priority, the server resources required by the task are allocated first. However, the priority of a task in the prior art is determined based on the experience of relevant personnel, so the priority of the task is not determined accurately enough, resulting in unreasonable resource allocation to the task based on the priority, and low resource utilization of the server cluster.

[0018] In addition, the resource allocation method of the prior art also includes: pre-setting fixed resources allocated to tasks, and allocating the pre-set fixed resources to tasks. However, this method ignores the resources actually required to perform the task, and is prone to the problem of allocating too many resources to tasks, resulting in resource waste. Or it is prone to the problem of allocating too few resources to tasks, resulting in insufficient resources when performing tasks. When the resources required for the task change dynamically, the corresponding resources cannot be provided for the task based on the dynamic change. Therefore, this method has a low resource utilization rate for the server cluster.

[0019] The resource allocation method of the prior art also includes: allocating the required resources to the task based on the order of task submission, the resources required to complete the task, and the available resources in the server cluster. However, this method cannot predict the time required to complete the task. Even when resources are scarce, it is still easy to allocate resources to tasks that require a long time to complete. For tasks that can be completed quickly, it takes a long time to wait for resource release. Therefore, tasks that can be completed quickly cannot be completed in a long time, resulting in low efficiency of the server cluster in executing tasks, unreasonable resources allocated to tasks, and low resource utilization of the server cluster.

[0020] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0021] Figure 1 A schematic diagram of a resource allocation method provided for an exemplary embodiment of the present application is provided. The execution subject of the method may be a server cluster. The method at least includes the following steps S101-S105:

[0022] S101, obtaining task information of a target task to be executed, the task information including: a first task type, a first task data volume, a deadline, an estimated amount of resources required to complete the target task to be executed, and an amount of available resources of the server cluster;

[0023] Optionally, the first task type is used to indicate the urgency of completing the task, wherein the first task type may be a stand-alone training task type or a distributed task type, and the urgency of completing the task of the stand-alone training task type is lower than the urgency of completing the task of the distributed task type.

[0024] Optionally, the first task data volume refers to the total amount of data to be processed in the target task to be executed.

[0025] Optionally, the deadline is the latest time for completing the target task to be performed.

[0026] Optionally, the estimated resource amount is the resources of the server cluster that are predicted to be required to complete the target task to be performed.

[0027] Optionally, the resources of the server cluster include GPU resources, CPU resources and memory resources.

[0028] Specifically, the GPU resource amount is the number of GPU cards, the CPU resource amount is the number of CPU cores, and the memory resource amount is the memory size. For explanations about the number of GPU cards, the number of CPU cores and the memory size, please refer to the prior art and will not be elaborated here.

[0029] Optionally, the available resource amount of the server cluster includes: the sum of the available GPU resource amount, the available CPU resource amount and the available memory resource amount in the server cluster.

[0030] S102, inputting the first task type, the first task data volume, and the estimated resource volume into a duration prediction model to obtain a first duration, wherein the duration prediction model is used to predict the duration required to complete the target task to be performed;

[0031] Optionally, the first duration is the duration predicted by the duration prediction model to complete the target task to be performed.

[0032] Optionally, in the aforementioned S102, before inputting the first task type, the first task data volume, and the estimated resource volume into the duration prediction model, the method further includes the following steps S1021-S104:

[0033] S1021, performing standardization processing on the first task type, the first task data volume, and the estimated resource volume to obtain a target first task type, a target first task data volume, and a target estimated resource volume;

[0034] Optionally, the standardization processing includes data cleaning, data formatting, data standardization, data normalization and data encoding, among which, the various processing procedures of the standardization processing can be referred to in the prior art and will not be described in detail here.

[0035] S1022, using the target first task type as the first task type;

[0036] S1023, taking the target first task data volume as the first task data volume;

[0037] S1024. Use the target estimated resource amount as the estimated resource amount.

[0038] S103, obtaining the current time;

[0039] Optionally, the current time is the system time of the server cluster at the current moment.

[0040] S104, using a preset function to process the current time, the estimated resource amount, the deadline, the available resource amount, and the first duration to obtain the priority of the target task to be executed;

[0041] Optionally, the priority is used to determine the order in which resources are allocated to the target tasks to be performed.

[0042] Optionally, the preset function includes a first function and a second function. In the aforementioned S104, the current time, the estimated resource amount, the deadline, the available resource amount, and the first duration are processed using the preset function to obtain the priority of the target task to be executed, including the following steps S01-S03:

[0043] S01. Calculate a first ratio of the estimated resource amount to the available resource amount by using the first function;

[0044] Optionally, the first ratio may be used to indicate the degree to which the target task to be executed requires available resources in the server cluster. A larger first ratio indicates a greater degree to which the target task to be executed requires available resources in the server cluster.

[0045] Specifically, the first ratio of the estimated resource amount to the available resource amount is calculated by using the first function in the aforementioned S01, which can be expressed as the following formula:

[0046] The first ratio = estimated resource volume ÷ available resource volume

[0047] S02, obtaining preset weight information, the weight information including a first weight value and a second weight value, wherein the first weight value is used to indicate the proportion of the difference between the deadline and the current time in determining the priority of the target task to be executed, and the second weight value is used to indicate the proportion of the first duration in determining the priority of the target task to be executed;

[0048] Optionally, the values ​​of the first weight and the second weight may be the same or different.

[0049] S03. Using the second function to process the weight information, the first ratio, the current time, the deadline and the first duration, obtain the priority of the target task to be executed.

[0050] Specifically, in the aforementioned S03, the weight information, the first ratio, the current time, the deadline and the first duration are processed by the second function to obtain the priority of the target task to be executed, which can be expressed as the following formula:

[0051] Priority = first weight ((deadline time - current time) ÷ first ratio) - second weight × first duration

[0052] Optionally, in the aforementioned S03, the use of the second function to calculate the weight information, the first ratio, the current time, the deadline and the first duration to obtain the priority of the target task to be executed includes the following steps S001-S003:

[0053] S001, obtaining a first result based on the deadline, the current time, the first ratio and the first weight value;

[0054] Specifically, in the aforementioned S001, a first result is obtained based on the deadline, the current time, the first ratio, and the first weight value, which can be expressed as the following formula:

[0055] First result = first weight ((deadline time - current time) ÷ first ratio)

[0056] S002. Obtain a second result based on the first duration and the second weight;

[0057] Specifically, in the aforementioned S002, the second result is obtained based on the first duration and the second weight, which can be expressed as the following formula:

[0058] Second result = second weight × first duration

[0059] S003. Use the second function to process the first result and the second result to obtain the priority of the target task to be executed.

[0060] Optionally, in the aforementioned S003, the first result and the second result are processed by using the second function to obtain the priority of the target task to be executed, which can be expressed as the following formula:

[0061] Priority = first result - second result

[0062] S105: Allocate resources to the target task to be executed based on the priority, the estimated resource amount, and the available resource amount.

[0063] Optionally, in the aforementioned S105, allocating resources to the target task to be executed based on the priority, the estimated amount of resources and the available amount of resources includes: if the target task to be executed is the task with the highest priority in the task queue, allocating resources to the target task to be executed based on the estimated amount of resources and the available amount of resources, wherein the task queue stores the target task to be executed and multiple other tasks to be executed.

[0064] In summary, the priority of the target task to be executed is determined by the available resources of the server cluster, the estimated resources of the target task to be executed, the first duration, the deadline and the current time. The factors affecting the priority of the target task to be executed are comprehensively considered, so that the calculated priority is more accurate. Specifically, through the current available resources in the server cluster and the estimated resources of the target task to be executed, it can be determined whether the server cluster has enough resources to allocate to the target task to be executed, and it is also determined whether the estimated resources allocated to the target task to be executed will cause tension in the available resources of the server cluster, thereby affecting the task execution efficiency of the server cluster. The deadline, current time and first time of the target task to be executed can be determined from the perspective of time to complete the target task to be executed. If the difference between the current time and the deadline is much greater than the first duration, it means that the time to complete the task to be executed is relatively abundant, and from the perspective of time, the tension to complete the target task to be executed is low. Therefore, the priority determined based on factors such as resource quantity and time is more accurate and comprehensively considers factors that affect the priority. If the available resources are relatively tight, the first duration of the target task to be executed is longer, the estimated resource quantity is larger, and the difference between the deadline and the current time is much greater than the first duration, it can be determined that the target execution task does not need to be executed immediately, and there is no need to allocate resources for the target execution task temporarily. Priority can be given to allocating resources to tasks to be executed with a shorter first time, a smaller estimated resource quantity, and a smaller difference between the deadline and the current time, thereby improving the execution efficiency of tasks executed by the server cluster.

[0065] It should be understood that when executing the target task to be executed, if some of the resources allocated to the target task to be executed fail to be available, it is very likely that the execution process of the target task to be executed will be slow, or even stagnate, and the resources occupied by the target task to be executed cannot be released in time, which results in other tasks to be executed being unable to use the occupied resources, thus reducing the utilization rate of server resources.

[0066] Optionally, in order to avoid stagnation of the execution process of the target task to be executed and to improve the utilization rate of server resources, the method also includes: detecting the start execution time and the current execution time of the target task to be executed, and if the difference between the current execution time and the start execution time is greater than the first duration, increasing the resources allocated to the target task to be executed, wherein the start execution time is the time before the current execution time.

[0067] Optionally, in order to avoid stagnation of the execution process of the target task to be executed and to improve the utilization rate of server resources, after increasing the resources allocated to the target task to be executed, the method further includes:

[0068] Obtain the latest available resource amount of the server cluster;

[0069] For each task to be executed other than the target task to be executed, determining the priority of the task to be executed based on the latest available resource amount and the task information of the task to be executed, thereby obtaining the priority of each task to be executed other than the target task to be executed;

[0070] Sorting the priorities of the other tasks to be executed from high to low to obtain the priority order of the other tasks to be executed;

[0071] Resources are allocated to each of the other tasks to be executed in sequence based on the priority order.

[0072] To sum up, when it is detected that the execution time of the target task to be executed exceeds the first time length, more resources are newly allocated to the target task to be executed, thereby ensuring that the target task to be executed is completed sequentially. At the same time, the available resources in the server cluster are redetermined, the priorities of other tasks to be executed are readjusted, and the order of allocating resources to other tasks to be executed is readjusted to achieve maximum utilization of resources in the server cluster and improve the task execution efficiency of the server cluster.

[0073] Optionally, in order to improve the prediction of the time required to complete the task to be performed, the method further includes the following steps S0001-S0002:

[0074] S0001. Acquire multiple sample information, each sample information corresponding to a completed task, the sample information including: a second task type, a second task data volume, an actual amount of resources to complete the task, and a second duration to complete the task;

[0075] S0002. Train an initial large language model based on the multiple sample information to obtain the duration prediction model.

[0076] Optionally, in the aforementioned S0002, training the initial large language model based on the plurality of sample information to obtain the duration prediction model includes the following steps S00021-S00023:

[0077] For each sample information among the plurality of sample information, repeatedly using the second task type, the second task data amount, and the actual resource amount of completing the task of the sample information as training information for training the large language model;

[0078] Using the second duration of completing the task in the sample information as label information of the large language model;

[0079] Specifically, the second duration is the actual duration to complete the task.

[0080] Inputting the training information into the large prediction model to obtain a third duration;

[0081] Determining that the difference between the third duration and the second duration is greater than a preset threshold, adjusting the parameters of the large prediction model based on the difference between the third duration and the second duration to obtain an intermediate language model;

[0082] Until the difference between the third duration and the second duration is no greater than a preset threshold, the intermediate language model is used as the duration prediction model.

[0083] Optionally, in order to obtain the actual execution information of the target task to be executed, so as to facilitate the subsequent adjustment and improvement of the duration prediction model, so as to obtain a duration prediction model that obtains a more accurate first duration. The method also includes: obtaining the first log information when executing the target task to be executed, and storing the first log information in a local database, and also synchronizing the first log information to a database outside the server cluster.

[0084] Optionally, in order to improve the accuracy of the duration prediction model, the method further includes the following steps S1-S3:

[0085] S1. Obtain second log information at preset time intervals, wherein the log generation time of the second log information is not less than the current system time minus the preset time, and the log generation time is not greater than the current system time;

[0086] S2, obtaining the third task type, the third task data volume, the estimated amount of resources to complete the task, the actual amount of resources to complete the task, the fourth duration estimated by the duration prediction model, and the actual duration to complete the task in the second log information;

[0087] S3. Based on the third task type, the third task data volume, the estimated amount of resources to complete the task, the actual amount of resources to complete the task, the fourth duration estimated by the duration prediction model and the actual duration to complete the task in the second log information, adjust the parameters of the duration prediction model to make the estimated time of the duration prediction model more accurate.

[0088] Optionally, in order to make the execution process of the target task to be executed clearer, see Figure 2 , Figure 2 A schematic diagram of an execution process of a target task to be executed provided for an exemplary embodiment of the present application is specifically as follows:

[0089] The task information of the target task to be executed is stored in a local database, and the task information of the target task to be executed required by the duration prediction model is input into the duration prediction model, and the first duration of completing the target task to be executed is predicted by the duration prediction model, and the priority of the target task to be executed is determined by the first duration and the task information. Based on the task information and priority, the target task to be executed is allocated with available resources in the server cluster, and the target task to be executed is executed using the server cluster. The log information of executing the target task to be executed is stored in the local database.

[0090] The sample task information stored in the database is used to build a duration prediction model, and the log information stored in the database is used to optimize the duration prediction model.

[0091] In summary, the solution provided by the present application is to obtain the task information of the target task to be executed, wherein the task information includes: a first task type, a first task data volume, a deadline, an estimated resource volume for completing the target task to be executed, and the available resource volume of the server cluster; input the first task type, the first task data volume, and the estimated resource volume into a duration prediction model to obtain a first duration, wherein the duration prediction model is used to predict the duration required to complete the target task to be executed; obtain the current time; use a preset function to process the current time, the estimated resource volume, the deadline, the available resource volume, and the first duration to obtain the priority of the target task to be executed; and allocate resources to the target task to be executed based on the priority, the estimated resource volume, and the available resource volume. The priority of the task is determined using the task information, and a more accurate priority is obtained, so that it is more reasonable to allocate resources to the task based on the priority, and reasonable allocation of resources improves the resource utilization of the server cluster.

[0092] Specifically, by predicting the completion time of each task to be executed through the duration prediction model, the available resources of the server cluster at each time point can be estimated, thereby optimizing resource allocation, reducing the waste of server cluster resources, and improving the resource utilization of the server cluster. At the same time, resources are allocated to the tasks to be executed based on the dynamic needs of the tasks to be executed, thereby improving the resource utilization of the server cluster. Based on the real-time detection of the execution process of the target task to be executed, when the execution time of the target task to be executed exceeds the estimated first duration, new resources are added to the target task to be executed in time to reduce the waiting time of other tasks to be executed. At the same time, the priority of other tasks to be executed in the task queue is re-determined, and resources are allocated to each task in the other tasks to be executed based on the re-determined priority of other tasks to be executed, shortening the waiting time of the re-determined high-priority tasks, improving resource utilization and improving the efficiency of executing tasks. By adjusting the priority of other tasks to be executed in the queue in real time, it is ensured that when under high load, the efficiency of executing tasks is improved and the utilization of resources is improved. In addition, the log information of historical data is used to adjust the parameters of the duration prediction model to improve the accuracy of the duration prediction model's prediction. Historical data and task type are used as partial factors in determining task priority, which improves the accuracy of the determined priority and achieves scientific allocation of resources.

[0093] Figure 3 A schematic diagram of a resource allocation device provided as an exemplary embodiment of the present application; wherein the device is applicable to a server cluster, and the device includes:

[0094] A first acquisition unit 31 is used to acquire task information of a target task to be executed, wherein the task information includes: a first task type, a first task data volume, a deadline, an estimated resource volume for completing the target task to be executed, and an available resource volume of the server cluster;

[0095] An input unit 32, configured to input the first task type, the first task data volume, and the estimated resource volume into a duration prediction model to obtain a first duration, wherein the duration prediction model is used to predict the duration required to complete the target task to be performed;

[0096] A second obtaining unit 33 is used to obtain the current time;

[0097] The processing unit 34 is used to process the current time, the estimated resource amount, the deadline, the available resource amount and the first duration by using a preset function to obtain the priority of the target task to be executed;

[0098] The allocating unit 35 is configured to allocate resources to the target task to be executed based on the priority, the estimated resource amount and the available resource amount.

[0099] Optionally, the preset function in the device includes a first function and a second function, and the device is used to use the preset function to process the current time, the estimated resource amount, the deadline, the available resource amount and the first duration to obtain the priority of the target task to be executed, specifically for: using the first function to calculate a first ratio of the estimated resource amount to the available resource amount; obtaining preset weight information, the weight information including a first weight value and a second weight value, wherein the first weight value is used to represent the proportion of the difference between the deadline and the current time in determining the priority of the target task to be executed, and the second weight value is used to represent the proportion of the first duration in determining the priority of the target task to be executed; using the second function to process the weight information, the first ratio, the current time, the deadline and the first duration to obtain the priority of the target task to be executed.

[0100] Optionally, the device is used to use the second function to calculate and process the weight information, the first ratio, the current time, the deadline and the first duration to obtain the priority of the target task to be executed, specifically for: obtaining a first result based on the deadline, the current time, the first ratio and the first weight value; obtaining a second result based on the first duration and the second weight; and using the second function to process the first result and the second result to obtain the priority of the target task to be executed.

[0101] Optionally, the device is also used to: obtain multiple sample information, each sample information corresponds to a completed task, the sample information including: a second task type, a second task data volume, an actual amount of resources to complete the task, and a second duration to complete the task; train an initial large language model based on the multiple sample information to obtain the duration prediction model.

[0102] Optionally, the device is also used to: detect the start execution time and current execution time of the target task to be executed, and if the difference between the current execution time and the start execution time is greater than the first duration, increase the resources allocated to the target task to be executed, wherein the start execution time is the time before the current execution time.

[0103] Optionally, the device is used to allocate resources to the target task to be executed based on the priority, the estimated amount of resources and the available amount of resources, specifically for: if the target task to be executed is the task with the highest priority in the task queue, then resources are allocated to the target task to be executed based on the estimated amount of resources and the available amount of resources, wherein the task queue stores the target task to be executed and multiple other tasks to be executed.

[0104] Optionally, the available resource amount of the server cluster in the device includes: the sum of the available GPU resource amount, the available CPU resource amount and the available memory resource amount in the server cluster.

[0105] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device may perform the above method embodiment, and the above and other operations and / or functions of each module in the device are the corresponding processes in each method in the above method embodiment, respectively, and no further description is given here for the sake of brevity.

[0106] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0107] Figure 4 is a schematic block diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include:

[0108] The memory 301 and the processor 302, the memory 301 is used to store the computer program and transmit the program code to the processor 302. In other words, the processor 302 can call and run the computer program from the memory 301 to implement the method in the embodiment of the present application.

[0109] For example, the processor 302 may be configured to execute the above method embodiments according to instructions in the computer program.

[0110] In some embodiments of the present application, the processor 302 may include but is not limited to:

[0111] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0112] In some embodiments of the present application, the memory 301 includes but is not limited to:

[0113] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0114] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 301 and executed by the processor 302 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0115] like Figure 4 As shown, the electronic device may also include:

[0116] The transceiver 303 may be connected to the processor 302 or the memory 301 .

[0117] The processor 302 may control the transceiver 303 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 303 may include a transmitter and a receiver. The transceiver 303 may further include an antenna, and the number of antennas may be one or more.

[0118] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0119] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0120] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0121] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0122] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0123] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0124] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A resource allocation method, characterized in that: Applicable to server clusters, including: Acquire task information of the target task to be executed, the task information including: a first task type, a first task data volume, a deadline, an estimated amount of resources required to complete the target task to be executed, and an amount of available resources of the server cluster; Inputting the first task type, the first task data volume, and the estimated resource volume into a duration prediction model to obtain a first duration, wherein the duration prediction model is used to predict the duration required to complete the target task to be performed; Get the current time; Using a preset function to process the current time, the estimated resource amount, the deadline, the available resource amount, and the first duration, to obtain the priority of the target task to be executed; Resources are allocated to the target task to be performed based on the priority, the estimated resource amount, and the available resource amount.

2. The method according to claim 1, characterized in that The preset function includes a first function and a second function, and the using of the preset function to process the current time, the estimated resource amount, the deadline, the available resource amount, and the first duration to obtain the priority of the target task to be executed includes: Calculating a first ratio of the estimated resource amount to the available resource amount using the first function; Obtaining preset weight information, the weight information including a first weight value and a second weight value, wherein the first weight value is used to indicate the proportion of the difference between the deadline and the current time in determining the priority of the target task to be executed, and the second weight value is used to indicate the proportion of the first duration in determining the priority of the target task to be executed; The weight information, the first ratio, the current time, the deadline, and the first duration are processed using the second function to obtain the priority of the target task to be executed.

3. The method according to claim 2, characterized in that The using the second function to calculate and process the weight information, the first ratio, the current time, the deadline, and the first duration to obtain the priority of the target task to be executed includes: Obtain a first result based on the deadline, the current time, the first ratio, and the first weight value; Obtain a second result based on the first duration and the second weight; The first result and the second result are processed by using the second function to obtain the priority of the target task to be executed.

4. The method according to claim 1, characterized in that: The method further comprises: Acquire multiple sample information, each sample information corresponds to a completed task, the sample information including: a second task type, a second task data volume, an actual amount of resources to complete the task, and a second duration to complete the task; The initial large language model is trained based on the multiple sample information to obtain the duration prediction model.

5. The method according to claim 1, characterized in that The method further comprises: Detect the start execution time and current execution time of the target task to be executed. If the difference between the current execution time and the start execution time is greater than the first duration, increase the resources allocated to the target task to be executed, wherein the start execution time is the time before the current execution time.

6. The method according to claim 1, characterized in that The allocating resources to the target task to be executed based on the priority, the estimated resource amount, and the available resource amount includes: If the target task to be executed is the task with the highest priority in the task queue, resources are allocated to the target task to be executed based on the estimated resource amount and the available resource amount, wherein the task queue stores the target task to be executed and multiple other tasks to be executed.

7. The method according to claim 1, characterized in that The available resources of the server cluster include: the sum of available GPU resources, available CPU resources and available memory resources in the server cluster.

8. A resource allocation device, characterized in that: Applicable to server clusters, including: A first acquisition unit is used to acquire task information of a target task to be executed, wherein the task information includes: a first task type, a first task data volume, a deadline, an estimated resource volume for completing the target task to be executed, and an available resource volume of the server cluster; An input unit, used for inputting the first task type, the first task data amount and the estimated resource amount into a duration prediction model to obtain a first duration, wherein the duration prediction model is used to predict the duration required to complete the target task to be performed; A second acquisition unit, used to acquire the current time; A processing unit, configured to process the current time, the estimated resource amount, the deadline, the available resource amount, and the first duration using a preset function to obtain the priority of the target task to be executed; An allocation unit is used to allocate resources to the target task to be executed based on the priority, the estimated resource amount and the available resource amount.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Task processing method and device, computer equipment and storage medium

    CN111104222A

  • Big data resource scheduling method and device, server and storage medium

    CN111352736A

  • Cluster resource scheduling method and device, computer equipment and storage medium

    CN112328399A

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

    CN115017030A

  • Computing power resource scheduling method and device, equipment and medium

    CN117785487A

Cited By

  • Network resource allocation method and system, electronic equipment and storage medium

    CN119893720A

  • Task scheduling method and related equipment

    CN120144243A

  • A task scheduling method and related device

    CN120144243B

  • Gateway, gateway task processing method, device and equipment

    CN120416693A

  • Information processing method and device, equipment and medium

    CN121681304A