Computing resource allocation method, apparatus, device, and program product
Patent Information
- Application Number
- CN202610891942.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-10-13
AI Technical Summary
[0003]本申请提出一种计算资源分配方法、装置、设备及程序产品,旨在解决现有技术中资源分配策略难以适应负载变化,导致资源闲置与任务等待、高实时性任务响应延迟以及异构资源匹配效率低下等问题
[0007]本申请实施例的方案首先对至少两个待处理任务进行处理优先级评估,得到每个待处理任务的优先级评分。通过引入优先级评分,能够区分不同待处理任务的重要程度,为后续资源倾斜分配提供依据,从而避免关键任务因资源竞争而被延迟。其次,将每个待处理任务的优先级评分以及目标计算系统的资源状态信息输入至一个强化学习模型。该模型通过模拟不同计算资源单元分配方案对目标计算系统的性能影响,并按照预设优化目标对分配方案进行迭代优化,最终输出所述至少两个待处理任务的计算资源单元分配方案。其中,所述资源状态信息用于反映目标计算系统中各计算资源单元的可用性、计算能力差异和相互间的协同能力中的至少一者;所述强化学习模型在优先级评分引导的资源分配倾斜策略下,采用类似于试错与奖励的反馈机制,持续调整分配策略以逼近最优解;所述预设优化目标包括任务完成及时性、目标计算系统的计算资源整体利用率以及能耗效率中的至少一者。该步骤利用强化学习模型的试错优化能力,结合不同计算资源单元在计算速度、带宽、功耗等方面的实际差异,能够在动态环境中自适应调整分配策略,从而克服传统静态规则或启发式算法无法应对复杂资源协同关系的缺陷。最后,基于迭代后的计算资源单元分配方案,将每个待处理任务分配至对应的目标计算资源单元执行。通过上述方式,本申请将优先级评估与强化学习模型相融合。优先级评分明确了任务的重要程度,使对响应时间敏感的任务在资源分配中获得倾斜;强化学习模型则基于资源状态信息(例如各计算资源单元的可用性、性能差异及协同能力),通过试错与奖励反馈机制不断优化分配策略。两者结合,使得任务差异化需求与不同计算资源单元的能力得以精确匹配,从而减少资源闲置,提升异构资源匹配效率,同时保证高实时性任务的及时响应。由此,有效克服了现有技术中资源分配策略难以适应负载变化所导致的资源闲置与任务等待、高实时性任务响应延迟以及异构资源匹配效率低下等问题。
Smart Images

