Dynamic task scheduling method and device for complex stability control model of power grid
By transforming the task scheduling problem into DAG and MDP, and combining it with encoder-decoder neural networks, an efficient scheduling strategy is generated, which solves the problems of task dependence and low resource utilization in the power grid stability control system, realizes more efficient task allocation and processor utilization, and improves the intelligence and automation level of simulation computing.
Patent Information
- Application Number
- CN202511275899.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-12-12
AI Technical Summary
Existing power grid stability control systems struggle to balance task dependence, resource heterogeneity, and multi-objective optimization in task scheduling. They also lack adaptability to dynamic environmental changes, rely on manual experience or parameter tuning, and have limited levels of automation and intelligence, making it difficult to meet the simulation and actual operation requirements of large-scale complex power grids.
The task scheduling problem is transformed into a directed acyclic graph (DAG). By combining it with a Markov decision process (MDP), a task scheduling strategy is generated through an encoder-decoder neural network. Multi-head attention and heterogeneous attention mechanisms are used to capture the relationships between tasks and generate feasible scheduling strategies that satisfy resource constraints and dependency constraints.
It improves scheduling flexibility and scalability, enables more efficient task allocation and processor utilization, enhances simulation calculation efficiency and accuracy, and strengthens the system's intelligence and automation level.
Smart Images

