Power grid dispatching method and device of artificial intelligence Transform model based on physical constraint

By using a physically constrained AI Transformer model for power grid dispatching, the problems of high computational complexity and poor robustness in large-scale power grids are solved, and fast and accurate power grid recovery and dispatching are achieved.

CN121886337APending Publication Date: 2026-04-17EAST CHINA BRANCH OF STATE GRID CORP
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EAST CHINA BRANCH OF STATE GRID CORP
Filing Date
2025-12-01
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing power grid dispatching methods have high computational complexity in large-scale power grids, making it difficult to meet the requirements for real-time recovery. Furthermore, deep reinforcement learning algorithms have poor robustness under complex physical constraints, resulting in low dispatching accuracy.

Method used

A physical constraint-based artificial intelligence Transformer model is adopted. By acquiring the state sequence, action sequence and target reward parameters of the switching nodes, the attention mechanism and Markov decision function in the Transformer model are used to construct the power grid physical constraint matrix, make switching decisions, and generate power grid dispatching strategies.

Benefits of technology

It improves the speed and accuracy of decision-making in large-scale power systems, enables rapid recovery and stable dispatch of complex power grids, and has good real-time performance and generalization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121886337A_ABST
    Figure CN121886337A_ABST
Patent Text Reader

Abstract

The invention discloses a power grid dispatching method and device based on a physical constraint artificial intelligence Transform model, relates to the technical field of power systems, and mainly aims to solve the problem of poor power grid dispatching in the prior art. Comprising the steps of obtaining a switching node state sequence, a switching node action sequence and a power grid target return parameter which are used for recovery operation in a power grid; the switch node state sequence, the switch node action sequence and the power grid target return parameters are predicted based on a Transform model which completes model training, a switch operation prediction result is obtained, and an attention mechanism in the Transform model is determined based on a power grid physical constraint matrix. The power grid physical constraint matrix is constructed based on a Markov decision function so as to carry out switching decision; and generating a power grid dispatching strategy based on the switch operation prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power system technology, and in particular to a power grid dispatching method and apparatus based on a physically constrained artificial intelligence Transformer model. Background Technology

[0002] With the expansion of the power grid and the increase in the penetration rate of renewable energy, the uncertainty and dynamism of power grid operation have increased significantly. Therefore, higher requirements are placed on the real-time performance, stability and scalability of fault recovery and dispatch control.

[0003] Currently, existing power grid dispatching methods typically employ optimal solutions based on physical models or intelligent solutions using deep reinforcement learning algorithms. However, physical models rely heavily on high precision in system parameters and topology. As the network scale expands, the number of controllable components increases, or the operating state changes rapidly, their computational complexity grows exponentially, making it difficult to meet real-time recovery requirements. On the other hand, deep reinforcement learning algorithms suffer from problems such as large training sample requirements, slow convergence speed, and instability under complex physical constraints, resulting in poor convergence and robustness, which significantly reduces the accuracy of power grid dispatching. Summary of the Invention

[0004] In view of this, this application provides a power grid dispatching method and apparatus based on a physically constrained artificial intelligence Transformer model, with the main purpose of solving the problem of poor power grid dispatching in the past.

[0005] According to one aspect of this application, a power grid dispatching method based on a physically constrained artificial intelligence Transformer model is provided, comprising: Acquire the state sequence of switch nodes used for recovery operations, the action sequence of switch nodes, and the target return parameters of the power grid; Based on the Transformer model that has completed model training, the state sequence of the switching node, the action sequence of the switching node, and the target reward parameter of the power grid are predicted to obtain the switching operation prediction result. The attention mechanism in the Transformer model is determined based on the physical constraint matrix of the power grid, which is constructed based on the Markov decision function to make switching decisions. A power grid dispatch strategy is generated based on the predicted results of the switching operations.

