Resource allocation control method and device for parallel tasks, computer device and medium

By dynamically adjusting the parallelism of tasks, selecting parallel tasks based on resource consumption and operational efficiency, and terminating some container instances, the problem of unreasonable resource allocation in traditional streaming task scheduling systems is solved, achieving reasonable resource allocation and stable device operation.

CN121785807BActive Publication Date: 2026-06-16ZHEJIANG DAHUA TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

In traditional streaming task scheduling systems, unreasonable resource allocation leads to resource-intensive tasks occupying resources for extended periods, while newly started or low-resource-consumption tasks are mistakenly downgraded, affecting the overall scheduling rationality and execution efficiency.

Method used

By periodically acquiring the resource usage of the target device, and based on the resource consumption and running efficiency of candidate tasks, parallel tasks are selected and some container instances are terminated. Once the resource usage is no longer exceeded, container instances are added to the efficiency-enhancing tasks, and the parallelism of the tasks is dynamically adjusted.

Benefits of technology

Quickly alleviate resource bottlenecks, avoid congestion caused by resource overload, improve throughput efficiency when resources are idle, and enhance the rationality of resource allocation and the operational stability of target equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785807B_ABST
    Figure CN121785807B_ABST
Patent Text Reader

Abstract

The application relates to a resource allocation control method and device for parallel tasks, computer equipment and a medium. The method comprises the following steps: acquiring resource usage of a target device for each iteration process; at least one candidate task is running in the target device; in the case that the resource usage exceeds a standard, a parallel task is selected from the candidate tasks according to resource occupation of different candidate tasks, and at least one container instance of the parallel task is ended; until the resource usage does not exceed the standard, an efficiency-improving task is selected from the candidate tasks according to running efficiency of different candidate tasks; and at least one container instance is added to the efficiency-improving task to complete the efficiency-improving task. The method can effectively improve rationality of resource allocation and running stability of the target device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a resource allocation control method, apparatus, computer equipment, and medium for parallel tasks. Background Technology

[0002] With the rapid development of technologies such as artificial intelligence, edge computing, and real-time analytics, higher demands are being placed on the resource utilization efficiency and real-time performance of streaming task scheduling systems.

[0003] In traditional technologies, streaming task scheduling typically employs static parallelism configuration or dynamic adjustment mechanisms based on global queue length. For example, it combines priority scheduling with rate limiting strategies, or shortens the task queue length when resources are scarce and extends the queue length when resources are idle, in order to achieve reasonable resource allocation and stable system operation.

[0004] However, traditional methods often rely on global queue length or priority for scheduling, which can easily lead to resource-intensive tasks occupying resources for a long time, while newly started or low-resource-consuming tasks are mistakenly downgraded, affecting the overall scheduling rationality and execution efficiency. Therefore, there is a problem of unreasonable resource allocation. Summary of the Invention

[0005] Therefore, it is necessary to provide a resource allocation control method, apparatus, computer equipment, and medium for parallel tasks that can reasonably allocate resources, in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides a resource allocation control method for parallel tasks, applied to a target device, the method comprising:

[0007] For each iteration, obtain the resource usage of the target device; there is at least one candidate task running on the target device.

[0008] When resource usage exceeds the limit, select parallel tasks from the candidate tasks based on their resource usage and terminate at least one container instance of the parallel task.

[0009] Until the resource usage indicator shows that the resource usage has not exceeded the standard, the efficiency-enhancing task is selected from the candidate tasks based on the running efficiency of different candidate tasks;

[0010] Add at least one container instance to the augmentation task to complete the augmentation task.

[0011] In one embodiment, parallel tasks are selected from the candidate tasks based on their resource consumption, including:

[0012] Obtain resource description data for different candidate tasks;

[0013] For each candidate task, a resource usage score is determined based on the resource description data of the candidate task; the resource usage score is used to characterize the resource usage of the candidate task.

[0014] A predetermined number of candidate tasks with high resource consumption scores are selected as parallel tasks.

[0015] In one embodiment, the resource description data includes at least one of resource occupancy ratio, preset degradation coefficient, and operating efficiency; based on the resource description data of the candidate tasks, a resource occupancy score for the candidate tasks is determined, including:

[0016] Based on the resource utilization ratio and operational efficiency, determine the resource consumption efficiency of candidate tasks;

[0017] The resource consumption score of a candidate task is determined based on at least one of resource consumption efficiency, operational efficiency, and a preset degradation coefficient.

[0018] In one embodiment, the resource consumption score of the candidate task is determined based on resource consumption efficiency, operational efficiency, and a preset degradation coefficient, including:

[0019] Based on the resource consumption efficiency of the target equipment, determine the preset efficiency weight that matches the resource consumption efficiency;

[0020] Based on the preset weight allocation rules, the preset proportional weight and preset degradation coefficient weight are determined according to the difference between the preset total weight and the preset efficiency weight; the weight allocation rules characterize the proportional relationship between the preset proportional weight and the preset degradation coefficient weight.

[0021] The resource consumption score of the candidate task is determined based on resource consumption efficiency, operational efficiency, preset degradation coefficient, and preset indicator weights; among which, the preset indicator weights include preset efficiency weights, preset ratio weights, and preset degradation coefficient weights.

[0022] In one embodiment, a predetermined number of candidate tasks with higher resource consumption scores are selected as parallel tasks, including:

[0023] Select a preset number of candidate tasks with high resource consumption scores as reference tasks;

[0024] Parallel tasks are selected from the reference tasks based on their running efficiency and the number of container instances.

[0025] In one embodiment, the method further includes:

[0026] Determine the cooldown time of parallel tasks based on their historical runtime.

[0027] Set a cooldown period for a parallel task, which is equal to the cooldown duration, so that the parallel task does not need to be terminated again by other container instances during the cooldown period.

[0028] In one embodiment, the method further includes:

[0029] For each candidate task, determine the end of the cooldown period.

[0030] If the cooldown period has ended, the candidate task can be allowed as an augmentation task.