Figure CN121119591A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent cross-disciplinary technology of power system simulation and computation, and relates to, but is not limited to, a dynamic task scheduling method and device for complex power grid stability control models. Background Technology
[0002] The power grid safety and stability control system (hereinafter referred to as the "control system") is a crucial foundation for ensuring the safe and stable operation of the power grid, providing strong support for national energy security and power supply. With the advancement of new power system construction, the control system is gradually exhibiting complex characteristics of large scale and strong coupling, leading to new challenges in its safe and stable operation. In actual operation, control devices often fail to operate or malfunction due to inherent defects and secondary circuit issues, affecting system safety. Furthermore, existing hardware-in-the-loop simulation verification methods based on actual hardware access have limitations, failing to fully cover complex fault scenarios. Therefore, establishing a simulation model of the control system and conducting simulation operations in a simulation environment has become an important means to improve the system's safety analysis and post-event assessment capabilities for complex fault events. However, with the continuous expansion of power system scale and the increasing complexity of its operating structure, the control simulation system faces enormous challenges. The surge in the number of power grid nodes, the diversity of power flow changes, and the complex and variable operating states have led to a heavier simulation verification computation task, a sharp increase in data volume and computational load, and higher requirements for the computational accuracy and efficiency of the simulation system.
[0003] To address the aforementioned challenges, researching task scheduling strategies in multiprocessor systems is crucial. By rationally allocating computational tasks to different Central Processing Units (CPUs), load balancing and optimized resource utilization can be achieved, significantly improving the overall computational efficiency, accuracy, response speed, and intelligence level of power grid stability simulation systems. Furthermore, Reinforcement Learning (RL) and its Deep Reinforcement Learning (DRL) demonstrate strong adaptive capabilities in complex task scheduling. RL, through continuous interaction with the environment, automatically learns optimal scheduling strategies to dynamically adapt to real-time changes in the power grid, improving the efficiency of parallel task execution. Combining advanced neural network structures such as graph neural networks and attention mechanisms, DRL exhibits stronger generalization and optimization capabilities in modeling task dependencies and resource contention, providing a new approach to solving large-scale complex task scheduling problems in power grid stability simulation systems.
[0004] In existing technologies, task scheduling algorithms include priority scheduling algorithms, heuristic algorithms, and intelligent optimization algorithms. Reinforcement learning scheduling methods include single-agent deep reinforcement learning scheduling methods, multi-agent reinforcement learning scheduling methods, and scheduling methods combining graph neural networks and attention mechanisms. These task scheduling algorithms and reinforcement learning scheduling methods are used to complete task scheduling in multiprocessor systems. However, in the process of completing task scheduling, existing technologies have the following problems: it is difficult to simultaneously consider task dependencies, resource heterogeneity, and multi-objective optimization; they lack adaptability to dynamic environmental changes and are difficult to generate high-quality scheduling schemes in real time; they rely on a lot of manual experience or parameter tuning, resulting in limited automation and intelligence; and their practical application in critical infrastructure such as power system stability control systems (SSCS) is still immature.
[0005] Therefore, there is an urgent need for a more efficient task allocation and scheduling method to solve the problems of complex task dependencies, low resource utilization and insufficient scheduling efficiency in the simulation of existing stability control systems. This would improve the system resource utilization and simulation calculation execution efficiency, enhance the intelligence and automation level of simulation task scheduling in stability control systems, and provide strong theoretical support and technical guarantee for the simulation and actual operation of large-scale complex power grid safety and stability control systems. Summary of the Invention
[0006] This application provides a method and apparatus for dynamic task scheduling of a complex power grid stability control model.
[0007] The technical solution of this application embodiment is implemented as follows: In a first aspect, embodiments of this application provide a dynamic task scheduling method for a complex power grid stability control model. The method includes: transforming the task scheduling problem into a Directed Acyclic Graph (DAG), wherein nodes in the DAG represent scheduling tasks, edges represent scheduling relationships between scheduling tasks, and paths represent scheduling sequences of processors, wherein high-priority scheduling tasks and low-priority scheduling tasks are executed alternately in the scheduling sequence, and resource constraints and dependency constraints are satisfied during the execution of scheduling tasks; combining the DAG, transforming the task scheduling process into a Markov Decision Process (MDP), wherein the state space of the Markov Decision Process consists of task state vectors and processor resource vectors, the action space consists of allocation pairs between scheduling tasks and processors that satisfy DAG constraints, and the reward function consists of a weighted combination of completion time and load balancer ratio (LBR); and an encoder-decoder neural network generates a task scheduling strategy based on the Markov Decision Process, wherein the encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism, and the decoder generates a feasible task scheduling strategy by combining masking processing.
[0008] The technical solution provided in this application transforms the task scheduling problem into a Directed Acyclic Graph (DAG). Nodes in the DAG represent scheduled tasks, edges represent scheduling relationships between tasks, and paths represent processor scheduling sequences. High-priority and low-priority tasks are interleaved in the scheduling sequence, and resource and dependency constraints are satisfied during task execution. This enhances the system's scheduling flexibility and scalability, resulting in more efficient task allocation and processor utilization. Furthermore, by combining the DAG with the task scheduling process, it is transformed into a Multi-Purpose Graph (MDP). The state space consists of task state vectors and processor resource vectors, the action space represents allocation pairs between scheduled tasks and processors that satisfy the DAG constraints, and the reward function is composed of completion time and LBR (Lower-Priority Boosting Ratio). The weighted combination structure iterates continuously to ensure the model can perceive system changes after the execution of scheduling tasks, gradually discovering scheduling strategies with higher throughput, shorter completion time, and better resource utilization. The encoder-decoder neural network generates task scheduling strategies based on Markov decision processes. The encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism, capturing the global complex relationships between scheduling tasks and the interactions between high- and low-priority scheduling tasks, respectively, improving the accuracy and efficiency of scheduling decisions. The decoder combines masking to generate feasible task scheduling strategies, hard filtering out candidate scheduling task nodes that violate resource or dependency constraints, ensuring the feasibility of the output strategy and avoiding ineffective actions in reinforcement learning exploration.
[0009] Optionally, the task scheduling problem includes multiple processors and a set of scheduled tasks. The number of high-priority scheduled tasks in the set is M, and the number of low-priority scheduled tasks is NM. The scheduling resource consumption of each scheduled task is known. The scheduling task satisfies resource constraints and dependency constraints during execution, including: the scheduling task is executed only after all parent node scheduling tasks of the corresponding node in the DAG have been completed; and the scheduling resource consumption during the execution of the scheduling task is less than or equal to the remaining resource capacity of the processor.
[0010] Optionally, the task state vector in the state space represents the current state of the scheduled task corresponding to each node in the DAG, and the current state includes pending execution, running, and completed; the processor resource vector represents the remaining resource capacity of each processor in the DAG at each decision step; when the state space is in the initial state, all scheduled tasks are unassigned, and all processor resources are fully loaded; the action in the action space represents selecting a ready scheduled task, assigning the ready scheduled task to a processor, and simultaneously satisfying the resource constraints and the dependency constraints; the calculation formula of the reward function is expressed by the following formula: ; In the formula, Indicating in the decision-making step Instant rewards; Indicates the completion time; Indicates the load balancing ratio; and This represents an adjustable weight parameter; positive rewards are given for timely completion of scheduling tasks and efficient use of processor resources, while penalties are given for wasting processor resources and for processors being idle. The scheduling strategy is learned to maximize the cumulative reward.
[0011] Optionally, the encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism, including: the encoder receives the state space and extracts the embedding representations of the main core, the main core group, and the auxiliary core group to generate an initial embedding representation; based on the initial embedding representation, it models the global correlation between all scheduling tasks through a multi-head self-attention mechanism to generate a global correlation embedding; combined with the global correlation embedding, it uses a heterogeneous attention mechanism to model the interaction between high-priority scheduling tasks and low-priority scheduling tasks to generate heterogeneous embeddings, the heterogeneous embeddings including high-priority task embeddings and low-priority task embeddings; and performs residual connection and instance normalization processing on the heterogeneous embeddings of each layer to generate the final embedding of the scheduling task and the overall graph embedding, the calculation formulas of the final embedding of the scheduling task and the overall graph embedding are expressed by the following formulas: ; In the formula, This indicates that the scheduled task is ultimately embedded; Indicates instance normalization; Indicates the first Embed new scheduling tasks; Indicates the first Layer Embedding of a scheduling task; This indicates that the overall diagram is embedded. Indicates the total number of scheduled tasks; Indicates the first The task is at the bottom level. The output embedding.
[0012] Optionally, the step of modeling the global correlation among all scheduled tasks using a multi-head self-attention mechanism based on the initial embedding representation to generate a global association embedding includes: generating a query vector, a value vector, and a key vector based on the initial embedding representation; calculating the dot product of the query vector and the key vector and scaling it to generate an attention score; converting the attention score into probability distribution weights using a softmax operation; and generating the global association embedding through weighted aggregation of the value vectors. The calculation formula for the global association embedding is expressed by the following formula: ; In the formula, Indicates global associative embedding; Indicates scheduling task The query vector, , The projection matrix of the query vector. Indicates the first Layer Embedding of a scheduling task; Indicates scheduling task The key vector, , The projection matrix of the key vector. Indicates the first Layer Embedding of a scheduling task; Indicates scheduling task The value vector, , The projection matrix representing the value vector; The dimension of the key vector. , Indicates the dimension of the query vector. This represents the dimension of the value vector. This represents the total dimension of the input embedding vector. This indicates the number of attention heads.
[0013] Optionally, the step of combining the global association embedding and using a heterogeneous attention mechanism to model the interaction between high-priority and low-priority scheduled tasks to generate heterogeneous embeddings includes: for high-priority scheduled tasks, aggregating low-priority scheduled task information to generate high-priority task embeddings, wherein the calculation formula for the high-priority task embedding is expressed by the following formula: ; In the formula, Indicates a high-priority scheduling task; This represents the embedding of high-priority tasks in layer l; Indicates attention weight; This indicates the total number of low-priority tasks; A value vector representing low-priority tasks; Indicates calculation and The similarity function of the association strength; Indicates calculation and The similarity function of the association strength; The query vector representing a high-priority task; Key vectors representing low-priority tasks; The key vector dimension is represented; for low-priority scheduled tasks, high-priority scheduled task information is aggregated in reverse to generate low-priority task embeddings, and the calculation formula for the low-priority task embeddings is expressed by the following formula: ; In the formula, Indicates a low-priority scheduling task; This represents the embedding of a low-priority task in layer l; Indicates attention weight; A value vector representing high-priority tasks; This indicates the total number of high-priority tasks; Indicates calculation and The similarity function of the association strength; Indicates calculation and The similarity function of the association strength; The query vector representing a low-priority task; Key vectors representing high-priority tasks; This represents the dimension of the key vector.
[0014] Optionally, the decoder combines masking to generate a feasible task scheduling strategy, including: the decoder receives the final embedding of the scheduled task and the overall graph embedding, concatenates the overall graph embedding, the previous scheduled task node embedding, and the current core load to generate a context vector; uses the context vector as a query vector, the embeddings of all candidate scheduled task nodes as key vectors and value vectors, applies different linear transformations to each attention head, concatenates the outputs of all attention heads, performs linear projection, and generates a comprehensive context representation through a multi-head attention mechanism; Based on the comprehensive context representation, for each candidate scheduling task node, the context vector and the embedding of each candidate scheduling task node are linearly mapped to generate their respective query vectors and key vectors. The original score of each candidate scheduling task node is determined by the similarity between the vectors, and the original score is scaled and nonlinearly activated. The compatibility score of each candidate scheduling task node is calculated using a single-head attention mechanism. Candidate scheduling task nodes that violate constraints are filtered out using masking. The compatibility scores of the candidate scheduling task nodes that violate constraints are assigned a minimum value. The candidate scheduling task nodes that violate constraints include nodes where the scheduling task has been assigned or completed, nodes where the scheduling resource consumption is greater than the remaining processor resource capacity, and nodes where a low-priority scheduling task preempts the scheduling resources of a high-priority scheduling task. The compatibility scores of the remaining candidate scheduling task nodes are subjected to softmax normalization to obtain the probability distribution of the current step. The decoder selects or samples the next scheduling task node according to the probability distribution, and gradually constructs a feasible task scheduling strategy.
[0015] Secondly, embodiments of this application provide a dynamic task scheduling device for a complex power grid stability control model, comprising: a scheduling problem transformation module, a scheduling process transformation module, and a scheduling strategy generation module, wherein: The scheduling problem transformation module is used to transform the task scheduling problem into a directed acyclic graph, wherein the nodes in the directed acyclic graph represent scheduling tasks, the edges represent scheduling relationships between scheduling tasks, and the paths represent the scheduling sequence of processors. High-priority scheduling tasks and low-priority scheduling tasks are executed alternately in the scheduling sequence, and resource constraints and dependency constraints are satisfied during the execution of scheduling tasks. The scheduling process transformation module is used to combine the directed acyclic graph to transform the task scheduling process into a Markov decision process. The state space of the Markov decision process consists of task state vectors and processor resource vectors, the action space consists of allocation pairs between scheduling tasks and processors that satisfy the constraints of the directed acyclic graph, and the reward function consists of a weighted combination of completion time and load balancing ratio. The scheduling strategy generation module is used by the encoder-decoder neural network to generate task scheduling strategies based on the Markov decision process. The encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism, and the decoder generates feasible task scheduling strategies by combining masking processing.
[0016] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the steps in the above-mentioned dynamic task scheduling method for a complex power grid stability control model.
[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the above-described dynamic task scheduling method for a complex power grid stability control model.
[0018] The beneficial effects of the technical solutions provided in this application include at least the following: This application provides a dynamic task scheduling method for complex power grid stability control models. It transforms the task scheduling problem into a Directed Acyclic Graph (DAG), where nodes represent scheduling tasks, edges represent scheduling relationships between tasks, and paths represent processor scheduling sequences. High-priority and low-priority tasks are interleaved in the scheduling sequence, and resource and dependency constraints are satisfied during task execution. This improves the system's scheduling flexibility and scalability, leading to more efficient task allocation and processor utilization. Furthermore, the task scheduling process is transformed into a Multi-Planetary Decomposition (MDP) based on the DAG. The state space consists of task state vectors and processor resource vectors, the action space represents allocation pairs between scheduling tasks and processors that satisfy the DAG constraints, and the reward function is determined by the completion of the task. The model is constructed using a weighted combination of time and LBR (Lower-Rate Layout) and iterative processing to ensure that it can perceive system changes after the execution of scheduled tasks, gradually discovering scheduling strategies with higher throughput, shorter completion times, and better resource utilization. The encoder-decoder neural network generates task scheduling strategies based on Markov decision processes. The encoder generates the final embedding of the scheduled task and the overall graph embedding through a two-stage multi-head attention mechanism, capturing the global complex relationships between scheduled tasks and the interactions between high- and low-priority scheduled tasks, respectively, improving the accuracy and efficiency of scheduling decisions. The decoder combines masking to generate feasible task scheduling strategies, hard filtering out candidate scheduled task nodes that violate resource or dependency constraints, ensuring the feasibility of the output strategy and avoiding ineffective actions in reinforcement learning exploration. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 A flowchart illustrating a dynamic task scheduling method for a complex power grid stability control model provided in this application embodiment; Figure 2 A schematic diagram of a digital-physical hybrid simulation principle for a power grid security and stability control system is provided in this application embodiment; Figure 3 A schematic diagram of a multi-core task scheduling overall architecture for a security and stability control system based on deep reinforcement learning, provided for an embodiment of this application; Figure 4 This is a schematic diagram illustrating the interaction between high- and low-priority scheduling tasks using a heterogeneous attention mechanism, as provided in an embodiment of this application. Figure 5 A schematic diagram of a dynamic task scheduling device for a complex power grid stability control model provided in this application embodiment. Figure 6 This is a schematic diagram of the hardware entity of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0022] It should be noted that the terms "first, second, and third" used in the embodiments of this application are merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0023] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. It should also be understood that terms such as those defined in general dictionaries should be understood to have a meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0024] The embodiments of this application will be further described below with reference to the accompanying drawings.
[0025] In view of the current problems in the research on task scheduling of power grid stability control models in the field of power system simulation and intelligent computing, this application provides a method and device for dynamic task scheduling of complex power grid stability control models.
[0026] The technical solution of this application is described below, starting with the method embodiments.
[0027] Please refer to Figure 1 It illustrates a flowchart of a dynamic task scheduling method for a complex power grid stability control model provided in an embodiment of this application, such as... Figure 1 As shown, the method includes at least the following steps S110 to S130.
[0028] Step S110: The task scheduling problem is transformed into a directed acyclic graph, where nodes in the directed acyclic graph represent scheduled tasks, edges represent scheduling relationships between scheduled tasks, and paths represent scheduling sequences of processors. High-priority and low-priority scheduled tasks are executed alternately in the scheduling sequence, and resource constraints and dependency constraints are satisfied during the execution of scheduled tasks.
[0029] In this embodiment, the task scheduling problem is a typical CPU task allocation problem, involving multiple processors and a set of tasks to be scheduled. The set contains N tasks, of which M are high-priority and NM are low-priority. The resource consumption of each task is known, including CPU cycles and memory usage. For an example, please refer to [reference needed]. Figure 2This document illustrates a schematic diagram of a digital-physical hybrid simulation principle for a power grid safety and stability control system provided in this application embodiment. The system comprises three core units: a control circuit (digital domain), an output circuit (physical domain), and an SSC interface. The control circuit generates dispatch commands by running a real-time power grid simulation model. The output circuit connects to actual power equipment such as circuit breakers and relay protection devices to execute the digital domain dispatch commands. The SSC interface enables bidirectional conversion between digital commands and physical signals, converting the control circuit's dispatch commands into physical drive signals executable by the equipment. In closed-loop mode, it receives and digitizes feedback data from the feedback circuit. The system supports both open-loop testing and closed-loop verification modes. In open-loop testing, the control circuit unidirectionally drives the output circuit via the SSC, with no feedback. In closed-loop verification, there are two levels of feedback circuits: the first-level feedback circuit collects equipment status in real time, and the second-level feedback circuit analyzes and monitors the dynamic response of the system load. These two levels combine to form a data closed loop. The feedback data, after being digitized by the SSC, is transmitted back to the control circuit, driving the control circuit to dynamically correct its strategy, achieving closed-loop control of "command-execution-feedback-optimization." Based on the inherent characteristics of SSCS, the task scheduling problem can be transformed into a DAG, thereby completing the modeling of the stability control system and generating an improved CPU Task Assignment Problem (CTAP) model. Specifically, in a DAG, nodes represent scheduled tasks, edges represent scheduling relationships between scheduled tasks, and paths represent the scheduling sequence of processors. A DAG can be represented by G, G = (V, E), where V represents the set of scheduled task nodes, including high-priority scheduled tasks, low-priority scheduled tasks, and initial scheduled task nodes representing the idle state of processors, and E is the edge set, representing all possible transitions or scheduling relationships between scheduled tasks. Each processor's scheduling sequence corresponds to a path in the DAG. The DAG can explicitly represent the dependencies between scheduled tasks, providing opportunities for scheduling optimization.
[0030] Furthermore, in this embodiment, high-priority and low-priority scheduling tasks are interleaved in the scheduling sequence. During task execution, resource constraints and dependency constraints must be satisfied; that is, the scheduling task is executed only after all parent node scheduling tasks of the corresponding node in the DAG have been completed, and the scheduling resource consumption during task execution is less than or equal to the remaining processor resource capacity. Traditional CTAP combined with RL schemes typically enforce strict priority constraints, requiring each processor to complete all its allocated high-priority scheduling tasks before executing any low-priority scheduling task. This constraint ensures system responsiveness and timely execution of critical scheduling tasks. However, this rigid constraint leads to reduced processor utilization and affects overall scheduling efficiency. The technical solution provided in this embodiment, in the improved CTAP model, allows high-priority and low-priority scheduling tasks to be interleaved in the scheduling sequence, requiring only the satisfaction of resource and dependency constraints. By relaxing task priority constraints, the system can achieve improved scheduling flexibility, more efficient task allocation, and higher processor utilization.
[0031] Step S120: Combining the directed acyclic graph, the task scheduling process is transformed into a Markov decision process. The state space of the Markov decision process consists of task state vectors and processor resource vectors, the action space consists of allocation pairs between scheduling tasks and processors that satisfy the constraints of the directed acyclic graph, and the reward function consists of a weighted combination of completion time and load balancing ratio.
[0032] In this embodiment, the task scheduling process is transformed into an MDP by combining a Directed Acyclic Graph (DAG). The MDP includes a state space, an action space, and a reward function. Specifically, the task state vector in the state space represents the current state of the scheduled task corresponding to each node in the DAG. The current state includes pending execution, running, and completed. The processor resource vector represents the remaining resource capacity of each processor in the DAG at each decision step. When the state space is in its initial state, all scheduled tasks are unallocated, and all processor resources are fully loaded. For a specific embodiment, please refer to... Figure 3 It shows a schematic diagram of the overall architecture of multi-core task scheduling of a security and stability control system based on deep reinforcement learning provided in an embodiment of this application. In each decision step t, the system state is denoted as s. t =(P t D t ), where P t The task state vector represents the current allocation and execution state of each scheduled task node in the set V of scheduled task nodes in the DAG, including pending, running, and completed; D t Let be the processor resource vector for decision step t, representing the processors in the DAG at decision step t. The remaining resource capacity at that time; in addition, at the initial time, i.e., t=0, S0 represents the initial state, P0 represents that all scheduled tasks are not allocated, and D0 represents that all processor resources are fully loaded, i.e., the full resource capacity of all processors.
[0033] In this embodiment, the action space (Action) represents the selection of ready-to-schedule tasks, the allocation of these tasks to the processor, and the simultaneous satisfaction of resource constraints and dependency constraints. In a specific embodiment, action a... t ∈A, indicating that a ready task i∈V is selected and assigned to processor k∈K, i.e., a t =(i,k), only allowing resources (D) to be satisfied in the DAG. t The feasible allocation of constraints and dependencies is demonstrated. The action module shows the allocation relationship between CPU cores and scheduled tasks. The scheduling agent generates specific scheduling actions based on the current state and optimization objective. Action a is then executed. t Afterwards, the environment changed from s t Transfer to s t+1 The status and processor resources of the scheduled tasks are updated, and the schedulability of downstream tasks is adjusted accordingly based on the DAG structure. The entire process iterates continuously through a feedback loop between the environment module and the feedback module to ensure that the model can perceive the system changes after the scheduled tasks are executed.
[0034] In this embodiment, the primary objective of the reward function design is to minimize completion time and improve processor load balancing. Specifically, the reward function is a weighted combination of completion time and LBR (Lower Processing Time). The two optimization objectives are flexibly adjusted through weight parameters. The calculation formula for this reward function is expressed as follows: ; In the formula, Indicating in the decision-making step Instant rewards; Indicates the completion time; Indicates the load balancing ratio; and This represents an adjustable weight parameter. Positive rewards are given for timely completion of scheduling tasks and efficient use of processor resources, while penalties are given for wasting processor resources or when the processor is idle. The cumulative reward is calculated using a discount factor to balance immediate and long-term scheduling performance, so as to effectively guide the agent to learn efficient and robust scheduling strategies and adapt to different task sizes and system states. The ultimate goal is to learn scheduling strategies to maximize the cumulative reward. Through interaction with the environment, the scheduling agent gradually discovers scheduling strategies with higher throughput, shorter completion time and better resource utilization.
[0035] Step S130: The encoder-decoder neural network generates a task scheduling strategy based on the Markov decision process. The encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism, and the decoder generates a feasible task scheduling strategy by combining masking processing.
[0036] In this embodiment, the encoder generates the final embedding of the scheduled task and the overall graph embedding through a two-stage multi-head attention mechanism. Specifically, the encoder receives the state space and extracts the embedding representations of the main core, the main core group, and the auxiliary core group to generate the initial embedding representation. The number of CPU cores is N. Each core Each has a normalized load value. , where 0 < | |<1. When a scheduled task starts from a core, that core runs at full load, and the initial embedding representation is expressed by the following formula: =[ , , ]; In the formula, The embedded representation of the main core, This represents the embedded representation of the main core group. The embedded representation of the auxiliary core group is used to model the relationship between the main core and the auxiliary cores, as well as their interactions, through the initial embedded representation, thereby providing a more valuable representation for subsequent task scheduling.
[0037] Furthermore, based on the initial embedding representation, a multi-head self-attention mechanism is used to model the global correlation between all scheduled tasks, generating a global associative embedding to better capture complex global relationships. In the initial stage, for any two scheduled tasks in the scheduling system, regardless of whether they are assigned to different cores, the same core, or represent interactions between a core and a scheduled task, dependencies or resource competition may exist, indicating a potential correlation between any pair of scheduled tasks. Therefore, the entire multi-core scheduling system is modeled as a graph, utilizing a multi-head self-attention mechanism to capture the relationships between all scheduled tasks. Specifically, first, query vectors, value vectors, and key vectors are generated based on the initial embedding representation. The dot product of the query vector and the key vector is calculated and scaled to generate an attention score. Next, the attention score is converted into probability distribution weights using a softmax operation. Finally, weighted aggregation is performed using the value vectors. In multi-core CPU scheduling, this process can be efficiently implemented using an optimized matrix multiplication library (such as BLAS) or a multi-threaded framework (such as OpenMP). Each attention head executes the above operations in parallel, ultimately generating a global associative embedding, the calculation formula of which is expressed as follows: ; In the formula, Indicates global associative embedding; Indicates scheduling task The query vector, , The projection matrix of the query vector. Indicates the first Layer Embedding of a scheduling task; Indicates scheduling task The key vector, , The projection matrix of the key vector. Indicates the first Layer Embedding of a scheduling task; Indicates scheduling task The value vector, , The projection matrix representing the value vector; The dimension of the key vector. , Indicates the dimension of the query vector. This represents the dimension of the value vector. This represents the total dimension of the input embedding vector. This indicates the number of attention heads.
[0038] Furthermore, combining global associative embedding, a heterogeneous attention mechanism is employed to model the interaction between high-priority and low-priority scheduled tasks. This mechanism, based on cross-type aggregation, generates heterogeneous embeddings, which include both high-priority and low-priority task embeddings. For examples, please refer to [link / reference]. Figure 4 This illustration shows a schematic diagram of modeling the interaction between high-priority and low-priority scheduling tasks through a heterogeneous attention mechanism, as provided in an embodiment of this application. Here, Scale represents a scaling operation, Softmax represents a flexible maximum function, and Matmul represents matrix multiplication. Specifically, for high-priority scheduling tasks, low-priority scheduling task information is aggregated to generate a high-priority task embedding. The calculation formula for this high-priority task embedding is expressed by the following formula: ; In the formula, Indicates a high-priority scheduling task; This represents the embedding of high-priority tasks in layer l; Indicates attention weight; This indicates the total number of low-priority tasks; A value vector representing low-priority tasks; Indicates calculation and The similarity function is a function of the association strength, which can be any learnable similarity function, such as a scaled dot product; Indicates calculation and The similarity function of the association strength; The query vector representing a high-priority task; Key vectors representing low-priority tasks; This represents the dimension of the key vector. For low-priority scheduled tasks, high-priority scheduled task information is aggregated in reverse to generate a low-priority task embedding. The calculation formula for this low-priority task embedding is expressed as follows: ; In the formula, Indicates a low-priority scheduling task; This represents the embedding of a low-priority task in layer l; Indicates attention weight; A value vector representing high-priority tasks; This indicates the total number of high-priority tasks; Indicates calculation and The similarity function of the association strength; Indicates calculation and The similarity function of the association strength; The query vector representing a low-priority task; Key vectors representing high-priority tasks; This represents the dimension of the key vector. Each projection method is represented by the following formula: ; In the formula, , , , , , This represents the query, key, and value vector generated after projection; , , A projection matrix representing the learnable query, key, and value vectors; , This represents the hidden state of the previous layer's output. Further, after completing the two-stage multi-head attention operation, all embeddings are processed through a feedforward network. The processing is represented by the following formula: ; In the formula, Represents the input vector; This represents the first-layer weight matrix; This represents the weight matrix of the second layer; This represents the first-level bias vector; This represents the second-layer bias vector.
[0039] Furthermore, residual connections and instance normalization are performed on the heterogeneous embeddings of each layer to generate the final embedding of the scheduling task and the overall graph embedding. The final embedding of each scheduling task is the output of the last layer. The calculation formulas for the final embedding of the scheduling task and the overall graph embedding are expressed by the following formulas: ; In the formula, This indicates that the scheduled task is ultimately embedded; Indicates instance normalization; Indicates the first Embed new scheduling tasks; Indicates the first Layer Embedding of a scheduling task; This indicates that the overall diagram is embedded. Indicates the total number of scheduled tasks; Indicates the first The task is at the bottom level. The output embedding.
[0040] In this embodiment, the decoder combines masking processing to generate a feasible task scheduling strategy. Specifically, the decoder receives the final embedding of the scheduled task and the overall graph embedding, and embeds the overall graph... Embedding the previous scheduling task node and current core load The vectors are then concatenated to generate the context vector for each decoding step. The context vector is processed through a series of attention mechanisms to determine the selection probability of the next node. The context vector is used as the query vector, and the embeddings of all candidate scheduling task nodes are used as key and value vectors. Different linear transformations are applied to each attention head, allowing the model to aggregate information from different subspaces. The outputs of all attention heads are concatenated and linearly projected to generate a comprehensive context representation through a multi-head attention mechanism, thereby enhancing the decoder's ability to capture complex relationships between nodes. Based on this comprehensive context representation, for each candidate scheduling task node, the context vector and the embedding of each candidate scheduling task node are linearly mapped to generate their respective query and key vectors. The original score of each candidate scheduling task node is determined by the similarity between vectors, which can be a dot product or a correlation function. The original score is scaled and nonlinearly activated to encourage exploration and control the score range. Finally, a compatibility score for each candidate scheduling task node is calculated using a single-head attention mechanism.
[0041] In this embodiment, masking is used to filter candidate scheduling task nodes that violate constraints. The compatibility score of these candidate scheduling task nodes is assigned a minimum value to prevent them from being selected, thus ensuring feasibility. Candidate scheduling task nodes that violate constraints include nodes where scheduling tasks have already been assigned or completed, nodes where scheduling resource consumption exceeds the remaining processor resource capacity, and nodes where low-priority scheduling tasks preempt scheduling resources from high-priority scheduling tasks. The compatibility scores of all remaining candidate scheduling task nodes are then subjected to softmax normalization to obtain the probability distribution for the current step. The decoder selects or samples the next scheduling task node based on the probability distribution, ultimately constructing a feasible complete task scheduling strategy step by step.
[0042] In summary, the dynamic task scheduling method for a complex power grid stability control model provided in this application transforms the task scheduling problem into a Directed Acyclic Graph (DAG). Nodes in the DAG represent scheduling tasks, edges represent scheduling relationships between tasks, and paths represent processor scheduling sequences. High-priority and low-priority tasks are interleaved in the scheduling sequence, and resource and dependency constraints are satisfied during task execution. This enhances the system's scheduling flexibility and scalability, resulting in more efficient task allocation and processor utilization. Furthermore, by combining the DAG with the method, the task scheduling process is transformed into a Multi-Planetary Decomposition (MDP). The state space consists of task state vectors and processor resource vectors, while the action space represents the allocation pairs between scheduling tasks and processors that satisfy the DAG constraints. The reward function is a weighted combination of completion time and LBR. Through continuous iteration, the model can perceive the system changes after the scheduling task is executed and gradually discover scheduling strategies with higher throughput, shorter completion time and better resource utilization. The task scheduling strategy is generated by an encoder-decoder neural network. The encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism. This captures the global complex relationship between scheduling tasks and the interaction between high and low priority scheduling tasks, respectively, to improve the accuracy and efficiency of scheduling decisions. The decoder generates feasible task scheduling strategies by combining masking processing and hard filtering out candidate scheduling task nodes that violate resource or dependency constraints, ensuring the feasibility of the output strategy and avoiding invalid actions in reinforcement learning exploration.
[0043] The above is a description of the method embodiments of this application. Based on the foregoing embodiments, the following describes the device embodiments of this application, which are used to execute the method of this application. For details not disclosed in the device embodiments, please refer to the method embodiments. This application embodiment further provides a dynamic task scheduling device for a complex power grid stability control model. The device includes various modules and units included in each module, which can be implemented by a processor in an electronic device; of course, it can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0044] Please refer to Figure 5 This illustration shows a schematic diagram of a dynamic task scheduling device 500 for a complex power grid stability control model provided in an embodiment of this application. This dynamic task scheduling device 500 for a complex power grid stability control model can achieve the following: Figure 1 The dynamic task scheduling method for the complex power grid stability control model is shown. For example... Figure 5 As shown, a dynamic task scheduling device 500 for a complex power grid stability control model includes: a scheduling problem transformation module 510, a scheduling process transformation module 520, and a scheduling strategy generation module 530. Specifically, The scheduling problem transformation module 510 is used to transform the task scheduling problem into a directed acyclic graph, wherein the nodes in the directed acyclic graph represent scheduling tasks, the edges represent scheduling relationships between scheduling tasks, and the paths represent the scheduling sequence of processors. High-priority scheduling tasks and low-priority scheduling tasks are executed alternately in the scheduling sequence, and resource constraints and dependency constraints are satisfied during the execution of scheduling tasks. The scheduling process transformation module 520 is used to combine the directed acyclic graph to transform the task scheduling process into a Markov decision process. The state space of the Markov decision process consists of task state vectors and processor resource vectors, the action space consists of allocation pairs between scheduling tasks and processors that satisfy the constraints of the directed acyclic graph, and the reward function consists of a weighted combination of completion time and load balancing ratio. The scheduling strategy generation module 530 is used for the encoder-decoder neural network to generate a task scheduling strategy based on the Markov decision process. The encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism, and the decoder generates a feasible task scheduling strategy by combining masking processing.
[0045] It should be noted that, in the embodiments of this application, if the above-mentioned dynamic task scheduling method for a complex power grid stability control model is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0046] Correspondingly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the steps in the dynamic task scheduling method for a complex power grid stability control model described in any of the above embodiments. Correspondingly, embodiments of this application also provide a computer program product. When executed by a processor of an electronic device, the computer program product is used to implement the steps in the dynamic task scheduling method for a complex power grid stability control model described in any of the above embodiments.
[0047] Based on the same technical concept, this application provides an electronic device for implementing a dynamic task scheduling method for a complex power grid stability control model as described in the above method embodiments. Figure 6 This is a hardware entity diagram of an electronic device provided in an embodiment of this application, such as... Figure 6 As shown, the electronic device 600 includes a memory 610 and a processor 620. The memory 610 stores a computer program that can run on the processor 620. When the processor 620 executes the program, it implements the steps in the dynamic task scheduling method for a complex power grid stability control model according to any embodiment of this application.
[0048] The memory 610 is configured to store instructions and applications executable by the processor 620, and can also cache data to be processed or already processed by the processor 620 and various modules in the electronic device (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).
[0049] The processor 620 executes a program to implement the steps of a dynamic task scheduling method for a complex power grid stability control model, as described above. The processor 620 typically controls the overall operation of the electronic equipment 600.
[0050] The aforementioned processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor. It is understood that other electronic devices can also implement the functions of the aforementioned processor, and this application does not specifically limit the specific implementation.
[0051] The aforementioned computer storage media / memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various electronic devices that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0052] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0053] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0054] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0055] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0056] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0057] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0058] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause the device automatic test line to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0059] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0060] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0061] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A dynamic task scheduling method for a complex power grid stability control model, characterized in that, The method includes: The task scheduling problem is transformed into a directed acyclic graph, where nodes in the directed acyclic graph represent scheduled tasks, edges represent scheduling relationships between scheduled tasks, and paths represent processor scheduling sequences. High-priority and low-priority scheduled tasks are executed alternately in the scheduling sequence, and resource constraints and dependency constraints are satisfied during the execution of scheduled tasks. Combining the aforementioned directed acyclic graph, the task scheduling process is transformed into a Markov decision process. The state space of the Markov decision process consists of task state vectors and processor resource vectors, the action space consists of allocation pairs between scheduling tasks and processors that satisfy the constraints of the directed acyclic graph, and the reward function consists of a weighted combination of completion time and load balancing ratio. The encoder-decoder neural network generates a task scheduling strategy based on the Markov decision process. The encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism, and the decoder generates a feasible task scheduling strategy by combining masking processing.
2. The method according to claim 1, characterized in that, The task scheduling problem involves multiple processors and a set of scheduled tasks. The set of scheduled tasks contains M high-priority tasks and NM low-priority tasks. The resource consumption of each scheduled task is known. The execution of each scheduled task satisfies resource constraints and dependency constraints, including: The scheduling task is executed after all parent node scheduling tasks of the corresponding node in the directed acyclic graph have been completed. The amount of scheduling resources consumed during the execution of the scheduling task is less than or equal to the remaining resource capacity of the processor.
3. The method according to claim 1, characterized in that, The task state vector in the state space represents the current state of the scheduled task corresponding to each node in the directed acyclic graph. The current state includes pending execution, running, and completed. The processor resource vector represents the remaining resource capacity of each processor in the directed acyclic graph at each decision step. When the state space is in the initial state, all scheduled tasks are unallocated and all processor resources are fully loaded. The action representation in the action space selects ready scheduling tasks, allocates the ready scheduling tasks to the processor, and simultaneously satisfies the resource constraints and the dependency constraints. The reward function is calculated using the following formula: ; In the formula, Indicating in the decision-making step Instant rewards; Indicates the completion time; Indicates the load balancing ratio; and This represents an adjustable weight parameter; positive rewards are given for timely completion of scheduling tasks and efficient use of processor resources, while penalties are given for wasting processor resources or when the processor is idle. The scheduling strategy is learned to maximize the cumulative reward.
4. The method according to claim 3, characterized in that, The encoder generates the final embedding of the scheduled task and the overall graph embedding through a two-stage multi-head attention mechanism, including: The encoder receives the state space and extracts the embedded representations of the main core, the main core group, and the auxiliary core group to generate an initial embedded representation; Based on the initial embedding representation, a global correlation embedding is generated by modeling the global correlation among all scheduled tasks through a multi-head self-attention mechanism. Combining the global association embedding, a heterogeneous attention mechanism is used to model the interaction between high-priority scheduled tasks and low-priority scheduled tasks, generating heterogeneous embeddings, which include high-priority task embeddings and low-priority task embeddings. Each layer of heterogeneous embeddings undergoes residual join and instance normalization to generate the final embedding of the scheduling task and the overall graph embedding. The calculation formulas for the final embedding of the scheduling task and the overall graph embedding are expressed by the following formulas: ; In the formula, This indicates that the scheduled task is ultimately embedded; Indicates instance normalization; Indicates the first Embed new scheduling tasks; Indicates the first Layer Embedding of a scheduling task; This indicates that the overall diagram is embedded. Indicates the total number of scheduled tasks; Indicates the first The task is at the bottom level. The output embedding.
5. The method according to claim 4, characterized in that, The step of generating a globally correlated embedding by modeling the global correlation among all scheduled tasks using a multi-head self-attention mechanism based on the initial embedding representation includes: Generate a query vector, a value vector, and a key vector based on the initial embedding representation; calculate the dot product of the query vector and the key vector and scale them to generate an attention score. The attention score is converted into probability distribution weights using a softmax operation; The global association embedding is generated by weighted aggregation of value vectors, and the calculation formula for the global association embedding is expressed by the following formula: ; In the formula, Indicates global associative embedding; Indicates scheduling task The query vector, , The projection matrix of the query vector. Indicates the first Layer Embedding of a scheduling task; Indicates scheduling task The key vector, , The projection matrix of the key vector. Indicates the first Layer Embedding of a scheduling task; Indicates scheduling task The value vector, , The projection matrix representing the value vector; This represents the dimension of the key vector. , Indicates the dimension of the query vector. This represents the dimension of the value vector. This represents the total dimension of the input embedding vector. This indicates the number of attention heads.
6. The method according to claim 4, characterized in that, The process of combining the global association embedding with a heterogeneous attention mechanism to model the interaction between high-priority and low-priority scheduled tasks and generating heterogeneous embeddings includes: For high-priority scheduled tasks, low-priority scheduled task information is aggregated to generate a high-priority task embedding. The calculation formula for the high-priority task embedding is expressed by the following formula: ; In the formula, Indicates a high-priority scheduling task; This represents the embedding of high-priority tasks in layer l; Indicates attention weight; This indicates the total number of low-priority tasks; A value vector representing low-priority tasks; Indicates calculation and The similarity function of the association strength; Indicates calculation and The similarity function of the association strength; The query vector representing a high-priority task; Key vectors representing low-priority tasks; Indicates the dimension of the key vector; For low-priority scheduled tasks, high-priority scheduled task information is aggregated in reverse to generate a low-priority task embedding. The calculation formula for the low-priority task embedding is expressed by the following formula: ; In the formula, Indicates a low-priority scheduling task; This represents the embedding of a low-priority task in layer l; Indicates attention weight; A value vector representing high-priority tasks; This indicates the total number of high-priority tasks; Indicates calculation and The similarity function of the association strength; Indicates calculation and The similarity function of the association strength; The query vector representing a low-priority task; Key vectors representing high-priority tasks; This represents the dimension of the key vector.
7. The method according to claim 1, characterized in that, The decoder, combined with masking, generates a feasible task scheduling strategy, including: The decoder receives the final embedding of the scheduled task and the overall graph embedding, and concatenates the overall graph embedding, the previous scheduled task node embedding, and the current core load to generate a context vector. The context vector is used as the query vector, the embeddings of all candidate scheduling task nodes are used as the key vector and value vector, different linear transformations are applied to each attention head, the outputs of all attention heads are concatenated, and after linear projection, a comprehensive context representation is generated through a multi-head attention mechanism. Based on the comprehensive context representation, for each candidate scheduling task node, the context vector and the embedding of each candidate scheduling task node are linearly mapped to generate their respective query vector and key vector. The original score of each candidate scheduling task node is determined by the similarity between the vectors, and the original score is scaled and nonlinearly activated. The compatibility score of each candidate scheduling task node is calculated by a single-head attention mechanism. Candidate scheduling task nodes that violate constraints are filtered using masking. The compatibility score of the candidate scheduling task nodes that violate constraints is assigned a minimum value. The candidate scheduling task nodes that violate constraints include nodes where the scheduling task has been assigned or completed, nodes where the scheduling resource consumption is greater than the remaining processor resource capacity, and nodes where a low-priority scheduling task preempts the scheduling resources of a high-priority scheduling task. The compatibility scores of the remaining candidate scheduling task nodes are normalized using softmax to obtain the probability distribution of the current step. The decoder selects or samples the next scheduling task node based on the probability distribution, and gradually constructs a feasible task scheduling strategy.
8. A dynamic task scheduling device for a complex power grid stability control model, characterized in that, The device includes: The scheduling problem transformation module is used to transform the task scheduling problem into a directed acyclic graph, wherein the nodes in the directed acyclic graph represent scheduling tasks, the edges represent scheduling relationships between scheduling tasks, and the paths represent the scheduling sequence of processors. High-priority scheduling tasks and low-priority scheduling tasks are executed alternately in the scheduling sequence, and resource constraints and dependency constraints are satisfied during the execution of scheduling tasks. The scheduling process transformation module is used to combine the directed acyclic graph to transform the task scheduling process into a Markov decision process. The state space of the Markov decision process consists of task state vectors and processor resource vectors, the action space consists of allocation pairs between scheduling tasks and processors that satisfy the constraints of the directed acyclic graph, and the reward function consists of a weighted combination of completion time and load balancing ratio. The scheduling strategy generation module is used by the encoder-decoder neural network to generate task scheduling strategies based on the Markov decision process. The encoder generates the final embedding of the scheduling task and the overall graph embedding through a two-stage multi-head attention mechanism, and the decoder generates feasible task scheduling strategies by combining masking processing.
9. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 7.