[0006] Furthermore, before acquiring the switch node state sequence, switch node action sequence, and grid target return parameters for recovery operations in the power grid, the method further includes: A training sample set of switch operations is obtained, and a neural network model containing a stacked Transformer encoder structure is constructed. The neural network model includes an embedding layer, a causal agent layer, and an action decoding layer. The training sample set of switch operations includes control action sample sequences of operable switches. The neural network model is trained based on the training sample set of the switching operation to obtain the Transformer model after the model training is completed; The attention mechanism introduced in the causal subject layer embeds a power grid physical constraint matrix, which is expressed as: ; Among them, the Representing the state space, Represents the action space, Represents the state transition probability. Represents the reward function, Indicates the discount factor. Indicates a time range. Let represent the Markov decision function.

[0007] Furthermore, the reward function also includes a backtracking reward, which is obtained by time-series summation based on the grid target return parameters.

[0008] Furthermore, the embedding layer is used to map the state sample sequence, action sample sequence and reward sequence in the control action sample sequence of the operable switch into vectors, and add position encoding; the action decoding layer is used to generate the switch probability distribution through the activation function and output the highest probability switch action.

[0009] Further, the step of training the neural network model based on the training sample set of the switching operations to obtain the completed Transformer model includes: During model training, the embedding layer inputs a preset number of state sample sequences from the switch operation training sample set into the causal subject layer. The switching decision is made by the causal subject layer, and the action decoding layer outputs the action sample sequence when the calculated cross-entropy loss value meets the preset training conditions, until the neural network model completes the preset rounds of model training.

[0010] Furthermore, the acquisition of the switch node state sequence, switch node action sequence, and grid target return parameters for recovery operations in the power grid includes: Acquire information on the power grid recovery process, including a recovery path, which includes multiple switching nodes; Based on the recovery process information, the state of each switch, and the action of each switch, a switch node state sequence and a switch node action sequence are generated.

[0011] Furthermore, the method also includes: Obtain the rated active power of the load nodes in the recovery path; The rated active power is summed over time to obtain the target return parameters of the power grid.

[0012] According to another aspect of this application, a power grid dispatching device based on a physically constrained artificial intelligence Transformer model is provided, comprising: The acquisition module is used to acquire the state sequence of switch nodes used for recovery operations, the action sequence of switch nodes, and the target return parameters of the power grid. The processing module is used to predict the state sequence of the switching node, the action sequence of the switching node, and the target reward parameter of the power grid based on the Transformer model that has completed model training, so as to obtain the switching operation prediction result. The attention mechanism in the Transformer model is determined based on the power grid physical constraint matrix, which is constructed based on the Markov decision function to make switching decisions. The generation module is used to generate a power grid dispatching strategy based on the prediction results of the switching operations.

[0013] Furthermore, the device also includes: The building module is also used to obtain a training sample set of switch operations and to build a neural network model containing a Transformer encoder stack structure. The neural network model includes an embedding layer, a causal subject layer and an action decoding layer. The training sample set of switch operations includes a sequence of control action samples of operable switches. The training module is used to train the neural network model based on the training sample set of the switching operation to obtain the Transformer model after the model training is completed. The attention mechanism introduced in the causal subject layer embeds a power grid physical constraint matrix, which is expressed as: ; Among them, the Representing the state space, Represents the action space, Represents the state transition probability. Represents the reward function, Indicates the discount factor. Indicates a time range. Let represent the Markov decision function.

[0014] Furthermore, the reward function also includes a backtracking reward, which is obtained by time-series summation based on the grid target return parameters.

[0015] Furthermore, the embedding layer is used to map the state sample sequence, action sample sequence and reward sequence in the control action sample sequence of the operable switch into vectors, and add position encoding; the action decoding layer is used to generate the switch probability distribution through the activation function and output the highest probability switch action.

[0016] Furthermore, The training module is specifically used to input a preset number of state sample sequences from the switch operation training sample set into the causal subject layer through the embedding layer during model training; make switch decisions through the causal subject layer; and output the action sample sequence through the action decoding layer when the calculated cross-entropy loss value meets the preset training conditions, until the neural network model completes a preset number of model training rounds.