[0031] Secondly, this application also provides a resource allocation control device for parallel tasks, applied to a target device, comprising:

[0032] The acquisition module is used to acquire the resource usage of the target device for each iteration; there is at least one candidate task running on the target device.

[0033] The load reduction module is used to select parallel tasks from candidate tasks and terminate at least one container instance of the parallel task when the resource usage is exceeded, based on the resource consumption of different candidate tasks.

[0034] The efficiency enhancement module is used to select an efficiency enhancement task from the candidate tasks based on the running efficiency of different candidate tasks until the resource usage indicator shows that the resource usage has not exceeded the limit; and to add at least one container instance to the efficiency enhancement task to complete the efficiency enhancement task.

[0035] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0036] For each iteration, obtain the resource usage of the target device; there is at least one candidate task running on the target device.

[0037] When resource usage exceeds the limit, select parallel tasks from the candidate tasks based on their resource usage and terminate at least one container instance of the parallel task.

[0038] Until the resource usage indicator shows that the resource usage has not exceeded the standard, the efficiency-enhancing task is selected from the candidate tasks based on the running efficiency of different candidate tasks;

[0039] Add at least one container instance to the augmentation task to complete the augmentation task.

[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0041] For each iteration, obtain the resource usage of the target device; there is at least one candidate task running on the target device.

[0042] When resource usage exceeds the limit, select parallel tasks from the candidate tasks based on their resource usage and terminate at least one container instance of the parallel task.

[0043] Until the resource usage indicator shows that the resource usage has not exceeded the standard, the efficiency-enhancing task is selected from the candidate tasks based on the running efficiency of different candidate tasks;

[0044] Add at least one container instance to the augmentation task to complete the augmentation task.

[0045] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0046] For each iteration, obtain the resource usage of the target device; there is at least one candidate task running on the target device.

[0047] When resource usage exceeds the limit, select parallel tasks from the candidate tasks based on their resource usage and terminate at least one container instance of the parallel task.

[0048] Until the resource usage indicator shows that the resource usage has not exceeded the standard, the efficiency-enhancing task is selected from the candidate tasks based on the running efficiency of different candidate tasks;

[0049] Add at least one container instance to the augmentation task to complete the augmentation task.

[0050] The resource allocation control method, device, computer equipment, and medium for the aforementioned parallel tasks periodically acquire the resource usage of the target device. When continuous resource overruns are detected, the system automatically performs a comprehensive evaluation based on indicators such as the resource occupancy ratio, operating efficiency, and degradation coefficient of each candidate task. Tasks with high resource occupancy and significant efficiency decline are prioritized for degradation, and some of their container instances are terminated to release resources, thereby quickly alleviating resource bottlenecks. After resource usage falls back to a safe threshold, container instances are gradually added to the degraded tasks based on the recovery of task operating efficiency, effectively avoiding resource fluctuations. Furthermore, while ensuring the continuous operation of tasks, this prevents congestion caused by resource overload, improves throughput efficiency when resources are idle, and effectively enhances the rationality of resource allocation and the operational stability of the target device. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This embodiment provides an application environment diagram for a resource allocation control method for parallel tasks.

[0053] Figure 2 A flowchart illustrating the resource allocation control method for the first type of parallel task provided in this embodiment;

[0054] Figure 3 This is a flowchart illustrating a task selection step provided in this embodiment;

[0055] Figure 4 This is a flowchart illustrating a scoring determination step provided in this embodiment;

[0056] Figure 5 This is a flowchart illustrating a task cooling step provided in this embodiment;

[0057] Figure 6 This embodiment provides a flowchart illustrating the process of adding steps.

[0058] Figure 7 This is a flowchart illustrating the resource allocation control method for the second type of parallel task provided in this embodiment;

[0059] Figure 8 This embodiment provides a structural block diagram of a resource allocation control device for parallel tasks.

[0060] Figure 9 This is an internal structural diagram of a computer device provided in this embodiment. Detailed Implementation

[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0062] The resource allocation control method for parallel tasks provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. For each iteration, the computer device obtains the resource usage of the target device; at least one candidate task is running on the target device; if the resource usage exceeds the limit, a parallel task is selected from the candidate tasks based on the resource consumption of different candidate tasks, and at least one container instance of the parallel task is terminated; until the resource usage does not exceed the limit, an efficiency-enhancing task is selected from the candidate tasks based on the running efficiency of different candidate tasks; at least one container instance is added to the efficiency-enhancing task to complete the task. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0063] In one exemplary embodiment, such as Figure 2 As shown, a resource allocation control method for parallel tasks is provided, which can be applied to... Figure 1 Taking a computer device as an example, the explanation includes the following steps S201 to S204. Wherein:

[0064] For each iteration, S201 obtains the resource usage of the target device.

[0065] The target device refers to a computing device, such as a server or edge computing node, that is running candidate tasks and whose resource usage is periodically monitored for resource allocation control. The target device must be running at least one candidate task.

[0066] Resource usage refers to the occupation and consumption of computing resources such as the central processing unit (CPU), graphics processing unit (GPU), and memory of the target device under its current operating state.

[0067] Candidate tasks refer to a set of tasks that run on the target device and may be selected for parallelism adjustments (such as adding or removing container instances) based on resource usage to optimize resource allocation. These tasks are typically streaming data processing tasks that require high parallelism to improve processing efficiency.

[0068] Optionally, the resource usage of the target device can be obtained in the following ways: First, a resource monitoring module can be set up in the target device; the GPU resource usage can be periodically detected through the resource monitoring module. Second, the resource occupancy rate of the target device can be periodically obtained; for each detection period, the periodic occupancy rate of the target device can be determined based on the relationship between the resource occupancy rate and a preset occupancy threshold; and the resource usage of the target device can be determined based on the periodic occupancy rate of different detection periods.

