A task preemption scheduling method

By using dynamic task priority analysis and resource satisfaction decision-making, the problems of single-dimensional evaluation and low resource utilization in task preemption scheduling are solved, achieving efficient task scheduling and improved resource utilization, reducing default risk and task process interruption.

CN121029338BActive Publication Date: 2026-04-07JIANGSU CLOUD FACTORY INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-23
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing task preemption scheduling methods rely on only a single dimension when evaluating task priority, without considering the dynamic changes in business scenarios, contract value, and time urgency. This leads to the underestimation of tasks with high business criticality or high contract value, and the failure to consider the coupling and dependency relationships between tasks can easily lead to default risks and task process interruptions. Furthermore, the lack of spatiotemporal prediction and multi-dimensional resource integration in resource scheduling results in low resource utilization and reduced system revenue.

Method used

By performing dynamic task priority analysis and queue topology reconstruction, a set of coupled task groups is obtained. Combining resource satisfaction decision-making and spatiotemporal prediction, the optimal preemption time decision is made. Considering inter-task dependencies and resource fragment integration, Pareto improvement verification and resource utilization optimization are adopted to construct the final scheduling scheme.

Benefits of technology

It enables multi-dimensional dynamic adjustment of task priority evaluation, reduces default risk and task process interruption, improves resource utilization and system benefits, avoids resource fragmentation, and optimizes resource integration and scheduling decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029338B_ABST
    Figure CN121029338B_ABST
Patent Text Reader

Abstract

The application discloses a task preemption scheduling method, relates to the field of task preemption scheduling, and obtains a coupled task group set through dynamic task priority analysis and queue topology reconstruction based on acquired task basic data, obtains a global resource satisfaction degree mark through resource satisfaction degree decision based on acquired node resource data, performs resource matching degree space-time prediction based on the global resource satisfaction degree mark, obtains an optimal preemption time, performs preemption decision on the optimal preemption time and the coupled task group set, obtains a total preemption loss value of nodes, performs resource fragment integration scheduling based on the total preemption loss value of the nodes, obtains a final scheduling scheme, creates a node direct scheduling model based on the global resource satisfaction degree mark, and obtains an optimal node mark, wherein a multi-dimensional resource comprehensive fragment index is constructed through resource fragment integration, the overall resource utilization is improved, the overall system benefit is improved, the recovery cost and time cost of the system can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of task preemptive scheduling, specifically a task preemptive scheduling method. Background Technology

[0002] Existing task preemption scheduling methods often limit themselves to a single dimension when evaluating task priority, relying solely on task deadlines or resource requirements. They neglect differences in business scenarios, contract value, and dynamic changes in time urgency. This can easily lead to tasks with high business criticality (such as real-time tasks in financial transactions) or high contract values ​​being underestimated and not processed in a timely manner, potentially causing default risks or business losses. Furthermore, existing methods fail to consider the coupling and dependencies between tasks, treating them as independent entities for scheduling. During preemption, this can disrupt the execution connections between related tasks, causing overall task flow interruptions and increasing system recovery costs and time overhead.

[0003] Meanwhile, existing technologies exhibit significant staticity and limitations in resource scheduling and preemption decision-making. On one hand, resource satisfaction judgments are largely based on static matching of the current resource state, lacking spatiotemporal prediction of future resource changes. This results in a lack of data support for preemption timing selection, often leading to a mismatch between resource release and new task demands, causing unnecessary preemption losses. On the other hand, resource fragmentation consolidation often focuses on a single resource type (such as memory fragmentation), failing to construct a comprehensive fragmentation index for multi-dimensional resources and lacking a mechanism to dynamically adjust consolidation intensity based on resource utilization. This results in persistent resource fragmentation issues in the system, making it difficult to improve overall resource utilization. Furthermore, existing preemption decision-making processes do not incorporate Pareto improvement verification, leading to situations where high-priority running tasks are preempted to schedule new tasks, resulting in a decrease in overall system benefits.

[0004] To address the aforementioned shortcomings, a technical solution is provided. Summary of the Invention

[0005] To address the technical problems raised in the background section, this invention is proposed. Embodiments of this invention provide a task preemptive scheduling method.

[0006] The objective of this invention can be achieved through the following technical solution: a task preemptive scheduling method, comprising the following steps:

[0007] Step S100: By acquiring basic task data, perform dynamic task priority analysis and queue topology reconstruction to obtain a set of coupled task groups;

[0008] Step S200: Make resource satisfaction decisions by acquiring node resource data to obtain a global resource satisfaction flag;

[0009] Step S300: Based on the global resource satisfaction flag, perform spatiotemporal prediction of resource matching degree to obtain the optimal preemption time;

[0010] Step S400: Make a preemption decision based on the optimal preemption time and the set of coupled task groups to obtain the total preemption loss of the node;

[0011] Step S500: Based on the total preemption loss of nodes, perform resource fragment integration and scheduling to obtain the final scheduling scheme;

[0012] Step S600: Create a direct scheduling model for nodes based on the global resource satisfaction flag to obtain the optimal node identifier.

[0013] Furthermore, the steps for analyzing the coupled task group set are as follows:

