Method, device, equipment, medium and product for task processing in cloud computing platform

By virtualizing task queues and waiting queues in the cloud computing platform, selecting resource units with the smallest waiting time to process tasks solves the problem of unsatisfied resource requirements during task processing, and achieves fast operation and efficient resource utilization.

CN118349336BActive Publication Date: 2024-10-18JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410781520.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-10-18
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

When processing tasks in cloud computing platforms, selecting inappropriate resource units results in unsatisfied computing resource requirements, causing tasks to run slowly. Moreover, the existing technology is highly complex and inaccurate, making it difficult to achieve the effect of running tasks quickly.

Method used

By virtualizing the task running queue and task waiting queue in the cloud computing platform, it determines which queue the task enters based on the available resources of the current resource unit, calculates the resource requirements of the task, and selects the resource unit with the minimum waiting time among the candidate resource units. Task migration to meet the computing resource requirements of the task.

Benefits of technology

On the basis of meeting the computing resource requirements of the task, the resource node with the minimum waiting time is selected for task processing, which improves the fast running ability of the task, improves the user experience, improves the resource utilization rate of cloud computing manufacturers, and reduces energy consumption. consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118349336B_ABST
    Figure CN118349336B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide a method, apparatus, device, medium and product for task processing in a cloud computing platform, which are applied to the field of cloud computing, including: obtaining tasks and determining the current available resource capacity in candidate resource units; when the current available resource capacity in all candidate resource units is less than the resource demand, placing the tasks in the task waiting queues of all candidate resource units; in the task running queues of the candidate resource units, deleting the tasks with the smallest remaining execution time from the task running queues to update the current available resource capacity, and determining in the task waiting queues a target task whose updated current available resource capacity is greater than or equal to the resource demand; determining the waiting time of the target task; determining the first target resource unit with the smallest waiting time, and migrating the target task to the task running queue, thereby realizing the selection of the resource node with the smallest waiting time for task processing on the basis of satisfying the demand for computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to methods, devices, equipment, media and products for task processing in a cloud computing platform. Background Art

[0002] With the development of cloud computing technology, cloud computing technology has been applied in more and more enterprises and has become an important technical support for enterprises. The core concept of cloud computing is to provide computing resources to users in the form of services through the network, so that users can obtain the required computing resources and services anytime and anywhere.

[0003] With the popularization of this model, more and more tasks with large computing volume and high complexity are deployed on cloud computing platforms. The operation of these tasks requires a large amount of computing resources and has very high time requirements. However, since cloud computing platforms usually have a large number of resource units, selecting inappropriate resource units is difficult to meet the task's demand for computing resources and cannot achieve the effect of quickly running tasks. Summary of the invention

[0004] In view of the above problems, a method, apparatus, device, medium and product for task processing in a cloud computing platform are proposed to overcome the above problems or at least partially solve the above problems, including:

[0005] A method for task processing in a cloud computing platform, wherein the cloud computing platform has a resource unit cluster consisting of a plurality of resource units, each resource unit has a different total resource capacity, and each resource unit is provided with a task waiting queue and a task running queue, the method comprising:

[0006] Obtaining tasks and determining resource requirements of the tasks;

[0007] Determine, from the multiple resource units, candidate resource units whose total resource capacity is greater than or equal to the resource demand, and determine currently available resource capacity in the candidate resource units;

[0008] When the currently available resource capacity in all candidate resource units is less than the resource demand, placing the task in the task waiting queue of all candidate resource units;

[0009] In the task running queue of the candidate resource unit, the task with the smallest remaining execution time is deleted from the task running queue to update the current available resource capacity, and in the task waiting queue, a target task whose updated current available resource capacity is greater than or equal to the resource demand is determined;

[0010] If the updated currently available resource capacity in the plurality of first candidate resource units is greater than or equal to the resource demand of the target task, determining the waiting time of the target task in the plurality of first candidate resource units;

[0011] A first target resource unit with the shortest waiting time is determined from the multiple first candidate resource units, and the target task is migrated from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit.

[0012] Optionally, determining the resource requirement of the task includes:

[0013] Determine multiple attribute information of the task; wherein the attribute information includes any one of the following: task type, size of task processing data, complexity of task processing data;

[0014] According to the preset mapping relationship between the attribute information and the sub-resource demand, the sub-resource demand of each attribute information is predicted;

[0015] Determine the attribute weight corresponding to each attribute information;

[0016] The attribute weights are used to perform weighted summation on the sub-resource requirements corresponding to each attribute information to obtain the resource requirement of the task.

[0017] Optionally, after determining the current available resource capacity in the candidate resource unit, the method further includes:

[0018] When the currently available resource capacity in the plurality of second candidate resource units is greater than or equal to the resource demand, determining the minimum waiting time of the task in the plurality of second candidate resource units to be a preset value;

[0019] A second target resource unit is determined from a plurality of second candidate resource units whose minimum waiting time is a preset value, and the task is migrated to the task running queue of the second target resource unit to execute the task in the second target resource unit.

[0020] Optionally, determining the second target resource unit from a plurality of second candidate resource units whose minimum waiting time is a preset value includes:

[0021] The second target resource unit is determined in a random manner from a plurality of second candidate resource units whose minimum waiting time is a preset value.

[0022] Optionally, the adopting a random manner to determine the second target resource unit from a plurality of second candidate resource units whose minimum waiting time is a preset value includes:

[0023] Determine the used resource capacity and the total resource capacity of a plurality of second candidate resource units whose minimum waiting time is a preset value, and determine the resource utilization rate according to the used resource capacity and the total resource capacity;

[0024] Determine, from the plurality of second candidate resource units whose minimum waiting time is a preset value, a plurality of second candidate resource units whose resource utilization rate is less than a utilization rate threshold;

[0025] The second target resource unit is determined in a random manner from a plurality of second candidate resource units whose resource utilization rates are less than a utilization rate threshold.

[0026] Optionally, before deleting the task with the smallest remaining execution time from the task running queue in the candidate resource unit to update the current available resource capacity, the method further includes:

[0027] Determine the total running time of the tasks in the task running queue of the candidate resource unit;

[0028] The remaining execution time is determined by combining the current time and the time when the execution started.

[0029] Optionally, the remaining execution time is calculated using the following formula:

[0030]

[0031] Among them, Time 剩余执行时间 is the remaining execution time, Time 运行的总时长 is the total running time, T 当前时刻 is the current moment, T 开始运行的时刻 The time to start running.

[0032] Optionally, the determining the total running time of the tasks in the task running queue of the candidate resource unit includes:

[0033] For the tasks in the task running queue of the candidate resource unit, a running time calculation request is generated in combination with the task identifier and attribute information of the task, and the running time calculation request is sent to other resource units in the cloud computing platform; wherein the attribute information includes any one of the following: task type, size of task processing data, complexity of task processing data;