[0017] Furthermore, The acquisition module is specifically used to acquire information about the power grid recovery process, including a recovery path and multiple switch nodes. Based on the recovery process information, the status of each switch, and the actions of each switch, a switch node status sequence and a switch node action sequence are generated.

[0018] Furthermore, The acquisition module is further configured to acquire the rated active power of the load nodes in the recovery path; and to perform time-series summation on the rated active power to obtain the target return parameters of the power grid.

[0019] According to another aspect of this application, a storage medium is provided that stores at least one executable instruction, which causes a processor to perform operations corresponding to the power grid scheduling method based on the physical constraint-based artificial intelligence Transformer model described above.

[0020] According to another aspect of this application, a terminal is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the power grid scheduling method based on the physical constraint-based artificial intelligence Transformer model.

[0021] By employing the above technical solutions, the technical solutions provided in the embodiments of this application have at least the following advantages: This application provides a power grid dispatching method and apparatus based on a physically constrained artificial intelligence Transformer model. Compared with the prior art, the embodiments of this application obtain the state sequence of switching nodes, the action sequence of switching nodes, and the target reward parameters of the power grid for recovery operations. Based on the Transformer model that has completed model training, the state sequence of switching nodes, the action sequence of switching nodes, and the target reward parameters of the power grid are predicted to obtain the switching operation prediction results. The attention mechanism in the Transformer model is determined based on the power grid physical constraint matrix, which is constructed based on the Markov decision function to make switching decisions. Based on the switching operation prediction results, a power grid dispatching strategy is generated. By introducing a physical constraint reward mechanism, the physical feasibility and voltage stability of the generated decision are guaranteed, improving the decision-making speed and accuracy of large-scale power systems. It can realize the rapid recovery and stable dispatching of complex power grids and has good real-time performance and generalization ability.

[0022] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0023] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart of a power grid scheduling method based on a physically constrained artificial intelligence Transformer model, provided in an embodiment of this application, is shown. Figure 2 This illustration shows an overall structural diagram of a physical constraint decision Transformer framework provided in an embodiment of this application; Figure 3 This paper illustrates a block diagram of a power grid dispatching device based on a physically constrained artificial intelligence Transformer model, as provided in an embodiment of this application. Figure 4 A schematic diagram of the structure of a terminal provided in an embodiment of this application is shown. Detailed Implementation

[0024] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] The embodiments of this invention can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0027] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0028] Based on this, in one embodiment, the present invention provides a power grid scheduling method based on a physically constrained artificial intelligence Transformer model. Taking the application of this method to computer devices such as servers as an example, the server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0029] This application provides a power grid scheduling method based on a physically constrained artificial intelligence Transformer model, such as... Figure 1 As shown, the method includes: 101. Obtain the state sequence of switch nodes, the action sequence of switch nodes, and the target return parameters of the power grid used for recovery operations.

[0030] In this embodiment, the power grid restoration process refers to the process of gradually connecting or initiating a series of switch control actions to change the load state from abnormal to normal operation. At this time, the restoration process can be modeled and predicted to determine which switch actions can restore the power grid, thus representing a method of power grid operation scheduling. The execution controller, acting as the current execution end to perform power grid scheduling, can be a server or terminal, including but not limited to a power grid server or terminal controller, to obtain switch node state sequences, switch node action sequences, and power grid target return parameters. Here, the switch node state sequence represents the switching state of each switch node, the switch node action sequence represents the action of each switch node, and the power grid target return parameters represent the power grid limit during the power grid restoration prediction process; this embodiment does not impose specific limitations on these parameters.

[0031] 102. Based on the Transformer model that has completed model training, the state sequence of the switching node, the action sequence of the switching node, and the target return parameters of the power grid are predicted to obtain the switching operation prediction results.

[0032] In this embodiment, after obtaining the switch node state sequence, switch node action sequence, and grid target reward parameters, a prediction process is performed on the switch node state sequence, switch node action sequence, and grid target reward parameters based on the Transformer model to obtain the switch operation prediction results. The attention mechanism in the Transformer model is determined based on the grid physical constraint matrix, which is constructed based on a Markov decision function to make switch decisions and predict the action operation results of each switch node.