[0014] Chaotic initial values ​​are generated through hash functions and modulo operations. Five iterations of Logistic chaotic mapping are performed on the initial values ​​to obtain chaotic values. The dot product of the feature vector and the weight vector is calculated to obtain the baseline priority. The chaotic values ​​and the baseline priority are combined to obtain the final priority of the task.

[0015] Based on the final priority of each task in the task queue, calculate the priority range of the queue, traverse all task pairs, and establish a dependency edge equal to 1 when the priority difference coupling condition is met (otherwise it is 0) to form a task dependency graph. The interconnected tasks are divided into the same coupling group by the graph connectivity component identification algorithm, and the set of coupled task groups is output.

[0016] Furthermore, the weight vector analysis steps are as follows:

[0017] The system's built-in task types are mapped to business keys to obtain business key values. Each task calculates its contract key value according to the contract inheritance mechanism. The contract key value and the business key value are added together to obtain the user-preset priority value.

[0018] The default penalty coefficient is calculated based on the user-preset priority value using an accelerated exponential penalty function.

[0019] By acquiring the percentage of task waiting time, the percentage of CPU resource demand, the user's preset priority value, and the penalty coefficient for breach of contract, a multi-dimensional task feature vector is constructed.

[0020] The multidimensional task feature vector is normalized to obtain a normalized probability matrix. The information entropy of each feature is calculated based on the normalized probability matrix. The information entropy of each feature is dynamically weighted to obtain a weight vector.

[0021] Furthermore, the global resource satisfaction flag analysis steps are as follows:

[0022] By collecting data in real time on the target node in the container cloud platform, such as the number of available CPU cores, the number of reserved CPU cores, the size of contiguous memory blocks, the memory fragmentation rate, the disk I / O bandwidth, and the disk latency, a node resource profile is constructed.

[0023] Perform three-dimensional matching calculations based on the node resource profile matrix to obtain the median of the node dimension. Create a task resource matching degree function by combining the median of the node dimension with the task resource requirement vector, and calculate the matching degree scalar.

[0024] Based on the matching degree scalar, task resource requirements, and node resource profiles, a resource satisfaction decision formula is established to obtain a global resource satisfaction flag. If the global resource satisfaction flag is True, scheduling is directly performed and step 6 is executed. If False, preemption is triggered, and node resource fingerprint analysis continues to step 3.

[0025] Furthermore, the optimal preemption time analysis steps are as follows:

[0026] Construct a future resource gap function based on the available resources at time τ;

[0027] The candidate task set is weighted and summed based on the matching degree matrix to obtain the preemption task loss. An objective function is constructed based on the preemption task loss and the future resource gap function, and the time-weighted combination is minimized to obtain the optimal preemption time.

[0028] Furthermore, the steps for analyzing the available resources at time τ are as follows:

[0029] Node dynamic feature analysis is performed based on the False flag in the global resource satisfaction flag to obtain the node resource fingerprint;

[0030] Task node affinity is calculated from node resource fingerprints and multi-dimensional task feature vectors to obtain a matching degree matrix;

[0031] By fitting historical monitoring data using the ARIMA model, the long-term resource change trend value at time τ is predicted. Periodic fluctuation signals are extracted from historical data through fast Fourier transform, and an event correction term is introduced to handle sudden impacts. The long-term resource change trend value at time τ, the periodic fluctuation signal, and the event correction term are linearly superimposed to obtain the available resource quantity at time τ.

[0032] Furthermore, the steps for analyzing the total preemption loss of the node are as follows:

[0033] A composite reward function is established based on the final priority of the task, the set of coupled task groups, and the optimal preemption time. Through a weighted linear combination, a reward vector is obtained.

[0034] Traverse all running tasks at node k, select the decision variables marked as tasks that need to be preempted, and obtain the actual set of preempted tasks at node k. For each task in the actual set of preempted tasks, calculate the area of ​​its resource utility function from the current interruption time to the originally planned completion time, and mark it as the expected output value. Divide the expected output value by the matching degree between the corresponding preempted task and the currently running node in the matching degree matrix to obtain the preemption loss of each task. Sum the preemption losses of all tasks in the actual set of preempted tasks at node k to obtain the total preemption loss of the node.

[0035] Furthermore, the verification results and resource utility function analysis steps are as follows:

[0036] A total revenue objective function is established based on the revenue vector, and a demand preemption dual constraint is established based on the set of coupled task groups and the demand of the tasks to be scheduled. A binary decision vector is output through an integer programming solver.

[0037] Pareto improvement verification was performed based on optimal preemption time and binary decision vector, and the verification results were obtained.

[0038] The resource utility function is obtained by performing a quadratic polynomial regression using historical task runtime monitoring data.

[0039] Furthermore, the final scheduling scheme analysis steps are as follows:

[0040] Collect real-time CPU utilization distribution data on the nodes, calculate the coefficient of variation of CPU utilization for each node, obtain the utilization distribution of memory blocks, calculate the coefficient of variation of memory block utilization for each node, obtain the I / O gap rate, calculate the average resource dispersion coefficient by combining the coefficient of variation of CPU utilization, the coefficient of variation of memory block utilization, and the I / O gap rate for each node, calculate the overall resource utilization of the nodes, analyze the overall resource utilization of the nodes, obtain the utilization adjustment factor, and multiply the average resource dispersion coefficient by the utilization adjustment factor to obtain the node fragmentation index.