[0034] The total running time of the task is calculated by using the attribute information in the running time calculation request through other resource units in the cloud computing platform, and a feedback message is generated in combination with the task identifier of the task and the total running time.

[0035] Optionally, in the task running queue of the candidate resource unit, deleting the task with the smallest remaining execution time from the task running queue to update the current available resource capacity includes:

[0036] In the task running queue of the candidate resource unit, the task with the shortest remaining execution time is deleted from the task running queue to simulate the completion of the task with the shortest remaining execution time;

[0037] The resource capacity occupied by the task with the smallest remaining execution time is recovered, and the current available resource capacity is updated according to the recovered resource capacity.

[0038] Optionally, before determining in the task waiting queue that the updated current available resource capacity is greater than or equal to the target task of the resource demand, the method further includes: traversing the tasks in the task waiting queue in order, and determining whether the updated current available resource capacity is greater than or equal to the traversed tasks;

[0039] Determining in the task waiting queue that the target task whose updated current available resource capacity is greater than or equal to the resource demand comprises: if the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, determining the traversed task as the target task.

[0040] Optionally, if the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, determining the traversed task as the target task includes:

[0041] If the updated currently available resource capacity is greater than or equal to the resource demand of the first task traversed, determine the first task traversed as the target task; wherein the first task is a task that is first traversed and whose resource demand is less than the updated currently available resource capacity;

[0042] If the updated currently available resource capacity is greater than or equal to the sum of the resource requirements of the traversed first task and one or more second tasks, the traversed first task and one or more second tasks are determined to be the target tasks; wherein, the first task and one or more second tasks are the multiple tasks whose sum of the resource requirements traversed first is less than the updated currently available resource capacity.

[0043] Optionally, after determining whether the updated current available resource capacity is greater than or equal to the traversed task, the method further includes:

[0044] If the updated currently available resource capacity is less than the resource demand of all traversed tasks, the task running queue of the candidate resource unit is executed again, and the task with the smallest remaining execution time is deleted from the task running queue to update the currently available resource capacity, until the updated currently available resource capacity is greater than or equal to the resource demand of the traversed tasks, and the traversed task is determined to be the target task.

[0045] Optionally, determining the waiting time of the target task in the plurality of first candidate resource units includes:

[0046] In each first candidate resource unit, the remaining execution time of the most recently deleted task with the smallest remaining execution time is determined as the waiting time of the target task in the first candidate resource unit.

[0047] Optionally, the migrating the target task from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit includes:

[0048] The target task is migrated from the task waiting queue of the first target resource unit to the task running queue to simulate executing the target task in the first target resource unit.

[0049] Optionally, after migrating the target task from the task waiting queue of the first target resource unit to the task running queue so that the first target resource unit executes the target task, the method further includes:

[0050] The target task is deleted from the task waiting queues of other candidate resource units.

[0051] Optionally, after migrating the target task from the task waiting queue of the first target resource unit to the task running queue so that the first target resource unit executes the target task, the method further includes:

[0052] The resource requirement of the target task is subtracted from the updated currently available resource capacity of the first target resource unit to update the currently available resource capacity again.

[0053] A device for task processing in a cloud computing platform, the cloud computing platform having a resource unit cluster consisting of a plurality of resource units, the total resource capacity of the plurality of resource units being different, each resource unit being provided with a task waiting queue and a task running queue, the device comprising:

[0054] A resource requirement determination module, used to obtain a task and determine the resource requirement of the task;

[0055] A current available resource capacity determination module, configured to determine, from the plurality of resource units, candidate resource units whose total resource capacity is greater than or equal to the resource demand, and determine the current available resource capacity in the candidate resource units;

[0056] A task placement module in a task waiting queue is used to place the task in the task waiting queue of all candidate resource units when the current available resource capacity in all candidate resource units is less than the resource demand;

[0057] A target task determination module is used to delete the task with the smallest remaining execution time from the task running queue of the candidate resource unit to update the current available resource capacity, and determine the target task whose updated current available resource capacity is greater than or equal to the resource demand in the task waiting queue;

[0058] A waiting time determination module, configured to determine the waiting time of the target task in the plurality of first candidate resource units if the updated current available resource capacity in the plurality of first candidate resource units is greater than or equal to the resource demand of the target task;

[0059] The target task execution module is used to determine the first target resource unit with the shortest waiting time from the multiple first candidate resource units, and migrate the target task from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit.

[0060] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method described above when executed by the processor.

[0061] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0062] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described above.

[0063] The embodiments of the present invention have the following advantages:

[0064] In an embodiment of the present invention, a task is acquired and the resource requirement of the task is determined; from the multiple resource units, a candidate resource unit whose total resource capacity is greater than or equal to the resource requirement is determined, and the current available resource capacity in the candidate resource unit is determined; when the current available resource capacity in all candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; in the task running queue of the candidate resource unit, the task with the smallest remaining execution time is deleted from the task running queue to update the current available resource capacity, and in the task waiting queue, a target task whose updated current available resource capacity is greater than or equal to the resource requirement is determined; if the updated current available resource capacity in multiple first candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; if the updated current available resource capacity in multiple first candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; The capacity is greater than or equal to the resource demand of the target task, and the waiting time of the target task in the multiple first candidate resource units is determined; the first target resource unit with the minimum waiting time is determined from the multiple first candidate resource units, and the target task is migrated from the task waiting queue of the first target resource unit to the task running queue, so as to execute the target task in the first target resource unit, thereby realizing that on the basis of meeting the demand of the task for computing resources, the resource node with the minimum waiting time is selected on the cloud computing platform for task processing, which can not only meet the demand of the task for computing resources but also achieve the effect of quickly running the user task. Quickly running the user task can not only improve the user experience, but also achieve the purpose of improving the resource utilization rate and reducing the energy consumption of the cloud computing vendor. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0066] Figure 1 It is a schematic diagram of node screening provided by related technologies;

[0067] Figure 2 It is a schematic diagram of dictionary set construction provided by the related technology;

[0068] Figure 3 It is a schematic diagram of task matching provided by related technologies;

[0069] Figure 4 is a flowchart of the steps of a method for task processing in a cloud computing platform provided by some embodiments of the present invention;

[0070] Figure 5is a flowchart of steps of an enqueue operation process provided by some embodiments of the present invention;

[0071] Figure 6 is a schematic diagram of a run queue provided by some embodiments of the present invention;

[0072] Figure 7 is a schematic diagram of a waiting queue provided by some embodiments of the present invention;

[0073] Figure 8 is a step flow chart of an example of task processing provided by some embodiments of the present invention;