[0033] In another embodiment of this application, to further define and illustrate, before obtaining the switch node state sequence, switch node action sequence, and grid target return parameters for the power grid recovery operation, the method further includes: Obtain a training sample set of switching operations and construct a neural network model containing a stacked Transformer encoder structure; The neural network model is trained based on the training sample set of the switching operation to obtain the Transformer model after the model training is completed.

[0034] To achieve the goal of a Transformer model based on physical constraints for decision-making, thereby improving the prediction accuracy of power grid actions, a training sample set of switching operations is pre-set at the current execution end, and a neural network model containing a stacked Transformer encoder structure is constructed. This neural network model includes an embedding layer, a causal agent layer, and an action decoding layer. The training sample set of switching operations includes control action sample sequences of operable switches. In this case, the attention mechanism introduced in the causal agent layer embeds a power grid physical constraint matrix, which is expressed as: ; Among them, the Representing the state space, Represents the action space, Represents the state transition probability. Represents the reward function, Indicates the discount factor. Indicates a time range. Let represent the Markov decision function.

[0035] It should be noted that, since the power grid logistics constraint matrix is ​​used to characterize the power grid recovery process, sequential decision-making is used for modeling. Specifically, the modeling constraints are first defined, including: (1) Voltage amplitude constraint: The node voltage must be maintained within the allowable range. , ]; (2) Power flow constraints: satisfy the power balance equation; (3) Output limitations of distributed power sources: active and reactive power output is limited by the upper limit of capacity; (4) Topological constraints: avoid loop formation and ensure that no node cell is visited repeatedly.

[0036] Furthermore, by using a Markov decision process for modeling, the expression for the power grid physical constraint matrix is ​​obtained: ; Among them, the Representing the state space, Represents the action space, Represents the state transition probability. Represents the reward function, Indicates the discount factor. Indicates a time range. Let represent the Markov decision function.

[0037] Additionally, the state space The system state vector representing time t is denoted as , The vector includes information such as the total restored load, voltage at each node, power output, operable switch status, and the execution status of the current restoration path. Action Space Representation of action Defined as selecting an operable switch (or node unit) at time t to initiate operation, thereby advancing the recovery process. State transition probability. Characterize a given state With action It transitions to the state of the next time step with a certain probability. Time range The maximum number of decision steps in the recovery process is defined by the discount factor. Reward function is used to measure the importance of future rewards. Used to assess the state Next action The contribution to the load recovery target is considered, while also taking into account the penalties for constraint violations.

[0038] In one embodiment of this application, the reward function is defined as: ; in, The reward associated with the recovery of load is represented as:

[0039] Where C represents the set of node units, Indicates whether node i has recovered at time t. This indicates its rated active power. The voltage constraint violation penalty item is represented as follows:

[0040] in, Defined as: ; Among these, ensuring the voltage of each node Falling within the allowable voltage range Internal parameters These are weighting coefficients, set to ensure that the penalty and reward terms are comparable in magnitude. The goal here is to learn the optimal policy. Maximizing cumulative rewards is expressed as: .

[0041] In some embodiments, in the above reward function In addition, the reward function also includes backtracking rewards. The backtrackable reward is obtained by time-series summation based on the power grid target return parameters, so as to better reflect the control objectives and physical constraints in sequence modeling. The backtrackable reward can be constructed in the training phase and the prediction phase respectively. Specifically, the backtrackable rewards during the training phase can be represented as: .

[0042] The backtrackable reward during the prediction phase can be represented as: ; .