[0069] In some embodiments, the method for determining the periodic occupancy of the target device within the corresponding detection period based on the relationship between the resource occupancy rate and the preset occupancy threshold is as follows: if the resource occupancy rate is greater than the preset occupancy threshold, the periodic occupancy of the target device within the corresponding detection period is determined to be resource occupancy exceeding the limit; if the resource occupancy rate is not greater than the preset occupancy threshold, the periodic occupancy of the target device within the corresponding detection period is determined to be resource occupancy not exceeding the limit.

[0070] In one optional embodiment, the resource usage of the target device can be determined based on the periodic occupancy of different detection cycles by directly using the periodic occupancy of the corresponding detection cycle as the resource usage of the target device; that is, if the periodic occupancy of the corresponding detection cycle is exceeded, the resource usage of the target device is characterized as exceeding the resource usage limit; if the periodic occupancy of the corresponding detection cycle is not exceeded, the resource usage of the target device is characterized as not exceeding the resource usage limit.

[0071] In one optional embodiment, the resource usage of the target device can be determined based on the cycle occupancy of different detection cycles as follows: when the number of detection cycles in which the resource occupancy exceeds the limit reaches a preset number, the resource usage of the target device is determined to be excessive; when the number of detection cycles in which the resource occupancy does not exceed the limit reaches a preset number, the resource usage of the target device is determined to be within the limit.

[0072] In one optional embodiment, the resource usage of the target device can be determined based on the cycle occupancy of different detection cycles as follows: when the number of consecutive detection cycles in which the resource occupancy exceeds the limit reaches a preset number, the resource usage of the target device is determined to be exceeding the limit; when the number of consecutive detection cycles in which the resource occupancy does not exceed the limit reaches a preset number, the resource usage of the target device is determined to be not exceeding the limit.

[0073] S202 If the resource usage is exceeded, based on the resource usage of different candidate tasks, select a parallel task from the candidate tasks and terminate at least one container instance of the parallel task.

[0074] Parallel tasks can be understood as candidate tasks that run simultaneously on the target device, achieving resource allocation and collaborative processing through multiple processes or threads. It should be noted that setting up multiple container instances aims to improve the overall processing efficiency of this parallel task.

[0075] In this context, a container instance can be understood as an independent execution unit in the operating system where a candidate task actually runs. Each container instance occupies certain computing resources (such as CPU, GPU, and memory), and the parallelism of the task can be dynamically adjusted by increasing or decreasing the number of container instances. It should be noted that there is at least one processing process in a container instance; for example, if the parallelism of any candidate task is represented as 2, it proves that there are 2 container instances running that candidate task.

[0076] In some embodiments, the method for selecting parallel tasks from candidate tasks based on the resource consumption of different candidate tasks is as follows: for each candidate task, determine the number of container instances of the candidate task; select candidate tasks that have at least one container instance as parallel tasks. It should be noted that the parallel tasks selected in this embodiment can be one or more, and this embodiment does not limit this.

[0077] In some embodiments, the method for terminating at least one container instance of a parallel task is as follows: determining the device resource occupancy type of the target device; determining the number of processes to be terminated on the target device based on the device resource occupancy type; and terminating the container instance of the parallel task according to the number of processes to be terminated.

[0078] For example, the method for determining the resource occupancy type of the target device is as follows: when the resource occupancy exceeds the preset first exceedance number for a continuous period of detection cycle, the resource occupancy type can be determined as severely exceeding the limit; when the resource occupancy exceeds the preset second exceedance number for a continuous period of detection cycle, but does not reach the preset first exceedance number, the resource occupancy type can be determined as moderately exceeding the limit; when the resource occupancy exceeds the preset third exceedance number for a continuous period of detection cycle, but does not reach the preset second exceedance number, the resource occupancy type can be determined as slightly exceeding the limit. Wherein, the preset first exceedance number is greater than the preset second exceedance number; the preset second exceedance number is greater than the preset third exceedance number.

[0079] For example, the method for determining the number of processes to be terminated on the target device based on the device resource usage type is as follows: if the device resource usage type is slightly excessive, the number of processes to be terminated on the target device is determined to be 1; if the device resource usage type is moderately excessive, the number of processes to be terminated on the target device is determined to be a first value; if the device resource usage type is severely excessive, the number of processes to be terminated on the target device is determined to be a second value; wherein the first value is less than the second value.

[0080] It should be noted that when the device resource usage type is the "heavy resource usage exceeding the standard" type, this embodiment can also terminate multiple container instances of multiple parallel tasks at the same time, as long as each parallel task has a container instance running the parallel task.

[0081] S203 until the resource usage status indicates that the resource usage has not exceeded the standard, select the efficiency-enhancing task from the candidate tasks based on the operating efficiency of different candidate tasks.

[0082] Operational efficiency can be understood as the amount of processing or resource utilization completed by a candidate task per unit of time. It is usually measured by indicators such as the ratio of current runtime to historical runtime, reflecting the balance between task execution speed and resource consumption. It should be noted that the current runtime and historical runtime must be compared under the same parallelism benchmark.

[0083] The current runtime can be understood as the runtime of a single run of a candidate task from start to finish within the most recent detection period, under the current parallelism; that is, the current average runtime per run. It should be noted that the current runtime can be calculated using real-time monitoring data, reflecting the immediate performance of the candidate task under the latest resource environment.

[0084] Historical runtime can be understood as the average runtime per run of a candidate task after it has stabilized under the same parallelism conditions as the current task. It should be noted that historical runtime serves as a baseline for measuring whether a task's performance has degraded at the same level of parallelism.

[0085] Among them, efficiency enhancement tasks can be understood as candidate tasks that are selected by the system when resource usage is not exceeded, and which improve processing capacity or shorten execution time by increasing the number of container instances. The aim is to optimize resource utilization and accelerate task completion.

[0086] Optionally, the method for selecting efficiency-enhancing tasks from the candidate tasks based on the running efficiency of different candidate tasks can be as follows: 1) Select the candidate task with the highest running efficiency from the candidate tasks as the efficiency-enhancing task; 2) Sort the candidate tasks according to their running efficiency and select at least two of the ranked candidate tasks as efficiency-enhancing tasks; 3) Select the candidate task whose running efficiency is greater than a preset reference efficiency threshold (such as 0.7 or 70%) as the efficiency-enhancing task.