[0074] Fig. 9 is a structural block diagram of a device for task processing in a cloud computing platform provided by some embodiments of the present invention;

[0075] Fig.10 is a structural block diagram of an electronic device provided by some embodiments of the present invention;

[0076] Fig.11 is a structural block diagram of a storage medium provided by some embodiments of the present invention;

[0077] Fig.12 It is a structural block diagram of a program product provided by some embodiments of the present invention. DETAILED DESCRIPTION

[0078] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0079] In the cloud computing platform, a resource unit (RU) is a unit that can process specific tasks according to resource types. It is a generalized concept and can refer to one or more physical devices of a specific type, or an abstract device with specific functions, such as CPU (Central Processing Unit), memory, GPU (Graphics Processing Unit), etc. Resource units play a vital role in the task waiting process. These resource units are the basis for the operation of user tasks, and their carrying capacity directly affects the execution efficiency of user tasks. The granularity of computing resources, such as CPU cores, GPU memory, computing power, bandwidth, etc., becomes the key factor in determining whether a task can be run on a resource unit. When selecting a specific resource unit, a task will go through a series of screening processes. The core of this process is to ensure that the available resource capacity of the selected resource unit is greater than the resource requirements required by the task. Only when the available resource capacity of the selected resource unit is greater than the resource requirements required by the task can the task start running smoothly and quickly on the resource unit and achieve the expected performance and efficiency.

[0080] In related technologies, such as Figure 1 The scheduling framework Kubernetes (Kubernetes is an open source, one-stop, complete distributed system development and support platform for managing containerized applications on multiple hosts in a cloud platform) also has a similar approach in this regard. When the user's task configuration file clearly indicates the required number of CPU cores and memory, Kubernetes will select an available and suitable node from the cluster based on these requirements. This node must meet the prerequisite that the available CPU core quota and available memory quota are both greater than the task requirements, but Kubernetes only considers whether the resource capacity can meet the task requirements, and cannot guarantee the minimum waiting time.

[0081] For the minimum waiting time calculation, heuristics are used in related technologies, such as Figure 2 and Figure 3After the system starts running, each time it receives a user task, the system will copy the task and distribute it to each computing node. Then, the timing will start from the moment the computing node receives the task until the task starts running. Finally, multiple (number of computing nodes) minimum waiting time data will be formed, and the computing node corresponding to the smallest data is the node where the current task will eventually run. According to the above operations, the minimum waiting time and the corresponding computing node of the tasks received by the system are calculated to form a minimum waiting time dictionary set; after the dictionary set reaches a certain capacity, subsequent new tasks do not need to calculate the waiting time. You only need to find historical tasks with similar characteristics in the dictionary set and regard the minimum waiting time of the historical task as the minimum waiting time of the new task.

[0082] However, this solution has a lot of drawbacks, mainly reflected in the high complexity of the system and inaccurate matching. The high complexity is because the system needs to build a dictionary set that contains a large amount of historical data. This construction will take up a lot of computing power, and even if the dictionary set is built, there will inevitably be a certain error when the new task is matched in the dictionary set, resulting in inaccurate inference of historical tasks, and then causing the computing node where the task runs to be not the ideal final node.

[0083] Based on this, the embodiment of the present invention proposes:

[0084] While calculating the minimum waiting time for the task, in order not to affect the normal operation of the tasks on the existing resource units, a task running queue and a task waiting queue are virtualized on each resource unit. When a task arrives, it is determined whether the new task enters the task running queue or the task waiting queue based on whether there are enough available resources in the current resource unit. If the remaining available resources of the current RU can meet the requirements of the target task, then the target task can be run directly, that is, the waiting time is zero. Since the approximate running time of the task is known, it is easy to calculate the remaining execution time for the task entering the task running queue.

[0085] During the calculation of the waiting time, the task with the shortest remaining execution time in the task running queue is deleted to simulate that it has finished running, and then the resources it occupies are released to the global available resource pool of the resource unit. Then the tasks in the task waiting queue are traversed to determine whether the remaining available resources of the current resource unit meet the requirements of the currently traversed task. If they meet the requirements, they are migrated to the task running queue for subsequent resource recycling recursive operations. If the traversed task waiting task is a new task, the minimum waiting time for the current resource unit is output. If not, continue to traverse the remaining tasks in the task waiting queue. Finally, among the waiting times of multiple resource units, select the minimum output.

[0086] In the embodiment of the present invention, it can be implemented by pure code, which is a mode of early intervention and calculation, while ensuring weak fairness of tasks, that is, first come first served in principle, without relying on any hardware facilities, the whole process is simple and efficient, and does not cause any intrusion to the real task environment. In some examples, it can be considered to add fairness factors to seek the fastest execution and fairest calculation method, such as weight.

[0087] The present invention is further described below:

[0088] Reference Figure 4 , showing a step flow chart of a method for task processing in a cloud computing platform provided by some embodiments of the present invention, wherein the cloud computing platform has a resource unit cluster consisting of a plurality of resource units, each resource unit having a different total resource capacity, and the resource units include any one or more of the following: a central processing unit resource unit, a graphics processing unit resource unit, and a memory resource unit.

[0089] Among them, each resource unit is provided with a task waiting queue and a task running queue, which are virtual queues for the convenience of calculating the waiting time, and are not the real queues of the resource unit when executing tasks.

[0090] Specifically, the following steps may be included:

[0091] Step 401, obtain a task and determine the resource requirement of the task.

[0092] In some embodiments of the present invention, determining the resource requirement of the task includes: predicting the resource requirement of the task based on attribute information of the task.

[0093] As some examples, the attribute information may include the task type, the size of the task processing data, etc.

[0094] In the embodiment of the present invention, by predicting the resource demand of the task according to the attribute information, the accuracy of the resource demand can be improved, thereby ensuring the allocation of appropriate resource units.

[0095] In some embodiments of the present invention, determining the resource requirement of the task includes:

[0096] Determine multiple attribute information of the task; predict the sub-resource demand of each attribute information according to the preset mapping relationship between the attribute information and the sub-resource demand; determine the attribute weight corresponding to each attribute information; use the attribute weight to perform weighted summation of the sub-resource demand corresponding to each attribute information to obtain the resource demand of the task.

[0097] The attribute information includes any of the following: task type, size of task processing data, complexity of task processing data;

[0098] When predicting the resource requirement of a task based on the attribute information of the task, the sub-resource requirement of each attribute information can be predicted first to obtain multiple sub-resource requirements, and then the attribute weight corresponding to each attribute information is used to perform weighted summation of the sub-resource requirements to obtain the resource requirement of the task.

[0099] Step 402: Determine, from the multiple resource units, candidate resource units whose total resource capacity is greater than or equal to the resource demand, and determine the currently available resource capacity in the candidate resource units.