[0043] In some embodiments, the embedding layer is used to map the state sample sequence, action sample sequence, and reward sequence in the control action sample sequence of the operable switch into vectors, and adds position encoding; the action decoding layer is used to generate a switch probability distribution through an activation function and then output the highest probability switch action. Specifically, such as Figure 2 As shown, the embedding layer maps the state, action, and reward sequences into vector form, with embedding dimensions... The Transformer model's latent space vectors are mapped back to specific switching actions, and positional encoding is added to preserve temporal information. The causal master layer, serving as the core structure of the Transformer model, employs a modified GPT-style structure and uses a causal mask to ensure autoregressivity. Each layer contains 8–12 attention heads, stacked in multiple layers (L=6–12 layers) to enhance long sequence modeling capabilities. A power grid physical constraint matrix is ​​embedded in the attention calculation to penalize attention weights that violate power flow balance, thus explicitly incorporating physical priors into the model structure. The Action Decoder layer maps the latent space vectors output by the Transformer back to specific switching actions, generating a switching probability distribution through Softmax activation and selecting the action with the highest probability.

[0044] The encoder's function is to receive a trajectory sequence consisting of rewards, states, and actions, map it to a token embedding, and then feed it into the main causal layer, the Transformer, for sequence modeling. At this point, the trajectory... Defined as: ; Among these features, due to the difference in trajectories compared to the original deep reinforcement learning framework, the current execution stage introduces backtrackable rewards. This is to better reflect the control objectives and physical constraints in sequence modeling. Furthermore, to ensure the rationality of the input trajectory, a backtrackable reward that satisfies the physical constraints needs to be defined. To ensure It can be effectively modeled by causal Transformer and accurately characterize the power distribution system's recovery objectives and operational constraints.

[0045] Finally, after embedding mapping, the trajectory It is fed into the main causal layer Transformer to generate the action at time t: ; Among them, the policy function Action sequences are generated via autoregression using causal Transformer parameterization. During training, The optimization objective is to minimize the cross-entropy loss between the predicted action and the actual action in the trajectory. The output of the Transformer is then mapped back to the original action space by the decoder to obtain the final distribution network switch control strategy.

[0046] 103. Generate a power grid dispatch strategy based on the predicted results of the switching operations.

[0047] In this embodiment of the application, the switch operation prediction result includes the switching actions of each switch node. Therefore, it is possible to generate strategy content including when to start or restore multiple switches. This embodiment of the application does not make specific limitations.

[0048] In another embodiment of this application, for further definition and explanation, the step of training the neural network model based on the switching operation training sample set to obtain a trained Transformer model includes: During model training, the embedding layer inputs a preset number of state sample sequences from the switch operation training sample set into the causal subject layer. The switching decision is made by the causal subject layer, and the action decoding layer outputs the action sample sequence when the calculated cross-entropy loss value meets the preset training conditions, until the neural network model completes the preset rounds of model training.

[0049] To enable effective training of the Transformer model, during training, the current execution end inputs a preset number of state sample sequences from the switch operation training sample set into the causal subject layer through the embedding layer, so that the causal subject layer can make switch decisions. When the calculated cross-entropy loss value meets the preset training conditions, the action decoding layer outputs the action sample sequence until the neural network model completes a preset number of training rounds.

[0050] In one specific embodiment, the training steps include: 1) Obtain dataset D, which contains offline trajectories of the target power system restoration operation. The trajectories can be obtained from power system experts or generated through simple offline random walks. They are used to obtain the sequence of control actions applied to operable switches. In this case, the trajectories may be non-optimal.

[0051] 2) Take a mini-batch of K sequences from dataset D, input them into the physical constraint decision Transformer framework for switching decisions, and update the framework parameters based on the cross-entropy loss.

[0052] 3) Repeat step 2 for a total of M rounds that meet the preset training conditions.

[0053] In some embodiments, for the aforementioned training process, the procedural steps include: Initialization: Dataset D, model and its learnable parameters Sampling size L, maximum number of training rounds M, mini-batch size b.

[0054] 1: For episode m=1 to M, execute; 2: Randomly sample b sequences of length K from D to form a mini-batch B; 3: Use the input physical constraint decision Transformer model to predict B; 4: Calculate the cross-entropy loss between the predicted action and the actual action; 5: Update parameters ; 6:end for.

[0055] Correspondingly, the predictive steps include: Initialization: Model and its training parameters Target return Power distribution system initialization state .