[0041] Based on the node fragmentation index, the total preemption loss of nodes, and the matching degree matrix, the integrated node set is obtained by minimizing the three-dimensional objective trade-off composite loss function of resource matching constraints;

[0042] An integrated mask is constructed based on the integrated node set. The integrated mask and node resource fingerprint are fused and frequency domain deconvolution is used to optimize the allocation, resulting in an optimized resource allocation.

[0043] The final scheduling scheme is obtained by making a value density maximization decision under resource constraints on the optimized resource allocation and the final priority of tasks.

[0044] Furthermore, the optimal node identifier analysis steps are as follows:

[0045] Based on the True flag in the global resource satisfaction flag, a direct node scheduling model is created by matching degree scalar, task resource requirement vector and node resource profile to obtain the optimal node identifier.

[0046] Compared with the prior art, the beneficial effects of the present invention are:

[0047] 1. This invention obtains a set of coupled task groups by acquiring basic task data for dynamic task priority analysis and queue topology reconstruction. It then uses node resource data to make resource satisfaction decisions, obtaining a global resource satisfaction flag. Based on this flag, it performs spatiotemporal prediction of resource matching to determine the optimal preemption time. Preemption decisions are then made based on the optimal preemption time and the set of coupled task groups to obtain the total preemption loss for each node. Finally, resource fragment integration and scheduling are performed based on this total preemption loss to arrive at the final scheduling scheme. In task priority evaluation, it is not limited to a single dimension, considering not only task deadlines or resource requirements but also business scenarios, differences in contract value, and dynamic changes in time urgency. This allows for timely priority processing of tasks with high business criticality or high contract value, thereby reducing the risk of default or business losses. Furthermore, by considering the coupling dependencies between tasks, the preemption process does not disrupt the execution of related tasks, preventing overall task flow interruptions and reducing system recovery costs and time overhead.

[0048] 2. This invention creates a direct scheduling model for nodes based on a global resource satisfaction flag, obtaining the optimal node identifier. Resource satisfaction judgment considers not only the current resource state but also the spatiotemporal prediction of future resource changes. The selection of preemption time is supported by data, significantly reducing the mismatch between resource release and new task requirements, and minimizing unnecessary preemption losses. Furthermore, resource fragmentation integration constructs a comprehensive fragmentation index for multi-dimensional resources, combined with a mechanism for dynamically adjusting integration intensity based on resource utilization. This eliminates resource fragmentation issues and improves overall resource utilization. In addition, the existing preemption decision process incorporates Pareto improvement verification, preventing the preemption of high-priority running tasks to schedule new tasks, thus improving overall system efficiency. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. The following drawings are not drawn to scale according to the actual size, but are intended to show the main idea of ​​the present invention.

[0050] Figure 1 This is a flowchart of the method of the present invention;

[0051] Figure 2This is a flowchart illustrating the preemption process of the present invention.

[0052] Figure 3 This is a flowchart of step S200 of the present invention. Detailed Implementation

[0053] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are also within the scope of protection of the present invention.

[0054] like Figure 1 , 2 As shown, a task preemptive scheduling method includes the following steps:

[0055] Step S100: By acquiring basic task data, perform dynamic task priority analysis and queue topology reconstruction to obtain a set of coupled task groups;

[0056] Step S200: Make resource satisfaction decisions by acquiring node resource data to obtain a global resource satisfaction flag;

[0057] Step S300: Based on the global resource satisfaction flag, perform spatiotemporal prediction of resource matching degree to obtain the optimal preemption time;

[0058] Step S400: Make a preemption decision based on the optimal preemption time and the set of coupled task groups to obtain the total preemption loss of the node;

[0059] Step S500: Based on the total preemption loss of nodes, perform resource fragment integration and scheduling to obtain the final scheduling scheme;

[0060] Step S600: Create a direct node scheduling model based on the global resource satisfaction flag to obtain the optimal node identifier;

[0061] Specifically, the detailed analysis of step S100 is as follows:

[0062] The basic task data includes task type and task contract data (including contract amount, deadline, and submission time). The system's built-in task type mapping rules are used to obtain the business key value. Specifically, the mapping rule relationship is as follows: real-time computing tasks (such as financial transactions) have a business key value of 9; batch processing tasks (such as log analysis) have a key value of 3; and model training tasks have a key value of 6. Each task calculates its contract key value according to the contract inheritance mechanism. Specifically, the contract inheritance mechanism is as follows: annual contract amounts above 5 million yuan correspond to a basic contract value of 8; annual contract amounts between 2 million and 5 million yuan correspond to a basic contract value of 6; and others correspond to 2. The task's time urgency is obtained: time urgency = 10 * (1 - min(1, (current time - submission time) / (deadline - submission time))). If the urgency is greater than the threshold TG1, the contract superposition value corresponds to 8; otherwise, the contract superposition value corresponds to 5. The basic contract value and the contract superposition value are added together to obtain the contract key value. The contract key value is then added together with the business key value to obtain the user-preset priority value.

[0063] The default penalty coefficient is calculated based on the user-preset priority value using an accelerated exponential penalty function. The accelerated exponential penalty function is as follows:

[0064] Among them SL penal The default penalty coefficient is represented by basecost, which is the basic default fee, the basic compensation amount agreed in the contract, in yuan / hour; delahours is the delay time, the number of hours between the actual task start time and the start time agreed in the SLA; SLdead is the latest start time deadline for the task agreed in the contract; and ψ is the user's preset priority value.

[0065] By acquiring the percentage of task waiting time, the percentage of CPU resource demand, the user's preset priority value, and the penalty coefficient for breach of contract, a multi-dimensional task feature vector is constructed.

[0066] Where t wai t max R represents the task waiting time and the maximum allowed waiting time by the system, respectively. cpu R total These represent the number of CPU cores required for the task and the total number of CPU cores in the cluster, respectively, and i represents the task sample index;

[0067] The multidimensional task feature vectors are normalized to obtain a normalized probability matrix. The information entropy of each feature dimension is calculated based on this normalized probability matrix. The information entropy of each feature dimension is then dynamically weighted to obtain a weight vector. The specific normalized probability matrix... Where k represents the feature dimension index. The sum of historical samples for feature dimension k, and the information entropy of each feature dimension. Where N represents the number of samples, and the weight vector... The weights of the specific feature dimension k Where m represents the cyclic index of the dimension, m∈{1,2,3,4}. Represents the sum of all characteristic utility values, 1-H k The entropy represents the information utility value of feature k; the smaller the entropy, the greater the utility.

[0068] Chaotic initial values ​​are generated through hash functions and modulo operations. Five iterations of Logistic chaotic mapping are performed on the initial values ​​to obtain chaotic values. The dot product of the feature vector and the weight vector is calculated to obtain the baseline priority. The chaotic values ​​and the baseline priority are combined to obtain the final priority of the task.

[0069] Specifically, the initial value of chaos Where TaskID represents the unique identifier of the task, hash(*) represents the hash function, such as the SHA-256 algorithm, mod1000 represents the modulo 1000 operation, generating integers from 0 to 999, ultimately mapping to the interval [0, 1), and the chaotic value. in This represents the chaos value in the nth iteration, and 3.99 represents the Logistic parameter. Indicates the chaos value for the next iteration, and the final priority of the task. Represents the chaotic perturbation term;

[0070] Based on the final priority of each task in the task queue, the priority range of the queue is calculated. All task pairs are traversed, and a dependency edge is established with 1 if the priority difference coupling condition is met (otherwise it is 0), forming a task dependency graph. A graph connectivity component identification algorithm is used to group interconnected tasks into the same coupling group, outputting the set of coupled task groups X = {G1, G2, ..., G...}. m}, where m represents the number of coupled task groups identified in the queue, and the task dependency graph G = (V, E), where V = task nodes and E = dependency edges. Where E ij This represents the dependency edge marker, where i and j represent task indices, and max represents the maximum value. k∈Q P k Indicates the highest priority of the queue, min k∈Q P k This indicates the lowest priority of the queue, and 0.1 represents the relative difference threshold. This indicates a priority difference coupling condition.

[0071] like Figure 3 As shown, the specific analysis of step S200 is as follows:

[0072] Node resource data includes the number of available CPU cores, the number of reserved CPU cores, the size of contiguous memory blocks, the memory fragmentation rate, disk I / O bandwidth, and disk latency. By collecting these data in real-time from the target node in the container cloud platform, a node resource profile is constructed. The memory fragmentation rate is calculated by dividing the total fragmented memory by the total memory. Where C ava C reser M ava M fra IO b and IO lat These represent the number of available CPU cores, the number of reserved CPU cores, the size of contiguous memory blocks, the memory fragmentation rate, the disk I / O bandwidth, and the disk latency, respectively.

[0073] Perform a three-dimensional matching calculation based on the node resource profile matrix to obtain the median of the node dimensions, where CPU dimension u1 = median(C ava C reser ), memory dimension u2 = median(M ava M fra ), IO dimension u3 = median(IO b IO lat ), where median represents taking the median, a task resource matching degree function is created by combining the median of the node dimensions with the task resource requirement vector, and the matching degree scalar is calculated, where the task resource matching degree function is: Λ i u represents the matching degree scalar. m (N) represents the median of each dimension of the node resource profile, m = 1, 2, 3, This represents the task's resource requirements (CPU, MEM, IO), which are the three-dimensional resource requirements (corresponding to the number of CPU cores, memory size, and IO bandwidth) explicitly declared by the user through the API or command-line interface. These requirements correspond to the median of each dimension of the node's resource profile. The multiplication symbol represents the chain of products.

[0074] Based on the matching degree scalar, task resource requirements, and node resource profiles, a resource satisfaction decision formula is established to obtain a global resource satisfaction indicator. The specific resource satisfaction decision formula is as follows:

[0075] Where Φ represents the global resource satisfaction flag. If True, scheduling proceeds directly to step 6; if False, preemption is triggered, and node resource fingerprint analysis continues to step 3. Indicates the existence of node k, and iterates through all nodes in the cluster, R i Indicates the task's resource requirements (CPU, MEM, IO). This represents the number of available CPU cores, contiguous memory block size, and disk I / O bandwidth in the node resource profile, corresponding to the task resource requirements. `st` indicates that these are limited by... This indicates an indicator function; it equals 1 if the condition is true, and 0 otherwise.