[0100] During the enqueue operation phase, resource units whose total resource capacity is less than the resource demand of the task can be filtered out and candidate resource units can be retained. This is because even if all these resources are idle later, they cannot meet the running requirements of the task. Therefore, these resource units will not appear in subsequent operations.

[0101] In some embodiments of the present invention, after determining the current available resource capacity in the candidate resource unit, it also includes: when the current available resource capacity in a plurality of second candidate resource units is greater than or equal to the resource demand, determining that the minimum waiting time of the task in the plurality of second candidate resource units is a preset value; determining a second target resource unit from the plurality of second candidate resource units whose minimum waiting time is the preset value, and migrating the task to the task running queue of the second target resource unit to execute the task in the second target resource unit.

[0102] In some embodiments of the present invention, the preset value is zero.

[0103] In some embodiments of the present invention, determining the second target resource unit from multiple second candidate resource units whose minimum waiting time is a preset value includes: determining the second target resource unit from multiple second candidate resource units whose minimum waiting time is a preset value in a random manner.

[0104] After receiving the task, if the candidate resource unit has idle resources that meet the task requirements, that is, the current available resource capacity is greater than or equal to the resource demand, then the minimum waiting time of the task on the candidate resource unit can be considered to be zero, that is, it can be executed without waiting.

[0105] In some cases, there may be multiple candidate resource units with sufficient resources in the system. Then, when the task selects the candidate resource unit to run, it can randomly select one from these multiple candidate resource units with zero waiting time as the second target resource unit. After the second target resource unit that will be finally run is determined, the task will occupy a certain amount of idle resources and be migrated to the task running queue of the second target resource unit, and the task will be executed in the second target resource unit.

[0106] In an embodiment of the present invention, two situations are distinguished according to whether the current available resource capacity is greater than or equal to the resource demand. If the current available resource capacity is greater than or equal to the resource demand, a second target resource unit is directly randomly selected for execution without the need for complex calculations, thereby improving processing efficiency.

[0107] In some embodiments of the present invention, the step of determining the second target resource unit from a plurality of second candidate resource units whose minimum waiting time is a preset value in a random manner includes:

[0108] Determine the used resource capacity and the total resource capacity of multiple second candidate resource units whose minimum waiting time is a preset value, and determine the resource utilization rate based on the used resource capacity and the total resource capacity; determine multiple second candidate resource units whose resource utilization rate is less than a utilization rate threshold from the multiple second candidate resource units whose minimum waiting time is a preset value; and determine the second target resource unit from the multiple second candidate resource units whose resource utilization rate is less than the utilization rate threshold in a random manner.

[0109] In practical applications, in addition to considering resource capacity, the resource utilization rate of the resource unit can also be taken into account to achieve the purpose of load balancing. Specifically, the ratio of the used resource capacity to the total resource capacity can be calculated to obtain the resource utilization rate of each second candidate resource unit, and then multiple second candidate resource units whose resource utilization rates are less than the utilization rate threshold can be screened out, such as the utilization rate threshold is 80%.

[0110] After determining multiple second candidate resource units whose resource utilization rates are less than the utilization rate threshold, the second target resource unit can be determined randomly from the multiple second candidate resource units whose resource utilization rates are less than the utilization rate threshold, thereby avoiding selecting resource units with higher resource utilization rates.

[0111] Step 403: When the currently available resource capacity in all candidate resource units is less than the resource demand, the task is placed in the task waiting queue of all candidate resource units.

[0112] If all candidate resource units in the cluster do not have sufficient free resources to meet the running requirements of the task, that is, the current available resource capacity in all candidate resource units is less than the resource demand, then the task is placed in the task waiting queue in each candidate resource unit so that the waiting time of the task in each candidate resource unit can be calculated later.

[0113] The following combination Figure 5 An example of the enqueue operation is given below:

[0114] 1. Receive the task;

[0115] 2. Filter resource units whose total resource volume is greater than the task requirement;

[0116] 3. Determine whether there are resource units with idle resources greater than the task demand;

[0117] 4. If there is a resource unit whose idle resources are greater than the task demand, a resource unit whose idle resources are greater than the task demand is randomly selected for scheduling;

[0118] 5. If there is no resource unit with idle resources greater than the task demand, place the task in the waiting queue of each resource unit.

[0119] Step 404, in the task running queue of the candidate resource unit, delete the task with the shortest remaining execution time from the task running queue to update the current available resource capacity, and in the task waiting queue, determine the target task whose updated current available resource capacity is greater than or equal to the resource demand.

[0120] In some embodiments of the present invention, in the task running queue of the candidate resource unit, the task with the shortest remaining execution time is deleted from the task running queue to update the currently available resource capacity, including: in the task running queue of the candidate resource unit, the task with the shortest remaining execution time is deleted from the task running queue to simulate the completion of the execution of the task with the shortest remaining execution time; the resource capacity occupied by the task with the shortest remaining execution time is recycled, and the currently available resource capacity is updated according to the recycled resource capacity.

[0121] In actual applications, the task waiting queue in the candidate resource unit will be filled with tasks to be run, and the queuing order is set according to the order of arrival time, that is, to ensure the first-come-first-served principle; the tasks in the task running queue are the running tasks, which occupy resources during the running period. Only after the task is completed, the occupied resources will be released for other waiting tasks to use.

[0122] In the waiting time calculation phase, by calculating the remaining execution time, the task with the shortest remaining execution time is deleted from the task running queue to simulate that it has completed running. After deletion, the resources occupied by the task are returned to the system available resource pool, that is, the current available resource capacity is updated. Because the system has available resources at this time, the waiting queue can be traversed in the order of entry to check whether the current available resource capacity meets the resource requirements of the tasks in the traversed waiting queue.

[0123] In some embodiments of the present invention, in the task waiting queue, before determining that the updated current available resource capacity is greater than or equal to the target task of the resource demand, it also includes: traversing the tasks in the task waiting queue in sequence, and determining whether the updated current available resource capacity is greater than or equal to the traversed tasks.

[0124] In some embodiments of the present invention, determining in the task waiting queue a target task whose updated current available resource capacity is greater than or equal to the resource demand comprises: if the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, determining the traversed task as the target task.

[0125] In some embodiments of the present invention, if the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, determining the traversed task as the target task includes:

[0126] If the updated currently available resource capacity is greater than or equal to the resource demand of the first task traversed, determine the first task traversed as the target task; wherein the first task is a task that is first traversed and whose resource demand is less than the updated currently available resource capacity;

[0127] If the updated currently available resource capacity is greater than or equal to the sum of the resource requirements of the traversed first task and one or more second tasks, the traversed first task and one or more second tasks are determined to be the target tasks; wherein, the first task and one or more second tasks are the multiple tasks whose sum of the resource requirements traversed first is less than the updated currently available resource capacity.