[0056] 1: Settings ; 2: For time step t=1 to T-1, execute; 3: According to Model-generated actions And calculate instant rewards ; 4: Perform the action Then, observe the system state transition. And update the target return: ; 5: will Add to track And retain the K most recent time steps, i.e. ; 6:endfor.

[0057] In another embodiment of this application, for further definition and explanation, the step of obtaining the switch node state sequence, switch node action sequence, and power grid target return parameters for the power grid recovery operation includes: Obtain information about the power grid recovery process; Based on the recovery process information, the state of each switch, and the action of each switch, a switch node state sequence and a switch node action sequence are generated.

[0058] To reduce control dimensions and improve the scalability of model predictions, thereby enhancing the accuracy of power grid dispatch predictions, the current execution terminal first acquires information about the power grid recovery process. Then, based on this recovery process information, the states of each switch, and the actions of each switch, it generates switch node state sequences and switch node action sequences. The recovery process information includes recovery paths, which comprise multiple switch nodes. Specifically, each switch operation sequence is defined as a recovery path, corresponding to a distributed power source, with its starting point being a switch node directly connected to that power source. Under the premise of satisfying operational and physical constraints, the recovery path gradually expands to form multiple local microgrids, thereby maximizing the overall load recovery level of the system. Simultaneously, to reduce the dimension of the action space, node unit modeling is introduced. This modeling compresses the action space, reduces the number of independent switches, and improves training efficiency and model scalability. A node unit consists of a set of nodes directly connected by non-switchable lines. During recovery, the lines within a node unit are simultaneously put into operation with the load. This design compresses the action space from hundreds of independent switches to several groups of node units (preferably 20–50 groups), significantly reducing control dimensions and improving model scalability.

[0059] In another embodiment of this application, for further definition and explanation, the steps also include: Obtain the rated active power of the load nodes in the recovery path; The rated active power is summed over time to obtain the target return parameters of the power grid.

[0060] To improve the model's learning accuracy, the expected value of the power grid target return parameter is specifically defined as follows: ; in, This indicates the load node at time t. The rated active power.

[0061] This application provides a power grid dispatching method based on a physically constrained artificial intelligence Transformer model. Compared with existing technologies, this application obtains the state sequence of switching nodes, the action sequence of switching nodes, and the target reward parameters of the power grid for recovery operations. Based on the Transformer model that has completed model training, the method performs prediction processing on the state sequence of switching nodes, the action sequence of switching nodes, and the target reward parameters of the power grid to obtain the switching operation prediction results. The attention mechanism in the Transformer model is determined based on the power grid physical constraint matrix, which is constructed based on the Markov decision function for switching decisions. Based on the switching operation prediction results, a power grid dispatching strategy is generated. By introducing a physical constraint reward mechanism, the physical feasibility and voltage stability of the generated decisions are guaranteed, improving the decision-making speed and accuracy of large-scale power systems. This enables rapid recovery and stable dispatching of complex power grids, and has good real-time performance and generalization ability.

[0062] Furthermore, as a response to the above Figure 1 The implementation of the method shown in this application provides a power grid dispatching device based on a physically constrained artificial intelligence Transformer model, such as... Figure 3 As shown, the device includes: The acquisition module 21 is used to acquire the state sequence of the switch nodes used for recovery operations, the action sequence of the switch nodes, and the target return parameters of the power grid in the power grid. Processing module 22 is used to perform prediction processing on the state sequence of the switching node, the action sequence of the switching node, and the target reward parameter of the power grid based on the Transformer model that has completed model training, so as to obtain the switching operation prediction result. The attention mechanism in the Transformer model is determined based on the physical constraint matrix of the power grid, which is constructed based on the Markov decision function to make switching decisions. The generation module 23 is used to generate a power grid dispatching strategy based on the prediction results of the switching operation.

