An asynchronous task control method
By extracting the decision context and training the model to generate a task execution plan in the asynchronous task control system, and combining time and success rate scores to select the optimal plan, the problem of asynchronous tasks being scheduled to non-optimal nodes is solved, thus improving execution efficiency.
Patent Information
- Application Number
- CN202511472217.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-15
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2045-10-15
AI Technical Summary
Existing asynchronous task scheduling relies on preset rules or simple load balancing strategies, which results in tasks being assigned to suboptimal nodes, affecting execution efficiency.
By extracting the decision context of the asynchronous task control system, multiple task execution plans are generated using a trained task allocation model. Combining task characteristics and work node characteristics, the total execution time and success rate of the plans are calculated, and a comprehensive scoring mechanism is used to select the optimal plan.
It improves the execution efficiency of asynchronous tasks, avoids lag and delay caused by resource mismatch and poor node status, and ensures that the solution has advantages in both time and success rate, achieving optimal configuration of resource utilization and execution rhythm.
Smart Images

Figure CN120950264B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to an asynchronous task control method. BACKGROUND
[0002] With the rapid development of distributed systems and cloud computing technologies, asynchronous tasks, as a non-blocking task processing mode, have been widely used in various complex scenarios. Early task processing mostly adopts a synchronous blocking mode, and task execution needs to wait for the completion of previous operations, which is low in efficiency and limited in resource utilization. Asynchronous tasks decouple task submission and result processing, allowing the system to process other tasks while waiting for a certain task to complete, significantly improving resource throughput. Today, asynchronous tasks are widely used in e-commerce order processing, big data analysis, real-time message pushing, background service scheduling and other fields, greatly shortening the waiting time and supporting the stable operation of high-concurrency business scenarios.
[0003] In related technologies, the task scheduling of asynchronous tasks mostly depends on preset rules or simple load balancing strategies, which may cause the tasks to be allocated to non-optimal nodes, affecting the execution efficiency of asynchronous tasks. SUMMARY
[0004] The problem solved by the present application is how to improve the execution efficiency of asynchronous tasks.
[0005] To solve the above problems, the present application provides an asynchronous task control method.
[0006] In a first aspect, the present application provides an asynchronous task control method, which comprises:
[0007] extracting current task features and current working node features according to the obtained decision context of the asynchronous task control system;
[0008] obtaining a scheme list through a trained task allocation model according to the current task features and the current working node features, the scheme list comprising a plurality of task execution schemes;
[0009] obtaining a corresponding total execution time of the scheme according to the task execution scheme;
[0010] obtaining a corresponding success rate of the scheme according to the task execution result distribution of the task execution scheme;
[0011] determining a corresponding scheme score through a comprehensive scoring mechanism according to the total execution time of the scheme and the success rate of the scheme corresponding to the task execution scheme;
[0012] determining the task execution scheme with the highest scheme score in all the task execution schemes as the final scheme.
[0013] Optionally, the total execution time of the task execution scheme is obtained according to the task execution scheme, comprising:
[0014] obtaining historical execution records and historical working node features corresponding to tasks in the task execution scheme, and a current working node feature of the task;
[0015] determining an average execution time of the task according to the historical execution records and the corresponding historical working node features through a preset mean value relationship;
[0016] determining a predicted execution time of the task according to the average execution time through a preset correction relationship;
[0017] calibrating the predicted execution time through the current working node feature corresponding to the task to obtain a corresponding actual execution time;
[0018] summing up the actual execution time corresponding to all the tasks in the task execution scheme to obtain the total execution time of the scheme.
[0019] Optionally, the average execution time of the task is determined according to the historical execution records and the corresponding historical working node features through a preset mean value relationship, comprising:
[0020] determining historical execution time and time interval from the current time corresponding to each task execution history according to the historical execution records, and determining historical CPU usage rate, historical memory usage rate and historical network delay corresponding to the task execution history according to the historical working node features; the historical execution records include a plurality of the task execution histories of the task;
[0021] obtaining a time decay factor corresponding to the task execution history according to the time interval and a preset decay relationship;
[0022] obtaining a node compensation coefficient corresponding to the task execution history through a preset compensation relationship according to the historical CPU usage rate, the historical memory usage rate and the historical network delay;
[0023] determining the average execution time corresponding to the task according to the historical execution time, the time decay factor and the node compensation coefficient corresponding to all the task execution histories through the mean value relationship.
[0024] Optionally, the decay relationship satisfies:
[0025] d i =exp(-α×∆c i );
[0026] the compensation relationship satisfies:
[0027] e i =βf i +γg i +δh i ;
[0028] The mean relationship satisfies:
[0029] ;
[0030] Wherein, A is the average execution time of the task, t i is the historical execution time corresponding to the i-th task execution history, d i is the time decay factor corresponding to the i-th task execution history, e i is the node compensation coefficient corresponding to the i-th task execution history, n is the number of task execution histories, alpha is the decay coefficient, delta c i is the time interval between the i-th task execution history and the current time, exp is the exponential function, beta is the CPU coefficient, f i is the historical CPU usage rate corresponding to the i-th task execution history, gamma is the memory coefficient, g i is the historical memory usage rate corresponding to the i-th task execution history, delta is the historical network delay coefficient, h i is the historical network delay corresponding to the i-th task execution history.
[0031] Optionally, the correction relationship satisfies:
[0032] r= (ln (1+A)) x epsilon;
[0033] Wherein, r is the predicted execution time, A is the average execution time of the task, epsilon is the correction coefficient, and ln is the natural logarithm function.
[0034] Optionally, the actual execution time corresponding to the predicted execution time is obtained by calibrating the current working node characteristics corresponding to the task, comprising:
[0035] According to the current working node characteristics, the current CPU usage rate, the current memory usage rate and the current network delay corresponding to the task are determined;
[0036] The product of the current CPU usage rate, the current memory usage rate and the current network delay and the corresponding preset coefficient is summed to obtain the current calibration coefficient;
[0037] The product of the current calibration coefficient and the predicted execution time is determined as the actual execution time of the task.
[0038] Optionally, the task execution result distribution of the task execution scheme is used to obtain a corresponding scheme success rate, including:
[0039] Obtain the failure interval sequence and the current execution number of the task;
[0040] According to the maximum failure interval number and the minimum failure interval number in the failure interval sequence, a corresponding failure parameter is determined through a preset failure relationship;
[0041] Sum all failure interval numbers in the failure interval sequence and divide by the failure number to obtain the average failure interval number;
[0042] According to the current execution number, the failure parameter, and the average failure interval number, a task success rate of the task is determined through a preset success rate relationship;
[0043] The smallest task success rate in the task execution scheme is determined as the scheme success rate.
[0044] Optionally, the failure relationship satisfies:
[0045]
[0046] The success rate relationship satisfies:
[0047] ;
[0048] wherein k is the failure parameter, p max is the maximum failure interval number, p min is the minimum failure interval number, s is the task success rate, p avg is the average failure interval number, and q is the current execution number.
[0049] Optionally, the scheme total execution time and the scheme success rate of the task execution scheme are used to determine a corresponding scheme score through a comprehensive scoring mechanism, including:
[0050] Obtain the scheme work node feature of the task execution scheme;
[0051] According to the scheme work node feature, an abnormal node feature vector is obtained through a multi-dimensional abnormal waveform feature extraction algorithm;
[0052] According to the scheme total execution time, the scheme success rate, and the abnormal node feature vector of the task execution scheme, the scheme score is determined through a preset scoring relationship.
[0053] Optionally, the scoring relationship satisfies:
[0054] ;
[0055] wherein Q is the scheme score, T is the total execution time of the scheme, T b is the baseline time, μ is the time penalty coefficient, ρ is the success reward coefficient, Y is the success rate of the scheme, ω is the abnormal penalty coefficient, is the abnormal node feature vector, |||2 is the Euclidean norm, θ is the resonance reward coefficient, Z is the resonance coefficient.
[0056] In a second aspect, an asynchronous task control device is provided, comprising:
[0057] a feature extraction module configured to extract a current task feature and a current worker feature according to a decision context of an asynchronous task control system;
[0058] a prediction module configured to obtain a scheme list by using a trained task allocation model according to the current task feature and the current worker feature, the scheme list comprising a plurality of task execution schemes;
[0059] a first processing module configured to obtain a corresponding total execution time of the task execution scheme;
[0060] a second processing module configured to obtain a corresponding success rate of the task execution scheme according to a task execution result distribution of the task execution scheme;
[0061] a scoring module configured to determine a corresponding scheme score of the task execution scheme by using a comprehensive scoring mechanism according to the total execution time and the success rate of the task execution scheme;
[0062] a comparison module configured to determine a final scheme as the task execution scheme with the highest scheme score in all the task execution schemes.
[0063] In a third aspect, an electronic device is provided, comprising a memory and a processor;
[0064] the memory is configured to store a computer program;
[0065] the processor is configured to implement the asynchronous task control method of the first aspect when executing the computer program.
[0066] In a fourth aspect, a computer readable storage medium is provided, the storage medium storing a computer program, and when the computer program is executed by a processor, the asynchronous task control method of the first aspect is implemented.
[0067] The asynchronous task control method has the beneficial effects that the current task features and the work node features are extracted based on the decision context of the asynchronous task control system, comprehensive and actual basic data are provided for subsequent decision, blind distribution caused by information missing or deviation from the actual state is avoided, problems such as execution jam and delay that may occur due to resource mismatch or poor node state are reduced, and a foundation is laid for efficient execution. The scheme list is generated by the trained task allocation model, a plurality of task-node combination schemes with higher adaptability can be quickly screened out by relying on the learning of the historical scheduling law of the model, the efficient and stable matching law of the task and the node can be accurately captured, compared with artificial or simple rule allocation, a scheme with higher efficiency potential can be generated, inefficient combination is avoided, and the overall efficiency baseline of the scheme is improved. The total execution time of the scheme is calculated based on the key task execution path, the success rate of the scheme is determined in combination with the task execution result distribution, and then the performance of the scheme is quantified through the comprehensive scoring mechanism, so that the efficiency core can be accurately focused. The time consumption of the key path directly determines the lower limit of the completion of the overall task, the total execution time is calculated based on the key path, schemes that can shorten the overall time consumption can be preferentially screened out; and the scoring logic combined with the success rate can also avoid selecting schemes with high failure risk (retry after failure will increase the total time consumption) that simply pursue speed, ensure that the scheme is fast and stable at the same time, and reduce the time waste caused by retry. Finally, the scheme with the highest score is selected as the final scheme, which is equivalent to further locking the optimal solution in multiple potential efficient schemes. The final scheme has advantages in total execution time (can shorten the overall time consumption of the task) and can reduce the probability of execution exception through reasonable task-node matching (reduce unnecessary time loss), finally realizes the optimal configuration of asynchronous tasks in resource utilization and execution rhythm, and effectively improves the execution efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0068] Figure 1 A flowchart of an asynchronous task control method according to an embodiment of the application;
[0069] Figure 2 A structural diagram of an asynchronous task control device according to an embodiment of the application;
[0070] Figure 3 A structural diagram of an electronic device according to an embodiment of the application. DETAILED DESCRIPTION
[0071] In order to make the above objectives, features and advantages of the present application more clear and comprehensible, specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be interpreted as being limited to the embodiments set forth herein, but rather these embodiments are provided so as to more thoroughly and completely understand the present application. It should be understood that the drawings and embodiments of the present application are merely for illustrative purposes and are not intended to limit the scope of the present application.
[0072] It should be understood that each of the steps recited in the method embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0073] As used herein, the term "includes" and its variants are open-ended, meaning "includes but is not limited to"; the term "based on" means "based, at least in part, on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments." Related terms will be understood analogously. It should be noted that reference numerals in the description and drawings indicate embodiments of the application and do not necessarily indicate any priority or dependency between the embodiments. It should be noted that the concepts of "first", "second", etc. mentioned in the present application are merely used to distinguish different apparatuses, modules or units, and do not imply the order or interdependence of the functions performed by these apparatuses, modules or units.
[0074] It should be noted that the modification of "one" or "more" mentioned in the present application is illustrative rather than limiting, and those skilled in the art should understand that, unless otherwise explicitly indicated in the context, it should be understood as "one or more".
[0075] The names of the messages or information exchanged between the plurality of apparatuses in the embodiments of the present application are merely for illustrative purposes and are not intended to limit the scope of the messages or information.
[0076] In the related art, in a digital human interaction system, an intelligent question and answer process often needs to perform multiple asynchronous tasks according to user needs, but the current task scheduling link of the asynchronous task lacks precise dynamic adaptation capability and depends on preset rules or a simple load balancing strategy: neither the task itself characteristics, such as the resource demand difference of different tasks for CPU and memory, the execution rhythm difference between short duration tasks and long cycle tasks, and the urgency difference between high priority tasks and ordinary tasks, nor the real-time state of the Worker node (worker node), such as whether the current CPU occupancy rate of the node has approached saturation, whether the memory remaining amount can support task running, and whether the network bandwidth is sufficient to meet the data transmission demand of the task. This "information fragmentation" scheduling method may cause the task to be allocated to a non-optimal node, forming a "path mismatch", for example, allocating a task with high network IO demand to a node with congested network bandwidth, which may cause the task to frequently stall in the data transmission link, and a task that can be completed within 10 minutes may be delayed to 20 minutes. Allocating a task with large memory demand to a node with insufficient memory remaining amount may further lengthen the execution time due to frequent memory swapping. At the same time, when facing tasks with dependency relationship or needing cross-node collaboration, the system lacks the ability of overall planning of the execution path under the global perspective, which may prolong the completion period of a single task, cause resource waste, and the node may be in a "busy but inefficient" state due to running mismatched tasks, while the adapted tasks cannot occupy resources in time due to improper scheduling. In a large-scale task concurrency scenario, it may trigger a chain reaction, causing the overall execution link to be disordered, a large number of tasks to be accumulated on non-optimal paths, further reducing the overall task execution efficiency of the system, and even triggering a retry mechanism due to long-time incomplete tasks, causing task accumulation and resource preemption, which seriously affects the execution efficiency of the asynchronous task.
[0077] To solve the problems in the related art, the embodiment of the present application provides an asynchronous task control method.
[0078] As shown in Figure 1 The asynchronous task control method provided by the embodiment of the present application comprises:
[0079] S100, extracting current task characteristics and current worker node characteristics according to the obtained decision context of the asynchronous task control system.
[0080] It should be noted that, for example, in the process of intelligent question answering for digital humans, multiple tasks proposed by users are scheduled and allocated through an asynchronous task control system to generate the task execution plan with the highest execution efficiency. For example, in an asynchronous task control system, the decision context provides a panoramic, dynamic, and comprehensive set of information for the scheduling and solution decision-making of intelligent question-answering tasks. It covers the core information of the intelligent question-answering task side, including basic task characteristics, such as the user needs to search for food videos, the compressed processing of the searched food videos, the estimated execution time, dependencies (search first, then compress), resource requirements, and historical execution trajectory (such as the execution time, success rate, and anomaly records of past search and compression tasks, which constitute the corresponding task "behavioral profile"); it also involves the core information of the working nodes (such as the hardware configuration of different nodes, the cluster they belong to, task type adaptation tags, real-time load, the current task queue, and historical anomaly feature vectors); it can also include environmental and policy constraints, such as environmental correction factors (network congestion level, remaining resource pool), scheduling policy rules (priority configuration, load balancing threshold, success rate weighting logic, and other parameters). Based on multiple tasks proposed by the user, the system comprehensively considers the real-time feature information of each working node and formulates the final solution with the highest execution efficiency. This final solution fully combines the user's requirements and the current state characteristics of the working nodes during the human-computer interaction process, and can efficiently and accurately complete multiple tasks proposed by the user.
[0081] Specifically, in the asynchronous task control system, the characteristics of the current task and the current working node are extracted through the decision context. For the characteristics of the current task, the system collects information such as task type (e.g., computational, I / O), expected execution time (calculated based on historical task execution time and related corrections), dependencies (whether it depends on other tasks to complete), and resource requirements (expected CPU, memory, etc. usage) from dimensions such as historical execution data and configuration information. The characteristics of the current working node focus on the real-time status and historical performance of the working node, such as the node's hardware configuration (number of CPU cores, memory capacity), current load (CPU utilization, memory usage), historical task execution success rate (obtained by analyzing historical execution results through Weibull distribution, etc.), and anomaly-related characteristics (based on the feature vector of anomaly nodes, covering indicators such as the number of historical anomalies and anomaly recovery time). By integrating and extracting this multi-dimensional information, basic data support is provided for subsequent task scheduling decisions and scheme evaluation.
[0082] S200: Based on the current task characteristics and the current working node characteristics, a scheme list is obtained through the trained task allocation model. The scheme list includes multiple task execution schemes.
[0083] Specifically, after obtaining the current task features (such as task type, estimated execution time, resource demand, dependency relationship, and historical execution success rate, etc.) and the current worker node features (such as node hardware configuration, real-time load, historical exception record, task type adaptation label, etc.), these feature data are input into the trained task allocation model. The model is trained based on historical scheduling data and can learn the matching rules of tasks and nodes, such as which types of tasks are more efficient on nodes with specific configurations, which nodes have more stable success rates when handling high-load tasks, etc. During model running, multi-dimensional features of tasks and nodes are combined for calculation to generate multiple possible task execution schemes, which differ in task allocation methods (such as which node or nodes the task is allocated to), execution order (for tasks with dependency relationships), etc., and together form a scheme list, providing a basis for subsequent multi-objective scoring and optimal scheme selection.
[0084] Exemplarily, the training process of the task allocation model includes: first, extracting historical task scheduling records from system logs as training samples, each sample containing task features (such as task type, resource demand, historical execution time, etc.), corresponding worker node features (such as hardware configuration, real-time load, historical success rate, etc.), and actual result indicators of this scheduling (such as total execution time, success rate, resource utilization, etc.); then, pre-processing the sample data, including outlier cleaning, feature standardization (such as normalizing CPU usage, memory occupation, etc. to the range of 0 to 1); then, selecting a suitable model structure (such as a tree model based on gradient boosting, a deep learning network, etc.), taking task features and node features as input, and constructing a loss function with scheduling result indicators (such as minimizing total execution time, maximizing success rate as optimization objectives); then, using the training set to train the model, iteratively optimizing the model parameters through back propagation, and monitoring the model performance with the validation set to prevent overfitting; finally, evaluating the generalization ability of the model (such as the prediction accuracy of scheduling schemes for new tasks) through the test set, and if the preset indicators (such as the error between the predicted total execution time and the actual value within 10%) are met, the training is completed, otherwise the feature selection or model structure needs to be adjusted for retraining, and finally a task allocation model that can stably output reasonable task allocation schemes is obtained. It should be noted that the existing artificial intelligence large model that has been debugged can also be used as the task allocation model, which can generate multiple candidate task execution schemes based on the decision context (including current system resources, historical data, real-time indicators, exception information, etc.), by analyzing task features (type, size, complexity, etc.), worker node features (memory usage, network IO stability, current load, etc.), and time series features (historical success rate, execution time trend, etc.).
[0085] S300, obtaining a corresponding scheme total execution time according to the task execution scheme.
[0086] Specifically, the dependency relationship of all tasks in the scheme can be first combed (such as the execution order is explicitly performed through a task topology diagram), and then for each possible task link, the expected execution time of each task on the link (determined in combination with the task characteristics and the work node characteristics) is accumulated, and finally the link with the longest accumulated time is selected as the critical path, and the total time consumption is the total execution time of the scheme. For example: a scheme contains 3 task links, link 1 (T1→T3→T5) total time consumption is 600s, link 2 (T2→T4) total time consumption is 450s, link 3 (T6) time consumption is 120s, wherein link 1 is the critical task execution path, and therefore the total execution time of the scheme is 600s.
[0087] S400, according to the task execution result distribution of the task execution scheme, the corresponding scheme success rate is obtained.
[0088] Specifically, when determining the success rate of the scheme through the task execution result distribution of the task execution scheme, the core is to calculate the probability of ultimately achieving the expected goal of the entire scheme based on the historical execution result law of each task in the scheme and in combination with the task dependency relationship. First, the task execution result distribution can include: for each task included in the scheme, the historical execution result data (usually divided into “success” and “failure”, and in complex scenarios, it can include “partial success” and the like) is counted, and then the success probability of a single task (such as task T1 has a historical execution of 100 times, and 92 times are successful, and the success probability is 92%) is obtained, and the common trigger conditions of task failure (such as the failure rate of task T2 increases sharply when the node resource is insufficient) are also recorded. Then, the single task success rate needs to be integrated in combination with the dependency relationship analysis result between tasks. Because in a task execution scheme, tasks are not isolated, if there is serial dependency (such as task T3 must be executed after tasks T1 and T2 are successfully completed), the failure of a previous task may directly cause the subsequent task to fail to execute, and the entire scheme naturally fails; if there are parallel tasks (such as T4 and T5 can be executed simultaneously, and one of them can promote the process), the failure of a single parallel task does not necessarily affect the overall scheme. The calculation of the success rate of the scheme needs to be based on the historical execution result distribution of each task (single task success rate, failure condition), and then combined with the dependency logic (serial, parallel, branch, etc.) between tasks to deduce, and finally a quantitative index reflecting the overall execution success probability of the scheme is obtained.
[0089] S500, according to the scheme total execution time and the scheme success rate corresponding to the task execution scheme, the corresponding scheme score is determined through a comprehensive scoring mechanism.
[0090] Specifically, when determining the scheme score based on the total execution time and success rate of the scheme, the comprehensive scoring mechanism will convert time efficiency and success reliability into comparable quantitative scores through multi-dimensional weighted calculation. First, the weight proportion of the total execution time and success rate in the score needs to be determined (according to business requirements, such as higher time weight in scenarios with high real-time requirements, and higher success rate weight in scenarios with high stability requirements). For the total execution time, the logic of "the shorter the time, the higher the score" is usually adopted, and the time efficiency score can be calculated by comparing with the benchmark time (such as the average time consumption of historical similar schemes). For the success rate, the logic of "the higher the success rate, the higher the score" is adopted, and it is directly converted into the corresponding score (such as a success rate of 95% corresponding to 95 points. Then, the comprehensive scoring mechanism weights and sums the time score and the success rate score according to the preset weight (for example, the time weight is 0.4 and the success rate weight is 0.6, a scheme with a time score of 80 points and a success rate score of 95 points has a comprehensive score of 80x0.4+95x0.6=89 points). Additional correction items (such as the matching degree of tasks and nodes, the influence of abnormal nodes, etc.) are also included in some scenarios, and the final score reflecting the comprehensive performance of the scheme is obtained, providing a direct basis for subsequent optimal scheme selection.
[0091] S600, determining the task execution scheme with the highest scheme score among all the task execution schemes as the final scheme.
[0092] Specifically, the scheme scores of all task execution schemes in the scheme list are sorted, and the task execution scheme with the highest score is selected as the final scheme, ensuring that the final selected task execution scheme is optimal under the current decision context (such as task characteristics, node status, environmental constraints, etc.), which can meet the time efficiency requirements as much as possible, guarantee a high success probability, and balance the matching degree of tasks and nodes and other influencing factors, thereby providing decision support for efficient and stable execution of asynchronous tasks.
[0093] In this embodiment, the current task features and the work node features are extracted based on the decision context of the asynchronous task control system, providing comprehensive and practical basic data for subsequent decision-making, avoiding blind allocation due to information loss or deviation from the actual state, thereby reducing the problems of execution jam, delay and other problems that may occur due to resource mismatch or poor node state, and laying a foundation for efficient execution. Through the trained task allocation model to generate a scheme list, relying on the model to learn the historical scheduling rules, multiple task-node combination schemes with higher adaptability can be quickly screened out, which can accurately capture the efficient and stable matching rules of tasks and nodes, and compared with artificial or simple rule allocation, a scheme with higher efficiency potential can be generated, avoiding inefficient combinations to occupy resources and improving the overall efficiency baseline of the scheme. Based on the key task execution path, the total execution time of the scheme is calculated, the success rate of the scheme is determined in combination with the task execution result distribution, and then the performance of the scheme is quantified through a comprehensive scoring mechanism, which can accurately focus on the efficiency core. The time consumption of the key path directly determines the lower limit of the completion of the overall task, and the total execution time is calculated based on it, so that schemes that can shorten the overall time consumption can be preferentially screened out; and the scoring logic combined with the success rate can also avoid selecting schemes with high failure risk (retrying after failure will increase the total time consumption) simply for speed, ensuring that the scheme is both fast and stable, reducing the time waste caused by retries. Finally, the scheme with the highest score is selected as the final scheme, which is equivalent to further locking the optimal solution among multiple potential efficient schemes. The final scheme not only has an advantage in total execution time (can shorten the overall time consumption of the task), but also can reduce the probability of execution exceptions through reasonable task-node matching (reduce unnecessary time loss), and finally realize the optimal configuration of asynchronous tasks in resource utilization and execution rhythm, effectively improving the execution efficiency.
[0094] Optionally, the total execution time of the corresponding scheme is obtained according to the task execution scheme, comprising:
[0095] Obtaining the historical execution records and historical work node features corresponding to the tasks in the task execution scheme, and the current work node features of the tasks;
[0096] According to the historical execution records and the corresponding historical work node features, the average execution time of the task is determined through a preset mean relationship;
[0097] According to the average execution time, the predicted execution time of the task is determined through a preset correction relationship;
[0098] The predicted execution time is calibrated through the current work node features corresponding to the task to obtain the corresponding actual execution time;
[0099] The actual execution time corresponding to all the tasks in the task execution scheme is summed to obtain the total execution time of the scheme.
[0100] Specifically, the historical execution records (such as the execution time length on different nodes, success / failure status) of each task in the task execution scheme, the historical working node features (such as the node load at that time, the hardware state), and the real-time features (such as the current CPU usage, memory occupation, network bandwidth, etc.) of the current allocation node of the task can be obtained from the decision context of the system. Then, based on the historical execution records of the task and the corresponding historical working node features, the average execution time of the task is calculated through a preset mean relationship. According to the average execution time of the task, the predicted execution time corresponding to the task is calculated through a correction relationship. In order to better fit the actual execution rule of the task, the predicted execution time can be further calibrated through the real-time features of the current working node to obtain the actual execution time of the task and the actual working node pi. Finally, the total execution time of the scheme is obtained by summing up the actual execution time of all tasks in the task execution scheme.
[0101] In this optional embodiment, based on the historical execution records of the task and the corresponding historical working node features, the average execution time is determined through a preset mean relationship, which avoids subjective estimation errors that are divorced from actual data; then the predicted execution time is obtained by adjusting the average execution time through a preset correction relationship, which can optimize time estimation by combining task characteristics and dynamic factors; then the predicted execution time is calibrated according to the current working node features, which can eliminate the calculation deviation caused by the real-time state change of the node; finally, the total execution time is obtained by accumulating the actual execution time of all tasks, which provides a reliable time dimension basis for subsequent comprehensive evaluation and optimal selection of the scheme, effectively avoids the selection of inefficient schemes due to inaccurate time calculation, and thus ensures the efficiency and stability of asynchronous task execution.
[0102] Optionally, the average execution time of the task is determined according to the historical execution records and the corresponding historical working node features through a preset mean relationship, which includes:
[0103] According to the historical execution records, the historical execution time corresponding to each task execution history and the time interval from the current time are determined, and according to the historical working node features, the historical CPU usage, historical memory usage, and historical network delay corresponding to the task execution history are determined. The historical execution records include multiple task execution histories of the task;
[0104] According to the time interval and a preset decay relationship, a time decay factor corresponding to the task execution history is obtained;
[0105] According to the historical CPU usage, the historical memory usage, and the historical network delay, a node compensation coefficient corresponding to the task execution history is obtained through a preset compensation relationship.
[0106] According to the historical execution time corresponding to each execution history of the task, the time decay factor and the node compensation coefficient, the average execution time corresponding to the task is determined through the mean relationship.
[0107] Specifically, from the historical execution record of the task, the historical execution time corresponding to each execution history of the task (the actual time length consumed by this execution) and the time interval between this execution and the current time (reflecting the new and old degree of historical data) are extracted; at the same time, from the historical working node characteristics, the historical CPU usage, the historical memory usage and the historical network delay of the node at this execution (the three indexes reflect the load and performance state of the node at that time) are extracted, and then the time decay factor is calculated through the preset decay relationship. The longer the time interval of a certain execution history from the current time (i.e. the older the data), the smaller the value of the time decay factor (because the absolute value of the negative parameter in the exponential function is larger, the result is closer to 0), which means that the weight of the historical execution time in the subsequent mean calculation will be reduced; on the contrary, the time decay factor of the recent data is closer to 1, and the weight is higher.
[0108] Exemplarily, the decay relationship satisfies:
[0109] d i =exp(-α×∆c i );
[0110] Wherein, when the decay coefficient α=0.1, the time interval Δc i of the i-th execution history of the task from the current time is 10 (interval 10 unit time), then the time decay factor di of the i-th execution history of the task is exp (-0.1×10)=exp (-1)≈0.368, and when Δc i =2 (interval 2 unit time), di=exp (-0.1×2)≈0.819, the latter has a higher weight due to data update, avoiding the interference of old data (which may be invalid due to changes in node performance, task logic iteration, etc.) on the average time.
[0111] Exemplarily, the compensation relationship satisfies:
[0112] e i =βf i +γg i +δh i ;
[0113] Wherein, f i is the historical CPU usage corresponding to the i-th execution history of the task, g i is the historical memory usage corresponding to the i-th execution history of the task, and h iThe historical network latency (typically normalized to the range of 0 to 1) corresponds to the execution history of the i-th task, γ is the memory coefficient, β is the CPU coefficient, and δ is the historical network latency coefficient (set according to the resource sensitivity of the task; for example, the δ value is higher for IO-intensive tasks). The node compensation coefficient e corresponding to the execution history of the i-th task. i Its purpose is to quantify the impact of node status on execution time: if the node CPU utilization f during a certain execution... i High network latency h i (large), then e i A larger value indicates that the execution was affected by node load, and the execution time may be longer (this needs to be considered in conjunction with subsequent average calculation logic). This can be addressed later via e. i For t i Perform state adjustments. For example, for a computationally intensive task with β=0.6, γ=0.3, and δ=0.1, the state f of a certain execution... i =0.8, g i =0.5, h i =0.2, and substituting the above value into the formula for the compensation relationship, the node compensation coefficient is calculated to be 0.65.
[0114] For example, the mean relationship satisfies:
[0115] ;
[0116] Where A is the average execution time of the task, and t i d represents the historical execution time corresponding to the i-th task execution history. i e is the time decay factor corresponding to the i-th task execution history. i The compensation coefficient for the node corresponding to the i-th task execution history. The average execution time A is the sum of the execution times t for each historical execution. i After performing dynamic weighted summation and averaging: For each t... i Multiply by its corresponding time decay factor d i (The impact of correcting for old and new data) and node compensation coefficient e i (The effect of correcting node states), then sum all the products, and finally divide by the total decay factor d. iFor example, the number of execution history of a certain task n = 2 execution history: the first time t1 = 100s, d1 = 0.819 (interval close), e1 = 0.65 (node load medium); the second time t2 = 120s, d2 = 0.368 (interval far), e2 = 0.9 (node load high), the above values are brought into the formula of the average relationship to obtain the average execution time A about 77.16s (only for example, the actual calculation needs to be carried out according to the specific historical execution data of the task). Through the calculation of the average execution time of the task, the excessive influence of the old data is eliminated, and the deviation of the historical execution time caused by the abnormal node state is corrected, and finally the average execution time obtained is closer to the actual average time consumption of the task, which provides a reliable reference value for subsequent prediction of execution time.
[0117] Exemplarily, the correction relationship satisfies:
[0118] r = (ln (1 + A)) x e;
[0119] Wherein, r is the predicted execution time, A is the average execution time of the task, ln is the natural logarithm function, and e is the correction coefficient. The correction coefficient e provides a flexible scene adaptation space for the predicted execution time. In practice, task execution may be affected by different scene factors (such as task priority adjustment, system overall load strategy change, etc.), e can be dynamically set according to these actual scenes (for example, when the system needs to prioritize time consumption and requires more conservative prediction, e can be set to a value slightly greater than 1; when the basic time consumption needs to be quickly estimated, e can be set to a benchmark value close to 1), by manually or automatically adjusting e, the predicted execution time can be out of the limitation of relying on historical data alone, and better adapt to the actual needs.
[0120] Optionally, the actual execution time corresponding to the predicted execution time is calibrated by the current working node characteristics corresponding to the task, comprising:
[0121] According to the current working node characteristics, the current CPU usage, the current memory usage and the current network delay corresponding to the task are determined;
[0122] The current CPU usage, the current memory usage and the current network delay are respectively multiplied by the corresponding preset coefficient to obtain the current calibration coefficient;
[0123] The product of the current calibration coefficient and the predicted execution time is determined as the actual execution time of the task.
[0124] In this optional embodiment, real-time indicators directly related to the time consumption of task execution are extracted from the current working node characteristics, i.e. the current CPU usage (reflecting the real-time load of the node CPU), the current memory usage (reflecting the occupancy of the node memory) and the current network delay (reflecting the real-time efficiency of the node network data transmission). These indicators can intuitively reflect the current busy degree of the node. For example, the higher the CPU usage, the more tasks the node processor is processing, and the time consumption of new tasks may increase due to resource competition; the larger the network delay, the longer the data transmission time consumption for IO-intensive tasks. Based on these three real-time indicators, the current calibration coefficient is calculated: first, set a corresponding preset coefficient for each indicator (the coefficient size is determined by the sensitivity of the task to the resource, for example, a calculation-intensive task depends more on CPU, and the corresponding preset coefficient can be set to a larger value, such as 0.6; while an IO-intensive task needs to increase the preset coefficient of network delay, such as 0.5), then multiply the current CPU usage, the current memory usage and the current network delay by the respective preset coefficients, and finally sum the three products to obtain the current calibration coefficient. For example, a task is calculation-intensive, the CPU preset coefficient β' = 0.6, the memory preset coefficient γ' = 0.2, and the network delay preset coefficient δ' = 0.2; if the current node CPU usage is 80% (i.e. 0.8), the memory usage is 60% (i.e. 0.6), and the network delay is 0.3, then the current calibration coefficient is 0.8x0.6+0.6x0.2+0.3x0.2=0.48+0.12+0.06=0.66. The calibration coefficient is a quantification of the degree to which the current state of the node affects the time consumption of the task, the larger the coefficient, the more significant the adverse effect of the current state of the node on the time consumption of the task (or the beneficial effect, which needs to be combined with the coefficient design logic, generally the higher the load, the larger the coefficient, which corresponds to the upward correction of the time consumption). Finally, the current calibration coefficient is multiplied by the predicted execution time to obtain the actual execution time of the task. Through the quantification coefficient of the real-time state of the node, the predicted execution time is adjusted from the theoretical value based on the history to the real time consumption that fits the actual load of the current node, avoiding the time measurement deviation caused by the change of the node state (such as from low load to high load). By extracting real-time resource indicators of the node, quantifying the state influence and correcting the predicted time, the final actual execution time can accurately reflect the real time consumption potential of the task on the current node, providing more reliable single-task time consumption data for the calculation of the total execution time of the subsequent scheme, and making the scheme evaluation more in line with the actual execution scenario.
[0125] Optionally, the corresponding scheme success rate is obtained according to the task execution result distribution of the task execution scheme, comprising:
[0126] obtaining the failure interval sequence of the task and the current execution number;
[0127] determining a corresponding failure parameter according to the maximum failure interval number and the minimum failure interval number in the failure interval sequence and a preset failure relationship;
[0128] summing all failure interval numbers in the failure interval sequence and dividing the sum by the failure number to obtain an average failure interval number;
[0129] determining a task success rate of the task according to the current execution number, the failure parameter and the average failure interval number and a preset success rate relationship;
[0130] determining a minimum task success rate in the task execution scheme as the scheme success rate.
[0131] Optionally, the failure relationship satisfies:
[0132]
[0133] the success rate relationship satisfies:
[0134] ;
[0135] wherein k is the failure parameter, p max is the maximum failure interval number, p min is the minimum failure interval number, s is the task success rate, p avg is the average failure interval number, and q is the current execution number.
[0136] In this optional embodiment, a failure interval sequence and a current execution number of a task are obtained. The failure interval sequence refers to a sequence of execution interval numbers between failures of the task, for example, the task fails at the third execution, fails again at the eighth execution, and fails again at the fifteenth execution, so the failure interval sequence is [5, 7] (5 execution intervals between the third and eighth executions, 7 execution intervals between the eighth and fifteenth executions); the current execution number refers to the total number of executions of the task up to the present (including the current execution number), which is used to determine the possibility of task failure in the current execution stage in combination with historical rules.
[0137] Further, the maximum failure interval number and the minimum failure interval number are extracted from the failure interval sequence, and the two values reflect the fluctuation range of the task failure interval. The larger the interval fluctuation, the weaker the regularity of task failure. Then, the maximum failure interval number and the minimum failure interval number are brought into the preset failure relationship formula to obtain the corresponding failure parameter, which converts the interval fluctuation characteristics into a quantitative index that can participate in the success rate calculation. The larger the failure parameter, the higher the uncertainty of task failure. At the same time, the sum of all interval numbers in the failure interval sequence is divided by the number of failures (i.e. the number of failure intervals in the sequence). For example, in the sequence [5, 7], the total sum is 12, and the number of failures is 2, so the average failure interval number is 6, which reflects the average number of task executions that will result in a failure. The larger the average interval, the lower the overall failure frequency of the task. Then, the current execution number, the failure parameter and the average failure interval number are combined to determine the task success rate through the preset success rate relationship. This relationship needs to consider three aspects: whether the current execution number is close to the average failure interval (for example, if the average interval is 6 and the current execution is the 5th, the success rate may be slightly low); the uncertainty brought by the failure parameter (when the failure parameter is large, the dependence on the “average interval” needs to be reduced, and the success rate needs to be appropriately adjusted); and the possible historical trend (such as whether the failure interval gradually increases with the number of executions). Finally, since the task execution plan needs to rely on the successful execution of all tasks (or the successful execution of key tasks), the overall reliability of the plan is affected by the weakest link, so the smallest task success rate in the plan is taken as the plan success rate. For example, a plan contains three tasks with success rates of 90%, 82% and 88%, respectively. The plan success rate is 82%, which intuitively reflects the minimum reliability of the plan execution and provides a key basis for plan risk assessment and resource adjustment (such as prioritizing low success rate tasks for optimization). Starting from the historical failure regularity of the task, the interval characteristics are quantified, and the current execution state is combined to gradually derive the single task success rate, and finally the minimum success rate is used to anchor the plan reliability, which not only accurately utilizes historical data, but also takes into account the uncertainty in execution, and can provide scientific support for risk prediction and optimization of task execution plans.
[0138] Optionally, the scheme score corresponding to the task execution scheme is determined by a comprehensive scoring mechanism according to the scheme total execution time and the scheme success rate corresponding to the task execution scheme, comprising:
[0139] Obtaining the scheme work node characteristics of the task execution scheme;
[0140] Obtaining an abnormal node feature vector according to the scheme work node characteristics through a multi-dimensional abnormal waveform feature extraction algorithm;
[0141] According to the total execution time, the success rate and the abnormal node feature vector of the task execution scheme, a preset scoring relationship is used to determine a scheme score.
[0142] Optionally, the scoring relationship satisfies:
[0143] ;
[0144] wherein Q is the scheme score, T is the total execution time, T b is a reference time, μ is a time penalty coefficient, ρ is a success reward coefficient, Y is the success rate, ω is an abnormal penalty coefficient, is the abnormal node feature vector, |||2 is a Euclidean norm, θ is a resonance reward coefficient, and Z is a resonance coefficient.
[0145] In this optional embodiment, the feature data of all the work nodes involved in the task execution scheme, i.e., the scheme work node features, are obtained. These features include the static attributes (such as hardware configuration, belonging cluster) and dynamic states (such as real-time CPU usage, memory occupation fluctuation, network delay change, historical fault frequency, etc.) of the nodes, which together constitute the basic information for evaluating the running state of the nodes. Then, a multi-dimensional abnormal waveform feature extraction algorithm is used to deeply analyze these node features to generate an abnormal node feature vector. This algorithm can capture abnormal patterns of the nodes from multiple dimensions such as time, space and frequency: for example, by analyzing the waveform change of CPU usage, it can identify abnormal waveforms such as sudden spikes and continuous high-load oscillations; by analyzing the trend of memory occupation, it can capture implicit abnormalities such as leakage growth; and by combining the collaborative state between nodes, it can identify associated abnormalities such as chain fluctuations triggered by single-point abnormalities. These abnormal features will be quantified as specific numerical values in the vector (such as abnormal duration, fluctuation amplitude, impact range, etc.) to form a multi-dimensional abnormal risk index. The greater the length of the vector, the higher the overall abnormal risk of the nodes in the scheme.
[0146] Exemplarily, the 5-dimensional abnormal node feature vector obtained by the multi-dimensional abnormal waveform feature extraction algorithm specifically includes the following contents: low-frequency energy, the energy of the 0 to 10 frequency band is extracted after 3-layer decomposition by db4 wavelet, reflecting the low-frequency trend feature of the abnormal rate sequence; medium-frequency energy, corresponding to the energy of the 11 to 30 frequency band, embodying the medium-frequency period feature of the abnormal rate sequence; high-frequency energy, corresponding to the energy of the 31 to 50 frequency band, reflecting the high-frequency noise feature of the abnormal rate sequence; Hurst index, used to quantify the long correlation of the abnormal rate sequence, embodying the persistence feature of the abnormal mode; singular value decomposition (SVD) entropy, calculated by singular value decomposition after phase space reconstruction, measuring the nonlinear complexity of the abnormal rate sequence. The abnormal node feature vector composed of the 5 dimensions is used as the input of the abnormal penalty term in the multi-objective score calculation, quantifying the influence of the node abnormality on the task execution.
[0147] Finally, according to the total execution time, the scheme success rate and the abnormal node feature vector of the task execution scheme, the scheme score is calculated through the preset scoring relationship. The scheme score not only embodies the core values of execution efficiency (total execution time) and reliability (success rate), but also takes into account the potential influence of node abnormal risk, realizes the comprehensive quantitative evaluation of the scheme performance, and provides a scientific basis for subsequent selection of the optimal scheme.
[0148] As shown in Figure 2 The embodiment of the present application provides an asynchronous task control device 200, which comprises:
[0149] The extraction module 210 is configured to extract the current task feature and the current working node feature according to the decision context of the acquired asynchronous task control system.
[0150] The prediction module 220 is configured to obtain a scheme list by using a trained task allocation model according to the current task feature and the current working node feature, wherein the scheme list comprises a plurality of task execution schemes.
[0151] The first processing module 230 is configured to obtain a corresponding scheme total execution time according to the task execution scheme.
[0152] The second processing module 240 is configured to obtain a corresponding scheme success rate according to the task execution result distribution of the task execution scheme.
[0153] The scoring module 250 is configured to determine a corresponding scheme score by using a comprehensive scoring mechanism according to the scheme total execution time and the scheme success rate corresponding to the task execution scheme.
[0154] The comparison module 260 is configured to determine the task execution scheme with the highest scheme score among all the task execution schemes as the final scheme.
[0155] The asynchronous task control device of the embodiment is used to implement the asynchronous task control method as described above, and has the same advantages as the asynchronous task control method as described above compared with the prior art, which will not be repeated here.
[0156] As shown in Figure 3 The electronic device 300 provided by the embodiment of the application includes a memory 310 and a processor 320; the memory 310 is configured to store a computer program; and the processor 320 is configured to implement the asynchronous task control method as described above when executing the computer program.
[0157] Alternatively, the electronic device 300 includes a memory 310 and a processor 320 coupled to the memory 310; the memory 310 is configured to store a computer program; and the processor 320 is configured to perform the following operations when executing the computer program:
[0158] According to the obtained decision context of the asynchronous task control system, the current task features and the current worker node features are extracted;
[0159] According to the current task features and the current worker node features, a scheme list is obtained through a trained task allocation model, and the scheme list includes a plurality of task execution schemes;
[0160] According to the task execution scheme, a corresponding total execution time of the scheme is obtained;
[0161] According to the task execution result distribution of the task execution scheme, a corresponding success rate of the scheme is obtained;
[0162] According to the total execution time of the scheme and the success rate of the scheme corresponding to the task execution scheme, a corresponding scheme score is determined through a comprehensive scoring mechanism;
[0163] The task execution scheme with the highest scheme score among all the task execution schemes is determined as the final scheme.
[0164] The computer readable storage medium provided by the embodiment of the application has a computer program stored thereon, and when the computer program is executed by a processor, the asynchronous task control method as described above is implemented.
[0165] Alternatively, a non-volatile computer readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the processor performs the following operations:
[0166] According to the obtained asynchronous task control system decision context, current task features and current worker node features are extracted;
[0167] According to the current task features and the current worker node features, a scheme list is obtained through a trained task allocation model, and the scheme list includes multiple task execution schemes;
[0168] According to the task execution scheme, a corresponding scheme total execution time is obtained;
[0169] According to a task execution result distribution of the task execution scheme, a corresponding scheme success rate is obtained;
[0170] According to the scheme total execution time and the scheme success rate corresponding to the task execution scheme, a corresponding scheme score is determined through a comprehensive scoring mechanism;
[0171] The task execution scheme with the highest scheme score among all the task execution schemes is determined as a final scheme.
[0172] An electronic device 300 that can be a server or a client of the present application will now be described, which is an example of a hardware device that can be applied to aspects of the present application. The electronic device 300 is intended to represent various forms of digital electronic computer devices such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computer devices. The electronic device 300 can also represent various forms of mobile devices such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.
[0173] The electronic device 300 includes a computing unit that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) or a computer program loaded into a random access memory (RAM) from a storage unit. In the RAM, various programs and data required for device operation can also be stored. The computing unit, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.
[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, the program can include the processes of the above-mentioned embodiment methods. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM), a random access memory (RAM), or the like. In this application, the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present application. In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically independently, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0175] Although the present application is disclosed as above, the protection scope of the present application is not limited to this. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, and these changes and modifications will fall within the protection scope of the present application.
Claims
1. An asynchronous task control method, characterized in that, The asynchronous task control method includes: Extract the current task features and current working node features based on the obtained decision context of the asynchronous task control system; Based on the current task characteristics and the current working node characteristics, a solution list is obtained through a trained task allocation model, and the solution list includes multiple task execution solutions. The total execution time of the corresponding plan is obtained based on the task execution plan; The success rate of the corresponding scheme is obtained based on the distribution of task execution results of the aforementioned task execution scheme. Based on the total execution time and success rate of the task execution plan, the corresponding plan score is determined through a comprehensive scoring mechanism. The task execution plan with the highest score among all the aforementioned task execution plans is determined as the final plan; The step of obtaining the total execution time of the corresponding plan based on the task execution plan includes: Obtain the historical execution records and historical working node characteristics corresponding to the tasks in the task execution plan, as well as the current working node characteristics of the tasks; Based on the historical execution records and the corresponding historical work node characteristics, the average execution time of the task is determined through a preset mean relationship; The predicted execution time of the task is determined based on the average execution time using a preset correction relationship; The predicted execution time is calibrated using the features of the current working node corresponding to the task to obtain the corresponding actual execution time; The total execution time of the plan is obtained by summing the actual execution times of all the tasks in the task execution plan. The step of determining the average execution time of the task based on the historical execution records and the corresponding historical work node characteristics through a preset mean relationship includes: The historical execution time and the time interval between each task execution history are determined based on the historical execution records, and the historical CPU utilization, historical memory utilization, and historical network latency corresponding to the task execution history are determined based on the historical worker node characteristics; the historical execution records include multiple task execution histories of the task. Based on the time interval and the preset decay relationship, the time decay factor corresponding to the task execution history is obtained; Based on the historical CPU utilization, the historical memory utilization, and the historical network latency, the node compensation coefficient corresponding to the task execution history is obtained through a preset compensation relationship; Based on the historical execution time, time decay factor, and node compensation coefficient corresponding to all the task execution histories, the average execution time corresponding to the task is determined through the mean relationship. The mean relationship satisfies: ; Where A is the average execution time of the task, and t i d represents the historical execution time corresponding to the i-th task execution history. i e is the time decay factor corresponding to the i-th task execution history. i is the node compensation coefficient corresponding to the i-th task execution history, and n is the number of task execution histories.
2. The asynchronous task control method according to claim 1, characterized in that, The attenuation relationship satisfies: d i =exp(-α×∆c i ); The compensation relationship satisfies: e i =βf i +γg i +δh i ; Where, d i e is the time decay factor corresponding to the i-th task execution history. i Here, α is the node compensation coefficient corresponding to the i-th task execution history, n is the number of task execution histories, α is the attenuation coefficient, and ∆c is the compensation coefficient for the node. i The time interval between the execution history of the i-th task and the current time, where exp is an exponential function, β is the CPU coefficient, and f i The historical CPU utilization rate corresponding to the i-th task execution history, γ is the memory coefficient, and g i The historical memory usage rate corresponding to the i-th task execution history, δ, the historical network latency coefficient, and h i The historical network latency corresponding to the execution history of the i-th task.
3. The asynchronous task control method according to claim 1, characterized in that, The correction relation satisfies: r = (ln(1+A)) × ε; Where r is the predicted execution time, A is the average execution time of the task, ε is the correction coefficient, and ln is the natural logarithm function.
4. The asynchronous task control method according to claim 1, characterized in that, The step of calibrating the predicted execution time using the features of the current working node corresponding to the task to obtain the corresponding actual execution time includes: Based on the characteristics of the current working node, determine the current CPU utilization, current memory utilization, and current network latency corresponding to the task; The current calibration coefficient is obtained by summing the products of the current CPU utilization, the current memory utilization, and the current network latency with their respective preset coefficients. The product of the current calibration coefficient and the predicted execution time is determined as the actual execution time of the task.
5. The asynchronous task control method according to claim 1, characterized in that, The step of obtaining the corresponding success rate of the task execution plan based on the distribution of task execution results includes: Obtain the failure interval sequence and the current execution count of the task; Based on the maximum and minimum failure interval counts in the failure interval sequence, the corresponding failure parameters are determined through a preset failure relationship; The average failure interval is obtained by summing all the failure interval counts in the failure interval sequence and dividing by the number of failures. The task success rate is determined based on the current number of executions, the failure parameters, and the average failure interval, using a preset success rate relationship. The minimum task success rate in the task execution plan is determined as the success rate of the plan.
6. The asynchronous task control method according to claim 5, characterized in that, The failure relation satisfies: ; The success rate relationship satisfies: ; Where k is the failure parameter, p max p is the maximum number of failure intervals. min Let s be the minimum failure interval, s be the task success rate, and p be the number of failures. avg q represents the average failure interval, and q represents the current execution count.
7. The asynchronous task control method according to claim 1, characterized in that, The step of determining the corresponding scheme score through a comprehensive scoring mechanism based on the total execution time and success rate of the task execution scheme includes: Obtain the working node characteristics of the task execution plan; Based on the working node characteristics of the aforementioned scheme, an abnormal node feature vector is obtained through a multi-dimensional abnormal waveform feature extraction algorithm. The score of the task execution plan is determined by a preset scoring relationship based on the total execution time of the plan, the success rate of the plan, and the feature vector of the abnormal node.
8. The asynchronous task control method according to claim 7, characterized in that, The scoring relationship satisfies: ; Where Q is the score of the solution, and T is the total execution time of the solution. b Let μ be the base time, μ be the time penalty coefficient, ρ be the success reward coefficient, Y be the success rate of the proposed scheme, and ω be the anomaly penalty coefficient. Let ||||2 be the Euclidean norm, θ be the resonance reward coefficient, and Z be the resonance coefficient.
Citation Information
Patent Citations
Multi-queue and multi-cluster task scheduling method and system
CN111831415A
Job scheduling method and device, equipment and storage medium
CN115829263A