[0128] The target task is one or more tasks that are first traversed and ranked first, and the sum of resource requirements of the first traversed multiple tasks is less than or equal to the updated current available resource capacity. By processing multiple tasks whose sum of resource requirements is less than or equal to the updated current available resource capacity at the same time, the complexity of the operation is simplified and the efficiency is improved.

[0129] In practical applications, such as Figure 6 and Figure 7, the task running queue has tasks 1 to task n, and the task waiting queue has tasks A to task N. To calculate the minimum waiting time of task B in the task waiting queue, and the remaining execution time of task 2 in the running queue is the smallest in the running queue, then after deleting task 2 (simulating the completion of task 2 running), it releases the occupied resources. Finally, the remaining available resources of the system can meet the resource requirements of task B after meeting the requirements of task A. Task A and task B can run, and the remaining execution time of task 2 is the waiting time of task A and task B on the current resource unit.

[0130] If the current available resource capacity meets the resource requirements of the tasks in the traversed waiting queue, it indicates that the task can be run. The task is deleted from the task waiting queue and migrated to the task running queue. At the same time, the total amount of system available resources is subtracted from the resource requirements of the task, simulating the start of the waiting task.

[0131] After subtracting the resource requirements of the task, if there are still available resources in the system, then continue to traverse the subsequent tasks in the waiting queue to find the next task that can be run that meets the current available resources.

[0132] In some embodiments of the present invention, after determining whether the updated current available resource capacity is greater than or equal to the traversed task, the method further includes: if the updated current available resource capacity is less than the resource demand of all traversed tasks, executing again the task running queue of the candidate resource unit, deleting the task with the smallest remaining execution time from the task running queue, and updating the current available resource capacity, until the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, and determining that the traversed task is the target task.

[0133] If the current available resource capacity does not meet the resource requirements of the task in the traversed waiting queue, it means that the existing system idle resources do not meet the requirements of the current task and cannot run. In this case, the current task is skipped and the next task in the waiting queue is traversed and the judgment is repeated.

[0134] If all tasks in the task waiting queue are traversed and no waiting tasks that meet the conditions can be found, it means that the existing free resources in the system are too small and it is necessary to continue waiting for the executing tasks to continue to release resources. Alternatively, the task running queue of the candidate resource unit can be executed again, and the task with the shortest remaining execution time can be deleted from the task running queue to update the current available resource capacity. Then, it can be determined in advance which resource unit has the current available resource capacity that meets the requirements, and the appropriate resource unit can be quickly assigned to the task for processing, thereby improving processing efficiency.

[0135] In some embodiments of the present invention, in the task running queue of the candidate resource unit, the task with the shortest remaining execution time is deleted from the task running queue to update the current available resource capacity, and it also includes: determining the total running time for the tasks in the task running queue of the candidate resource unit; and determining the remaining execution time in combination with the current time and the time when the running starts.

[0136] In some embodiments of the present invention, the remaining execution time is calculated using the following formula:

[0137]

[0138] Among them, Time 剩余执行时间 is the remaining execution time, Time 运行的总时长 is the total running time, T 当前时刻 is the current moment, T 开始运行的时刻 The time to start running.

[0139] In an embodiment of the present invention, for tasks being executed in a task running queue, the remaining execution time of the task is calculated by combining the total duration of the task running, the current time, and the time when the task starts running, thereby improving the accuracy of calculating the remaining execution time of the task.

[0140] In some embodiments of the present invention, determining the total running time of the tasks in the task running queue of the candidate resource unit includes:

[0141] For the tasks in the task running queue of the candidate resource unit, a running duration calculation request is generated in combination with the task identifier and attribute information of the task, and the running duration calculation request is sent to other resource units in the cloud computing platform; through other resource units in the cloud computing platform, the total running duration of the task is calculated using the attribute information in the running duration calculation request, and a feedback message is generated in combination with the task identifier of the task and the total running duration.

[0142] The attribute information includes any one of the following: task type, size of task processing data, and complexity of task processing data.

[0143] In practical applications, other resource units in the cloud computing platform can be used to calculate the total running time of the task. Specifically, other resource units can calculate the total running time of the task based on the attribute information of the task. For example, the total running time corresponding to different task types is different, and the size of the task processing data, the complexity of the task processing data and the total running time are positively correlated.

[0144] Step 405: If the updated currently available resource capacity in the plurality of first candidate resource units is greater than or equal to the resource demand of the target task, determine the waiting time of the target task in the plurality of first candidate resource units.

[0145] In some embodiments of the present invention, determining the waiting time of the target task in the multiple first candidate resource units includes: in each first candidate resource unit, determining the remaining execution time of the task with the smallest remaining execution time that was most recently deleted as the waiting time of the target task in the first candidate resource unit.

[0146] In actual applications, if the currently traversed task is the target task for calculating the minimum waiting time, then the remaining execution time of the task deleted from the task running queue at the beginning is the waiting time of the current target task. For multiple resource units in the system, multiple waiting times may be calculated, and the one with the shortest time is selected as the minimum waiting time of the target task.

[0147] In an embodiment of the present invention, by using the remaining execution time of the task with the smallest remaining execution time that was most recently deleted as the waiting time of the target task in the candidate resource unit, not only can the waiting time be simply calculated, but also the accuracy of the waiting time can be guaranteed, thereby enabling more accurate selection of a suitable resource unit for task processing, thereby improving the efficiency of task processing.

[0148] Step 406, determining a first target resource unit with a minimum waiting time from the multiple first candidate resource units, and migrating the target task from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit.

[0149] After determining the first target resource unit with the minimum waiting time, the target task can be migrated from the task waiting queue of the first target resource unit to the task running queue, and then the target task can be executed in the first target resource unit.

[0150] In some embodiments of the present invention, migrating the target task from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit includes: migrating the target task from the task waiting queue of the first target resource unit to the task running queue to simulate executing the target task in the first target resource unit.

[0151] In some embodiments of the present invention, after migrating the target task from the task waiting queue of the first target resource unit to the task running queue so that the first target resource unit executes the target task, it also includes: deleting the target task from the task waiting queues of other candidate resource units.

[0152] In some embodiments of the present invention, after migrating the target task from the task waiting queue of the first target resource unit to the task running queue so that the first target resource unit executes the target task, it also includes: subtracting the resource demand of the target task from the updated current available resource capacity of the first target resource unit so as to update the current available resource capacity again.

[0153] The following combination Figure 8 The present invention is illustrated by way of example:

[0154] 1. Delete the task with the shortest remaining execution time in the running queue;

[0155] 2. Release the resources of the task deleted in the previous step to the system's available resource pool;

[0156] 3. Traverse the waiting queue;