[0063] Furthermore, the device also includes: The building module is also used to obtain a training sample set of switch operations and to build a neural network model containing a Transformer encoder stack structure. The neural network model includes an embedding layer, a causal subject layer and an action decoding layer. The training sample set of switch operations includes a sequence of control action samples of operable switches. The training module is used to train the neural network model based on the training sample set of the switching operation to obtain the Transformer model after the model training is completed. The attention mechanism introduced in the causal subject layer embeds a power grid physical constraint matrix, which is expressed as: ; Among them, the Representing the state space, Represents the action space, Represents the state transition probability. Represents the reward function, Indicates the discount factor. Indicates a time range. Let represent the Markov decision function.

[0064] Furthermore, the reward function also includes a backtracking reward, which is obtained by time-series summation based on the grid target return parameters.

[0065] Furthermore, the embedding layer is used to map the state sample sequence, action sample sequence and reward sequence in the control action sample sequence of the operable switch into vectors, and add position encoding; the action decoding layer is used to generate the switch probability distribution through the activation function and output the highest probability switch action.

[0066] Furthermore, The training module is specifically used to input a preset number of state sample sequences from the switch operation training sample set into the causal subject layer through the embedding layer during model training; make switch decisions through the causal subject layer; and output the action sample sequence through the action decoding layer when the calculated cross-entropy loss value meets the preset training conditions, until the neural network model completes a preset number of model training rounds.

[0067] Furthermore, The acquisition module is specifically used to acquire information about the power grid recovery process, including a recovery path and multiple switch nodes. Based on the recovery process information, the status of each switch, and the actions of each switch, a switch node status sequence and a switch node action sequence are generated.

[0068] Furthermore, The acquisition module is further configured to acquire the rated active power of the load nodes in the recovery path; and to perform time-series summation on the rated active power to obtain the target return parameters of the power grid.

[0069] This application provides a power grid dispatching device based on a physically constrained artificial intelligence Transformer model. Compared with the prior art, the embodiments of this application obtain the state sequence of switching nodes, the action sequence of switching nodes, and the target reward parameters of the power grid for recovery operations. Based on the Transformer model that has completed model training, the state sequence of switching nodes, the action sequence of switching nodes, and the target reward parameters of the power grid are predicted to obtain the switching operation prediction results. The attention mechanism in the Transformer model is determined based on the power grid physical constraint matrix, which is constructed based on the Markov decision function to make switching decisions. Based on the switching operation prediction results, a power grid dispatching strategy is generated. By introducing a physical constraint reward mechanism, the physical feasibility and voltage stability of the generated decision are guaranteed, improving the decision-making speed and accuracy of large-scale power systems. It can realize the rapid recovery and stable dispatching of complex power grids and has good real-time performance and generalization ability.

[0070] According to one embodiment of this application, a storage medium is provided, the storage medium storing at least one executable instruction, which can execute the power grid dispatching method based on the physical constraint artificial intelligence Transformer model in any of the above method embodiments.

[0071] Figure 4 The diagram shows a structural schematic of a terminal according to one embodiment of the present application. The specific embodiments of the present application do not limit the specific implementation of the terminal.

[0072] like Figure 4 As shown, the terminal may include: a processor 302, a communications interface 304, a memory 306, and a communications bus 308.

[0073] The processor 302, communication interface 304, and memory 306 communicate with each other via communication bus 308.

[0074] Communication interface 304 is used to communicate with other network elements such as clients or other servers.

[0075] The processor 302 is used to execute program 310, specifically to execute the relevant steps in the above-described embodiment of the power grid dispatching method based on the physical constraint-based artificial intelligence Transformer model.

[0076] Specifically, program 310 may include program code that includes computer operation instructions.

[0077] Processor 302 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The terminal includes one or more processors, which may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs.

[0078] Memory 306 is used to store program 310. Memory 306 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0079] Specifically, program 310 can be used to cause processor 302 to perform the following operations: Acquire the state sequence of switch nodes used for recovery operations, the action sequence of switch nodes, and the target return parameters of the power grid; Based on the Transformer model that has completed model training, the state sequence of the switching node, the action sequence of the switching node, and the target reward parameter of the power grid are predicted to obtain the switching operation prediction result. The attention mechanism in the Transformer model is determined based on the physical constraint matrix of the power grid, which is constructed based on the Markov decision function to make switching decisions. A power grid dispatch strategy is generated based on the predicted results of the switching operations.