[0087] It should be noted that the preset reference efficiency threshold of 0.7 in this embodiment is set to ensure the safety and efficiency of the recovery operation. Specifically, if the preset reference efficiency threshold is set to 0.9, the device will attempt to restore parallelism as long as the running efficiency increases by 10%, causing the device to be overly sensitive and prone to frequent increases in parallelism due to instantaneous performance fluctuations. If the preset reference efficiency threshold is set to 0.5, the running efficiency needs to increase by 100% (almost double) to trigger recovery, causing the device to be overly conservative and slow to respond, further resulting in the inability to quickly utilize idle resources, seriously affecting task running efficiency and device stability. Obviously, with the preset reference efficiency threshold set to 0.7, it indicates that the current running efficiency of the candidate task is higher than the historical average. With an increase of over 30%, false recovery caused by short-term performance fluctuations is eliminated, preventing scheduling oscillations. At this point, once the target device confirms that the overall resource utilization has stabilized and fallen below the safe threshold, restoring parallelism for candidate tasks (adding container instances) becomes a safe scheduling action with clear expected benefits. This ensures that the recovery operation is only performed when the task is capable of absorbing more resources and the system has resources available for allocation. This effectively improves task processing speed and overall system throughput while strictly avoiding frequent adjustments to parallelism and resource waste caused by instantaneous resource fluctuations or task saturation. Ultimately, it achieves the best balance between improving efficiency and ensuring system stability. Furthermore, it allows the target device to utilize idle resources promptly, avoiding overly conservative and sluggish recovery due to excessively high thresholds (e.g., 0.9).

[0088] S204 adds at least one container instance to the enhancement task to complete the enhancement task.

[0089] In one optional embodiment, adding at least one container instance to the enhancement task to complete the enhancement task can be done by adding at least one container instance to the enhancement task according to the preset parallelism limit of the enhancement task. For example, a preset number of container instances (which is less than the preset parallelism limit) can be added to the enhancement task each time until the number of container instances of the enhancement task reaches the preset parallelism limit; alternatively, container instances can be added directly to the enhancement task to reach the preset parallelism limit. The specific number and method of adding container instances to the enhancement task are not limited in this embodiment. It should be noted that the preset parallelism limit can be based on a user-defined setting or the GPU resource quota of the GPU unit where the enhancement task is located; this embodiment does not limit this.

[0090] In one alternative embodiment, the method of adding at least one container instance to the enhancement task to complete the enhancement task can also be: determining the device resource idle type of the target device; determining the number of processes to be added to the target device based on the device resource idle type; and adding at least one container instance to the enhancement task according to the number of processes to be added to complete the enhancement task.

[0091] For example, the method for determining the idle type of the target device's resources is as follows: if the resource occupancy rate is lower than a preset first idle threshold (e.g., 60%), the idle type of the device's resources is determined to be the robust recovery type; if the detection cycle of the resource occupancy rate being lower than a preset second idle threshold (e.g., 20%) reaches a preset number of idle cycles (e.g., 3-5 cycles), the idle type of the device's resources is determined to be the accelerated recovery type.

[0092] For example, the method for determining the number of processes to be added to the target device based on the device resource occupancy type is as follows: if the device resource idle type is robust recovery, the number of processes to be added to the target device is determined to be 1; if the device resource idle type is accelerated recovery, the number of processes to be added to the target device is determined to be at least one.

[0093] It should be noted that, when the device resource idle type is set to accelerated recovery, this embodiment can also add multiple container instances for multiple enhancement tasks simultaneously, in order to quickly complete each enhancement task.

[0094] The resource allocation control method for the aforementioned parallel tasks periodically acquires the resource usage of the target device. When continuous resource overruns are detected, it automatically performs a comprehensive evaluation based on indicators such as the resource occupancy ratio, operating efficiency, and degradation coefficient of each candidate task. Tasks with high resource occupancy and significant efficiency decline are prioritized for degradation, and some of their container instances are terminated to release resources, thereby quickly alleviating resource bottlenecks. After resource usage falls back to a safe threshold, container instances are gradually added to the degraded tasks based on the recovery of task operating efficiency, effectively avoiding resource fluctuations. Furthermore, while ensuring the continuous operation of tasks, it prevents congestion caused by resource overload, improves throughput efficiency when resources are idle, and effectively enhances the rationality of resource allocation and the operational stability of the target device.

[0095] Figure 3 This is a flowchart illustrating the task selection steps in one embodiment. This embodiment refines the steps in the above embodiment for selecting parallel tasks from candidate tasks based on their resource consumption, including the following steps:

[0096] S301 obtains resource description data for different candidate tasks.

[0097] Resource description data refers to a set of parameters used to quantify the resource usage characteristics of candidate tasks, including indicators such as resource usage ratio, preset degradation coefficient, and operating efficiency, which are used to assess the impact of tasks on system resources and scheduling priority.

[0098] The resource utilization ratio can be understood as the ratio of the actual computing resources (such as CPU, GPU, and memory) currently occupied by the candidate task to the total resources of the target device, which is used to quantify the degree to which the task consumes system resources.

[0099] The preset degradation coefficient can be understood as a key parameter used to quantify the degradability of candidate tasks. The preset degradation coefficient describes the degree to which a candidate task is sacrificial under resource constraints on the target device. The larger the value, the easier it is for the candidate task to be degraded. It is used to balance task priority and system stability during scheduling. The preset degradation coefficient can be in the range of [0.3, 1].

[0100] Among them, the running efficiency can be understood as the ratio of the current average single run time of the candidate task to the historical average single run time. It is used to measure whether the task execution speed has degraded. For example, when the running efficiency is ≥1.0, it indicates that the running efficiency of the target device has decreased.

[0101] In some embodiments, for each candidate task, the resource usage ratio, preset degradation coefficient, current average single run duration, and historical average single run duration of the candidate task are obtained; the ratio between the current average run duration and the historical average run duration is used as the operating efficiency of the target device; and the resource usage ratio, preset degradation coefficient, and operating efficiency of the candidate task are used as the resource description data of the candidate task.