[0157] 4. Determine whether the available resources of the system meet the requirements of the traversed tasks;

[0158] 5. If the currently traversed waiting task is the target task for calculating the minimum waiting time, then the remaining execution time of the task deleted from the running queue at the beginning is the waiting time of the current target task. For multiple resource units in the system, multiple waiting times may be calculated, and the minimum one is selected as the minimum waiting time of the target task;

[0159] 6. The available resource pool capacity of the system minus the resource requirement of the task;

[0160] 7. Add the task to the running queue;

[0161] 8. Determine whether the system still has available resources and repeat steps 3 to 7 above.

[0162] In an embodiment of the present invention, a task is acquired and the resource requirement of the task is determined; from the multiple resource units, a candidate resource unit whose total resource capacity is greater than or equal to the resource requirement is determined, and the current available resource capacity in the candidate resource unit is determined; when the current available resource capacity in all candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; in the task running queue of the candidate resource unit, the task with the smallest remaining execution time is deleted from the task running queue to update the current available resource capacity, and in the task waiting queue, a target task whose updated current available resource capacity is greater than or equal to the resource requirement is determined; if the updated current available resource capacity in multiple first candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; if the updated current available resource capacity in multiple first candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; The capacity is greater than or equal to the resource demand of the target task, and the waiting time of the target task in the multiple first candidate resource units is determined; the first target resource unit with the minimum waiting time is determined from the multiple first candidate resource units, and the target task is migrated from the task waiting queue of the first target resource unit to the task running queue, so as to execute the target task in the first target resource unit, thereby realizing that on the basis of meeting the demand of the task for computing resources, the resource node with the minimum waiting time is selected on the cloud computing platform for task processing, which can not only meet the demand of the task for computing resources but also achieve the effect of quickly running the user task. Quickly running the user task can not only improve the user experience, but also achieve the purpose of improving the resource utilization rate and reducing the energy consumption of the cloud computing vendor.

[0163] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0164] Reference Fig. 9 , shows a schematic diagram of the structure of a task processing device in a cloud computing platform provided by some embodiments of the present invention, wherein the cloud computing platform has a resource unit cluster consisting of a plurality of resource units, the total resource capacity of the plurality of resource units is different, and each resource unit is provided with a task waiting queue and a task running queue, which may specifically include the following modules:

[0165] The resource requirement determination module 901 is used to obtain a task and determine the resource requirement of the task;

[0166] The current available resource capacity determination module 902 is used to determine, from the multiple resource units, candidate resource units whose total resource capacity is greater than or equal to the resource demand, and determine the current available resource capacity in the candidate resource units;

[0167] The task is placed in the task waiting queue module 903, which is used to place the task in the task waiting queue of all candidate resource units when the current available resource capacity in all candidate resource units is less than the resource demand;

[0168] The target task determination module 904 is used to delete the task with the smallest remaining execution time from the task running queue of the candidate resource unit to update the current available resource capacity, and determine the target task whose updated current available resource capacity is greater than or equal to the resource demand in the task waiting queue;

[0169] A waiting time determination module 905 is used to determine the waiting time of the target task in the plurality of first candidate resource units if the updated current available resource capacity in the plurality of first candidate resource units is greater than or equal to the resource demand of the target task;

[0170] The target task execution module 906 is used to determine the first target resource unit with the minimum waiting time from the multiple first candidate resource units, and migrate the target task from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit.

[0171] Optionally, determining the resource requirement of the task includes:

[0172] Determine multiple attribute information of the task; wherein the attribute information includes any one of the following: task type, size of task processing data, complexity of task processing data;

[0173] According to the preset mapping relationship between the attribute information and the sub-resource demand, the sub-resource demand of each attribute information is predicted;

[0174] Determine the attribute weight corresponding to each attribute information;

[0175] The attribute weights are used to perform weighted summation on the sub-resource requirements corresponding to each attribute information to obtain the resource requirement of the task.

[0176] Optionally, after determining the current available resource capacity in the candidate resource unit, the method further includes:

[0177] When the currently available resource capacity in the plurality of second candidate resource units is greater than or equal to the resource demand, determining the minimum waiting time of the task in the plurality of second candidate resource units to be a preset value;

[0178] A second target resource unit is determined from a plurality of second candidate resource units whose minimum waiting time is a preset value, and the task is migrated to the task running queue of the second target resource unit to execute the task in the second target resource unit.

[0179] Optionally, determining the second target resource unit from a plurality of second candidate resource units whose minimum waiting time is a preset value includes:

[0180] The second target resource unit is determined in a random manner from a plurality of second candidate resource units whose minimum waiting time is a preset value.

[0181] Optionally, the adopting a random manner to determine the second target resource unit from a plurality of second candidate resource units whose minimum waiting time is a preset value includes:

[0182] Determine the used resource capacity and the total resource capacity of a plurality of second candidate resource units whose minimum waiting time is a preset value, and determine the resource utilization rate according to the used resource capacity and the total resource capacity;

[0183] Determine, from the plurality of second candidate resource units whose minimum waiting time is a preset value, a plurality of second candidate resource units whose resource utilization rate is less than a utilization rate threshold;

[0184] The second target resource unit is determined in a random manner from a plurality of second candidate resource units whose resource utilization rates are less than a utilization rate threshold.

[0185] Optionally, before deleting the task with the smallest remaining execution time from the task running queue in the candidate resource unit to update the current available resource capacity, the method further includes:

[0186] Determine the total running time of the tasks in the task running queue of the candidate resource unit;

[0187] The remaining execution time is determined by combining the current time and the time when the execution started.

[0188] Optionally, the remaining execution time is calculated using the following formula:

[0189]

[0190] Among them, Time 剩余执行时间 is the remaining execution time, Time 运行的总时长is the total running time, T 当前时刻 is the current moment, T 开始运行的时刻 The time to start running.

[0191] Optionally, the determining the total running time of the tasks in the task running queue of the candidate resource unit includes:

[0192] For the tasks in the task running queue of the candidate resource unit, a running time calculation request is generated in combination with the task identifier and attribute information of the task, and the running time calculation request is sent to other resource units in the cloud computing platform; wherein the attribute information includes any one of the following: task type, size of task processing data, complexity of task processing data;

[0193] The total running time of the task is calculated by using the attribute information in the running time calculation request through other resource units in the cloud computing platform, and a feedback message is generated in combination with the task identifier of the task and the total running time.

[0194] Optionally, in the task running queue of the candidate resource unit, deleting the task with the smallest remaining execution time from the task running queue to update the current available resource capacity includes:

[0195] In the task running queue of the candidate resource unit, the task with the shortest remaining execution time is deleted from the task running queue to simulate the completion of the task with the shortest remaining execution time;