[0080] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0081] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A power grid dispatching method based on a physically constrained artificial intelligence Transformer model, characterized in that, include: Acquire the state sequence of switch nodes used for recovery operations, the action sequence of switch nodes, and the target return parameters of the power grid; Based on the Transformer model that has completed model training, the state sequence of the switching node, the action sequence of the switching node, and the target reward parameter of the power grid are predicted to obtain the switching operation prediction result. The attention mechanism in the Transformer model is determined based on the physical constraint matrix of the power grid, which is constructed based on the Markov decision function to make switching decisions. A power grid dispatch strategy is generated based on the predicted results of the switching operations.

2. The method according to claim 1, characterized in that, Before acquiring the switch node state sequence, switch node action sequence, and power grid target return parameters for recovery operations in the power grid, the method further includes: A training sample set of switch operations is obtained, and a neural network model containing a stacked Transformer encoder structure is constructed. The neural network model includes an embedding layer, a causal agent layer, and an action decoding layer. The training sample set of switch operations includes control action sample sequences of operable switches. The neural network model is trained based on the training sample set of the switching operation to obtain the Transformer model after the model training is completed; The attention mechanism introduced in the causal subject layer embeds a power grid physical constraint matrix, which is expressed as: ; Among them, the Representing the state space, Represents the action space. Represents the state transition probability. Represents the reward function, Indicates the discount factor. Indicates a time range. Let represent the Markov decision function.

3. The method according to claim 2, characterized in that, The reward function also includes a backtracking reward, which is obtained by time-series summation based on the grid target return parameters.

4. The method according to claim 3, characterized in that, The embedding layer is used to map the state sample sequence, action sample sequence and reward sequence in the control action sample sequence of the operable switch into vectors and add position encoding; the action decoding layer is used to generate the switch probability distribution through the activation function and output the highest probability switch action.

5. The method according to claim 3, characterized in that, The step of training the neural network model based on the switching operation training sample set to obtain a trained Transformer model includes: During model training, the embedding layer inputs a preset number of state sample sequences from the switch operation training sample set into the causal subject layer. The switching decision is made by the causal subject layer, and the action decoding layer outputs the action sample sequence when the calculated cross-entropy loss value meets the preset training conditions, until the neural network model completes the preset rounds of model training.

6. The method according to claim 1, characterized in that, The acquisition of the switch node state sequence, switch node action sequence, and power grid target return parameters used for recovery operations in the power grid includes: Acquire information on the power grid recovery process, including a recovery path, which includes multiple switching nodes; Based on the recovery process information, the state of each switch, and the action of each switch, a switch node state sequence and a switch node action sequence are generated.

7. The method according to claim 6, characterized in that, The method further includes: Obtain the rated active power of the load nodes in the recovery path; The rated active power is summed over time to obtain the target return parameters of the power grid.

8. A power grid dispatching device based on a physically constrained artificial intelligence Transformer model, characterized in that, include: The acquisition module is used to acquire the state sequence of switch nodes used for recovery operations, the action sequence of switch nodes, and the target return parameters of the power grid. The processing module is used to predict the state sequence of the switching node, the action sequence of the switching node, and the target reward parameter of the power grid based on the Transformer model that has completed model training, so as to obtain the switching operation prediction result. The attention mechanism in the Transformer model is determined based on the power grid physical constraint matrix, which is constructed based on the Markov decision function to make switching decisions. The generation module is used to generate a power grid dispatching strategy based on the prediction results of the switching operations.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.

10. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method of claim 1.

Citation Information

Patent Citations

  • Active power distribution network point-to-point energy transaction method, system, equipment and medium

    CN118982427A

  • Virtual power plant intelligent scheduling method and system based on digital twinning

    CN120638336A

  • Power distribution network real-time scheduling method based on reinforcement learning, computer equipment and storage medium

    CN121390572A