Figure CN122903167A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resource allocation, and in particular to a method, apparatus, equipment and program product for computing resource allocation. Background Technology
[0002] In systems with multiple types of computing resources (such as CPUs, GPUs, and FPGAs), resource allocation strategies are mainly divided into two categories: static and dynamic. Static strategies pre-fix resource mappings before task execution, making it difficult to adapt to dynamic load changes. This often results in some resources remaining idle for extended periods, while other tasks wait indefinitely due to insufficient resources. Dynamic strategies, while adjusting allocation based on system status, often rely solely on task arrival order or estimated execution time for decision-making, failing to differentiate the sensitivity of tasks to response time, thus preventing timely processing of high-real-time tasks. Furthermore, both strategies fail to fully utilize the actual differences in computing speed and power consumption among different computing units, leading to low resource matching efficiency. Summary of the Invention
[0003] This application proposes a computing resource allocation method, apparatus, device, and program product, aiming to solve the problems in the prior art where resource allocation strategies are difficult to adapt to load changes, leading to resource idleness and task waiting, high real-time task response delays, and low efficiency in heterogeneous resource matching. Accordingly, the technical solution of this application is as follows: In a first aspect, embodiments of this application provide a method for allocating computing resources, including: Prioritize at least two pending tasks and obtain a priority score for each task. The priority score of each pending task and the resource status information of the target computing system are input into a reinforcement learning model for decision-making and reasoning to obtain a computing resource unit allocation scheme for the at least two pending tasks. The resource status information reflects at least one of the availability, computing power differences, and inter-unit collaboration capabilities of each computing resource unit in the target computing system. Under a resource allocation bias strategy guided by priority scores, the reinforcement learning model simulates the performance impact of different computing resource unit allocation schemes on the target computing system based on the resource status information, and iterates the computing resource unit allocation schemes according to preset optimization objectives. The preset optimization objectives include at least one of task completion timeliness, overall computing resource utilization of the target computing system, and energy efficiency. Based on the aforementioned computing resource unit allocation scheme, each task to be processed is assigned to the corresponding target computing resource unit for execution.
[0004] Secondly, embodiments of this application provide a computing resource allocation apparatus, comprising: The priority evaluation module evaluates the processing priority of at least two pending tasks and obtains a priority score for each pending task. The allocation planning module inputs the priority score of each pending task and the resource status information of the target computing system into a reinforcement learning model for decision-making and reasoning, thereby obtaining a computing resource unit allocation scheme for the at least two pending tasks. The resource status information reflects at least one of the availability, computing power differences, and inter-unit synergy of each computing resource unit in the target computing system. Under a priority-based resource allocation bias strategy, the reinforcement learning model simulates the performance impact of different computing resource unit allocation schemes on the target computing system based on the resource status information, and iterates the allocation schemes according to preset optimization objectives. These preset optimization objectives include at least one of task completion timeliness, overall computing resource utilization of the target computing system, and energy efficiency. The allocation and execution module, based on the computing resource unit allocation scheme, assigns each task to be processed to the corresponding target computing resource unit for execution.
[0005] Thirdly, embodiments of this application provide an electronic device, including: a processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in the first aspect.
[0006] Fourthly, embodiments of this application provide a computer program product, the computer program product including a computer-readable storage medium storing a computer program operable to cause a computer to perform the method described in the first aspect.
[0007] The solution in this application first evaluates the processing priority of at least two pending tasks, obtaining a priority score for each task. By introducing priority scores, the importance of different pending tasks can be distinguished, providing a basis for subsequent resource allocation and avoiding delays in critical tasks due to resource competition. Secondly, the priority scores of each pending task and the resource status information of the target computing system are input into a reinforcement learning model. This model simulates the performance impact of different computing resource unit allocation schemes on the target computing system and iteratively optimizes the allocation scheme according to a preset optimization objective, ultimately outputting the computing resource unit allocation scheme for the at least two pending tasks. The resource status information reflects at least one of the availability, computing power differences, and inter-unit synergy of each computing resource unit in the target computing system. Under the resource allocation tilt strategy guided by the priority scores, the reinforcement learning model employs a feedback mechanism similar to trial and error and rewards to continuously adjust the allocation strategy to approach the optimal solution. The preset optimization objective includes at least one of task completion timeliness, overall computing resource utilization of the target computing system, and energy efficiency. This step leverages the trial-and-error optimization capabilities of reinforcement learning models, combined with the actual differences in computing speed, bandwidth, and power consumption among different computing resource units, to adaptively adjust allocation strategies in dynamic environments. This overcomes the limitations of traditional static rules or heuristic algorithms in handling complex resource coordination relationships. Finally, based on the iteratively optimized computing resource unit allocation scheme, each task is assigned to its corresponding target computing resource unit for execution. Through this approach, this application integrates priority evaluation with a reinforcement learning model. Priority scoring clarifies the importance of tasks, ensuring that tasks sensitive to response time receive preferential treatment in resource allocation. The reinforcement learning model, based on resource status information (such as the availability, performance differences, and coordination capabilities of each computing resource unit), continuously optimizes the allocation strategy through trial-and-error and reward feedback mechanisms. This combination allows for precise matching of differentiated task requirements with the capabilities of different computing resource units, thereby reducing resource idleness, improving heterogeneous resource matching efficiency, and ensuring timely response for high-real-time tasks. Thus, it effectively overcomes the problems of resource allocation strategies in existing technologies that struggle to adapt to load changes, leading to resource idleness and task waiting, high-real-time task response delays, and low heterogeneous resource matching efficiency. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 This is a schematic diagram of the first process of the computing resource allocation method according to an embodiment of this application.
[0010] Figure 2 This is a schematic diagram of a second process for the computing resource allocation method according to an embodiment of this application.
[0011] Figure 3 This is a schematic diagram of the third process of the computing resource allocation method according to an embodiment of this application.
[0012] Figure 4 This is a schematic diagram of the fourth process of the computing resource allocation method according to an embodiment of this application.
[0013] Figure 5 This is a fifth flowchart illustrating the computing resource allocation method according to an embodiment of this application.
[0014] Figure 6 This is a schematic diagram of the computing resource allocation device according to an embodiment of this application.
[0015] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0016] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0017] One embodiment of this application provides a method for allocating computing resources. Figure 1 This is a flowchart illustrating the computing resource allocation method, including: S101, evaluate the processing priority of at least two pending tasks and obtain a priority score for each pending task.
[0018] This step aims to provide a quantitative basis for task importance in subsequent resource allocation decisions. In systems with limited computing resources, different tasks often have significantly different requirements for response time, computational accuracy, or execution order. Indiscriminately allocating resources equally can easily lead to delays in critical tasks due to resource contention, while low-priority tasks consume scarce resources, resulting in waste. Therefore, this embodiment first performs a priority assessment on each task to be processed, transforming the inherent requirements of the task into a comparable score, thereby guiding resource allocation towards higher-priority tasks. The priority assessment is based on a multi-factor weighted model, comprehensively considering task type, user-specified level, and historical execution data to ensure that high-priority tasks can be quickly identified and responded to, avoiding delays that could impact overall system performance.
[0019] To facilitate understanding, a typical application scenario is given below: In a cloud computing platform, a batch of computing tasks arrive simultaneously, including real-time data analysis tasks (requiring millisecond-level response), batch report generation tasks (tolerating minute-level latency), and user interaction request tasks (prioritizing user experience). These tasks differ in terms of urgency, importance, and user level, and their priorities need to be quantified first.
[0020] refer to Figure 2 As shown, this embodiment, when evaluating the processing priority of at least two pending tasks, specifically includes the following operations: First, receiving the task queue, i.e., the system receives the pending task queue from the input source in real time and temporarily stores it in a memory buffer to ensure the integrity and accessibility of task data. Second, extracting the task attributes of each pending task, automatically parsing and extracting key attribute parameters for each task in the queue. The task attributes include, but are not limited to, task urgency (e.g., real-time indicators), task importance (preset by the user or system), task deadline (task timeout threshold), task type (e.g., computationally intensive or I / O intensive), user-specified level (e.g., priority label defined by the administrator), and historical execution data (e.g., average response time and success rate). Among these, task urgency can be assigned a value based on the expected delay tolerance of the task; task importance can be determined based on business value or the scope of failure impact; the closer the task deadline, the higher the score; task type can be distinguished as real-time, batch processing, or background; user level corresponds to different service level agreement requirements; historical execution data can reflect the average execution time, resource consumption pattern, and success rate of the task. Then, priority calculation is performed, which involves dynamically calculating the priority score for each task to be processed using a preset multi-factor weighted evaluation algorithm. As an example, the priority score is calculated as follows: Priority Score = α × Urgency + β × Importance + γ × Deadline + δ × Task Type + × User level + ζ Historical execution data. Where α, β, γ, δ, ζ and ζ are adjustable weighting factors, and their weights can be adaptively optimized based on historical execution data (such as task execution efficiency and resource utilization). The weights of each attribute can also be pre-defined according to system operation strategies. For example, in scenarios with stringent real-time requirements, "task urgency" and "task deadline" are given higher weights; in systems targeting enterprise users, the weight of "user level" is appropriately increased. Through weighted summation, multiple dimensions are integrated, ensuring that the priority score reflects both the urgency of the task itself and business differences and resource constraints, thus providing accurate input features for subsequent intelligent decision-making models. Finally, a sorted list is generated, that is, all tasks are sorted in descending order based on the calculated priority scores, forming a priority-ordered task list. This ensures that high-scoring tasks enter the subsequent processing stage first, thereby minimizing latency risks and improving system throughput efficiency.
[0021] Taking a real-time data analysis task as an example, its urgency level is assigned a value of 0.9, its importance level is assigned a value of 0.8, its deadline (10 seconds remaining) is assigned a value of 0.95, its task type (computation-intensive) is assigned a value of 0.9, its user level (gold user) is assigned a value of 0.9, and its historical execution data (average execution time of 0.5 seconds, high success rate) is assigned a value of 0.8. The weights for each element are set as α=0.3, β=0.2, γ=0.3, and δ=0.1, respectively. If ζ = 0.05 and ζ = 0.05, then the weighted sum of the priority scores is: 0.9 × 0.3 + 0.8 × 0.2 + 0.95 × 0.3 + 0.9 × 0.1 + 0.9 × 0.05 + 0.8 × 0.05 = 0.27 + 0.16 + 0.285 + 0.09 + 0.045 + 0.04 = 0.89. In this way, high-scoring tasks will receive preferential treatment in subsequent resource allocation, thereby effectively ensuring the overall service quality of the system.
[0022] S102, the priority score of each task to be processed and the resource status information of the target computing system are input into the reinforcement learning model for decision reasoning to obtain at least two computing resource unit allocation schemes for the tasks to be processed; wherein, the resource status information is used to reflect at least one of the availability, computing power differences and mutual coordination capabilities of each computing resource unit in the target computing system; the reinforcement learning model is used to simulate the performance impact of different computing resource unit allocation schemes on the target computing system based on the resource status information under the resource allocation bias strategy guided by the priority score, and to iterate the computing resource unit allocation schemes according to the preset optimization objectives; the preset optimization objectives include at least one of the following: task completion timeliness, overall utilization rate of computing resources of the target computing system, and energy efficiency.
[0023] After obtaining the priority score for each task to be processed, this embodiment needs to combine it with the dynamic resource status information of the target computing system to generate a reasonable computing resource unit allocation scheme. Relying solely on the priority score can easily overlook the differences in heterogeneity (such as processing speed and architectural expertise) and dynamic availability among the computing resource units. Therefore, this step introduces a reinforcement learning model. This reinforcement learning model can simulate the performance impact of different computing resource unit allocation schemes on the target computing system based on resource status information under a resource allocation bias strategy guided by priority scores, and iteratively optimize the allocation scheme according to preset optimization objectives, ultimately outputting a computing resource unit allocation scheme that balances multiple objectives.
[0024] Resource status information is the foundation for reinforcement learning models to make accurate decisions. Its core is to quantitatively describe the real-time status of each computing resource unit (such as CPU, GPU, FPGA), which mainly includes at least one of the following dimensions: 1) Utilization rate: refers to the proportion of time a computing resource unit is in an active state within a specific sampling period, used to measure its workload. The calculation formula is:
[0025] In the above formula, Indicates the utilization rate of resources. This indicates the time during which the resource is in an active state within the sampling period. This represents the total sampling period duration. The monitoring agent uses this formula to calculate the real-time utilization value by periodically collecting raw data (such as clock counts or event logs from the CPU, GPU, and FPGA), and combines this with idle capacity and performance metrics to construct a dynamically updated resource status matrix.
[0026] 2) Idle capacity: This refers to the ratio of the amount of unused resources in a computing resource unit to its total resources within a specific sampling period. It is used to measure the remaining available resource space. The calculation formula is:
[0027] In the above formula, Indicates the available capacity of the resource. This indicates the amount of resources that are idle during the sampling period (e.g., available memory size or number of idle processing units). This represents the total amount of resources (such as total memory capacity or total number of processing units). The monitoring agent uses this formula to calculate the real-time idle capacity value by periodically collecting raw data (such as memory usage information or processing unit activity logs), and combines it with utilization and performance indicators to construct a dynamically updated resource status matrix.
[0028] 3) Performance metrics: These refer to the rate at which a computational resource unit processes effective workload within a specific sampling period, used to measure its actual computing power, such as instruction throughput. The calculation formula is:
[0029] In the above formula, This represents a performance metric value (such as instruction throughput or latency parameters). This indicates the effective workload processed within the sampling period (such as the number of instructions or tasks completed). This represents the total sampling period duration. The monitoring agent uses this formula to calculate real-time performance metrics by periodically collecting raw data (such as the instruction counter of a graphics processor or the pipeline event log of a field-programmable gate array). Combined with data such as utilization and idle capacity, it constructs a dynamically updated resource status matrix to comprehensively reflect the differences in real-time computing capabilities and collaborative potential of heterogeneous resources.
[0030] After obtaining the utilization rate, idle capacity, and performance metrics of each computing resource unit, this embodiment fuses these metrics to form unified resource status information. For example, for the i-th computing resource unit, its metrics can be fused into a feature vector [utilization rate i, idle capacity i, performance metric i]. The fusion results of all computing resource units together constitute a multi-dimensional resource status information matrix. This representation method can both preserve the independent state characteristics of each unit and facilitate the model's understanding of the collaborative relationships between units.
[0031] Finally, the reinforcement learning model takes the preprocessed task priority queue and this dynamic resource state matrix as input, and outputs a specific computing resource unit allocation scheme through policy reasoning. This computing resource unit allocation scheme will prioritize directing high-priority tasks to high-performance or high-idle resources, while rationally allocating low-priority tasks to achieve multi-objective optimization such as maximizing system resource utilization and minimizing task latency.
[0032] For details on how to obtain resource status information, please refer to [link / reference]. Figure 3As shown in the diagram, this embodiment first deploys a lightweight monitoring agent on each computing node of the target computing system. This agent runs at fixed intervals (e.g., millisecond intervals), collecting raw operational data from computing resource units through the system's application programming interface (API) or hardware interface. This ensures efficient and low-overhead monitoring, avoiding interference with normal computing task execution. Within each sampling period, the monitoring agent automatically collects real-time operational data from heterogeneous units such as the CPU, GPU, and FPGA, including clock counts, memory usage information, event logs, and processing unit activity status. The collection scope covers utilization, idle capacity, and performance metrics. Subsequently, based on preset function formulas, the collected data is calculated in real-time to obtain the utilization, idle capacity, and performance metrics values for each resource. The calculation process can be calibrated using historical data to improve the accuracy of the metrics. Next, the calculated metric values are integrated into a multi-dimensional resource status matrix. Rows represent resource types (e.g., CPU, GPU, FPGA), and columns represent metric dimensions (e.g., utilization, idle capacity, performance metrics), with timestamps appended to dynamically reflect the real-time availability, computing power differences, and collaborative potential of heterogeneous resources. Finally, the monitoring agent periodically refreshes the matrix content and stores the updated resource status matrix in shared memory or a distributed database. At the same time, it triggers an event notification mechanism to ensure that changes in resource status can be fed back to the task scheduling module in real time, providing reliable data support for subsequent dynamic allocation.
[0033] S103, based on the computing resource unit allocation scheme, assigns each task to be processed to the corresponding target computing resource unit for execution.
[0034] This step aims to transform the decision schemes generated by the reinforcement learning model into actual scheduling actions within the system, and to establish a complete closed loop of "execution-monitoring-feedback-optimization" to ensure that allocation decisions are accurately implemented and continuously self-optimized.
[0035] In its implementation, this embodiment first determines the target computing resource unit corresponding to each task to be processed based on the task-resource mapping relationship explicitly defined in the computing resource unit allocation scheme. Then, by calling the kernel-level scheduling interface of the target computing system, the control flow of the task to be processed is directed to the corresponding target computing resource unit, and a binding relationship is established between the task to be processed and the target computing resource unit in the kernel task control table of the target computing system. This prevents the task to be processed from being arbitrarily migrated by the operating system's default scheduler, thereby ensuring the stability of the computing resource unit allocation scheme. After confirming the successful establishment of the binding relationship, this embodiment sets a resource consumption limit for each task to be processed on the corresponding target computing resource unit. For example, it limits the available memory capacity or CPU time slice ratio through the cgroups mechanism to prevent a single task from excessively consuming resources due to abnormal behavior and interfering with the normal execution of other tasks. Finally, each task to be processed is triggered to start execution on the bound target computing resource unit.
[0036] For example, suppose the computing resource unit allocation scheme requires allocating a high-priority real-time data analysis task to a graphics processing unit (GPU) with large idle capacity and high performance, while allocating a low-priority batch report generation task to an older CPU unit. This embodiment first determines the target computing resource unit for the former as GPU node #2 and the latter as CPU core #3. Then, it calls the kernel-level scheduling interface to point the control flow pointer of the real-time data analysis task to the execution queue of GPU node #2 and records the binding relationship between the task and GPU node #2 in the kernel task control table. Next, it sets a maximum video memory usage of 4GB and a time slice ratio of 80% for the real-time data analysis task, and a maximum CPU usage limit of 50% for the batch report generation task. Finally, it triggers both tasks to start execution on their respective bound target computing resource units. This fine-grained allocation ensures both rapid response of real-time tasks and prevents low-priority tasks from preempting critical resources.
[0037] in, Figure 4This embodiment illustrates the specific process of reinforcement learning decision-making inference and allocation scheme generation. First, the input data is preprocessed. The priority-ordered task list generated in the priority evaluation step and the real-time resource state matrix constructed in the resource state monitoring step are used as input data, and format unification and feature encoding are performed. Specifically, the task list needs to be converted into a vector sequence containing key features such as priority score, task type, and resource requirements (e.g., estimated computational load, memory usage); the resource state matrix needs to be standardized to eliminate dimensional differences between different resource types (CPU, GPU, FPGA), ultimately forming a unified and comparable resource feature matrix that can be directly used by the reinforcement learning model. Subsequently, this embodiment uses a pre-trained reinforcement learning model (e.g., a model based on Q-learning or an Actor-Critic architecture) for online decision-making inference. This model takes the current system state (i.e., the processed task queue feature vector sequence and resource feature matrix) as state input, and after inference calculation, outputs the probability distribution of resource allocation actions for each task to be processed. The model's strategy aims to maximize a pre-defined long-term reward function, which comprehensively considers multiple objectives such as task completion timeliness (ensuring high-priority tasks are satisfied first), overall system computing resource utilization (reducing idle time), and energy efficiency (avoiding resource overload). Next, based on the action probability distribution output by the model, this embodiment selects the resource allocation action combination with the highest expected reward, thus forming a specific task-resource mapping scheme. This scheme explicitly assigns each pending task to a specific heterogeneous computing resource unit (e.g., a node in a graphics processing unit cluster, or a specific processing unit in a field-programmable gate array), and can predict its execution start-up time window. The generation of the scheme must strictly adhere to pre-defined constraints, ensuring that the resource requirements of any task (e.g., memory usage) do not exceed the current idle capacity of the target resource, and implementing a priority-guided strategy to allow high-priority tasks to obtain high-performance resources first (e.g., allocating computationally intensive high-priority tasks to currently idle graphics processing units). Finally, this embodiment sends the finalized dynamic resource allocation scheme to the underlying resource scheduler for execution, initiating the actual execution of the pending tasks on the designated resources. Meanwhile, the system records key execution parameters of this allocation decision (such as the actual execution time of the task and changes in resource utilization) and overall system performance indicators (such as task latency and system throughput). These data are used as experience samples to feed back into the reinforcement learning model for online fine-tuning and strategy optimization of the subsequent model, thereby achieving continuous adaptive improvement of the system's decision-making capabilities.
[0038] Furthermore, during task execution, this embodiment collects processing data of any completed target task in real time, providing a basis for subsequent feedback and optimization. The collected processing data covers three main categories: the first is actual execution time, which records the time taken from task initiation to completion, used to compare with the estimated time to assess allocation accuracy; the second is resource consumption, including monitoring the instantaneous utilization fluctuations of computing resources such as the CPU, GPU, and FPGA, actual memory usage, cache hit rate, and input / output throughput; the third is performance indicators, such as instruction latency, floating-point operation efficiency, and task success rate, etc. For example, for a real-time data analysis task, if its actual execution time exceeds the estimated window, it indicates that the allocation scheme may be biased; if the utilization of its GPU spikes instantaneously, it may reflect resource contention.
[0039] After the task is completed, this embodiment aggregates the various types of data collected in real time to construct a structured feedback dataset. This feedback dataset integrates information from three dimensions: the task dimension includes the actual execution time deviation rate, resource demand prediction error, etc.; the resource dimension includes the resource utilization change curve after allocation, energy efficiency ratio (i.e., computing throughput per unit power consumption), etc.; and the system dimension includes the queuing delay of subsequent tasks caused by this allocation, the fluctuation of the overall system throughput, and task timeout events, etc. For example, if an allocation causes a 20% increase in the queuing delay of subsequent tasks, this information will be recorded in the system dimension.
[0040] Subsequently, this embodiment inputs the feedback dataset into the reinforcement learning model and / or the priority evaluation module to drive the closed-loop optimization process. On one hand, based on the actual urgency of the task (such as the risk of timeout) and the actual resource consumption cost, the weight factors in the priority scoring formula are dynamically adjusted, such as the weights corresponding to urgency, importance, and deadline, thereby improving the predictive accuracy of priority evaluation. On the other hand, the parameters in the resource monitoring formula (such as the sampling period for utilization calculation) are calibrated using the actually collected resource utilization and performance data to improve the real-time reliability of the resource state matrix. Finally, the feedback data is used as new experience samples to update the parameters of the reinforcement learning model's policy network through online learning algorithms (such as experience replay), optimizing its long-term reward function (which comprehensively considers objectives such as task delay, resource utilization, and energy efficiency), thereby enhancing the adaptability and robustness of subsequent dynamic allocation decisions.
[0041] Furthermore, this embodiment periodically generates system performance reports, summarizing and visually displaying key indicators such as task allocation success rate, resource utilization rate, and average response time of high-priority tasks. This assesses the long-term optimization effect of the dynamic allocation strategy and provides data support for operational decisions (such as capacity planning and strategy parameter tuning). For example, if the report shows that the average response time of high-priority tasks remains consistently high, it can trigger a recalibration of the priority scoring weights. Through this complete monitoring, feedback, and optimization loop, this embodiment enables the resource allocation scheme to continuously evolve with changes in system load and task characteristics, thereby maintaining high efficiency and stable performance over the long term.
[0042] in, Figure 5This example illustrates the complete process of resource allocation execution and feedback closed loop in this embodiment. First, in the scheme issuance and resource binding stage, this embodiment is responsible for transforming resource allocation decisions into actual system scheduling instructions: The resource scheduler receives the task-resource mapping scheme generated by the decision reasoning step, parses the specific allocation instructions, and sends task execution instructions and associated data packets to the target computing resource unit (e.g., a specified graphics processor node or field-programmable gate array processing unit). At the same time, it dynamically establishes the binding relationship between the task process and the allocated computing resource unit through the system kernel interface, ensuring that the task can exclusively occupy or share the allocated resources according to the strategy, and can set resource isolation strategies (e.g., apply constraints through the cgroups mechanism) to prevent tasks from over-consuming resources, ensuring the accurate execution of the allocation scheme and system stability. During task execution, this embodiment uses a deployed monitoring agent to continuously and finely observe and collect data on the execution process. The core monitoring indicators include actual execution time (accurately recording the time taken from task start to completion, used to compare with the estimated time window to evaluate the accuracy of the allocation scheme), actual resource consumption (tracking the instantaneous utilization fluctuations of target computing resource units such as central processing unit, graphics processing unit, and field-programmable gate array during execution, as well as dynamic indicators such as actual memory usage, cache hit rate, and input / output throughput), and task-level performance indicators (statistical instruction latency, actual floating-point operation efficiency, and key performance indicators such as the final execution result of the task). After the task is completed, this embodiment aggregates and deeply analyzes the collected raw monitoring data to construct a structured multidimensional feedback dataset. The dataset integrates information from three dimensions: task dimension (including the deviation rate between actual execution time and estimated time, prediction error of task resource requirements, etc.), resource dimension (including the resource utilization change curve before and after task allocation, energy efficiency ratio during task execution, etc.), and system dimension (covering the subsequent task queuing delay changes caused by this allocation decision, the fluctuation of the overall system throughput, and whether task timeout events are triggered), in order to quantitatively evaluate the immediate effect of a single allocation decision. Subsequently, in this embodiment, the constructed feedback dataset is simultaneously input into the reinforcement learning model and the task priority evaluation module for closed-loop optimization: on the one hand, the reinforcement learning model is fine-tuned, that is, the feedback data is used as new experience samples, and the parameters of the model policy network are updated through online learning algorithms (such as experience replay) to optimize its long-term reward function (comprehensively considering task delay, resource utilization, energy efficiency, etc.), thereby improving the adaptability and robustness of subsequent dynamic resource allocation decisions; on the other hand, the priority model is updated, that is, based on the actual urgency of the task (such as whether it is close to timeout) and the actual resource consumption cost, the weight factors in the priority scoring formula (such as urgency weight, importance weight, deadline weight, etc.) are dynamically adjusted to optimize the prediction accuracy of priority evaluation, so that task ranking can better reflect the actual system requirements.Finally, this embodiment periodically summarizes and presents the system's operational performance, automatically generating system performance reports periodically (e.g., hourly or daily), summarizing and analyzing core performance indicators such as task allocation success rate, comprehensive utilization rate of computing resources, and average response time of high-priority tasks. The reports are presented in a visual format (e.g., charts, dashboards) to intuitively display the long-term optimization effect of the dynamic resource allocation strategy and the system's operational trends, providing quantitative data support for operations and maintenance personnel's decisions (e.g., capacity planning, strategy parameter tuning), thereby completing a complete management closed loop from decision-making, execution, monitoring to evaluation and optimization.
[0043] In summary, the method of this embodiment first evaluates the processing priority of at least two tasks to be processed, obtaining a priority score for each task. By introducing priority scores, the importance of different tasks can be distinguished, providing a basis for subsequent resource allocation and avoiding delays in critical tasks due to resource competition. Secondly, the priority scores of each task and the resource status information of the target computing system are input into a reinforcement learning model. This model simulates the performance impact of different computing resource unit allocation schemes on the target computing system and iteratively optimizes the allocation scheme according to a preset optimization objective, ultimately outputting the computing resource unit allocation scheme for the at least two tasks to be processed. The resource status information reflects at least one of the availability, computing power differences, and inter-unit synergy of each computing resource unit in the target computing system; the reinforcement learning model, under the resource allocation tilt strategy guided by the priority scores, employs a feedback mechanism similar to trial and error and rewards to continuously adjust the allocation strategy to approach the optimal solution; the preset optimization objective includes at least one of task completion timeliness, overall utilization rate of the target computing system's computing resources, and energy efficiency. This step leverages the trial-and-error optimization capabilities of reinforcement learning models, combined with the actual differences in computing speed, bandwidth, and power consumption among different computing resource units, to adaptively adjust allocation strategies in dynamic environments. This overcomes the limitations of traditional static rules or heuristic algorithms in handling complex resource coordination relationships. Finally, based on the iteratively optimized computing resource unit allocation scheme, each task to be processed is assigned to its corresponding target computing resource unit for execution. In this way, the method in this embodiment integrates priority evaluation with a reinforcement learning model. Priority scoring clarifies the importance of tasks, ensuring that tasks sensitive to response time receive preferential treatment in resource allocation; the reinforcement learning model, based on resource status information (such as the availability, performance differences, and coordination capabilities of each computing resource unit), continuously optimizes the allocation strategy through trial-and-error and reward feedback mechanisms. The combination of these two approaches allows for precise matching of differentiated task requirements with the capabilities of different computing resource units, thereby reducing resource idleness, improving heterogeneous resource matching efficiency, and ensuring timely response for high-real-time tasks. This effectively overcomes the problems in existing technologies, such as resource allocation strategies being unable to adapt to load changes leading to resource idleness and task waiting, high-real-time task response delays, and low heterogeneous resource matching efficiency.
[0044] In addition, corresponding to Figure 1 The method shown in this embodiment, in another embodiment, also provides a computing resource allocation device. Wherein, Figure 6 This is a schematic diagram of the computing resource allocation device 600, including: The priority evaluation module 610 evaluates the processing priority of at least two pending tasks and obtains a priority score for each pending task.
[0045] The allocation planning module 620 inputs the priority score of each task to be processed and the resource status information of the target computing system into a reinforcement learning model for decision-making and reasoning, thereby obtaining a computing resource unit allocation scheme for the at least two tasks to be processed. The resource status information reflects at least one of the availability, computing power differences, and inter-unit synergy of each computing resource unit in the target computing system. Under a resource allocation bias strategy guided by priority scores, the reinforcement learning model simulates the performance impact of different computing resource unit allocation schemes on the target computing system based on the resource status information, and iterates the computing resource unit allocation schemes according to preset optimization objectives. The preset optimization objectives include at least one of task completion timeliness, overall computing resource utilization of the target computing system, and energy efficiency.
[0046] The allocation and execution module 630, based on the computing resource unit allocation scheme, allocates each task to be processed to the corresponding target computing resource unit for execution.
[0047] Optionally, the priority evaluation module 610 evaluates the processing priority of at least two pending tasks to obtain a priority score for each pending task, including: extracting task attributes for each pending task, wherein the task attributes include at least one of task urgency, task importance, task deadline, task type, user level, and historical execution data; and for each pending task, performing a weighted summation of all included task attributes to obtain the corresponding priority score.
[0048] Optionally, the resource status information includes the utilization rate, idle capacity, and performance indicators of each computing resource unit; wherein, the utilization rate is calculated based on the ratio of the time a computing resource unit is in working state during the sampling period to the total sampling period duration; the idle capacity is calculated based on the ratio of the amount of idle resources of a computing resource unit during the sampling period to the total amount of resources of the computing resource unit; and the performance indicators are calculated based on the ratio of the effective workload processed by the computing resource unit during the sampling period to the total sampling period duration.
[0049] Optionally, before inputting the priority score of each task to be processed and the resource status information of the target computing system into the reinforcement learning model for decision reasoning, the allocation planning module 620 is further configured to: collect the operating data of each computing resource unit in each sampling period, the operating data including at least one of clock count, memory usage information, event log and processor activity status; calculate the utilization rate, idle capacity and performance index of each computing resource unit based on the collected operating data; and fuse the utilization rate, idle capacity and performance index of each computing resource unit to obtain the resource status information composed of the fusion results of each computing resource unit.
[0050] Optionally, the allocation planning module 620 inputs the priority score of each pending task and the resource status information of the target computing system into the reinforcement learning model for decision-making reasoning, including: for each pending task, fusing the corresponding priority score with the task attribute to form a feature vector of the pending task, and arranging the feature vectors of all pending tasks in descending order of priority score to generate a feature vector sequence; standardizing and fusing the resource status information of each computing resource unit in the target computing system to form a resource feature matrix; determining initial state features based on the feature vector sequence and the resource feature matrix, and inputting the state features into the reinforcement learning model for multi-round iterative execution; based on the resource allocation tilt strategy guided by the priority score, simulating the performance impact of different computing resource unit allocation schemes on the target computing system according to the current state features, and outputting the probability distribution of computing resource unit allocation actions for each pending task; based on the probability distribution, selecting the allocation action combination with the highest expected reward value to generate the computing resource unit allocation scheme for the current round, wherein the expected reward is used to characterize the expected contribution of the allocation action combination to the preset optimization objective; and updating the state features based on the computing resource unit allocation scheme for the current round.
[0051] Optionally, the apparatus in this embodiment further includes: The feedback execution module, after allocating each task to be processed to a corresponding computing resource unit for execution, is used to: acquire the processing data of the completed target task, including execution time, resource consumption data, and performance indicators of the allocated computing resource unit; compare the processing data of the target task with the corresponding computing resource unit allocation scheme to generate a feedback dataset, which is used to characterize the difference between the actual execution effect of the target task and the expected target; and adjust the decision inference parameters of the reinforcement learning model based on the feedback dataset.
[0052] Optionally, the allocation execution module 630, based on the computing resource unit allocation scheme, allocates each pending task to a corresponding target computing resource unit for execution, including: determining the target computing resource unit mapped to each pending task; the target computing resource unit refers to the computing resource unit selected according to the computing resource unit allocation scheme; calling the kernel-level scheduling interface of the target computing system to direct the control flow pointer of each pending task to the corresponding target computing resource unit, and establishing a binding relationship between each pending task and the corresponding target computing resource unit in the kernel task control table of the target computing system; after confirming that the binding relationship is successfully established, setting a resource occupancy limit for each pending task in the corresponding target computing resource unit, and triggering each pending task to start execution in the corresponding target computing resource unit.
[0053] It should be noted that the computing resource allocation device in this embodiment can be used as... Figure 1 The execution body of the method shown is therefore able to achieve... Figure 1 The steps and functions of the method shown are illustrated.
[0054] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to it. Figure 7 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0055] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0056] Memory is used to store computer programs. Specifically, the computer program may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides the computer program to the processor.
[0057] Specifically, the processor reads the corresponding computer program from non-volatile memory into memory and then runs it, forming the above-mentioned logical structure. Figure 6 The illustrated computing resource allocation device. Correspondingly, the processor executes the program stored in memory and specifically performs the following operations: Priority evaluation is performed on at least two pending tasks to obtain a priority score for each task.
[0058] The priority score of each pending task and the resource status information of the target computing system are input into a reinforcement learning model for decision-making and reasoning to obtain a computing resource unit allocation scheme for the at least two pending tasks. The resource status information reflects at least one of the availability, computing power differences, and inter-unit collaboration capabilities of each computing resource unit in the target computing system. Under a resource allocation bias strategy guided by priority scores, the reinforcement learning model simulates the performance impact of different computing resource unit allocation schemes on the target computing system based on the resource status information, and iterates the computing resource unit allocation scheme according to a preset optimization objective. The preset optimization objective includes at least one of task completion timeliness, overall computing resource utilization of the target computing system, and energy efficiency.
[0059] Based on the aforementioned computing resource unit allocation scheme, each task to be processed is assigned to the corresponding target computing resource unit for execution.
[0060] The above is as described in this instruction manual. Figure 1The computing resource allocation method disclosed in the illustrated embodiments can be applied to a processor and implemented by the processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0061] Of course, in addition to software implementation, the electronic device described in this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0062] Furthermore, embodiments of this application also propose a computer program product, including a computer-readable storage medium storing one or more computer programs, the one or more computer programs including instructions.
[0063] When the aforementioned instructions are executed by a portable electronic device that includes multiple applications, they enable the portable electronic device to perform... Figure 1 The steps in the method shown include: Priority evaluation is performed on at least two pending tasks to obtain a priority score for each task.
[0064] The priority score of each pending task and the resource status information of the target computing system are input into a reinforcement learning model for decision-making and reasoning to obtain a computing resource unit allocation scheme for the at least two pending tasks. The resource status information reflects at least one of the availability, computing power differences, and inter-unit collaboration capabilities of each computing resource unit in the target computing system. Under a resource allocation bias strategy guided by priority scores, the reinforcement learning model simulates the performance impact of different computing resource unit allocation schemes on the target computing system based on the resource status information, and iterates the computing resource unit allocation scheme according to a preset optimization objective. The preset optimization objective includes at least one of task completion timeliness, overall computing resource utilization of the target computing system, and energy efficiency.
[0065] Based on the aforementioned computing resource unit allocation scheme, each task to be processed is assigned to the corresponding target computing resource unit for execution.
[0066] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0067] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0068] The above are merely embodiments of this specification and are not intended to limit the scope of this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification. Furthermore, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of this document.
Claims
1. A method for allocating computing resources, characterized in that, include: Prioritize at least two pending tasks and obtain a priority score for each task. The priority score of each pending task and the resource status information of the target computing system are input into a reinforcement learning model for decision-making and reasoning to obtain a computing resource unit allocation scheme for the at least two pending tasks. The resource status information reflects at least one of the availability, computing power differences, and inter-unit collaboration capabilities of each computing resource unit in the target computing system. Under a resource allocation bias strategy guided by priority scores, the reinforcement learning model simulates the performance impact of different computing resource unit allocation schemes on the target computing system based on the resource status information, and iterates the computing resource unit allocation schemes according to preset optimization objectives. The preset optimization objectives include at least one of task completion timeliness, overall computing resource utilization of the target computing system, and energy efficiency. Based on the aforementioned computing resource unit allocation scheme, each task to be processed is assigned to the corresponding target computing resource unit for execution.
2. The method according to claim 1, characterized in that, Prioritize at least two pending tasks to obtain a priority score for each task, including: Extract the task attributes for each task to be processed. The task attributes include at least one of the following: task urgency, task importance, task deadline, task type, user level, and historical execution data. For each task to be processed, a weighted sum of all the task attributes is calculated to obtain the corresponding priority score.
3. The method according to claim 1, characterized in that, The resource status information includes the utilization rate, idle capacity, and performance indicators of each computing resource unit; The utilization rate is calculated based on the ratio of the time the computing resource unit is in working state during the sampling period to the total sampling period duration; the idle capacity is calculated based on the ratio of the amount of idle resources of the computing resource unit during the sampling period to the total amount of resources of the computing resource unit; and the performance index is calculated based on the ratio of the effective workload processed by the computing resource unit during the sampling period to the total sampling period duration.
4. The method according to claim 3, characterized in that, Before inputting the priority score of each task to be processed and the resource status information of the target computing system into the reinforcement learning model for decision reasoning, the method further includes: During each sampling period, the operating data of each computing resource unit is collected, and the operating data includes at least one of clock count, memory usage information, event log and processor activity status; Based on the collected operational data, the utilization rate, idle capacity, and performance indicators of each computing resource unit are calculated. The utilization rate, idle capacity, and performance indicators of each computing resource unit are fused together to obtain the resource status information composed of the fused results of each computing resource unit.
5. The method according to claim 2, characterized in that, The priority score of each task to be processed and the resource status information of the target computing system are input into the reinforcement learning model for decision-making and reasoning, including: For each task to be processed, the corresponding priority score and task attributes are fused to form the feature vector of the task to be processed. The feature vectors of all tasks to be processed are arranged in order of priority score from high to low to generate a feature vector sequence. The resource status information of each computing resource unit in the target computing system is standardized and then fused to form a resource feature matrix; Based on the feature vector sequence and the resource feature matrix, initial state features are determined, and these state features are input into a reinforcement learning model for multiple rounds of iterative execution. Based on the priority-scoring-guided resource allocation bias strategy, the performance impact of different computing resource unit allocation schemes on the target computing system is simulated according to the current state features, outputting a probability distribution of computing resource unit allocation actions for each task to be processed. Based on the probability distribution, the allocation action combination with the highest expected reward value is selected to generate the computing resource unit allocation scheme for the current round, where the expected reward characterizes the expected contribution of the allocation action combination to the preset optimization objective. The state features are updated based on the computing resource unit allocation scheme for the current round.
6. The method according to any one of claims 1 to 5, characterized in that, After assigning each pending task to a corresponding computing resource unit for execution, the method further includes: Obtain processing data for completed target tasks, including execution time, resource consumption data, and performance indicators of the allocated computing resource units; The processing data of the target task to be processed is compared with the corresponding computing resource unit allocation scheme to generate a feedback dataset. The feedback dataset is used to characterize the difference between the actual execution effect of the target task to be processed and the expected target. Based on the feedback dataset, the decision-making and inference parameters of the reinforcement learning model are adjusted.
7. The method according to any one of claims 1 to 5, characterized in that, Based on the aforementioned computing resource unit allocation scheme, each task to be processed is assigned to a corresponding target computing resource unit for execution, including: Determine the target computing resource unit mapped to each task to be processed; the target computing resource unit refers to the computing resource unit selected according to the computing resource unit allocation scheme. The kernel-level scheduling interface of the target computing system is invoked to direct the control flow pointer of each task to be processed to the corresponding target computing resource unit, and a binding relationship between each task to be processed and the corresponding target computing resource unit is established in the kernel task control table of the target computing system. After confirming that the binding relationship has been successfully established, a resource usage limit is set for each pending task in the corresponding target computing resource unit, and each pending task is triggered to start execution in the corresponding target computing resource unit.
8. A computing resource allocation device, characterized in that, include: The priority evaluation module evaluates the processing priority of at least two pending tasks and obtains a priority score for each pending task. The allocation planning module inputs the priority score of each pending task and the resource status information of the target computing system into a reinforcement learning model for decision-making and reasoning, thereby obtaining a computing resource unit allocation scheme for the at least two pending tasks. The resource status information reflects at least one of the availability, computing power differences, and inter-unit synergy of each computing resource unit in the target computing system. Under a priority-based resource allocation bias strategy, the reinforcement learning model simulates the performance impact of different computing resource unit allocation schemes on the target computing system based on the resource status information, and iterates the allocation schemes according to preset optimization objectives. These preset optimization objectives include at least one of task completion timeliness, overall computing resource utilization of the target computing system, and energy efficiency. The allocation and execution module, based on the computing resource unit allocation scheme, assigns each task to be processed to the corresponding target computing resource unit for execution.
9. An electronic device, comprising: processor; And a memory arranged to store computer-executable instructions, characterized in that, when executed, the executable instructions cause the processor to perform the method as described in any one of claims 1 to 7.
10. A computer program product, the computer program product comprising a computer-readable storage medium storing a computer program, characterized in that, The computer program is operable to cause the computer to perform the method as described in any one of claims 1 to 7.