[0196] The resource capacity occupied by the task with the smallest remaining execution time is recovered, and the current available resource capacity is updated according to the recovered resource capacity.

[0197] Optionally, before determining in the task waiting queue that the updated current available resource capacity is greater than or equal to the target task of the resource demand, the method further includes: traversing the tasks in the task waiting queue in order, and determining whether the updated current available resource capacity is greater than or equal to the traversed tasks;

[0198] Determining in the task waiting queue that the target task whose updated current available resource capacity is greater than or equal to the resource demand comprises: if the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, determining the traversed task as the target task.

[0199] Optionally, if the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, determining the traversed task as the target task includes:

[0200] If the updated currently available resource capacity is greater than or equal to the resource demand of the first task traversed, determine the first task traversed as the target task; wherein the first task is a task that is first traversed and whose resource demand is less than the updated currently available resource capacity;

[0201] If the updated currently available resource capacity is greater than or equal to the sum of the resource requirements of the traversed first task and one or more second tasks, the traversed first task and one or more second tasks are determined to be the target tasks; wherein, the first task and one or more second tasks are the multiple tasks whose sum of the resource requirements traversed first is less than the updated currently available resource capacity.

[0202] Optionally, after determining whether the updated current available resource capacity is greater than or equal to the traversed task, the method further includes:

[0203] If the updated currently available resource capacity is less than the resource demand of all traversed tasks, the task running queue of the candidate resource unit is executed again, and the task with the smallest remaining execution time is deleted from the task running queue to update the currently available resource capacity, until the updated currently available resource capacity is greater than or equal to the resource demand of the traversed tasks, and the traversed task is determined to be the target task.

[0204] Optionally, determining the waiting time of the target task in the plurality of candidate resource units includes:

[0205] In each first candidate resource unit, the remaining execution time of the most recently deleted task with the smallest remaining execution time is determined as the waiting time of the target task in the first candidate resource unit.

[0206] Optionally, the migrating the target task from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit includes:

[0207] The target task is migrated from the task waiting queue of the first target resource unit to the task running queue to simulate executing the target task in the first target resource unit.

[0208] Optionally, after migrating the target task from the task waiting queue of the first target resource unit to the task running queue so that the first target resource unit executes the target task, the method further includes:

[0209] The target task is deleted from the task waiting queues of other candidate resource units.

[0210] Optionally, after migrating the target task from the task waiting queue of the first target resource unit to the task running queue so that the first target resource unit executes the target task, the method further includes:

[0211] The resource requirement of the target task is subtracted from the updated currently available resource capacity of the first target resource unit to update the currently available resource capacity again.

[0212] In an embodiment of the present invention, a task is acquired and the resource requirement of the task is determined; from the multiple resource units, a candidate resource unit whose total resource capacity is greater than or equal to the resource requirement is determined, and the current available resource capacity in the candidate resource unit is determined; when the current available resource capacity in all candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; in the task running queue of the candidate resource unit, the task with the smallest remaining execution time is deleted from the task running queue to update the current available resource capacity, and in the task waiting queue, a target task whose updated current available resource capacity is greater than or equal to the resource requirement is determined; if the updated current available resource capacity in multiple first candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; if the updated current available resource capacity in multiple first candidate resource units is less than the resource requirement, the task is placed in the task waiting queue of all candidate resource units; The capacity is greater than or equal to the resource demand of the target task, and the waiting time of the target task in the multiple first candidate resource units is determined; the first target resource unit with the minimum waiting time is determined from the multiple first candidate resource units, and the target task is migrated from the task waiting queue of the first target resource unit to the task running queue, so as to execute the target task in the first target resource unit, thereby realizing that on the basis of meeting the demand of the task for computing resources, the resource node with the minimum waiting time is selected on the cloud computing platform for task processing, which can not only meet the demand of the task for computing resources but also achieve the effect of quickly running the user task. Quickly running the user task can not only improve the user experience, but also achieve the purpose of improving the resource utilization rate and reducing the energy consumption of the cloud computing vendor.

[0213] Reference Fig.10 , shows an electronic device provided by some embodiments of the present invention, including a processor 1001, a memory 1002, and a computer program stored in the memory 1002 and capable of running on the processor 1001, and the computer program implements the above method when executed by the processor.

[0214] Reference Fig.11 , shows a computer-readable storage medium 1100 provided in some embodiments of the present invention, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0215] Reference Fig.12, shows a computer program product 1200 provided by some embodiments of the present invention, including a computer program, and the computer program implements the above method when executed by a processor.

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

[0217] The above is a detailed introduction to the methods, devices, equipment, media and products for task processing in the provided cloud computing platform. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for task processing in a cloud computing platform, It is characterized in that The cloud computing platform has a resource unit cluster consisting of a plurality of resource units, each resource unit has a different total resource capacity, and each resource unit is provided with a task waiting queue and a task running queue, and the method comprises: Obtaining tasks and determining resource requirements of the tasks; Determine, from the multiple resource units, candidate resource units whose total resource capacity is greater than or equal to the resource demand, and determine currently available resource capacity in the candidate resource units; When the currently available resource capacity in all candidate resource units is less than the resource demand, placing the task in the task waiting queue of all candidate resource units; In the task running queue of the candidate resource unit, the task with the smallest remaining execution time is deleted from the task running queue to update the current available resource capacity, and in the task waiting queue, a target task whose updated current available resource capacity is greater than or equal to the resource demand is determined; If the updated currently available resource capacity in the plurality of first candidate resource units is greater than or equal to the resource demand of the target task, determining the waiting time of the target task in the plurality of first candidate resource units; A first target resource unit with the shortest waiting time is determined from the multiple first candidate resource units, and the target task is migrated from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit.

2. The method according to claim 1, It is characterized in that The determining of the resource requirement of the task includes: Determine multiple attribute information of the task; wherein the attribute information includes any one of the following: task type, size of task processing data, complexity of task processing data; According to the preset mapping relationship between the attribute information and the sub-resource demand, the sub-resource demand of each attribute information is predicted; Determine the attribute weight corresponding to each attribute information; The attribute weights are used to perform weighted summation on the sub-resource requirements corresponding to each attribute information to obtain the resource requirement of the task.

3. The method according to claim 1, It is characterized in that After determining the current available resource capacity in the candidate resource unit, the method further includes: When the currently available resource capacity in the plurality of second candidate resource units is greater than or equal to the resource demand, determining the minimum waiting time of the task in the plurality of second candidate resource units to be a preset value; A second target resource unit is determined from a plurality of second candidate resource units whose minimum waiting time is a preset value, and the task is migrated to the task running queue of the second target resource unit to execute the task in the second target resource unit.