[0102] S302 determines the resource usage score of each candidate task based on its resource description data.

[0103] Among them, the resource occupancy score can be understood as a score used to characterize the task's occupation of system resources and scheduling priority; the higher the score, the more significant the impact of the task on system performance when resources are scarce, and it is usually used as the basis for dynamically adjusting the degree of parallelism (such as degrading or improving efficiency).

[0104] In one optional embodiment, the resource usage score of a candidate task is determined based on its resource description data in the following ways: It can be based on a scoring determination function, determining the resource usage score of the candidate task according to its resource description data. Alternatively, it can be based on the resource usage ratio of the candidate task to determine a first score; based on a preset degradation coefficient of the candidate task to determine a second score; based on the running efficiency of the candidate task to determine a third score; and finally, based on the first, second, and third scores to determine the total resource usage score. It should be noted that in this embodiment, the sum of the first, second, and third scores can be directly used as the resource usage score of the candidate task; alternatively, a weighted sum of the first, second, and third scores can be used as the resource usage score of the candidate task. This embodiment does not impose any limitations on this.

[0105] S303 selects a preset number of candidate tasks with high resource consumption scores as parallel tasks.

[0106] The pre-set threshold for the number of candidate tasks used to filter parallel or performance-enhancing tasks is typically determined dynamically based on system resource status, task priority, or weight ratio (e.g., the top 20% of high-scoring tasks, rounded down if the decimal part is less than 0.5, otherwise rounded up) to ensure the accuracy of resource adjustments and system stability. Optionally, the preset number can be one or more; this embodiment does not limit this.

[0107] In one optional embodiment, the candidate tasks are sorted in descending order of resource consumption scores; a preset number of candidate tasks at the top of the list are selected as parallel tasks.

[0108] In another optional embodiment, a preset number of candidate tasks with high resource consumption scores are selected as reference tasks. Parallel tasks are then selected from these reference tasks based on their running efficiency and the number of container instances. The advantage of this approach is that selecting a preset number of candidate tasks with high resource consumption scores as a reference set ensures that tasks with a significant impact on system resources are prioritized. The dynamic determination of parallel tasks, combining running efficiency and the number of container instances, avoids misjudgments caused by relying solely on static scores. This ensures timely degradation of resource-intensive tasks, prevents inefficient tasks from consuming resources through efficiency degradation indicators, and optimizes the granularity of parallelism adjustments using the number of container instances.

[0109] For example, the method of selecting a preset number of candidate tasks with higher resource consumption scores as reference tasks is as follows: sort the candidate tasks in descending order of resource consumption scores; and select the preset number of candidate tasks that appear first in the order as reference tasks.

[0110] For example, the method for selecting parallel tasks from the reference tasks based on the running efficiency and the number of container instances of different reference tasks is as follows: For each reference task, determine the running efficiency of the reference task; select high-efficiency tasks from the reference tasks based on the running efficiency of different reference tasks; select high-efficiency tasks from each high-efficiency task whose number of container instances is greater than a preset threshold (such as 1) as parallel tasks.

[0111] Optionally, based on the running efficiency of different reference tasks, the efficient tasks can be selected from the reference tasks in the following ways: First, the reference tasks can be sorted in descending order of running efficiency, and the reference task ranked highest can be selected as the efficient task. Second, all reference tasks with running efficiency greater than a preset standard efficiency threshold (such as 1 or 100%) can be considered as efficient tasks.

[0112] It should be noted that in this embodiment, a decrease in the execution efficiency of the reference task under the current resource environment is only considered valid when the running efficiency is greater than or equal to 1.0, thus meeting the conditions for degrading. Without this judgment mechanism, some newly started tasks might be mistakenly downgraded due to instability, thereby affecting the continuity and efficiency of overall task execution.

[0113] In the above embodiments, by obtaining the resource description data of candidate tasks and calculating the resource occupancy score, the resource occupancy of each task can be accurately quantified. Then, tasks with higher resource occupancy scores are selected as parallel tasks for dynamic adjustment. This effectively avoids resource-intensive tasks from monopolizing system resources for a long time, and prevents low-resource-occupancy tasks from being mistakenly downgraded. This significantly improves the rationality of resource allocation and task execution efficiency, and ensures the stable operation of the target device in high-concurrency scenarios.

[0114] Figure 4 This is a flowchart illustrating the scoring determination steps in one embodiment. In this embodiment, the resource description data includes at least one of resource occupancy ratio, preset degradation coefficient, and operating efficiency. Based on this, this embodiment refines the steps in the above embodiment for determining the resource occupancy score of a candidate task based on its resource description data, including the following steps:

[0115] S401 determines the resource consumption efficiency of candidate tasks based on resource utilization ratio and operating efficiency.

[0116] Resource consumption efficiency is used to quantify the rationality of resource utilization and scheduling priority of tasks. The higher the indicator, the better the processing efficiency of the task when occupying the same amount of resources, or the lower the resource consumption when processing the same amount of tasks.

[0117] In some embodiments, the square of the resource utilization ratio is determined; the product of the square of the resource utilization ratio and the operating efficiency is used as the resource consumption efficiency of the candidate task.

[0118] S402 determines the resource usage score of the candidate task based on at least one of resource consumption efficiency, operating efficiency, and preset degradation coefficient.

[0119] In one optional embodiment, at least one target indicator is selected from resource consumption efficiency, resource utilization ratio, and a preset degradation coefficient; based on the target indicator, an indicator score for the corresponding target indicator is determined; and based on the scores of each indicator, a resource utilization score for the candidate task is determined. It should be noted that the resource utilization score for the candidate task can be determined based on the sum or weighted sum of the scores of each indicator.