[0076] Specifically, the detailed analysis of step S300 is as follows:

[0077] Node dynamic feature analysis is performed based on the False flag in the global resource satisfaction flag to obtain node resource fingerprints. in Δmem represents the standard deviation of CPU utilization at node k (over the past 5 minutes). (k) This indicates the change in memory usage for node k (over the last minute). This represents the average memory usage of node k over the past 10 minutes. This represents the IO change rate (current value - mean) / mean. Specifically, when the global resource satisfaction flag is False, node resource fingerprint analysis is triggered.

[0078] Task node affinity is calculated by analyzing node resource fingerprints and multi-dimensional task feature vectors to obtain a matching degree matrix. Where F i (d+1) This represents the 2nd to 4th dimensions of the multidimensional task feature vector. This represents the historical mean of the d-th dimension of the node resource fingerprint. This represents the standard deviation of the d-th dimension of the node resource fingerprint;

[0079] By fitting historical monitoring data (Rhist, 5-minute granularity) to the ARIMA model, the long-term resource change trend value at time τ is predicted. This step captures the slow evolution pattern of resources such as CPU, memory, and I / O. Periodic fluctuation signals are extracted from historical data using Fast Fourier Transform (FFT), and an event correction term is introduced to handle sudden impacts. The long-term resource change trend value at time τ, the periodic fluctuation signal, and the event correction term are linearly superimposed to obtain the available resource quantity at time τ. Among them, ARIMA (Rhist) τ FFT represents the long-term resource change trend value at time τ. seas (τ) represents the periodic fluctuation signal, ξ represents the set of future planned events (such as the completion of a scheduled task), and ΔR e λ represents the amount of resources released by event e, and λ represents the time decay coefficient.

[0080] A future resource gap function is constructed based on the available resource quantity at time τ. The specific future resource gap function... in The vector represents the resource requirements (CPU, MEM, IO) of the task to be scheduled. The three-dimensional resource requirements (corresponding to the number of CPU cores, memory size, and IO bandwidth) are explicitly declared by the user through the API or command line interface. ||*||2 represents the norm, β, α, and χ represent the regression parameters (fitted from historical data), and t represents the prediction time (minutes).

[0081] The preemption task loss is obtained by weighted summation of the candidate task set based on the matching degree matrix. An objective function is constructed from the preemption task loss and the future resource gap function, and the optimal preemption time is obtained by minimizing the time-weighted combination. The preemption task loss is then calculated. Where Ω represents the set of candidate preemption tasks, t runj Indicates the running time of task j, ν represents the decay factor, and M represents the time elapsed since the task was completed. jk The matching degree matrix represents the degree to which a task belongs to the set of candidate preemptive tasks, and the optimal preemption time. Where T max This indicates the maximum tolerable delay (system setting). represents the attenuation factor, and argmin indicates taking the minimum value.

[0082] Specifically, the detailed analysis of step S400 is as follows:

[0083] A composite reward function is established based on the final priority of the task, the set of coupled task groups, and the optimal preemption time. This function is then used to obtain a reward vector through a weighted linear combination. Specifically, the composite reward function includes: Where P i P represents the final priority of the task to be scheduled. j The final priority of task j during execution is given by denoted by deg(j), the degree of task j in the dependency graph G, the number of edges connected to task node j, |X|, and the total number of tasks in the coupled task group set to which task j belongs. estj This represents the estimated total running time of task j, where θ, γ, and ρ represent weight parameters. Payof j This represents the reward vector for task j;

[0084] A total revenue objective function is established based on the revenue vector. A preemptive constraint is established based on the set of coupled task groups and the needs of the tasks to be scheduled. A binary decision vector is output using an integer programming solver (such as the branch and bound method). Specifically, the above includes the following formulas:

[0085]

[0086]

[0087] x j Belongs to {0,1}

[0088] in, Represents a binary decision vector, x j The decision variable represents whether to preempt task j. This represents the amount of resources (CPU, MEM, IO) released after task j is preempted, obtained through container monitoring tools. This represents the minimum total resources (CPU, MEM, IO) required for a new scheduled task. X represents the three-dimensional resource requirements (corresponding to the number of CPU cores, memory size, and IO bandwidth) explicitly declared by the user through the API or command-line interface. k This represents the set of the k-th coupled task group;

[0089] Pareto improvement verification was performed based on the optimal preemption time and decision vector, and the verification results were obtained. The Pareto improvement verification included: Where ∑ j P j P represents the sum of the final priorities of all running tasks (before preemption). i P represents the final priority to be scheduled. j Indicates the final priority of task j in operation, x j Let Ψ(t) represent the decision variable, κ represent the system improvement coefficient, and Ψ(t) represent the system improvement coefficient. pree () represents the time decay factor. Where ω represents the attenuation coefficient. If the above Pareto improvement verification is satisfied, the verification is passed and the next step of preemption loss calculation is performed. If not satisfied, the process returns to the preemption benefit matrix construction, a new candidate task set is selected, and the result is marked as the verification result.