4. The method according to claim 3, It is characterized in that The determining of the second target resource unit from a plurality of second candidate resource units whose minimum waiting time is a preset value comprises: The second target resource unit is determined in a random manner from a plurality of second candidate resource units whose minimum waiting time is a preset value.

5. The method according to claim 4, It is characterized in that The method of determining the second target resource unit from a plurality of second candidate resource units whose minimum waiting time is a preset value in a random manner includes: Determine the used resource capacity and the total resource capacity of a plurality of second candidate resource units whose minimum waiting time is a preset value, and determine the resource utilization rate according to the used resource capacity and the total resource capacity; Determine, from the plurality of second candidate resource units whose minimum waiting time is a preset value, a plurality of second candidate resource units whose resource utilization rate is less than a utilization rate threshold; The second target resource unit is determined in a random manner from a plurality of second candidate resource units whose resource utilization rates are less than a utilization rate threshold.

6. The method according to claim 1, It is characterized in that In the task running queue of the candidate resource unit, before deleting the task with the smallest remaining execution time from the task running queue to update the current available resource capacity, the method further includes: Determine the total running time of the tasks in the task running queue of the candidate resource unit; The remaining execution time is determined by combining the current time and the time when the execution started.

7. The method according to claim 6, It is characterized in that The remaining execution time is calculated using the following formula: Among them, Time 剩余执行时间 is the remaining execution time, Time 运行的总时长 is the total running time, T 当前时刻 is the current moment, T 开始运行的时刻 The time to start running.

8. The method according to claim 6, It is characterized in that The determining of the total running time of the tasks in the task running queue of the candidate resource unit includes: For the tasks in the task running queue of the candidate resource unit, a running time calculation request is generated in combination with the task identifier and attribute information of the task, and the running time calculation request is sent to other resource units in the cloud computing platform; wherein the attribute information includes any one of the following: task type, size of task processing data, complexity of task processing data; The total running time of the task is calculated by using the attribute information in the running time calculation request through other resource units in the cloud computing platform, and a feedback message is generated in combination with the task identifier of the task and the total running time.

9. The method according to claim 1, It is characterized in that The step of deleting the task with the smallest remaining execution time from the task running queue of the candidate resource unit to update the current available resource capacity includes: In the task running queue of the candidate resource unit, the task with the shortest remaining execution time is deleted from the task running queue to simulate the completion of the task with the shortest remaining execution time; The resource capacity occupied by the task with the smallest remaining execution time is recovered, and the current available resource capacity is updated according to the recovered resource capacity.

10. The method according to claim 1, It is characterized in that Before determining in the task waiting queue that the updated current available resource capacity is greater than or equal to the target task of the resource demand, the method further includes: traversing the tasks in the task waiting queue in order, and determining whether the updated current available resource capacity is greater than or equal to the traversed tasks; Determining in the task waiting queue that the target task whose updated current available resource capacity is greater than or equal to the resource demand comprises: if the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, determining the traversed task as the target task.

11. The method according to claim 10, It is characterized in that If the updated current available resource capacity is greater than or equal to the resource demand of the traversed task, determining the traversed task as the target task includes: If the updated currently available resource capacity is greater than or equal to the resource demand of the first task traversed, determine the first task traversed as the target task; wherein the first task is a task that is first traversed and whose resource demand is less than the updated currently available resource capacity; If the updated currently available resource capacity is greater than or equal to the sum of the resource requirements of the traversed first task and one or more second tasks, the traversed first task and one or more second tasks are determined to be the target tasks; wherein, the first task and one or more second tasks are the multiple tasks whose sum of the resource requirements traversed first is less than the updated currently available resource capacity.

12. The method according to claim 10, It is characterized in that After determining whether the updated current available resource capacity is greater than or equal to the traversed task, the method further includes: If the updated currently available resource capacity is less than the resource demand of all traversed tasks, the task running queue of the candidate resource unit is executed again, and the task with the smallest remaining execution time is deleted from the task running queue to update the currently available resource capacity, until the updated currently available resource capacity is greater than or equal to the resource demand of the traversed tasks, and the traversed task is determined to be the target task.

13. The method according to any one of claims 1 to 12, It is characterized in that The determining the waiting time of the target task in the plurality of first candidate resource units includes: In each first candidate resource unit, the remaining execution time of the most recently deleted task with the smallest remaining execution time is determined as the waiting time of the target task in the first candidate resource unit.

14. The method according to claim 1, It is characterized in that The step of migrating the target task from the task waiting queue of the first target resource unit to the task running queue so as to execute the target task in the first target resource unit includes: The target task is migrated from the task waiting queue of the first target resource unit to the task running queue to simulate executing the target task in the first target resource unit.

15. The method according to claim 1, It is characterized in that After migrating the target task from the task waiting queue of the first target resource unit to the task running queue so that the first target resource unit executes the target task, the method further includes: The target task is deleted from the task waiting queues of other candidate resource units.

16. The method according to claim 1, It is characterized in that After migrating the target task from the task waiting queue of the first target resource unit to the task running queue so that the first target resource unit executes the target task, the method further includes: The resource requirement of the target task is subtracted from the updated currently available resource capacity of the first target resource unit to update the currently available resource capacity again.

17. A device for task processing in a cloud computing platform, It is characterized in that The cloud computing platform has a resource unit cluster consisting of a plurality of resource units, the total resource capacity of the plurality of resource units is different, each resource unit is provided with a task waiting queue and a task running queue, and the device comprises: A resource requirement determination module, used to obtain a task and determine the resource requirement of the task; A current available resource capacity determination module, configured to determine, from the plurality of resource units, candidate resource units whose total resource capacity is greater than or equal to the resource demand, and determine the current available resource capacity in the candidate resource units; A task placement module in a task waiting queue is used to place the task in the task waiting queue of all candidate resource units when the current available resource capacity in all candidate resource units is less than the resource demand; A target task determination module is used to delete the task with the smallest remaining execution time from the task running queue of the candidate resource unit to update the current available resource capacity, and determine the target task whose updated current available resource capacity is greater than or equal to the resource demand in the task waiting queue; A waiting time determination module, configured to determine the waiting time of the target task in the plurality of first candidate resource units if the updated current available resource capacity in the plurality of first candidate resource units is greater than or equal to the resource demand of the target task; The target task execution module is used to determine the first target resource unit with the shortest waiting time from the multiple first candidate resource units, and migrate the target task from the task waiting queue of the first target resource unit to the task running queue to execute the target task in the first target resource unit.

18. An electronic device, It is characterized in that The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method according to any one of claims 1 to 16 when executed by the processor.

19. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 16 is implemented.

20. A computer program product, It is characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Method for rapidly configuring virtual machine resources in cloud computing data center

    CN105389206A

  • Resource scheduling method and device, equipment and storage medium

    CN114518945A