Adaptive task scheduling methods, apparatuses, devices, media, and program products
By acquiring multi-dimensional operational status data and resource prediction models of computing nodes, and dynamically matching task and node resource requirements, the problem of unreasonable task scheduling in existing technologies is solved, and efficient resource utilization and system load balancing are achieved.
Patent Information
- Application Number
- CN202611445641.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-17
- Publication Date
- 2026-11-17
AI Technical Summary
Existing distributed task scheduling systems fail to effectively consider the resource requirements of tasks when making scheduling decisions. This results in large tasks being assigned to nodes with insufficient resources, leading to execution timeouts or failures, while small tasks are assigned to nodes with abundant resources, resulting in a waste of computing resources and making it difficult to achieve fine-grained scheduling.
By acquiring multi-dimensional operational status metrics of computing nodes, and combining them with weight allocation algorithms and resource prediction models, the resource requirements and load information of tasks and nodes are dynamically matched to select the most suitable execution node and record the actual execution results to optimize scheduling decisions.
It achieves a reasonable match between task and node resource configuration, reduces task execution timeouts and resource waste, reduces system load imbalance and operation and maintenance pressure, and improves the adaptability and reliability of the scheduling system.
Smart Images

Figure CN123114690A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and more specifically to an adaptive scheduling method, apparatus, device, medium, and program product. Background Technology
[0002] Existing distributed task scheduling systems (such as round-robin, random selection, or simple judgment based on instantaneous load) typically only consider the static attributes of nodes or the current load status when making scheduling decisions, without taking into account the resource requirements of the tasks to be scheduled.
[0003] There is a possibility that large tasks may be assigned to nodes with insufficient resources, causing task execution timeouts or even failures, while small tasks may be assigned to large nodes with abundant resources, resulting in a waste of computing resources, making it difficult to achieve fine-grained scheduling. Summary of the Invention
[0004] In view of the above problems, this application provides an adaptive task scheduling method, apparatus, device, medium and program product.
[0005] According to the first aspect of this application, an adaptive task scheduling method is provided, comprising: acquiring multi-dimensional operational status index data reported by each computing node at a dynamic acquisition frequency; normalizing the acquired multi-dimensional operational status index data of each computing node, and determining the node load information corresponding to each computing node by combining a preset weight allocation algorithm, wherein the node load information is used to characterize the comprehensive carrying capacity of the computing node at the current moment; in response to the arrival of a task to be scheduled, predicting the scale of resources required for the task to be scheduled during execution and the expected execution duration based on a resource prediction model, and generating resource requirement information for the task to be scheduled; matching the resource requirement information of the task to be scheduled with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled; distributing the task to be scheduled to the target execution node for execution, and recording the actual execution results.
[0006] According to an embodiment of this application, the node load information corresponding to each computing node is determined by combining a preset weight allocation algorithm, including: for each computing node, determining the weight coefficient of each dimension indicator in the computing node at the current moment based on the contribution of each dimension indicator of the computing node to the task execution success rate in the historical scheduling record, wherein the weight coefficient is periodically updated as the historical scheduling of the computing node accumulates; and weighting and fusing the normalized dimension indicators with the corresponding weight coefficients to determine the node load information of the computing node at the current moment.
[0007] According to an embodiment of this application, the resource requirement information of the task to be scheduled is matched with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled. This includes: calculating the node adaptability of each computing node based on the current scheduling mode, the resource requirement information of the task to be scheduled, and the node load information of each computing node; the node adaptability is a quantitative indicator used to evaluate the comprehensive adaptability of candidate computing nodes to execute the task to be scheduled, and the calculation basis of the node adaptability is different under different scheduling modes; based on the load balancing constraint, the computing node with the highest node adaptability is selected as the target execution node and a scheduling decision log is generated.
[0008] According to embodiments of this application, the scheduling modes include a balanced priority mode, a matching priority mode, and a stable preference mode. Based on the current scheduling mode, the resource requirements of the task to be scheduled, and the node load information of each computing node, the node fit of each computing node is calculated, including: calculating the basic fit of each candidate computing node based on the resource requirements of the task to be scheduled and the remaining computing capacity of each candidate computing node; the basic fit is the degree of matching between the resource requirements of the task to be scheduled and the remaining computing capacity of the candidate computing nodes; and correcting the basic fit according to the current scheduling mode to obtain the node fit of each candidate computing node. Specifically, in the matching priority mode, the basic fit is used as the node fit; in the balanced priority mode, a first correction coefficient is applied to the basic fit based on the deviation between the current load of each candidate computing node and the global average load, the value of the first correction coefficient being proportional to the deviation; and in the stable preference mode, a second correction coefficient is applied to the basic fit based on the combined execution success rate of the task to be scheduled and each candidate computing node in historical scheduling records, the value of the second correction coefficient being proportional to the success rate.
[0009] According to an embodiment of this application, after acquiring the multi-dimensional operating status index data reported by each computing node at a dynamic acquisition frequency, the method further includes: for each computing node, acquiring the temporal change trend of each dimension index of the computing node within a preset time window, and obtaining the change rate of each dimension index; when the change slope of at least one dimension index of any computing node exceeds the alarm threshold corresponding to that dimension and the node load information is lower than a preset first threshold, marking the computing node as a first node to be predicted; when determining the node adaptability of the first node, applying an attenuation factor to the first node to reduce the probability of the first node being selected.
[0010] According to an embodiment of this application, resource requirement information for a scheduled task is generated based on a resource prediction model to predict the resource consumption and expected execution duration of the task to be scheduled during execution. This includes: in response to the arrival of the task, obtaining the task's attribute information and historical execution records; the attribute information including at least task type, data size, and input parameter distribution; and the historical execution records including at least the actual resource consumption sequence and actual execution duration sequence of the task in each historical execution round; inputting the attribute information and historical execution records into the resource prediction model to obtain the resource consumption peak range and expected execution duration probability distribution output by the resource prediction model; and generating resource requirement information for the task to be scheduled based on the output of the resource prediction model.
[0011] According to an embodiment of this application, the method further includes: extracting new training samples from the historical execution database at a preset period, merging the new samples with the historical training samples, fine-tuning the training with the model parameters of the current deployment version as the initial parameters, and obtaining a candidate model; using a validation set to validate and evaluate the candidate model, and when the prediction error of the candidate model is lower than that of the current deployment version, determining the candidate model deployment as the new current deployment version.
[0012] According to embodiments of this application, the method further includes: determining the co-occurrence confidence of task pairs arriving successively within a preset sliding time window based on historical scheduling records; when the co-occurrence confidence exceeds a preset threshold, marking the corresponding task pair as a strongly related task pair; in response to the scheduling of the first-arriving task in the strongly related task pair, selecting the node with the highest matching degree from the same rack node set of the target execution node of the first-arriving task as a pre-deployment candidate node based on the resource requirement information of the later-arriving task in the strongly related task pair; when the later-arriving task actually arrives within a preset timeout window, directly scheduling it to the pre-deployment candidate node for execution; when the later-arriving task does not arrive within the preset timeout window, releasing the resource pre-occupancy.
[0013] The second aspect of this application provides an adaptive task scheduling device, comprising: an acquisition module for acquiring multi-dimensional operational status index data reported by each computing node at a dynamic acquisition frequency; a first determination module for normalizing the acquired multi-dimensional operational status index data of each computing node and determining the node load information corresponding to each computing node in combination with a preset weight allocation algorithm, wherein the node load information is used to characterize the comprehensive carrying capacity of the computing node at the current moment; a prediction module for predicting the resource scale and expected execution duration required by the task to be scheduled during execution based on a resource prediction model in response to the arrival of the task to be scheduled, thereby generating resource requirement information for the task to be scheduled; a second determination module for matching the resource requirement information of the task to be scheduled with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled; and an execution module for distributing the task to be scheduled to the target execution node for execution and recording the actual execution results.
[0014] A third aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0015] A fourth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0016] The fifth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0017] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 The illustrations depict application scenarios of the adaptive task scheduling method, apparatus, device, medium, and program product according to embodiments of this application.
[0019] Figure 2 A flowchart illustrating an adaptive task scheduling method according to an embodiment of this application is shown schematically.
[0020] Figure 3 This illustration shows a flowchart of determining the node load information corresponding to each computing node according to a preset weight allocation algorithm based on an embodiment of this application.
[0021] Figure 4This illustration shows a flowchart of matching the resource requirement information of the task to be scheduled with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled, according to an embodiment of this application.
[0022] Figure 5 A flowchart illustrating the application of a decay factor based on the rate of change of a computed node index, according to an embodiment of this application, is shown.
[0023] Figure 6 The flowchart illustrates a process for generating resource requirement information for a scheduled task based on a resource prediction model, according to an embodiment of this application, to predict the scale of resources required and the expected execution duration of the task during execution.
[0024] Figure 7 This schematic diagram illustrates a structural block diagram of an adaptive task scheduling apparatus according to an embodiment of the present application;
[0025] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing an adaptive task scheduling method according to an embodiment of this application. Detailed Implementation
[0026] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0027] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0029] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0030] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0031] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with relevant laws, regulations, and standards, and necessary measures have been taken to ensure that they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse.
[0032] In scenarios where personal information is used for automated decision-making, the methods, devices, and systems provided in this application all provide users with corresponding operation entry points for users to choose to agree to or reject the automated decision results; if the user chooses to reject, the process enters the expert decision-making process.
[0033] This application provides an adaptive task scheduling method, comprising: acquiring multi-dimensional operational status index data reported by each computing node at a dynamic acquisition frequency; normalizing the acquired multi-dimensional operational status index data of each computing node, and determining the node load information corresponding to each computing node by combining a preset weight allocation algorithm, wherein the node load information is used to characterize the comprehensive carrying capacity of the computing node at the current moment; in response to the arrival of a task to be scheduled, predicting the scale of resources required for the task to be scheduled and the expected execution duration during the execution process based on a resource prediction model, and generating resource requirement information for the task to be scheduled; matching the resource requirement information of the task to be scheduled with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled; distributing the task to be scheduled to the target execution node for execution, and recording the actual execution results.
[0034] Figure 1 The illustration shows an application scenario diagram of the adaptive task scheduling method, apparatus, device, medium, and program product according to embodiments of this application.
[0035] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0036] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0038] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0039] It should be noted that the adaptive task scheduling method provided in this application embodiment can generally be executed by server 105. Correspondingly, the adaptive task scheduling device provided in this application embodiment can generally be located in server 105. The adaptive task scheduling method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the adaptive task scheduling device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0040] It should be understood that Figure 1The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0041] The following will be based on Figure 1 The described scene, through Figures 2-6 The adaptive task scheduling method of the disclosed embodiments will be described in detail.
[0042] Figure 2 A flowchart illustrating an adaptive task scheduling method according to an embodiment of this application is shown.
[0043] like Figure 2 As shown, the adaptive task scheduling method of this embodiment includes operations S210 to S250.
[0044] During operation of S210, multi-dimensional operational status indicator data reported by each computing node at a dynamic acquisition frequency are obtained.
[0045] In some embodiments, multi-dimensional operational status metrics data for each computing node can be collected at a specific collection frequency, with different collection frequencies corresponding to different computing nodes. For example, the collection frequency can be automatically adjusted based on the average execution duration of historical tasks on each node. For nodes running long-running batch processing tasks, the collection frequency can be automatically reduced to decrease network overhead and storage pressure. For nodes with a large number of short tasks, the collection frequency can be automatically increased to capture rapid changes in load. The multi-dimensional operational status metrics data include at least processor utilization, memory usage, storage I / O latency, and network throughput.
[0046] In operation S220, the multi-dimensional operating status index data of each computing node collected are normalized and combined with the preset weight allocation algorithm to determine the node load information corresponding to each computing node. The node load information is used to characterize the comprehensive carrying capacity of the computing node at the current moment.
[0047] In some embodiments, after receiving the raw indicator data reported by each node, the data is first cleaned and then normalized to map the raw values of different dimensions to a unified numerical range (such as 0 to 1) to eliminate the comparability problem between different units.
[0048] After normalization, each dimension can be weighted and fused according to a preset weighting algorithm. The weight coefficients reflect the importance of different resource types in scheduling decisions. The values of the weight coefficients can be set by operations and maintenance personnel based on business characteristics, or they can be calculated based on historical data analysis of the impact of each dimension on task success rate.
[0049] The normalized multi-dimensional operational status index data is weighted and fused to obtain the node load information corresponding to each computing node. The value of the node load galaxy is used to reflect the comprehensive carrying capacity of the node at the current moment. The lower the value, the more idle the node is, and the higher the value, the more busy the node is.
[0050] In operation S230, in response to the arrival of the task to be scheduled, the resource requirement information of the task to be scheduled is generated based on the resource prediction model to predict the scale of resources required by the task to be scheduled during execution and the expected execution duration.
[0051] In some embodiments, when a new task to be scheduled arrives, attribute information such as task type, data size, and input parameters are extracted from the task description, and the historical execution record database is queried to obtain the historical execution data of the task (such as historical resource consumption and execution time).
[0052] The attribute information and historical records are integrated and input into the resource prediction model. This model can be a supervised learning model (such as XGBoost), which has been trained using historical task data. Each training sample contains the attribute features of the task and the actual resource consumption during execution. Based on the input features (i.e., the integrated attribute information and historical records), the resource prediction model outputs a prediction result (i.e., resource requirement information), which includes the expected resource consumption of the task (such as CPU utilization and memory usage) and the expected execution duration.
[0053] In operation S240, the resource requirement information of the task to be scheduled is matched with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled.
[0054] In some embodiments, for each candidate node, the resource requirements of the task are comprehensively matched with the load information of that node. For example, the matching calculation can be performed from two aspects: the overall carrying capacity of the node and the degree of matching between the task resource requirements and the node's available resource capacity across various dimensions. For instance, the lower the load on the computing node (the more idle it is), and the higher the fit between the remaining resources of the computing node and the task resource requirements, the higher the matching score.
[0055] Sort the nodes by matching score from highest to lowest, and select the node with the highest score as the target execution node.
[0056] In operation S250, the task to be scheduled is distributed to the target execution node for execution, and the actual execution results are recorded.
[0057] In some embodiments, after determining the target execution node, the task to be scheduled and its required input data are packaged into an execution instruction and sent to the node via the network. Upon receiving the instruction, the execution process on the node starts a task container or process, and after execution, returns the execution result. The execution result may include, for example, whether the execution was successful, the actual resource consumption, and the actual execution time. The received execution result is recorded in a historical database for subsequent resource prediction model training and matching strategy optimization. Furthermore, the node's load status cache is updated based on the execution result (the node load naturally decreases after the task is completed), ensuring that the load information used in the next round of scheduling is as close as possible to the actual state.
[0058] This application's embodiments introduce node load information and match tasks based on overall carrying capacity. Tasks are preferentially allocated to nodes with lower current loads, effectively avoiding the imbalance of some nodes being overloaded while others are idle, and reducing the overall load standard deviation. By introducing task resource demand prediction, execution timeouts caused by weak nodes for large tasks or resource waste caused by strong nodes for small tasks can be avoided, making the resource allocation between tasks and nodes more reasonable and reducing task queuing time and execution time. Since the scheduling decision considers both task demand and node load, the probability of node overload is significantly reduced, and the number of system alarms triggered by insufficient node resources is correspondingly reduced, alleviating the operational burden.
[0059] This application embodiment records the actual execution results of each scheduling and uses them for subsequent model training. The scheduling quality of the system continuously improves as the running time increases, and it can adapt to changes in load patterns without manual intervention.
[0060] Figure 3 The flowchart illustrating the process of determining the node load information corresponding to each computing node according to an embodiment of the present application using a preset weight allocation algorithm is shown.
[0061] like Figure 3 As shown, the node load information corresponding to each computing node in this embodiment of the application is determined by combining a preset weight allocation algorithm, including operations S310 to S320.
[0062] In operation S310, for each computing node, the weight coefficient of each dimension indicator in the computing node at the current moment is determined based on the contribution of each dimension indicator to the task execution success rate in the historical scheduling record. The weight coefficient is periodically updated as the historical scheduling of the computing node accumulates.
[0063] In the S320 operation, the normalized indicators of each dimension are weighted and fused with the corresponding weight coefficients to determine the node load information of the computing node at the current moment.
[0064] When the system starts up for the first time, an initial weight coefficient can be set for each computing node. For example, the initial weight coefficient can be set according to the hardware configuration information of each computing node. For computing nodes with more CPU cores and higher clock speeds, a higher CPU weight can be set; for computing nodes with larger memory capacity, a higher memory weight can be set.
[0065] Each time the system completes a task scheduling and execution, it records the relevant information for that scheduling, forming a historical scheduling record. Each historical scheduling record may include at least the following fields: the node identifier of the computing node executing the task; the sampled values of processor utilization, memory usage, storage I / O latency, and network throughput of the computing node during the execution of the task; the execution status identifier of the task, which is used to indicate whether the task was executed successfully or failed; and the timestamp of that scheduling.
[0066] The weight recalculation process can be triggered according to a preset fixed time period (e.g., every 24 hours, during the early morning hours when the system load is low).
[0067] For each computing node, extract its historical scheduling records within the most recent statistical time window. Based on the extracted historical scheduling records, calculate the task success rate for each metric dimension under different load ranges.
[0068] Taking processor utilization as an example, the processor utilization values of the computing node in each historical scheduling record are grouped according to a preset interval division rule (e.g., each interval is 0%-10%, 10%-20%, ..., 90%-100%). For each group, the proportion of successfully executed tasks within that group to the total number of tasks within that group is calculated, thus obtaining the task success rate distribution of the computing node in each load interval of this dimension. Similarly, the same statistical operation is performed on the three dimensions of memory usage, storage I / O latency, and network throughput.
[0069] The contribution score for each dimension is calculated based on the magnitude of the decrease in task success rate as load increases. For example, the task success rate of that dimension across different load ranges can be linearly fitted or statistically analyzed piecewise to calculate the magnitude of the decrease in success rate from low load to high load. The larger the decrease, the more significant the negative impact of increased load on task execution success rate for that dimension.
[0070] The contribution scores of each dimension are normalized to obtain the updated weight coefficients for each dimension.
[0071] Upon receiving multi-dimensional operational status data reported by a computing node, the following real-time calculation steps are performed: The weighting coefficients currently used by the computing node are weighted and fused with the normalized values of each dimension to obtain the node load information. The expression for the node load information can be:
[0072] Node load information = Σ (normalized value of dimension i × weight coefficient of dimension i)
[0073] The numerical range of node load information is [0, 1]. The higher the value, the higher the overall resource consumption and the weaker the carrying capacity of the computing node at the current moment.
[0074] In some embodiments, after each weight recalculation, the difference measure between the updated weight coefficient and the current weight coefficient is calculated (e.g., the Euclidean distance or the sum of the absolute values of the differences between the weights of each dimension is calculated); when the difference measure exceeds a preset update threshold, the current weight coefficient is replaced with the updated weight coefficient; when the difference measure does not exceed the update threshold, the current weight coefficient remains unchanged.
[0075] This application embodiment calculates weight coefficients independently for each computing node, ensuring that the weights of each dimension of the node load information match the actual hardware configuration and operating characteristics of that node. This avoids the problem of distorted load information for some nodes caused by using uniform fixed weights on all nodes. Since the performance of the same node may change at different times, this solution periodically recalculates the weight coefficients, allowing them to automatically adjust to performance drift caused by hardware aging, configuration changes, or changes in the operating environment, thus maintaining the accuracy of node load information without manual intervention.
[0076] Figure 4 The illustration shows a flowchart of matching the resource requirement information of the task to be scheduled with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled, according to an embodiment of this application.
[0077] like Figure 4 As shown, in this embodiment of the application, the resource requirement information of the task to be scheduled is matched with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled, including operations S410 to S420.
[0078] When operating S410, the node adaptability of each computing node is calculated based on the current scheduling mode, the resource requirements of the task to be scheduled, and the node load information of each computing node. The node adaptability is a quantitative indicator used to evaluate the overall adaptability of candidate computing nodes to execute the task to be scheduled. The calculation basis of the node adaptability is different under different scheduling modes.
[0079] When operating S420, based on load balancing constraints, the computing node with the highest node adaptability is selected as the target execution node and a scheduling decision log is generated.
[0080] In some embodiments, before matching, the currently effective scheduling policy is first determined, and then the adaptability of each computing node is calculated according to the adaptability calculation rule corresponding to the scheduling policy. Then, the corresponding node is selected as the target node based on the adaptability.
[0081] For example, the current scheduling strategy can be automatically selected and switched based on the real-time monitoring results of the system's global operating status, or it can be manually set by technical personnel through the management interface.
[0082] The scheduler determines the node fit of each candidate computing node based on the type of the current scheduling policy and the calculation criteria corresponding to that policy. Node fit is a quantitative indicator used to evaluate the overall suitability of candidate computing nodes for executing the scheduled tasks, and its calculation method varies depending on the scheduling policy.
[0083] According to one embodiment of this application, the scheduling modes include a balanced priority mode, a matching priority mode, and a stable preference mode. Based on the current scheduling mode, the resource requirements of the task to be scheduled, and the node load information of each computing node, the node fit of each computing node is calculated, including: calculating the basic fit of each candidate computing node based on the resource requirements of the task to be scheduled and the remaining computing capacity of each candidate computing node; the basic fit is the degree of matching between the resource requirements of the task to be scheduled and the remaining computing capacity of the candidate computing nodes; and correcting the basic fit according to the current scheduling mode to obtain the node fit of each candidate computing node.
[0084] In some embodiments, for a task to be scheduled, the basic fit of each node is first calculated. The basic fit refers to the degree of fit between the node and the task to be scheduled, measured solely from the perspective of resource supply and demand matching, without considering any scheduling preferences.
[0085] For example, for each computing node, the remaining capacity of each dimension of the node is compared with the resource requirements of each dimension of the task to be scheduled, and the matching degree in each dimension is calculated. Taking the CPU dimension as an example, if the task is predicted to require 2 CPU cores and the node currently has 4 CPU cores remaining, the matching degree in the CPU dimension is high; if the node currently has 1.5 CPU cores remaining, the matching degree in the CPU dimension is low.
[0086] The matching degree for each dimension can be calculated as the ratio of task demand to the remaining capacity for that dimension. A higher matching degree indicates a greater remaining capacity than task demand, while a lower matching degree indicates a less remaining capacity than task demand. The matching degrees for each dimension are then weighted and aggregated to obtain the basic fit degree for the candidate node. A higher basic fit degree indicates a better match between the node's remaining resource capacity and the task's resource demand, meaning that, without considering other scheduling preferences, the node is more suitable for executing the task. Optionally, the weights used in the weighted aggregation can be the same as those used in the aforementioned node load information calculation, or they can be set to equal weights.
[0087] After calculating the basic fitness of each computing node, the basic fitness is adjusted according to the currently effective scheduling mode to obtain the final node fitness of each candidate computing node.
[0088] In the matching priority mode, the system takes the precise matching between the resource requirements of the task to be scheduled and the remaining computing capacity of the computing node as the main optimization goal, and can directly use the basic adaptability as the node adaptability of the node.
[0089] In the load balancing priority mode, the system prioritizes load balancing among computing nodes as its primary optimization objective. A first correction coefficient is applied to the base fitness score based on the deviation of each candidate computing node's current load from the global average load. The value of this first correction coefficient is proportional to the degree of deviation. For example, when a computing node's current load is lower than the global average load, that node receives a positive correction, and its fitness score is increased; when a computing node's current load is higher than the global average load, that node receives a negative correction, and its fitness score is decreased; the greater the deviation of the current load from the global average load, the larger the correction magnitude.
[0090] In stable preference mode, the system primarily optimizes task execution success rate and predictability. A second correction coefficient can be applied to the basic fit based on the combined execution success rate of the task to be scheduled and each candidate computing node in historical scheduling records. The value of the second correction coefficient is directly proportional to the success rate. For example, a positive correction is applied to the basic fit based on the combined execution success rate of the task to be scheduled and each computing node in historical scheduling records. When the historical combined execution success rate of a computing node with that task type is higher than a preset threshold, that node receives a positive preference correction, and its node fit is increased; the higher the historical combined execution success rate, the greater the correction.
[0091] This application's embodiments calculate node suitability based on the resource requirements of the task to be scheduled and the load information of each computing node, avoiding decision-making biases caused by relying on only a single dimension for scheduling and improving the matching accuracy between tasks and nodes. Different suitability calculation criteria are used in different scheduling modes, enabling the system to flexibly adjust scheduling preferences according to current business objectives and system operating status, overcoming the shortcomings of a single fixed scheduling strategy that cannot accommodate multiple application scenarios. In high-concurrency scenarios (i.e., balanced priority mode), tasks are preferentially allocated to computing nodes with lower current loads, making the load of each node more balanced and avoiding some nodes being overloaded while others are idle. In scenarios with high stability requirements (i.e., stability preference mode), by prioritizing historically stable task-node combinations, the uncertainty introduced by scheduling decisions is reduced, improving the reliability of task execution and thus effectively improving the flexibility of task scheduling.
[0092] According to one embodiment of this application, after acquiring the multi-dimensional operating status index data reported by each computing node at a dynamic acquisition frequency, an attenuation factor is applied based on the rate of change of the computing node index.
[0093] Figure 5 A flowchart illustrating the application of a decay factor based on the rate of change of a computed node index is shown in the embodiment of this application.
[0094] like Figure 5 As shown, the application of the attenuation factor based on the rate of change of the computing node index in this embodiment includes operations S510 to S530.
[0095] When operating S510, for each computing node, the time-series change trend of each dimension index of the computing node within a preset time window is obtained, and the change rate of each dimension index is obtained.
[0096] In operation S520, when the slope of change of at least one dimension indicator of any computing node exceeds the alarm threshold corresponding to that dimension and the node load information is lower than a preset first threshold, the computing node is marked as the first predicted node.
[0097] In operation S530, when determining the node fit of the first node, a decay factor is applied to the first node to reduce the probability that the first node is selected.
[0098] In some embodiments, after receiving multi-dimensional operational status metrics data reported by each computing node, for each metric of each computing node (including processor utilization, memory usage, storage I / O latency, and network throughput), the scheduler calculates the trend of change of that metric within a preset time window (e.g., the past 5 minutes or the past 10 collection cycles) based on historical data within that time window. The trend is represented by the slope of change; a positive slope indicates that the metric value is increasing (i.e., the load on the node in that dimension is increasing), and a negative slope indicates that the metric value is decreasing (i.e., the load on the node in that dimension is decreasing).
[0099] For each dimension metric of each computing node, the absolute value of the slope of change of that dimension is compared with the alarm threshold corresponding to that dimension. The alarm threshold can be a preset fixed value or an adaptive threshold determined based on the statistical distribution of the node's historical data.
[0100] If the slope of change of at least one dimension indicator of a computing node exceeds the alarm threshold corresponding to that dimension, and the current node load information of the computing node is lower than a preset first threshold, the computing node is identified as the first node. When a node that is currently in a low-load state begins to show an abnormal trend of rapid resource consumption, it means that the node is entering an abnormal load growth mode.
[0101] For candidate computing nodes marked as the first candidate node, the scheduler applies a decay factor to their node fitness when calculating their fitness score, thereby reducing the probability of the node being selected. For example, during fitness score calculation, the node's base fitness score and / or corrected fitness score are multiplied by a decay factor less than 1. The specific value of the decay factor can be determined based on the degree to which the slope of the node's metric changes exceeds the alarm threshold; the greater the slope exceeds the alarm threshold (i.e., the more severe the degradation trend), the smaller the decay factor, and the greater the reduction in fitness score. Alternatively, the decay factor can also be a fixed value within the (0, 1) interval, meaning all computing nodes marked as the first candidate node are subject to the same decay magnitude.
[0102] This application's embodiments identify current risk nodes by introducing node indicator change trend analysis into scheduling decisions, overcoming the lag problem caused by relying solely on current load snapshots for decision-making, and proactively avoiding emerging risks. Combining the two conditions of the change slope exceeding the alarm threshold and the node load information falling below a first threshold can improve the accuracy of risk node identification and minimize resource consumption.
[0103] Figure 6The illustration shows a flowchart of a process for generating resource requirement information for a scheduled task based on a resource prediction model, according to an embodiment of the present application, which predicts the scale of resources required and the expected execution duration of the task during execution.
[0104] like Figure 6 As shown, the resource requirement information of the scheduled task is generated by predicting the resource scale and expected execution duration of the task to be scheduled during the execution process based on the resource prediction model in this application embodiment, including operations S610 to S630.
[0105] In operation S610, in response to the arrival of the task to be scheduled, the attribute information and historical execution records of the task to be scheduled are obtained. The attribute information includes at least the task type, data size and input parameter distribution. The historical execution records include at least the actual resource consumption sequence and actual execution duration sequence of the task to be scheduled in each historical execution round.
[0106] In operation S620, attribute information and historical execution records are input into the resource prediction model to obtain the probability distribution of the peak range of resource consumption and the expected execution duration output by the resource prediction model.
[0107] When operating S630, resource requirement information for tasks to be scheduled is generated based on the output of the resource prediction model.
[0108] In some embodiments, when the scheduler retrieves a task to be scheduled from the task queue, it extracts the task's attribute information. The attribute information consists of inherent characteristics of the task, related to its specific content, and includes at least the task type, data size, and input parameter distribution. Specifically, the task type indicates the category to which the task belongs, the data size indicates the amount of data the task needs to process, and the input parameter distribution describes the distribution characteristics of the task's input parameters.
[0109] Simultaneously, a query request is sent to the historical execution record database to retrieve the historical execution records of the task to be scheduled. The historical execution records include at least the actual resource consumption sequence and the actual execution duration sequence of the task in each historical execution round. Specifically, the actual resource consumption sequence is a sequence formed by chronologically arranging the actual CPU resource consumption, memory resource consumption, storage I / O access, and network bandwidth usage recorded by the scheduler for each previous execution of the task; the actual execution duration sequence is a sequence formed by chronologically arranging the time elapsed from the start of execution to completion for each previous execution of the task.
[0110] The resource prediction model is a supervised learning model that provides prediction services via function calls. This model was trained offline using historical task data before the system went live. Each training sample contains the task's attribute features (task type, data size, input parameter distribution) and corresponding labels for actual resource consumption and execution duration. This application does not limit the specific algorithm implementation of the model; it can be implemented using any of the supervised learning algorithms selected from XGBoost, Random Forest, Gradient Boosting Tree, or Lightweight Neural Networks.
[0111] After feature engineering, the acquired attribute information and historical execution records are input into the resource prediction model. Feature engineering includes at least the following: converting the task type category feature into a numerical feature using one-hot encoding or label encoding; performing logarithmic transformation or standardization on the data size to eliminate the influence of dimensions; normalizing the statistical characteristics of the input parameter distribution; and extracting statistical features from the actual resource consumption sequence and actual execution duration sequence in the historical execution records using sliding window statistics. The purpose of feature engineering is to convert the raw input data into a numerical feature vector acceptable to the model.
[0112] After receiving input, the resource prediction model outputs the prediction result for the task to be scheduled. The prediction result includes at least the peak resource consumption range and the probability distribution of the expected execution duration for the task. The peak resource consumption range refers to the range of peak CPU and memory resource consumption values that the task may reach during execution. The probability distribution of the expected execution duration refers to the statistical distribution of the expected execution duration of the task.
[0113] After obtaining the peak resource consumption range and the probability distribution of expected execution duration from the resource prediction model, the resource requirement information for the task to be scheduled is generated based on this output. The resource requirement information includes at least a parameterized description (such as distribution type, mean, standard deviation, quantiles, etc.) of the peak CPU resource consumption range, peak memory resource consumption range, and probability distribution of expected execution duration for the task.
[0114] This application's embodiments extract task attribute information and historical execution records as input to the prediction model. This allows the resource prediction model to base its predictions not only on the inherent characteristics of the task (task type, data scale, input parameter distribution) but also on the task's actual performance in past executions (resource consumption sequences and duration sequences for each round), effectively improving prediction accuracy. Using a supervised learning model as the foundation of the resource prediction model enables the scheduling system to continuously improve prediction accuracy during the accumulation of historical data. Effective prediction can be achieved without extensive trial-and-error interactions with the environment, resulting in faster cold start speeds and more stable initial prediction performance.
[0115] According to one embodiment of this application, the method further includes: extracting new training samples from the historical execution database at a preset period, merging the new samples with the historical training samples, fine-tuning the training with the model parameters of the current deployment version as the initial parameters, and obtaining a candidate model; using a validation set to validate and evaluate the candidate model, and when the prediction error of the candidate model is lower than that of the current deployment version, determining the candidate model as the new current version.
[0116] In some embodiments, a fixed time period is preset as the trigger interval for model updates. The length of this period can be configured according to the characteristics of the system's operating environment; for example, the preset period could be 7 days. Alternatively, the preset period can be dynamically adjusted based on the average daily arrival volume of tasks in the system. In systems with frequent task arrivals, the update period can be shortened (e.g., once a day), while in systems with sparse task arrivals, the update period can be extended (e.g., once a month) to ensure that the accumulated number of new samples within each period is sufficient to support effective model updates. Alternatively, when the accumulated number of new training samples reaches a preset threshold (e.g., the number of new samples exceeds 10% of the current training set size), the model update process can be triggered in advance without waiting for the fixed period to arrive, thus avoiding problems caused by a fixed period that is too short or too long in scenarios with large fluctuations in task volume.
[0117] When the preset period is reached or the cumulative number of new samples reaches a preset threshold, new training samples are extracted from the historical execution record database. New training samples refer to historical execution records accumulated from the last model update to the current trigger time that have not yet been used for model training. Each new training sample includes input features and an output label. The input features include at least the attribute information of the corresponding task (task type, data size, input parameter distribution) and the statistical characteristics of the historical execution records of the task before execution; the output label includes at least the peak actual resource consumption and the actual execution duration of the task in this execution.
[0118] The newly extracted training samples are merged with the historical training sample set corresponding to the resource prediction model of the current deployment version in the model repository to form an expanded full training sample set. The expanded full training sample set includes all historical training samples used in previous updates of the current deployment version of the model and the newly added training samples in this round. The full training sample set obtained after merging the two parts consists of two parts.
[0119] Using the expanded full training sample set as training data and the model parameters of the currently deployed resource prediction model as initial parameters, fine-tuning training is performed to obtain candidate versions of the resource prediction model. Fine-tuning training refers to making small adjustments to the model parameters using new data, based on the current model's already good predictive ability, rather than retraining from scratch. For example, during training, the model's hyperparameters remain consistent with the current deployment version; only the model parameters are iteratively optimized. The objective function of fine-tuning training is to minimize the model's prediction error on the expanded full training sample set.
[0120] The candidate model is validated and evaluated using a validation set. When the prediction error of the candidate model is lower than that of the current deployment version, it indicates that the candidate model has better generalization performance on independent data not used for training. In this case, the candidate model is deployed as the new current deployment version, replacing the original current deployment version. When the prediction error of the candidate model is not lower than that of the current deployment version, it indicates that the performance of the candidate model has not been substantially improved. In this case, the results of this fine-tuning training are abandoned, the resource prediction model of the current deployment version is maintained, and the system continues to run until the next update cycle.
[0121] In some embodiments, the model update process can be executed via a background thread, which is isolated from and runs in parallel with the scheduling process. For example, when processing arriving tasks, the scheduling process invokes the resource prediction model of the currently deployed version; the background thread, during training and validation evaluation, uses independent computing resources and memory space, without consuming the scheduling process's processing power. When the background update thread completes validation evaluation and determines that a new version needs to be deployed, it can load the new version of the model into the model repository accessible by the main scheduling process through atomic operations, completing the version switch. This switchover process is instantaneous and does not interrupt the main scheduling process's real-time task processing.
[0122] This application's embodiments trigger model updates at preset intervals, enabling the resource prediction model to continuously absorb knowledge from new data over time, thereby continuously improving prediction accuracy. By merging new samples with historical training samples and fine-tuning the training with the current parameters as the initial point, the model retains its learned knowledge (avoiding catastrophic forgetting) while incorporating patterns from new data (achieving knowledge increment). Compared to retraining from scratch, this significantly reduces computational resource consumption and time overhead. By designing the model update process as an independent thread executed asynchronously in the background, the real-time reception, prediction, and distribution of tasks are avoided from being blocked by model updates, thus preventing the model update process from impacting online scheduling performance and ensuring the timely response of the scheduling system in high-throughput scenarios.
[0123] According to one embodiment of this application, the method further includes: determining the co-occurrence confidence of task pairs arriving successively within a preset sliding time window based on historical scheduling records; when the co-occurrence confidence exceeds a preset threshold, marking the corresponding task pair as a strongly related task pair; in response to the scheduling of the first-arriving task in the strongly related task pair, selecting the node with the highest matching degree from the same rack node set of the target execution node of the first-arriving task as a pre-deployment candidate node based on the resource requirement information of the later-arriving task in the strongly related task pair; when the later-arriving task actually arrives within the preset timeout window, directly scheduling it to the pre-deployment candidate node for execution; when the later-arriving task does not arrive within the preset timeout window, releasing the resource pre-occupancy.
[0124] In some embodiments, historical scheduling records for each task are extracted from the historical execution record database. Each historical scheduling record includes at least a task identifier, a task arrival timestamp, a task type, and the node identifier of the computing node to which the task was scheduled. All historical scheduling records can be sorted chronologically to form a task arrival time sequence. In this sequence, each task is positioned by its arrival timestamp, and subsequent arriving tasks constitute the subsequent task set for that task. By analyzing the arrival order of different tasks in this sequence, it is possible to identify which tasks tend to arrive sequentially within a short period of time.
[0125] Using a preset sliding time window as the analysis unit, the arrival time sequence of the above tasks is traversed. The length of the preset sliding time window can be configured according to the business scenario, such as 30 seconds, 1 minute, or 5 minutes. The sliding time window slides forward in fixed steps (such as 10 seconds), and after each slide, all tasks contained in the current window are extracted to construct a co-occurrence set of tasks within that window.
[0126] For any two tasks (Task A and Task B), count the number of times Task A arrives before Task B within the sliding time window, and the total number of times Task A appears within the window. Based on these statistics, calculate the co-occurrence confidence of the task pair (Task A → Task B): Co-occurrence confidence = Number of times Task A and Task B co-occur within the window / Total number of times Task A appears within the window. The co-occurrence confidence represents the conditional probability that Task B will arrive within the preset time window after Task A arrives. The higher the confidence, the greater the probability that Task B will arrive after Task A.
[0127] The calculated co-occurrence confidence of the task pairs is compared with a preset threshold. When the co-occurrence confidence of a task pair (task A → task B) exceeds the preset threshold, the task pair is marked as a strongly associated task pair, and the correspondence between the first and last arriving tasks in the strongly associated task pair is recorded, as well as the average arrival time interval of the task pair (i.e., the statistical average of the time elapsed from the arrival of task A to the arrival of task B within all windows that meet the conditions).
[0128] In actual operation, upon receiving a task to be scheduled (hereinafter referred to as the "current task") and selecting its target execution node, the list of strongly related task pairs is queried to determine whether the current task is the first-arriving task in a strongly related task pair. If the current task is the first-arriving task in a strongly related task pair, the resource requirement information of the later-arriving tasks in that pair is extracted. The node identifiers of all other computing nodes within the rack where the target execution node of the current task is located are obtained, forming a set of nodes within the same rack. "Same rack" refers to a group of computing nodes physically located in the same cabinet or rack. Nodes within the same rack have lower network latency, which minimizes data exchange or communication overhead between subsequent tasks.
[0129] For each candidate node in the same rack node set, the current remaining resource capacity of the candidate node is matched with the resource requirements of the subsequent arriving tasks. The matching degree between the two is calculated (e.g., the ratio or difference between the remaining capacity and the task requirements in each dimension). The candidate node with the highest matching degree is selected as the pre-deployment candidate node. The pre-deployment candidate node is a node that prepares the execution environment in advance for the upcoming tasks after the current task has been completed. Resources are pre-reserved on the pre-deployment candidate node, and the amount of resources required by the subsequent arriving tasks is deducted from the available resource pool of the node in advance and marked as reserved, so that these resources are not allocated to other tasks during the reservation period.
[0130] The preset timeout window can be determined based on the historical average arrival time interval of the strongly associated task pair. Within the preset timeout window, the system monitors whether the later-arriving task is received. If the later-arriving task actually arrives within the timeout window, the scheduler directly schedules the later-arriving task to a pre-deployment candidate node for execution, without needing to re-execute the node matching step. At this time, the reserved resources are used by the later-arriving task, and the resource pre-reservation is converted into actual resource allocation.
[0131] If the later-arriving task does not arrive within the timeout window, a resource release command is sent to the pre-deployment candidate node, instructing the node to cancel the resource reservation status and release the previously reserved resources back to the available resource pool for use by other tasks.
[0132] This application's embodiments pre-select and reserve resources for candidate nodes when the first arriving task is executed, allowing subsequent arriving tasks to be executed directly without undergoing a complete node matching and resource allocation process. This shortens the scheduling waiting time for subsequent arriving tasks and reduces the overall response latency. By selecting candidate nodes from the same rack node set, two tasks in a strongly correlated task pair are deployed within the same rack as much as possible, reducing the potential cross-node communication distance between tasks, lowering network transmission latency and bandwidth consumption, and improving the communication efficiency of task execution.
[0133] Based on the above adaptive task scheduling method, this application also provides an adaptive task scheduling apparatus. The following will combine... Figure 7 The device is described in detail.
[0134] Figure 7 A schematic block diagram of an adaptive task scheduling apparatus according to an embodiment of this application is shown.
[0135] like Figure 7 As shown, the adaptive task scheduling device 700 of this embodiment includes an acquisition module 710, a first determination module 720, a prediction module 730, a second determination module 740, and an execution module 750.
[0136] The acquisition module 710 is used to acquire multi-dimensional operational status indicator data reported by each computing node at a dynamic acquisition frequency. In one embodiment, the acquisition module 710 can be used to perform the operation S210 described above, which will not be repeated here.
[0137] The first determining module 720 is used to normalize the collected multi-dimensional operating status index data of each computing node, and determine the node load information corresponding to each computing node by combining it with a preset weight allocation algorithm. The node load information is used to characterize the comprehensive carrying capacity of the computing node at the current moment. In one embodiment, the first determining module 720 can be used to execute the operation S220 described above, which will not be repeated here.
[0138] The prediction module 730 is used to generate resource requirement information for the task to be scheduled in response to the arrival of the task to be scheduled, based on a resource prediction model, to predict the scale of resources required by the task during execution and the expected execution duration. In one embodiment, the prediction module 730 can be used to perform the operation S230 described above, which will not be repeated here.
[0139] The second determining module 740 is used to match the resource requirement information of the task to be scheduled with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled. In one embodiment, the second determining module 740 can be used to perform the operation S240 described above, which will not be repeated here.
[0140] The execution module 750 is used to distribute the tasks to be scheduled to the target execution nodes for execution and to record the actual execution results. In one embodiment, the execution module 750 can be used to perform the operation S250 described above, which will not be repeated here.
[0141] According to embodiments of this application, any multiple modules among the acquisition module 710, the first determination module 720, the prediction module 730, the second determination module 740, and the execution module 750 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the acquisition module 710, the first determination module 720, the prediction module 730, the second determination module 740, and the execution module 750 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in a suitable combination of any of these. Alternatively, at least one of the acquisition module 710, the first determination module 720, the prediction module 730, the second determination module 740, and the execution module 750 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0142] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing an adaptive task scheduling method according to an embodiment of this application.
[0143] like Figure 8 As shown, an electronic device 800 according to an embodiment of this application includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0144] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0145] According to embodiments of this application, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output (I / O) interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0146] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0147] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803 described above.
[0148] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0149] When the computer program is executed by the processor 801, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0150] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0151] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0152] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0154] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
[0155] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of this application, those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.
Claims
1. An adaptive task scheduling method, characterized in that, The method includes: Acquire multi-dimensional operational status metrics data reported by each computing node at a dynamic acquisition frequency; The collected multi-dimensional operating status index data of each computing node are normalized and combined with a preset weight allocation algorithm to determine the node load information corresponding to each computing node. The node load information is used to characterize the comprehensive carrying capacity of the computing node at the current moment. In response to the arrival of a task to be scheduled, the resource requirement information of the task to be scheduled is generated based on the resource prediction model to predict the scale of resources required for the task to be scheduled during execution and the expected execution duration. The resource requirement information of the task to be scheduled is matched with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled. The task to be scheduled is distributed to the target execution node for execution, and the actual execution results are recorded.
2. The method according to claim 1, characterized in that, The determination of node load information for each computing node using a preset weight allocation algorithm includes: For each computing node, the weight coefficient of each dimension indicator in the computing node at the current moment is determined based on the contribution of each dimension indicator to the task execution success rate in the historical scheduling record. The weight coefficient is periodically updated as the historical scheduling of the computing node accumulates. The normalized indicators of each dimension are weighted and fused with their corresponding weight coefficients to determine the node load information of the computing node at the current time.
3. The method according to claim 1, characterized in that, The step of matching the resource requirement information of the task to be scheduled with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled includes: Based on the current scheduling mode, the resource requirements of the task to be scheduled, and the node load information of each computing node, the node adaptability of each computing node is calculated. The node adaptability is a quantitative indicator used to evaluate the overall adaptability of candidate computing nodes in executing the task to be scheduled. The calculation basis of the node adaptability is different under different scheduling modes. Based on load balancing constraints, the computing node with the highest node adaptability is selected as the target execution node, and a scheduling decision log is generated.
4. The method according to claim 3, characterized in that, The scheduling modes include balanced priority mode, matching priority mode and stable preference mode; The step of calculating the node adaptability of each computing node based on the current scheduling mode, the resource requirement information of the task to be scheduled, and the node load information of each computing node includes: Based on the resource requirements of the task to be scheduled and the remaining computing capacity of each candidate computing node, the basic fit degree of each candidate computing node is calculated. The basic fit degree is the degree of matching between the resource requirements of the task to be scheduled and the remaining computing capacity of the candidate computing node. The basic fit is corrected according to the current scheduling mode to obtain the node fit of each candidate computing node. In the matching priority mode, the basic adaptability is used as the node adaptability; in the balanced priority mode, a first correction coefficient is applied to the basic adaptability based on the deviation between the current load of each candidate computing node and the global average load, and the value of the first correction coefficient is proportional to the deviation; in the stable preference mode, a second correction coefficient is applied to the basic adaptability based on the combined execution success rate of the task to be scheduled and each candidate computing node in the historical scheduling record, and the value of the second correction coefficient is proportional to the success rate.
5. The method according to claim 3, characterized in that, After acquiring the multi-dimensional operational status indicator data reported by each computing node at a dynamically collected frequency, the method further includes: For each computing node, the temporal change trend of each dimension indicator of that computing node within a preset time window is obtained, and the change rate of each dimension indicator is obtained. When the slope of change of at least one dimension indicator of any computing node exceeds the alarm threshold corresponding to that dimension and the node load information is lower than a preset first threshold, the computing node is marked as the first node. When determining the node fit of the first node, a decay factor is applied to the first node to reduce the probability that the first node is selected.
6. The method according to claim 1, characterized in that, The resource requirement information for the scheduled task is generated by predicting the resource consumption and expected execution duration of the task during execution based on a resource prediction model, including: In response to the arrival of a task to be scheduled, the attribute information and historical execution records of the task to be scheduled are obtained. The attribute information includes at least the task type, data size and input parameter distribution. The historical execution records include at least the actual resource consumption sequence and actual execution duration sequence of the task to be scheduled in each historical execution round. The attribute information and historical execution records are input into the resource prediction model to obtain the peak range of resource consumption and the probability distribution of expected execution duration output by the resource prediction model. The resource requirement information of the task to be scheduled is generated based on the output of the resource prediction model.
7. The method according to claim 6, characterized in that, The method further includes: New training samples are extracted from the historical execution database at preset intervals. The new samples are merged with the historical training samples, and the resource prediction model parameters of the current deployment version are used as the initial parameters for fine-tuning training to obtain candidate models. The candidate model is validated and evaluated using a validation set. When the prediction error of the candidate model is lower than that of the current deployment version, the candidate model is determined as the new resource prediction model.
8. The method according to claim 1, characterized in that, Also includes: Based on historical scheduling records, the co-occurrence confidence of task pairs arriving successively within a preset sliding time window is determined. When the co-occurrence confidence exceeds a preset threshold, the corresponding task pairs are marked as strongly correlated task pairs. When the first-arriving task in the strongly associated task pair is scheduled for execution, the node with the highest matching degree is selected as a pre-deployment candidate node from the same rack node set of the target execution node of the first-arriving task, based on the resource requirement information of the later-arriving task in the strongly associated task pair. When the late-arriving task actually arrives within the preset timeout window, it is directly scheduled to be executed on the pre-deployed candidate node; If the later-arriving task does not arrive within the preset timeout window, the resource pre-occupancy is released.
9. An adaptive task scheduling device, characterized in that, The device includes: The acquisition module is used to acquire multi-dimensional operational status indicator data reported by each computing node at a dynamic acquisition frequency; The first determining module is used to normalize the multi-dimensional operating status index data of each computing node collected, and determine the node load information corresponding to each computing node in combination with a preset weight allocation algorithm. The node load information is used to characterize the comprehensive carrying capacity of the computing node at the current moment. The prediction module is used to predict the scale of resources required by the task to be scheduled and the expected execution duration during the execution of the task based on the resource prediction model in response to the arrival of the task to be scheduled, and to generate the resource requirement information of the task to be scheduled. The second determining module is used to match the resource requirement information of the task to be scheduled with the node load information of each computing node to determine the target execution node corresponding to the task to be scheduled. The execution module is used to distribute the task to be scheduled to the target execution node for execution and record the actual execution results.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