[0120] In one optional embodiment, a preset efficiency weight matching the resource consumption efficiency of the target device is determined; based on the preset weight allocation rules, a preset proportional weight and a preset degradation coefficient weight are determined according to the difference between the total preset weight and the preset efficiency weight; and the resource occupancy score of the candidate task is determined based on the resource consumption efficiency, operating efficiency, preset degradation coefficient, and preset indicator weights. The advantage of this setup is that it determines the preset efficiency weight by dynamically matching the resource utilization rate of the target device, and further decomposes the preset proportional weight and preset degradation coefficient weight based on the weight allocation rules, forming a multi-dimensional weight system; combining indicators such as resource consumption efficiency, resource occupancy ratio, and preset degradation coefficient, a weighted calculation is used to generate a resource occupancy score, which not only ensures the adaptability of the score to the real-time status of the device, but also balances the impact of task processing efficiency, resource occupancy scale, and degradation coefficient on the score through the weight allocation rules, significantly improving the system's resource utilization and the rationality of task scheduling.

[0121] The weight allocation rule represents the proportional relationship between the preset proportional weight and the preset degradation coefficient weight; the preset indicator weight includes the preset efficiency weight, the preset proportional weight and the preset degradation coefficient weight.

[0122] The preset efficiency weight is positively correlated with the overall resource utilization of the target device. When the resources of the target device are continuously higher than the severe bottleneck threshold, the value of the preset efficiency weight is significantly increased, causing the resource occupancy scoring function to prioritize and degrade tasks with high resource occupancy ratios in order to quickly release resources.

[0123] The preset proportional weight plays a major role when resources are under mild strain. The preset proportional weight reaches its peak when resource utilization is in a moderate pressure range, in order to accurately identify inefficient tasks where resource consumption and processing efficiency are mismatched.

[0124] The preset degradation coefficient weight is negatively correlated with the overall system resource utilization. When the resource utilization is below the safety threshold, the value of the preset degradation coefficient weight is significantly increased, so that scheduling decisions respect the user's preset task priorities more when resources are sufficient.

[0125] For example, the method for determining the preset efficiency weight that matches the resource consumption efficiency of the target device is as follows: maintain an efficiency weight table in advance, which stores the efficiency weights applicable under different resource consumption efficiencies; and directly select the preset efficiency weight that matches the resource consumption efficiency from the efficiency weight table based on the resource consumption efficiency of the target device.

[0126] For example, based on a preset weight allocation rule, the preset proportional weight and preset degradation coefficient weight are determined according to the difference between the preset total weight and the preset efficiency weight. The method is as follows: determine the difference between the preset total weight and the preset efficiency weight; based on the preset weight allocation rule, proportionally split the difference to obtain the preset proportional weight and the preset degradation coefficient weight. For instance, if the preset total weight is 1, the preset efficiency weight is 0.5, and the preset weight allocation rule is preset proportional weight: preset degradation coefficient weight = 3:2, then the preset proportional weight is determined to be 0.3, and the preset degradation coefficient weight is determined to be 0.2.

[0127] For example, the resource occupancy score of a candidate task is determined based on resource consumption efficiency, operating efficiency, preset degradation coefficient and preset index weight as follows: Based on the following formula (1), the resource occupancy score of the candidate task is determined based on resource consumption efficiency, operating efficiency, preset degradation coefficient and preset index weight.

[0128] (1)

[0129] Where score is the resource usage score, w1 is the preset efficiency weight, w2 is the preset ratio weight, w3 is the preset degradation coefficient weight, r is the resource usage ratio, and D is the resource usage ratio. coef The preset degradation factor is t2, where t2 is the current runtime and t1 is the historical runtime. For resource consumption efficiency, For operational efficiency.

[0130] In some embodiments, by calculating resource consumption efficiency by combining the resource occupancy ratio and operating efficiency, the actual processing efficiency of a task under a unit of resources can be accurately quantified, avoiding the one-sidedness of a single indicator. By combining at least one of resource consumption efficiency, resource occupancy ratio and preset degradation coefficient, a resource occupancy score can be dynamically generated. This allows for priority degradation of high-occupancy and low-efficiency tasks, as well as flexible adjustment of priority for tasks with high degradation coefficients, significantly improving system resource utilization and task execution stability.

[0131] Figure 5 This is a flowchart illustrating the task cooling step in one embodiment. This embodiment refines the above embodiment and includes the following steps:

[0132] S501 determines the cooldown time of parallel tasks based on their historical runtime.

[0133] Historical runtime can be understood as the total actual runtime of a parallel task from start to completion or termination in past execution cycles. It is usually quantified in time units (such as seconds or minutes) and is used to reflect the task's processing complexity, resource requirement stability, and execution efficiency characteristics. This data can be collected through task logs or monitoring systems and used as a reference for dynamically adjusting the cooldown time.

[0134] The cooldown period can be understood as a protective time window dynamically set based on the historical runtime of the parallel task, during which the system prohibits the termination of the parallel container instance of the task. The cooldown period aims to balance resource reclamation efficiency and task execution continuity, avoiding frequent interruptions of long-cycle tasks due to short-term resource contention. Its calculation logic can be determined based on a weighted proportion of historical runtime (such as 50%-100%) or a fixed threshold (such as a minimum of 10 seconds).

[0135] In some embodiments, a cooling-off period table is maintained in advance, which stores the mapping relationship between different historical runtimes and cooling-off periods. After determining the historical runtime of a parallel task, the cooling-off period that matches the historical runtime is found from the cooling-off period table. For example, the cooling-off period table can be as shown in Table 1 below, where the runtime of a single task is the historical runtime, and the cooling-off period range is the selectable cooling-off period.

[0136] Table 1 Cooling Time

[0137]

[0138] S502 sets a cooldown period for parallel tasks, which is equal to the cooldown duration, so that parallel tasks do not need to be terminated again by other container instances during the cooldown period.

[0139] In some embodiments, after a parallel task has completed at least one processing cycle, a cooldown period of a duration equal to the cooling duration is set for the parallel task; during the cooldown period, other container instances of the parallel task cannot be terminated again to prevent the degraded task from being frequently degraded.