[0090] By performing quadratic polynomial regression on historical task runtime monitoring data (such as curves of CPU utilization and memory usage over time), a resource utility function is obtained. Specifically, time-series data of resource consumption in the past execution process of similar tasks are collected, and coefficients are fitted using the least squares method to generate a parabola describing the resource utility change pattern of task j in its life cycle (e.g., resource demand increases in the early stage of startup, stabilizes in the middle stage, and decreases before the end).

[0091] Traverse all running tasks at node k and select the decision variables marked as tasks to be preempted to obtain the actual set of preempted tasks at node k. For each task in the actual set of preempted tasks, calculate the area of ​​its resource utility function from the current interruption time to the originally planned completion time, and mark it as the expected output value. Divide the expected output value by the matching degree between the corresponding preempted task and the currently running node in the matching degree matrix to obtain the preemption loss of each task. Specifically, the expected output value, matching degree and preemption loss are all dimensionless, and the resource utility function is an abstract utility value without units (normalized value). Sum the preemption losses of all tasks in the actual set of preempted tasks at node k to obtain the sum of the losses of all preempted tasks on node k, and mark it as the total preemption loss of the node.

[0092] Specifically, the detailed analysis of step S500 is as follows:

[0093] Real-time CPU utilization distribution data is collected from nodes. The coefficient of variation of CPU utilization for each node (standard deviation of CPU utilization divided by mean CPU utilization) is calculated to measure the dispersion of computing resource allocation. The utilization distribution of memory blocks is obtained, and the coefficient of variation of memory block utilization for each node (standard deviation of memory block utilization divided by mean memory block utilization) is calculated to assess the fragmentation of memory resources. The I / O gap rate (1 - used I / O bandwidth / total I / O bandwidth) is obtained to quantify the waste of network resources. The coefficients of variation of CPU utilization, memory block utilization, and I / O utilization for each node are compared. The average resource dispersion coefficient is obtained by taking the average gap rate. The overall resource utilization rate of the node is calculated (by weighting the utilization rates of CPU, memory, and IO with a weighting coefficient of 4:3:3). The ratio of the overall resource utilization rate of the node to 80% of the preset maximum safe utilization rate is subtracted from 1 to obtain the utilization rate adjustment factor. Specifically, when the node utilization rate is low, this factor approaches 1 (amplifying the fragmentation penalty) and when the utilization rate is high, it approaches 0 (mitigating the impact of fragmentation). The average resource dispersion coefficient is multiplied by the utilization rate adjustment factor to obtain the node fragmentation index. The larger the value, the more serious the resource fragmentation problem.

[0094] Based on the node fragmentation index, the total preemption loss of nodes, and the matching degree matrix, the integrated node set is obtained by minimizing the three-dimensional objective trade-off composite loss function of resource matching constraints. The specific three-dimensional objective trade-off composite loss function of resource matching constraints includes:

[0095]

[0096] Fra k y represents the fragmentation index of node k. k The variable representing the decision of whether to retain a node. Let M represent the decision vector, and M represent the matching degree matrix, where M is the matching degree between task i and node k. Represents the constraint vector. b i Let T represent the minimum matching threshold required for task i, and let cost be the transpose of the matrix. k Let ρ and ψ represent the total preemption loss of node k, and let ρ and ψ represent the matching degree constraint weight and preemption loss weight, respectively. Solve the three-dimensional objective tradeoff composite loss function and output all values ​​labeled y. k For nodes with a value of 0, we obtain the integrated node set Y;

[0097] An integrated mask is constructed based on the integrated node set. The integrated mask and node resource fingerprints are then fused and frequency domain deconvolution is used to optimize the allocation, resulting in an optimized resource allocation. in This indicates the optimized resource allocation. This represents the minimum total resources (CPU, MEM, IO) required for a new scheduled task. These are the three-dimensional resource requirements (corresponding to the number of CPU cores, memory size, and IO bandwidth) explicitly declared by the user through the API or command-line interface. Represents the node resource fingerprint. Represents element-wise product. F represents the complex conjugate of the frequency domain signal, and F represents the Fourier transform. -1 Let M denote the inverse transform, ε denote the regularization coefficient, and M... Y Indicates the integration mask.

[0098] The optimized resource allocation and final task priorities are then used to make a value density maximization decision under resource constraints, resulting in the final scheduling scheme. The value density maximization decision under resource constraints includes:

[0099] Where T represents the set of tasks to be scheduled (including new tasks and preempted tasks), φ i Indicates the density of task value. P i Indicates the final priority of the task. Let z be the L1 norm of the task resource requirement vector. i Representing scheduling decision variables, the algorithm solves for the value density maximization decision under resource constraints, and outputs a binary vector consisting of these decision variables. Its component z i =1 marks the task that needs to be scheduled, z i =0 marks tasks that need to be skipped, and the binary vector composed of decision variables is the final scheduling scheme.

[0100] Specifically, the detailed analysis of step S600 is as follows:

[0101] Based on the True flag in the global resource satisfaction flag, a direct node scheduling model is created using the matching degree scalar, task resource requirement vector, and node resource profile to obtain the optimal node identifier. The direct node scheduling model includes:

[0102] Where k * K represents the identifier of the optimal node. val Indicates satisfaction The set of candidate nodes, Λ ik The value represents the matching degree scalar, and D represents the number of resource dimensions, which are 3-dimensional (CPU, MEM, IO). Represents the task resource requirement vector. This represents the number of available CPU cores, contiguous memory block size, and disk I / O bandwidth in the node resource profile. Π represents the multiplication operator, d represents the resource dimension identifier, and k represents the physical node identifier (node ​​ID).

[0103] Specifically, dynamic priority analysis and queue topology reconstruction identify task dependencies to form a set of coupled task groups. Based on resource profiles and matching degree scalars, resource satisfaction decisions are made to generate a global flag. If satisfied, the task is directly scheduled to the optimal node; otherwise, a preemption process is triggered. During the preemption process, resource fingerprint spatiotemporal prediction is combined to determine the optimal preemption time. A decision vector is generated through a composite benefit function and dual constraints. After Pareto verification, resource utility loss is calculated. Finally, fragment integration and frequency domain optimization achieve resource reorganization and maximize value density under constraints, outputting the final scheduling scheme. Chaotic priority and dependency group modeling effectively maintain system topology integrity while ensuring high-value tasks, avoiding cascading failures caused by traditional preemption. The fusion of resource fingerprint prediction and frequency domain deconvolution optimization achieves fragment-aware resource allocation, improving resource utilization compared to static strategies. An economic decision-making chain is established to uniformly quantify preemption losses and scheduling gains, reducing overall operating costs while meeting business SLAs and addressing the industry problem of balancing resource waste and business needs.

[0104] In another embodiment, this task preemption scheduling method is specifically applied to road maintenance, coordinating tasks such as crack repair and sign replacement, and using vehicle-mounted cameras and drones to collect real-time images of road defects (such as crack width and sign damage). Task priority calculation first generates an initial user-preset priority value based on task type (crack repair / signage update, etc.), contract amount range (over 5 million yuan is considered high value), and time urgency (dynamically calculated based on the deadline). Then, a default penalty coefficient is calculated using a built-in acceleration exponential penalty function. This function dynamically adjusts the penalty for task delays based on the user-preset priority value—the higher the priority of a task, the more exponentially its penalty coefficient increases if it fails to start on time, directly improving the task's final priority ranking. Based on the aforementioned task preemption scheduling method, queue topology reconstruction is performed to obtain a set of coupled task groups. Resource satisfaction decisions are made by acquiring node resource data to obtain a global resource satisfaction flag. Based on the global resource satisfaction flag, spatiotemporal prediction of resource matching is performed to obtain the optimal preemption time. Preemption decisions are made on the optimal preemption time and the set of coupled task groups to obtain the total preemption loss value for nodes. Based on the total preemption loss value for nodes, resource fragment integration scheduling is performed to obtain the final scheduling scheme. A direct node scheduling model is created based on the global resource satisfaction flag to obtain the optimal node identifier.

[0105] The foregoing description is illustrative of the invention and should not be construed as limiting it. Although several exemplary embodiments of the invention have been described, those skilled in the art will readily understand that many modifications can be made to the exemplary embodiments without departing from the novel teachings and advantages of the invention. Therefore, all such modifications are intended to be included within the scope of the invention as defined in the claims. It should be understood that the foregoing description is illustrative of the invention and should not be construed as limiting it to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The invention is defined by the claims and their equivalents.

Claims

1. A task preemptive scheduling method, characterized in that, Includes the following steps: Step S100: By acquiring basic task data, perform dynamic task priority analysis and queue topology reconstruction to obtain a set of coupled task groups; Step S200: Make resource satisfaction decisions by acquiring node resource data to obtain a global resource satisfaction flag; Step S300: Based on the global resource satisfaction flag, perform spatiotemporal prediction of resource matching degree to obtain the optimal preemption time; Step S400: Make a preemption decision based on the optimal preemption time and the set of coupled task groups to obtain the total preemption loss of the node; Step S500: Based on the total preemption loss of nodes, perform resource fragment integration and scheduling to obtain the final scheduling scheme; Step S600: Create a direct scheduling model for nodes based on the global resource satisfaction flag to obtain the optimal node identifier.

2. The task preemptive scheduling method according to claim 1, characterized in that, The steps for analyzing the coupled task group set are as follows: Chaotic initial values ​​are generated through hash functions and modulo operations. Logistic chaotic mapping is iterated on the initial values ​​to obtain chaotic values. The dot product of the feature vector and the weight vector is calculated to obtain the baseline priority. The chaotic values ​​and the baseline priority are combined to obtain the final priority of the task. Based on the final priority of each task in the task queue, the priority range of the queue is calculated. All task pairs are traversed, and when the priority difference coupling condition is met, a dependency edge is established to form a task dependency graph. The interconnected tasks are divided into the same coupling group by the graph connectivity component identification algorithm, and the set of coupled task groups is output.

3. The task preemptive scheduling method according to claim 2, characterized in that, The weight vector analysis steps are as follows: The system's built-in task types are mapped to business keys to obtain business key values. Each task calculates its contract key value according to the contract inheritance mechanism. The contract key value and the business key value are added together to obtain the user-preset priority value. The default penalty coefficient is calculated based on the user-preset priority value using an accelerated exponential penalty function. By acquiring the percentage of task waiting time, the percentage of CPU resource demand, the user's preset priority value, and the penalty coefficient for breach of contract, a multi-dimensional task feature vector is constructed. The multidimensional task feature vector is normalized to obtain a normalized probability matrix. The information entropy of each feature is calculated based on the normalized probability matrix. The information entropy of each feature is dynamically weighted to obtain a weight vector.