[0140] In the above embodiments, the cooling-off period is dynamically set by analyzing the historical runtime of parallel tasks, and the tasks are forced to remain in parallel state during the cooling-off period. This avoids resource overhead (such as process creation / destruction overhead and context switching cost) and performance fluctuations caused by frequent starting and stopping of container instances, while reducing the computational load of repeated scheduling decisions. The introduction of the cooling-off period also ensures a stable execution environment for long-cycle tasks and prevents them from being mistakenly terminated due to short-term resource contention. Thus, while ensuring the utilization rate of system resources, the continuity of task execution and the overall throughput are significantly improved.

[0141] Figure 6 This is a flowchart illustrating the process of adding steps in one embodiment. This embodiment refines the above embodiment and includes the following steps:

[0142] S601 determines the end of the cooldown period for each candidate task.

[0143] In some embodiments, for each candidate task, it is determined whether the cooling time of the candidate task has reached a preset cooling threshold; if the cooling time has reached the preset cooling threshold, it is determined that the cooling period of the candidate task has ended; if the cooling time has not reached the preset cooling threshold, it is determined that the cooling period of the candidate task has not ended.

[0144] It should be noted that the candidate tasks in this embodiment can be all candidate tasks after determining that the resource usage status indicates that the resource usage has not exceeded the standard; or, after determining that the resource usage status indicates that the resource usage has not exceeded the standard, candidate tasks that can be used as efficiency-enhancing tasks are selected from the candidate tasks based on the running efficiency of different candidate tasks. This embodiment does not limit this.

[0145] S602 allows candidate tasks to be used as augmentation tasks after the cooldown period has ended.

[0146] In some embodiments, if the cooldown period has ended, the candidate task is allowed as a booster task. If the cooldown period has not ended, the candidate task is not allowed as a booster task, and the candidate task continues to execute until the cooldown period is over.

[0147] In the above embodiments, by dynamically tracking the end status of the cooldown period of each candidate task, it is only allowed to participate in resource allocation as an enhancement task after the cooldown period expires. This effectively avoids repeated start-up and shutdown of container instances caused by premature task release, and reduces resource fragmentation and context switching overhead. At the same time, the setting of the cooldown period ensures that high-priority or long-cycle tasks are not interrupted before completing the critical processing stage. This not only ensures the continuity of task execution, but also optimizes the screening quality of enhancement tasks through the cooldown period filtering mechanism, ultimately achieving a dual improvement in system resource utilization and task processing stability.

[0148] In one embodiment, this embodiment provides an optional method for resource allocation control of parallel tasks, using the application of this method to a server as an example for illustration. Figure 7 As shown, the method includes the following steps:

[0149] Starting with S700;

[0150] S701 obtains the resource usage information of the target device;

[0151] S702 determines whether the resource usage exceeds the limit. If yes, proceed to S703; otherwise, proceed to S713.

[0152] S703 acquires resource description data for different candidate tasks;

[0153] For each candidate task, S704 determines the resource consumption efficiency based on the resource utilization ratio and operating efficiency.

[0154] S705 determines a preset efficiency weight that matches the resource utilization rate of the target equipment; this resource utilization rate can also be understood as resource consumption efficiency.

[0155] S706 determines the preset proportional weight and preset degradation coefficient weight based on the preset weight allocation rules and the difference between the preset total weight and the preset efficiency weight.

[0156] S707 determines the resource consumption score of candidate tasks based on resource consumption efficiency, operational efficiency, preset degradation coefficient, and preset indicator weights.

[0157] S708 selects a preset number of candidate tasks with higher resource consumption scores as reference tasks;

[0158] S709 selects parallel tasks from the reference tasks based on the running efficiency of different reference tasks and the number of container instances.

[0159] S710 terminates at least one container instance of a parallel task;

[0160] S711 determines the cooldown time of parallel tasks based on their historical runtime.

[0161] S712 sets a cooldown period for the parallel task with a duration equal to the cooldown duration, so that the parallel task does not need to terminate other container instances of the parallel task again during the cooldown period, and returns to the execution step S701.

[0162] S713 selects the enhancement task that has completed its cooldown period from the candidate tasks based on the running efficiency of different candidate tasks.

[0163] S714 adds at least one container instance to an enhancement task that has completed its cooldown period to complete the enhancement task.

[0164] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0165] Based on the same inventive concept, this application also provides a resource allocation control device for parallel tasks to implement the resource allocation control method for parallel tasks described above. The solution provided by this device is similar to the implementation scheme described in the above method. Therefore, the specific limitations in one or more embodiments of the resource allocation control device for parallel tasks provided below can be found in the limitations of the resource allocation control method for parallel tasks described above, and will not be repeated here.

[0166] In one exemplary embodiment, such as Figure 8 As shown, a resource allocation control device for parallel tasks is provided, including: an acquisition module 801, a burden reduction module 802, and an efficiency enhancement module 803, wherein:

[0167] The acquisition module 801 is used to acquire the resource usage of the target device for each iteration process; there is at least one candidate task running in the target device;

[0168] The load reduction module 802 is used to select parallel tasks from candidate tasks and terminate at least one container instance of the parallel task when the resource usage characterization shows that the resource usage exceeds the limit.

[0169] The efficiency enhancement module 803 is used to select an efficiency enhancement task from the candidate tasks based on the running efficiency of different candidate tasks until the resource usage characterization shows that the resource usage has not exceeded the standard; and to add at least one container instance to the efficiency enhancement task to complete the efficiency enhancement task.

[0170] In some embodiments, the load reduction module 802 is further configured to obtain resource description data of different candidate tasks; for each candidate task, determine the resource occupancy score of the candidate task based on the resource description data of the candidate task; the resource occupancy score is used to characterize the resource occupancy of the candidate task; and select a preset number of candidate tasks with higher resource occupancy scores as parallel tasks.

[0171] In some embodiments, the load reduction module 802 is further configured to determine the resource consumption efficiency of the candidate task based on the resource occupancy ratio and operating efficiency; and to determine the resource occupancy score of the candidate task based on at least one of the resource consumption efficiency, operating efficiency and preset degradation coefficient.

[0172] In some embodiments, the load reduction module 802 is further configured to determine a preset efficiency weight that matches the resource consumption efficiency of the target device; determine a preset proportional weight and a preset degradation coefficient weight based on the difference between the preset total weight and the preset efficiency weight according to the preset weight allocation rule; the weight allocation rule represents the proportional relationship between the preset proportional weight and the preset degradation coefficient weight; and determine the resource occupancy score of the candidate task based on the resource consumption efficiency, operating efficiency, preset degradation coefficient, and preset indicator weight; wherein the preset indicator weight includes the preset efficiency weight, the preset proportional weight, and the preset degradation coefficient weight.

[0173] In some embodiments, the load reduction module 802 is further configured to select a preset number of candidate tasks with high resource consumption scores as reference tasks; and select parallel tasks from the reference tasks based on the running efficiency and the number of container instances of different reference tasks.

[0174] In some embodiments, the load reduction module 802 is further configured to determine the cooldown duration of the parallel task based on the historical runtime of the parallel task; and set a cooldown period of the duration to be the cooldown duration for the parallel task so that the parallel task does not need to terminate other container instances of the parallel task again during the cooldown period.

[0175] In some embodiments, the enhancement module 803 is further configured to determine the end status of the cooldown period for each candidate task; and if the cooldown period has ended, allow the candidate task to be used as an enhancement task.

[0176] Each module in the resource allocation control device for the aforementioned parallel tasks can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0177] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a resource allocation control method for parallel tasks.

[0178] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0179] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0180] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0181] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0182] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0183] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0184] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A resource allocation control method for parallel tasks, characterized in that, Applied to a target device, the method includes: For each iteration, the resource usage of the target device is obtained; at least one candidate task is running on the target device; the candidate task is a task running on the target device and selected for parallelism adjustment based on the resource usage. When the resource usage status indicates that resource usage exceeds the limit, resource description data for different candidate tasks are obtained; For each candidate task, a resource occupancy score is determined based on the resource description data of the candidate task; the resource occupancy score is used to characterize the resource occupancy of the candidate task. A preset number of candidate tasks with high resource usage scores are selected as parallel tasks, and at least one container instance of the parallel task is terminated. Then, the process returns to the step of obtaining the resource usage of the target device. The parallel tasks are candidate tasks that implement resource allocation on the target device through multi-threading. Until the resource usage status indicates that the resource usage has not exceeded the limit, an efficiency-enhancing task is selected from the candidate tasks based on the running efficiency of different candidate tasks; the running efficiency is the amount of processing completed by the candidate task per unit time. Add at least one container instance to the augmentation task to complete the augmentation task.

2. The method according to claim 1, characterized in that, The resource description data includes at least one of resource occupancy ratio, preset degradation coefficient, and operating efficiency; determining the resource occupancy score of the candidate task based on the resource description data includes: Based on the resource occupancy ratio and the operating efficiency, the resource consumption efficiency of the candidate task is determined; The resource consumption score of the candidate task is determined based on at least one of the resource consumption efficiency, the operating efficiency, and the preset degradation coefficient.

3. The method according to claim 2, characterized in that, Based on the resource consumption efficiency, the operational efficiency, and the preset degradation coefficient, the resource usage score of the candidate task is determined, including: Based on the resource consumption efficiency of the target device, a preset efficiency weight matching the resource consumption efficiency is determined; Based on the preset weight allocation rules, the preset proportional weight and preset degradation coefficient weight are determined according to the difference between the preset total weight value and the preset efficiency weight; the weight allocation rules characterize the proportional relationship between the preset proportional weight and the preset degradation coefficient weight. The resource consumption score of the candidate task is determined based on the resource consumption efficiency, the operating efficiency, the preset degradation coefficient, and the preset indicator weight; wherein, the preset indicator weight includes a preset efficiency weight, a preset proportion weight, and a preset degradation coefficient weight; the resource consumption efficiency, the operating efficiency, and the preset degradation coefficient correspond one-to-one with the preset efficiency weight, the preset proportion weight, and the preset degradation coefficient weight.

4. The method according to claim 1, characterized in that, The step of selecting a preset number of candidate tasks with high resource consumption scores as parallel tasks includes: Select a preset number of candidate tasks with high resource consumption scores as reference tasks; Parallel tasks are selected from the reference tasks based on the running efficiency and the number of container instances of different reference tasks.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The cooldown time of the parallel task is determined based on the historical runtime of the parallel task. Set a cooldown period for the parallel task, the duration of which is the cooling duration, so that the parallel task does not need to terminate other container instances of the parallel task again during the cooldown period.

6. The method according to claim 5, characterized in that, The method further includes: For each candidate task, determine the end status of the cooldown period for that candidate task; If the cooling-off period has ended, the candidate task is allowed to be used as an enhancement task.

7. A resource allocation control device for parallel tasks, characterized in that, Applied to a target device, the device includes: The acquisition module is used to acquire the resource usage of the target device for each iteration process; at least one candidate task is running on the target device; the candidate task is a task running on the target device and selected for parallelism adjustment based on the resource usage. The load reduction module is used to obtain resource description data for different candidate tasks when the resource usage status indicates that resource usage exceeds the limit; for each candidate task, a resource occupancy score is determined based on the resource description data of the candidate task; the resource occupancy score is used to characterize the resource occupancy status of the candidate task; a preset number of candidate tasks with higher resource occupancy scores are selected as parallel tasks, and at least one container instance of the parallel tasks is terminated, and the process returns to the step of obtaining the resource usage status of the target device; the parallel tasks are candidate tasks that implement resource allocation on the target device through multi-threading. An efficiency enhancement module is used to select an efficiency enhancement task from candidate tasks based on the running efficiency of different candidate tasks until the resource usage status characterizes that the resource usage has not exceeded the limit; the running efficiency is the amount of processing completed by the candidate task per unit time; and to add at least one container instance to the efficiency enhancement task to complete the efficiency enhancement task.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.