4. The task preemptive scheduling method according to claim 1, characterized in that, The steps for analyzing the global resource satisfaction rating are as follows: By collecting data in real time on the target node in the container cloud platform, such as the number of available CPU cores, the number of reserved CPU cores, the size of contiguous memory blocks, the memory fragmentation rate, the disk I / O bandwidth, and the disk latency, a node resource profile is constructed. Perform three-dimensional matching calculations based on the node resource profile matrix to obtain the median of the node dimension. Create a task resource matching degree function by combining the median of the node dimension with the task resource requirement vector, and calculate the matching degree scalar. Based on the matching degree scalar, task resource requirements, and node resource profiles, a resource satisfaction decision formula is established to obtain a global resource satisfaction indicator.

5. The task preemptive scheduling method according to claim 1, characterized in that, The optimal preemption time analysis steps are as follows: Construct a future resource gap function based on the available resources at time τ; The candidate task set is weighted and summed based on the matching degree matrix to obtain the preemption task loss. An objective function is constructed based on the preemption task loss and the future resource gap function, and the time-weighted combination is minimized to obtain the optimal preemption time.

6. The task preemptive scheduling method according to claim 5, characterized in that, The steps for analyzing the available resources at time τ are as follows: Node dynamic feature analysis is performed based on the False flag in the global resource satisfaction flag to obtain the node resource fingerprint; Task node affinity is calculated from node resource fingerprints and multi-dimensional task feature vectors to obtain a matching degree matrix; By fitting historical monitoring data using the ARIMA model, the long-term resource change trend value at time τ is predicted. Periodic fluctuation signals are extracted from historical data through fast Fourier transform, and an event correction term is introduced to handle sudden impacts. The long-term resource change trend value at time τ, the periodic fluctuation signal, and the event correction term are linearly superimposed to obtain the available resource quantity at time τ.

7. The task preemptive scheduling method according to claim 1, characterized in that, The steps for analyzing the total preemption loss of the node are as follows: A composite reward function is established based on the final priority of the task, the set of coupled task groups, and the optimal preemption time. Through a weighted linear combination, a reward vector is obtained. Traverse all running tasks at node k, select the decision variables marked as tasks that need to be preempted, and obtain the actual set of preempted tasks at node k. For each task in the actual set of preempted tasks, calculate the area of ​​its resource utility function from the current interruption time to the originally planned completion time, and mark it as the expected output value. Divide the expected output value by the matching degree between the corresponding preempted task and the currently running node in the matching degree matrix to obtain the preemption loss of each task. Sum the preemption losses of all tasks in the actual set of preempted tasks at node k to obtain the total preemption loss of the node.

8. A task preemptive scheduling method according to claim 7, characterized in that, The verification results and resource utility function analysis steps are as follows: A total revenue objective function is established based on the revenue vector, and a demand preemption dual constraint is established based on the set of coupled task groups and the demand of the tasks to be scheduled. A binary decision vector is output through an integer programming solver. Pareto improvement verification was performed based on optimal preemption time and binary decision vector, and the verification results were obtained. The resource utility function is obtained by performing a quadratic polynomial regression using historical task runtime monitoring data.

9. The task preemptive scheduling method according to claim 1, characterized in that, The analysis steps for the final scheduling scheme are as follows: Collect real-time CPU utilization distribution data on the nodes, calculate the coefficient of variation of CPU utilization for each node, obtain the utilization distribution of memory blocks, calculate the coefficient of variation of memory block utilization for each node, obtain the I / O gap rate, calculate the average resource dispersion coefficient by combining the coefficient of variation of CPU utilization, the coefficient of variation of memory block utilization, and the I / O gap rate for each node, calculate the overall resource utilization of the nodes, analyze the overall resource utilization of the nodes, obtain the utilization adjustment factor, and multiply the average resource dispersion coefficient by the utilization adjustment factor to obtain the node fragmentation index. Based on the node fragmentation index, the total preemption loss of nodes, and the matching degree matrix, the integrated node set is obtained by minimizing the three-dimensional objective trade-off composite loss function of resource matching constraints; An integrated mask is constructed based on the integrated node set. The integrated mask and node resource fingerprint are fused and frequency domain deconvolution is used to optimize the allocation, resulting in an optimized resource allocation. The final scheduling scheme is obtained by making a value density maximization decision under resource constraints on the optimized resource allocation and the final priority of tasks.

10. A task preemptive scheduling method according to claim 1, characterized in that, The optimal node identifier analysis steps are as follows: Based on the True flag in the global resource satisfaction flag, a direct node scheduling model is created by matching degree scalar, task resource requirement vector and node resource profile to obtain the optimal node identifier.

Citation Information

Patent Citations

  • Container cloud-oriented task preemption scheduling method and system

    CN111399989A

  • Kubernetes scheduling method and device and storage medium

    CN114064296A