A power system end-to-end unit combination method driven by object-data fusion and spatiotemporal attention graph neural network
By using a spatiotemporal attention graph neural network driven by the fusion of physical and data aspects, and combining data-driven and physical mechanisms, the problem of insufficient spatiotemporal feature extraction and optimization in the unit combination of power systems is solved. This achieves efficient and accurate unit combination optimization, reduces system operating costs, improves the convergence speed and stability of the model, adapts to the randomness and volatility of new energy output, and enhances the operating efficiency and economy of the power system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING ELECTRIC POWER COLLEGE
- Filing Date
- 2025-05-14
- Publication Date
- 2026-05-26
AI Technical Summary
Existing power system unit combination methods have shortcomings in handling spatiotemporal feature extraction and optimization, making it difficult to effectively handle temporal and spatial constraints simultaneously, resulting in high computational complexity and low solution efficiency. Furthermore, existing data-driven methods suffer from contradictions between feasibility and stability, as well as uncontrollable computational complexity.
A spatiotemporal attention graph neural network driven by data fusion is adopted, combining data-driven approaches and physical mechanisms. The spatiotemporal features of the power system are extracted through a spatiotemporal self-attention graph convolutional neural network model. A two-stage learning mode and an adaptive penalty term update method are used to optimize the model training process. The model training process is optimized by introducing an adaptive penalty term update algorithm to balance the physical constraint weights, thus achieving convergence of the unit combination model.
It achieves efficient and accurate unit combination optimization, reduces system operating costs, improves model convergence speed and stability, ensures that model output meets the physical constraints and operating requirements of the power system, adapts to the randomness and volatility of new energy output, and improves the operating efficiency and economy of the power system.
Smart Images

Figure CN120449698B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system optimization and dispatching technology, and in particular relates to a power system end-to-end unit combination method driven by a spatiotemporal attention graph neural network based on the fusion of physical and numerical data. Background Technology
[0002] With the development of a new type of power system that is clean, low-carbon, safe, efficient, and deeply penetrated by renewable energy, the power supply structure and system characteristics of the system have undergone profound changes: the proportion of conventional synchronous generating units continues to decline, high-penetration new energy sources with prominent random fluctuation characteristics are gradually becoming the main power source, AC / DC hybrid interconnection has led to an exponential increase in the complexity of the power grid topology, dynamic coupling of multiple links such as source-grid-load-storage forms a strong nonlinear interaction, and the reconstruction of the power market mechanism introduces multi-dimensional operational constraints, resulting in time-varying and non-convex characteristics of the system operating domain boundary; new energy sources and load centers are distributed in opposite directions, the utilization rate of transmission channels between the western new energy-rich areas and the eastern load centers is low, and the time and space regulation demand difference is large, which significantly exacerbates the difficulty of power balance and increases the difficulty of safe and economical operation of the power system.
[0003] Unit commitment is an effective strategy for achieving short-term economic operation of power systems. Its core lies in minimizing the overall system operating cost by rationally arranging the start-up, shutdown, and output power of thermal power units within each dispatch cycle, while simultaneously satisfying system operating constraints and unit-specific constraints. Traditional power system unit commitment (UC) methods mainly rely on physical models and optimization algorithms. For example, traditional heuristic algorithms or recursive branch-and-bound methods face problems of high computational complexity and low solution efficiency when solving unit commitment problems.
[0004] Therefore, many researchers have turned to data-driven deep learning methods. Current data-driven UC solution methods can be mainly divided into three categories: first, imitation learning methods, which accelerate the solution process by learning historical experience or rules; second, substructure enhancement of traditional methods, which improves solution efficiency by optimizing specific parts of traditional algorithms; and third, condition-solution space mapping learning, which uses machine learning techniques to establish a mapping relationship between input conditions and output solutions, thereby quickly predicting the optimal solution. However, incorrect predictions may lead to no improvement in branch-and-bound search and may result in timeouts, making it difficult to achieve good duality and feasibility. This gives the first two categories of methods some shortcomings in UC and limits their application. The third category of methods has received widespread attention in power systems because it can quickly approach feasible approximate optimal solutions. Supervised learning (SL) and reinforcement learning (RL) are the mainstream algorithms in this category. Although SL and RL have shown potential in improving solution efficiency, their core shortcomings still focus on two dimensions: the contradiction between feasibility and stability, and the uncontrollable computational complexity. SL relies on MIP solvers to generate massive amounts of high-quality labeled samples, while RL needs to explore feasible strategies in the discrete state-action space through trial and error mechanisms. Both require the introduction of post-processing correction mechanisms or regularization constraints to maintain the physical feasibility of the solution space, resulting in non-stationary Markov properties in the training process and causing gradient vanishing and policy oscillation risks. Reinforcement learning policy networks are highly sensitive to hyperparameters such as exploration factors and discount rates, and the policy space dimension explosion problem causes their exploration efficiency to drop sharply in the context of unit start-up and shutdown timing coupling.
[0005] Furthermore, the power system unit combination problem is essentially a spatiotemporal optimization problem, and existing methods are insufficient in terms of spatiotemporal feature extraction and optimization, making it difficult to effectively handle temporal and spatial constraints simultaneously.
[0006] To address the aforementioned issues, it is urgent to propose an end-to-end unit combination method for power systems that utilizes a data-driven spatiotemporal attention graph neural network. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention proposes an end-to-end unit combination method for power systems driven by a data-driven spatiotemporal attention graph neural network. This method combines the advantages of data-driven and physical mechanisms, extracts the spatiotemporal features of the power system through a spatiotemporal self-attention graph convolutional neural network model, and optimizes the model training process using a two-stage learning mode and an adaptive penalty term update method, thereby achieving efficient and accurate unit combination optimization to solve the problems existing in the prior art.
[0008] To achieve the above objectives, this invention provides a power system end-to-end unit combination method using a data-driven spatiotemporal attention graph neural network, comprising the following steps:
[0009] Acquire operational data of the power system, including load data and renewable energy forecasts;
[0010] A spatiotemporal self-attention graph convolutional neural network is constructed, and a unit combination model is constructed based on the spatiotemporal self-attention graph convolutional neural network. The spatiotemporal self-attention graph convolutional neural network includes 3 layers of self-attention temporal convolutional layers and 3 layers of spatial convolutional layers based on graph convolutional networks.
[0011] The power system's operating data is input into the unit combination model for two-stage model training. The first stage is based on a fusion strategy of physical mechanism, local relaxation of integer variables, and supervised pre-training to minimize the physical constraints and empirical risks of the unit combination model's weight matrix and guide the initialization of model parameters. The second stage uses goal guidance, physical mechanism constraints, and local relaxation of integer variables to achieve secondary adjustment of model parameters.
[0012] An adaptive penalty term update algorithm is introduced to balance the physical constraint weights and complete the convergence of the unit combination model, thus obtaining the trained unit combination model.
[0013] Power system unit combination decision-making is realized based on the trained unit combination model.
[0014] Optionally, the self-attention temporal convolutional layer employs a multi-head attention mechanism, transforming the input data into a query matrix, a key matrix, and a value matrix through multiple sets of linear transformation matrices; each transformed query matrix, key matrix, and value matrix is input into the self-attention mechanism for calculation; the output results of the self-attention mechanism are concatenated together based on the Concat function to obtain the concatenated feature matrix; the concatenated feature matrix is then integrated and transformed through a fully connected layer to finally obtain the global correlation output features of the nodes.
[0015] Optionally, the expression for the spatial convolutional layer based on the graph convolutional network is as follows:
[0016]
[0017] In the formula, yes The degree matrix, It is the weight parameter matrix connecting layer (l) and layer (l+1).
[0018] Optionally, before inputting the power system's operating data into the unit combination model for two-stage model training, the following steps are also included:
[0019] Taking power system nodes as units, the time-series vector of a node is composed of load values and new energy forecast values for several time periods. The time-series vector of the node is then used to form the input feature. The input feature and its position code are added together to obtain the input of the spatiotemporal self-attention map convolutional neural network.
[0020] Optionally, the second stage, which employs goal-oriented guidance, physical mechanism constraints, and local relaxation of integer variables to achieve secondary adjustment of model parameters, includes:
[0021] Relaxation constraints are introduced to relax the binarized variables of generator switching states in the power system, so that the relaxed binarized variables match the generator output. Constraints are added between the calculated generator output and the generator output input to the model. The generator output is calculated through the AC power flow model to ensure that the model learns the power flow mechanism of the power system. Unit start-up and shutdown time constraints are introduced to convert the relaxed start-up and shutdown variables output by the model into integer variables to determine the generator start-up and shutdown states, and then the model parameters are adjusted a second time.
[0022] Optionally, the loss function for relaxing the constraints is calculated as follows:
[0023]
[0024] in, For relaxed start-stop state variables, P G,i,t To provide power to the generator.
[0025] Optionally, an adaptive penalty term update algorithm is introduced to optimize the model training process. The process of obtaining the trained unit combination model includes:
[0026] To address the various constraints in model training, an adaptive penalty term update algorithm is introduced. This algorithm assigns a unique penalty parameter to each constraint and adaptively updates the corresponding penalty parameter based on the characteristics of the constraint.
[0027] Optionally, the expression for the adaptive penalty term update algorithm is as follows:
[0028]
[0029]
[0030] In the formula, It is the penalty parameter for the i-th class in the k-th iteration. It is the Lagrange multiplier of the i-th class in the k-th iteration, f i (θ (k) ) is a function of the i-th class and k-th iteration, α is a smoothing constant, γ is the global learning rate, and ∈ is a constant.
[0031] The present invention also provides a power system unit combination system based on a data-physical hybrid driven spatiotemporal attention graph neural network for implementing the method, comprising: a data acquisition module, a model building module, a first model training module, a second model training module, and a unit combination module;
[0032] The data acquisition module is used to acquire the operating data of the power system, including load data and new energy forecast values.
[0033] The model building module is used to build a spatiotemporal self-attention graph convolutional neural network, and to build a unit combination model based on the spatiotemporal self-attention graph convolutional neural network. The spatiotemporal self-attention graph convolutional neural network includes 3 layers of self-attention temporal convolutional layers and 3 layers of spatial convolutional layers based on graph convolutional networks.
[0034] The first model training module is used to input the power system operation data into the unit combination model for two-stage model training. The first stage is based on the fusion strategy of physical mechanism, local relaxation of integer variables and supervised pre-training to complete the physical constraints and empirical risk minimization of the weight matrix of the unit combination model and guide the initialization of model parameters. The second stage uses target guidance, physical mechanism constraints and local relaxation of integer variables to achieve secondary adjustment of model parameters.
[0035] The second model training module is used to introduce an adaptive penalty term update algorithm to balance the physical constraint weights and complete the convergence of the unit combination model, thereby obtaining the trained unit combination model.
[0036] The unit combination module is used to make unit combination decisions for the power system based on the trained unit combination model.
[0037] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method.
[0038] Compared with the prior art, the present invention has the following advantages and technical effects:
[0039] High-efficiency optimization capability: Through the Spatiotemporal Self-Attention Graph Convolutional Neural Network (STSAGCN) model, it can simultaneously extract the spatiotemporal features of the power system, effectively handle the temporal and spatial constraints in the unit combination problem, achieve overall optimization within the scheduling cycle, and reduce system operating costs.
[0040] Enhanced convergence performance: An adaptive penalty term update method (APU) is introduced to assign adaptive penalty parameters to different constraints, optimize the model training process, significantly improve the convergence speed and stability of the model, and enable it to find the optimal solution quickly and accurately.
[0041] Smooth search space: Relaxing the binary variables of generator switching states smooths the originally discrete search space, avoids the problem of gradients not being effectively propagated due to discrete variables, and improves the model's generalization ability and optimization efficiency.
[0042] Precise fulfillment of physical constraints: By introducing relaxation constraints, generator output constraints, and unit start-up and shutdown time constraints in model training, the model output is ensured to meet the physical constraints and operational requirements of the power system, thereby improving the practicality and reliability of the model.
[0043] Effective adaptation to new energy scenarios: During model training, through small sample learning and physical mechanism guidance, the model can adapt to the randomness and volatility of new energy output, providing an effective optimization tool for the operation of the power system under high new energy penetration.
[0044] Improved online application efficiency: The trained unit combination model has high online application efficiency, which can provide accurate decision support for the real-time dispatch of the power system in a short time, thereby improving the operating efficiency and economy of the power system. Attached Figure Description
[0045] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0046] Figure 1 This is a schematic diagram of the structure of the Spatiotemporal Attention Map Convolutional Neural Network (STSAGCNN) according to an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of the unit combination model of the physical-data hybrid driven spatiotemporal attention graph neural network according to an embodiment of the present invention;
[0048] Figure 3 This is a schematic diagram showing the average value of the generator output constraint violation amount in an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram of the average value of the node power balance constraint violation amount in an embodiment of the present invention;
[0050] Figure 5 This is a schematic diagram of the random convergence analysis in Example 2 of the present invention, wherein (a) is a schematic diagram of the summer scene analysis and (b) is a schematic diagram of the winter scene analysis;
[0051] Figure 6 This is a schematic diagram illustrating the computational cost analysis for 300 scenarios in Example 1 of this invention. Detailed Implementation
[0052] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0053] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0054] Example 1
[0055] This embodiment provides a power system end-to-end unit combination method using a data fusion-driven spatiotemporal attention graph neural network, including the following steps:
[0056] Acquire operational data of the power system, including load data and renewable energy forecasts;
[0057] A spatiotemporal self-attention graph convolutional neural network is constructed, and a unit combination model is built based on the spatiotemporal self-attention graph convolutional neural network. The spatiotemporal self-attention graph convolutional neural network includes 3 layers of self-attention temporal convolutional layers and 3 layers of spatial convolutional layers based on graph convolutional networks. The self-attention mechanism extracts temporal features and completes overall temporal optimization. The graph convolutional neural network realizes spatial feature extraction, enabling the model to meet the physical constraints on a single time section.
[0058] The power system's operating data is input into the unit combination model for two-stage model training. The first stage is based on a fusion strategy of physical mechanism, local relaxation of integer variables, and supervised pre-training to minimize the physical constraints and empirical risks of the unit combination model's weight matrix and guide the initialization of model parameters. The second stage uses goal guidance, physical mechanism constraints, and local relaxation of integer variables to achieve secondary adjustment of model parameters.
[0059] An adaptive penalty term update algorithm is introduced to balance the physical constraint weights and complete the convergence of the unit combination model, thus obtaining the trained unit combination model.
[0060] Power system unit combination decision-making is realized based on the trained unit combination model.
[0061] This embodiment constructs a data-physics hybrid-driven spatio-temporal self-attention graph convolutional network (DPHD-STSAGCN) for unit allocation. It guides the model's optimization direction through few-shot learning, uses physical mechanisms to drive the graph neural network to fit power flow constraints, and employs a self-attention mechanism to extract temporal correlations to achieve overall optimization within the scheduling cycle. The main processes include:
[0062] (1) A spatiotemporal self-attention graph convolutional neural network (STSAGCN) model was designed, and a unit combination model based on data-physical hybrid-driven spatiotemporal graph attention neural network was proposed. The attention model extracts temporal features and completes temporal optimization; the graph neural network realizes spatial feature extraction, which enables the model to meet the physical constraints on a single time section.
[0063] (2) A two-stage learning model is proposed. In the first stage, the model parameters are initialized through direct estimation and small sample learning. In the second stage, the model parameters are adjusted twice: the search space is smoothed by relaxing the unit state variables, the constraints between generator output and integer relaxation variables are increased to make the output meet the generator output constraints, and the model learns the physical mechanism through constraints such as AC power flow.
[0064] (3) Introduce the Adaptive Penalty Updates (APU) method to improve the convergence performance of the model.
[0065] The feasible mathematical model for unit combination is as follows:
[0066] Unit combination is an effective strategy for achieving short-term economic operation of a power system. Its core lies in minimizing the overall system operating cost while simultaneously satisfying system operating constraints and unit-specific constraints by rationally arranging the start-up, shutdown, and output power of thermal power units within each dispatch cycle. For a power system with N nodes, N... G Taiwan thermal power unit, N R The mathematical model of the power system and unit combination of a new energy power station can be described as follows:
[0067]
[0068] In the formula, T represents the length of the scheduling period, Ω G Let P represent the set of thermal power units, Ω represent the set of all nodes; G,i,t S i,t P represents the output and start / stop status of thermal power unit i at time t, respectively. R,F,i,t PR,i,t These are the predicted and actual power outputs of renewable energy power station i at time t, respectively. G,i,t S i,t P R,i,t δ i,t All are decision variables in an optimization problem; f i (P G,i,t ) = a i (P G,i,t ) 2 +b i P G,i,t +c i It is the cost of thermal power generation, a i b i and c i For the cost coefficients of the i-th unit, including the secondary, primary, and constant terms; K is the startup cost of unit i. i B i τ i Z represents the starting coefficient of unit i, and Z represents the starting coefficient of unit i. i,t-1 Let be the continuous downtime of unit i before time period t; the objective function F is to minimize the sum of the total cost of unit active power output and the cost of renewable energy curtailment. Equation (1-2) represents the node active power balance, P i,t It is the net injected active power at node i at time t, for the DC power flow model P i,t =∑ j∈i B i,j (δ i,t -δ j,t For the P-type communication power flow model i,t =V i,t ∑ j∈i V j,t (G ij cosδ ij,t +B ij sinδ ij,t ), P D,i,t This represents the load at node i during time period t. B i,j δ represents the conductance of branch ij. i,t Let r represent the voltage phase angle of node i at time t. Equation (1-3) is the reserve constraint of the power grid. G,u,i,t R is the positive standby of unit i during time period t, obtained through equation (1-4). u,t The system's standby demand is during time period t, r G,u,i,t P is the negative reserve of unit i during time period t, obtained through equation (1-5). G,i,max P G,i,min These are the upper and lower limits of generator output, r G,u,i r G,d,iis the upslope and downslope of the generator at node i. Equation (1-6) is the active power flow transmission capacity constraint of the branch, P ij,t This indicates that the branch has active power, for the DC power flow model P ij,t =B i,t (δ i,t -δ j,t For the communication trend model This represents the maximum active power capacity of branch ij. Equation (1-7) represents the upper and lower limits of generator active power output. Equation (1-8) represents the new energy output constraint. Equation (1-9) represents the generator ramp rate constraint. Equations (1-10) and (1-11) represent the generator start-up and shutdown time constraints. X on,i,t-1 This indicates the continuous operating time of group i during the time interval t-1, X. off,i,t-1 This indicates the duration during which machine group i has been continuously shut down during the time interval t-1. on,i It is the shortest startup time of unit i, T off,i It is the shortest shutdown time for unit i.
[0069] The feasible two-stage learning process of a data-physical hybrid-driven spatiotemporal graph attention neural network is as follows:
[0070] The unit combination problem needs to satisfy constraints such as power flow and generator output on the spatial cross-section (spatial domain), and start-up and shutdown time constraints, as well as the goals of cost optimization and minimizing renewable energy curtailment over the entire time series (temporal domain). Therefore, the key to the problem lies in how to effectively extract the spatiotemporal features of the data and transform the features to achieve spatiotemporal physical constraints. The self-attention (SA) mechanism understands the sequence by calculating the relationship between elements in the sequence, and can explore the relationship between any two data in the time series data to achieve global optimization within the scheduling cycle. In order to integrate and effectively utilize spatial and temporal features, this embodiment first designs a spatiotemporal self-attention graph convolutional neural network (STSAGCNN), and on this basis, proposes a two-stage unit combination model driven by a physical-data hybrid spatiotemporal attention graph neural network.
[0071] Feasible construction of spatiotemporal attention graph neural network models:
[0072] Spatiotemporal self-attention map convolutional neural network (STSAGCNN) model, such as Figure 1As shown, it consists of 3 layers of self-attention-based temporal convolutional layers and 3 layers of spatial convolutional layers based on GCN. Unlike other time series problems, the unit combination of a power system needs to simultaneously satisfy spatial physical constraints and temporal physical constraints within each time period. Therefore, spatial information propagation is achieved through continuous stacking of spatial graph convolutions, while temporal feature extraction is achieved through continuous stacking of self-attention layers, rather than alternating stacking of spatial graph convolutions and temporal convolutions, such as STGCN.
[0073] Self-attention is a mechanism for processing sequential data, most notably in the Transformer model. It's a variant of attention mechanisms that reduces reliance on external information, more effectively captures the internal relationships between data or features, and has the ability to consider all elements in the sequence simultaneously. This mechanism calculates the similarity between each element and other elements to obtain the weights of each element, then sums all elements according to their weights to form a final weighted representation vector, used to express the correlation between the input at the current position and the inputs at other positions. Its core idea lies in capturing the correlation between vectors.
[0074] The self-attention temporal convolutional layer in this embodiment employs a multi-head attention mechanism, using multiple sets of linear transformation matrices. Will Transform into different Then, each set of features is processed by the Self-Attention mechanism to calculate the output. Then the output of each group After splicing, we get z (l-1) Finally, the global correlation output features of the nodes are obtained through a linear transformation of the fully connected layer. The expression is:
[0075]
[0076] In the formula, T is the length of the time series. In the day-ahead unit combination model, T = 24, d l-1 Indicates the dimension of data features. It refers to the number of heads that need attention. This is the parameter matrix that needs to be learned. The expression for the temporal self-attention mechanism that extracts the correlation between node features across different time periods is:
[0077]
[0078] The output of the multi-head self-attention model is:
[0079]
[0080] In the formula, C on It is the Concat function, which concatenates the attention feature matrices between different time periods in different subspaces; For fully connected network weights.
[0081] The expression for spatial graph convolution is:
[0082]
[0083] In the formula, yes The degree matrix. It is the weight parameter matrix connecting layer (l) and layer (l+1).
[0084] A feasible construction of a unit grouping model based on a physical-data hybrid-driven spatiotemporal attention graph neural network:
[0085] The overall framework of the physical-data hybrid-driven spatiotemporal attention graph neural network-based unit combination model (STSAGCNNN) is as follows: Figure 2 As shown.
[0086] (1) Input data construction:
[0087] Solving the unit combination (UC) problem involves determining the generator output and its on / off state under the target optimal condition within a scheduling cycle, based on load, renewable energy forecasts, and parameters of traditional thermal power units. Therefore, the model takes the feature data x, composed of load and renewable energy forecasts, and the adjacency matrix A as inputs; the feature data reflects the spatiotemporal characteristics of the data, and the adjacency matrix A is used to aggregate spatial features.
[0088] Taking power system nodes as units, the node time series vector x is composed of load and renewable energy forecast values over T time periods. i =[x i,1 ,x i,2 ,…,x i,T Then, the temporal vectors of the nodes are used to construct the input feature x.
[0089]
[0090] In the formula x n,t Let be the feature vector of node n in time period t, where n = 1, 2, N, t = 1, 2, T, N is the number of nodes, and T is the total number of time periods in a scheduling cycle. The input feature x and its position encoding are summed to obtain the input H of the spatiotemporal self-attention map convolutional neural network (STSAGCNN). (0) .
[0091] The parameterized expression between the output (generator output and node voltage phase angle) and the input of the unit combination model driven by the physics-data hybrid spatiotemporal attention graph neural network is as follows:
[0092]
[0093] In the formula, x is a tensor distributed across the graph nodes. O is the output of the STGCNN model, [P G ,P R ,s O ,V,δ]={[P G,i,t ,P R,i,t ,s O,i,t V i,t ,δ i,t ]|i∈Ω,t∈T}; In order to align node features, for nodes without generators, s i,t It is only used as output and does not participate in the calculation of the loss function. It is a simplified representation of the nonlinear mapping between a given input (x, A) and the desired output O, which is φ θ A functional relating to the model parameter vector θ.
[0094] (2) Output construction and relaxation processing:
[0095] The generator output state in the model is a discrete and discontinuous variable, which may cause discontinuous jumps in the model's decision boundary, affecting the model's generalization ability. To improve the model's convergence performance, this embodiment relaxes the binarized variables of the generator switching state, smoothing the search space through relaxation. After relaxation, corresponding constraints are added to make the relaxed binarized variables closer to the feasible solution; simultaneously, to ensure that the relaxed binarized variables match the generator output, this embodiment defines a relaxation constraint matching the generator output, denoted as f. s :
[0096]
[0097] Since the relaxation constraint is only used in the second stage of learning, the parameters have been initialized before use. When the generator is started, the output is near the minimum output, and when it is shut down, the output is near 0. The constraint here is only to match the generator start-up and shutdown states with the output. The generator output range constraint is (1-7).
[0098] To enable the model to learn the power flow mechanism, the injected power of the node is calculated based on the node voltage, and then the generator output is calculated, thus increasing the constraint between the calculated generator output and the generator output input to the model.
[0099]
[0100] In the formula, Pi,t The calculation is performed using an AC power flow model.
[0101] The generator start-up and shutdown time constraints need to be obtained from the trained start-up and shutdown variables. Therefore, the relaxed start-up and shutdown variables output by the model need to be converted into integer variables. After obtaining the relaxed generator start / stop states output by the network, the generator start-up and shutdown states are determined according to equation (1-22).
[0102] s = […, round(s) O,i,t (1-22)
[0103] After obtaining the discretized generator state, the model is reparameterized as follows:
[0104]
[0105] (3) Optimize the problem description:
[0106] Since the mechanisms of the two-stage learning are different, for ease of explanation, optimization models are given separately for each stage. The first stage initializes the model parameters through pass-through estimation, few-sample learning, and physical mechanisms; the equivalent optimization model is as follows:
[0107]
[0108] In the formula, x Y This represents the input corresponding to the labeled sample Y; P, S, l, R, and T represent the types of physical constraints, f P It is obtained from node power balance (1-2), generator output constraint (1-7), new energy output constraint (1-8), and unit ramp rate constraint (1-9); f l Obtained from branch flow constraints (1-6); f R Obtained from the spare constraint (5-3); f T This is obtained from the generator start-stop time constraints (1-10) and (1-11). Y It includes 5 types of label constraints, each corresponding to the generator output P. G New energy output P R The generator start / stop state s, node voltage amplitude V, and node voltage phase angle δ are considered. Labeled sample constraints serve as hard constraints, guiding the model training direction and ensuring consistency between the model output and the samples. Physical constraints serve as soft constraints, enabling the model to learn the physical mechanism while fitting the input-output relationship. The second stage involves fine-tuning the model based on the physical mechanism; the equivalent optimized model is:
[0109]
[0110] In the formula, f s Based on the relaxed constraints (1-20), ρ sThese are the weighting coefficients for the relaxation constraints.
[0111] An feasible model training process includes:
[0112] Because the model is guided by physical mechanisms, and the constraints of the unit combination problem are complex, model training is difficult. To achieve efficient computation, an Adaptive Penalty Updates (APU) optimization algorithm is introduced to further improve model convergence. APU is an improvement on ALM, assigning a unique penalty parameter to each constraint and adaptively updating it based on the characteristics of the constraint. This allows different constraints to have different penalty strengths according to their impact on the optimization process. The expression for APU implementation is:
[0113]
[0114] In the formula, It is the penalty parameter for the i-th class in the k-th iteration. It is the Lagrange multiplier of the i-th class in the k-th iteration, f i (θ (k) ) is a function of the i-th class and k-th iteration, α is a smoothing constant, γ is the global learning rate, and ∈ is a constant. To improve the convergence performance and robustness of the model, the weights of each loss term are adaptively adjusted by an improved extended Lagrangian method APU.
[0115] Further, the first phase of training:
[0116] Based on the optimization model (1-24), the loss function for the first stage of training using the APU is:
[0117]
[0118] In the formula, i∈{P G ,P R ,s,V,δ} are the constraint class numbers, and r represents the number of each constraint in the i-th class. The first stage of training of the DPHD-STSAGCNN model is performed according to equation (1-29); the even variables and model parameters θ are updated alternately. Given θ, λ, and ρ at the k-th iteration, the (k+1)-th update of the model is shown in equation (1-31). First, θ is updated by minimizing equation (1-30) to obtain (ψ θ (x,A)) (k+1) Then, fix θ and update the dual variables using equations (1-26)-(1-28).
[0119]
[0120] The update of θ is achieved by the gradient descent method shown in equation (1-31).
[0121]
[0122] Equation (1-22) shows the generation of the on / off state s through the output of the spatial graph convolutional layer. The gradient of the unit state variables obtained by discretization quantization Backpropagation is not possible. To address the issue of inefficient gradient propagation caused by discretization, pass-through estimation is still used. The expression for pass-through estimation in the `round()` function is:
[0123]
[0124] Table 1 shows the first-stage training process of the DPHD-STSAGCNN model:
[0125] Table 1
[0126]
[0127] Further, the second phase of training process:
[0128] Based on the optimization model (1-25), the loss function for the second stage of training using the APU is:
[0129]
[0130] In the formula, i∈{P,R,l,G,T} is the number of the constraint class, and r represents the number of each constraint in the i-th constraint class.
[0131] The second stage of training for the DPHD-STSAGCNN model is performed according to equation (1-33); the even variables and model parameters θ are updated alternately. Given θ, λ, and ρ at the k-th iteration, the (k+1)-th update of the model is shown in equation (1-35). First, θ is updated by minimizing (1-34) and (ψ) is obtained. θ (x,A)) (k+1) Then, fix θ and update the dual variables using equations (1-26)-(1-28).
[0132]
[0133] The update of θ is achieved by the gradient descent method shown in equation (1-35).
[0134]
[0135] In the formula, the gradient of the unit's state variables It is still achieved through pass-through estimation.
[0136] The training process is shown in Table 2:
[0137] Table 2
[0138]
[0139] Feasible example analysis:
[0140] Example setup:
[0141] The numerical examples were analyzed on two IEEE systems, with the following specific settings:
[0142] Example 1: An improved IEEE 30-bus system. Node 2 is replaced with a hydroelectric generator of rated power. Historical data for 24 hours per day for one year is added to wind farms with rated power of 60MW and 70MW respectively at nodes 6 and 12. Historical data for photovoltaic power plants with rated power of 55MW, 65MW, and 65MW respectively are added to nodes 10, 15, and 27. The penetration rate of new energy is 39.2%. To accurately reflect the dynamic characteristics of the load, considering the fluctuation and randomness of the load, the active power load at nodes 2, 5, 7, and 8 is replaced with historical data for 24 hours per day for one year for loads with rated active power equal to theirs. To obtain a sufficient number of sample data, the minimum start-up and shutdown time for all units is set to 2. Generators at nodes 1 and 13 have been running for one period at the initial time, while generators at nodes 5, 8, and 11 have been running for two periods at the initial time.
[0143] Example 2: An improved IEEE 118-node system. The generator outputs on nodes 10, 25, 26, 46, 49, and 54 are replaced with historical data from 24 hours per day for one year for new energy generating units with rated capacities of 560MW, 328MW, 185MW, 118MW, 304MW, and 148MW, respectively. The active loads on nodes 1, 3, 4, 11, 15, 18, 19, 32, 59, 70, and 116 are replaced with historical data from 24 hours per day for one year for loads with the same maximum load. To obtain a sufficient number of sample data, the minimum start-up and shutdown time for all units is set to 2. The generators on nodes 1, 3, 4, 11, and 15 have been running for one period since the initial start-up time, while the generators on nodes 18, 19, 32, 59, 70, and 116 have been running for two periods since the initial start-up time.
[0144] To verify the effectiveness of the proposed model, four methods were used for comparison with the two methods proposed in this embodiment:
[0145] M0: The traditional branch and bound method based on physical mechanisms, which uses the Gurobi optimizer, is used as the benchmark algorithm.
[0146] M1: To prove the effectiveness of the physical mechanism, a label-based supervised learning method is adopted. The neural network model adopts a spatiotemporal attention graph neural network, and the solution of M0 is used as the label sample.
[0147] M2: Due to the dynamic, complex and nonlinear nature of the UC problem, in order to prove that it is difficult to converge by simply relying on physical model training, a self-supervised learning model based on physical mechanisms to guide the spatiotemporal attention graph neural network is adopted.
[0148] M3: To illustrate the effect of the unit combination model based on data-physical hybrid-driven spatiotemporal attention graph neural network on time series optimization, the time series feature extraction model in the unit combination model based on data-physical hybrid-driven spatiotemporal attention graph neural network is replaced with LSTM.
[0149] M4: A reinforcement learning-based approach. Reinforcement learning is currently the mainstream optimization scheduling method based on deep learning. To illustrate the effectiveness of the method in this embodiment, reinforcement learning methods are used as a comparison.
[0150] M5: The proposed unit combination model is based on small sample data and physical guidance spatiotemporal graph convolutional network. Temporal feature extraction and spatial feature extraction are performed alternately, and the temporal feature extraction model is LSTM.
[0151] M6: A proposed unit combination model based on a data-physical hybrid-driven spatiotemporal attention graph neural network.
[0152] Experimental results:
[0153] Convergence analysis:
[0154] To illustrate the model's convergence and ability to satisfy physical constraints, Figure 3 and Figure 4 The average values of generator output constraint violations and nodal power balance constraint violations are given in the last 3000 iterations of model training. The horizontal axis represents the number of training iterations, and the vertical axis represents the average violation factor (AVF), calculated using equation (1-36).
[0155]
[0156] In the formula, S is the number of training data groups (not called the number of samples to distinguish it from the number of labeled samples), T is the number of time periods in a scheduling cycle, and N is the number of training data groups. y The number of physical constraints, ε, is a number close to 0.
[0157] from Figure 3 and Figure 4It can be seen that M1 relies on labels to guide model training and has the most physical constraints. Due to the lack of label guidance, M2 is more prone to getting trapped in local optima, resulting in a relatively large default rate. M3 uses LSTM to extract temporal features only from the current time period and previous time periods, resulting in low fitting accuracy. M4 relies on discrete space search. Since solving UC is an NP-hard problem, reinforcement learning struggles to find the optimal or near-optimal solution, thus resulting in poor fitting of node power balance constraints. However, because reinforcement learning forces generator output within the allowable range, the default rate of generator constraints is minimized. Compared with the other models, M5 and M6 have better physical mechanism fitting results because they utilize label guidance and incorporate physical knowledge. However, because the temporal and spatial feature extraction of the M5 method is performed alternately, it is difficult to simultaneously satisfy temporal and spatial constraints, thus the constraint effect of the physical mechanism is not as good as that of M6.
[0158] To illustrate the stochastic convergence of the method, a comparison is made using Example 2. Load scenarios for a single day in winter and summer are selected respectively. Based on the wind power and solar power output models, the data for wind farms and solar power output are modified, resulting in 1200 sets of data for testing. The calculated cost is as follows: Figure 5 As shown, M0 represents the calculation results of 1200 sets, and M6 represents the results of sequentially calling the aforementioned 1200 sets of data in the last 1200 training sessions using the method of this embodiment. It can be seen that as the model training is completed, the cost of the M6 method gets closer and closer to that of the M0 method, and finally stabilizes near the calculation result of the M0 method, indicating that the method of this embodiment can also effectively converge for new energy stochastic scenarios.
[0159] Feasibility analysis:
[0160] To illustrate the performance of the methods, the computational costs of several methods and the computational cost of M0 are shown in Example 1 for 300 scenarios. Figure 6 As shown in the figure, RMSE is the root mean square error. It can be seen from the figure that, compared with other methods, the cost distribution of method M6 in this embodiment is most similar to the cost distribution of the reference method M0; the root mean square error of M6 is 2.61, while the root mean square error of the traditional reinforcement learning method M4 is 3.61. Compared with traditional reinforcement learning, the method in this embodiment has a greater advantage.
[0161] summary:
[0162] This embodiment first proposes a data-physical driven end-to-end unit combination model based on the STGCN network to achieve approximate optimization of unit combination; however, due to the discrete search space, model optimization is difficult. To address this issue, the model is improved by proposing a data-physical hybrid driven spatiotemporal graph attention neural network-based unit combination model:
[0163] (1) The designed spatiotemporal self-attention graph convolutional neural network model uses graph convolutional networks (GCN) and self-attention mechanism to extract spatiotemporal features from the data, so that the decision of the UC problem not only meets the spatiotemporal physical constraints, but also can efficiently optimize the cost.
[0164] (2) Instead of directly outputting the unit state variables, integer variables representing its state are obtained based on the output of traditional power generation, which makes the search space of the UC problem smoother and improves the model convergence performance.
[0165] (3) An improved augmented Lagrangian (APU) learning strategy is introduced to adaptively adjust the weights of various losses during model training, further improving the model's convergence performance. Experiments on the improved IEEE 30-node and IEEE 118-node systems show that the proposed method outperforms traditional model-based methods and the three existing data-driven models; the model is highly efficient for online application and can provide a new tool for unit combination problems.
[0166] Example 2
[0167] This embodiment also provides a power system unit combination system based on a data-physical hybrid driven spatiotemporal attention graph neural network, used to implement the method, including: a data acquisition module, a model building module, a first model training module, a second model training module, and a unit combination module;
[0168] The data acquisition module is used to acquire the operating data of the power system, including load data and new energy forecast values.
[0169] The model building module is used to build a spatiotemporal self-attention graph convolutional neural network, and to build a unit combination model based on the spatiotemporal self-attention graph convolutional neural network. The spatiotemporal self-attention graph convolutional neural network includes 3 layers of self-attention temporal convolutional layers and 3 layers of spatial convolutional layers based on graph convolutional networks.
[0170] The first model training module is used to input the power system operation data into the unit combination model for two-stage model training. The first stage is based on the fusion strategy of physical mechanism, local relaxation of integer variables and supervised pre-training to complete the physical constraints and empirical risk minimization of the weight matrix of the unit combination model and guide the initialization of model parameters. The second stage uses target guidance, physical mechanism constraints and local relaxation of integer variables to achieve secondary adjustment of model parameters.
[0171] The second model training module is used to introduce an adaptive penalty term update algorithm to balance the physical constraint weights and complete the convergence of the unit combination model, thereby obtaining the trained unit combination model.
[0172] The unit combination module is used to make unit combination decisions for the power system based on the trained unit combination model.
[0173] Example 3
[0174] This embodiment also provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method.
[0175] The above are merely preferred embodiments 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. An end-to-end unit commitment method of power system based on object fusion driven spatio-temporal attention graph neural network, characterized in that, Includes the following steps: Acquire operational data of the power system, including load data and renewable energy forecasts; A spatiotemporal self-attention graph convolutional neural network is constructed, and a unit combination model is constructed based on the spatiotemporal self-attention graph convolutional neural network. The spatiotemporal self-attention graph convolutional neural network includes 3 layers of self-attention temporal convolutional layers and 3 layers of spatial convolutional layers based on graph convolutional networks. The power system's operating data is input into the unit combination model for two-stage model training. The first stage is based on a fusion strategy of physical mechanism, direct-through estimation, and supervised pre-training to minimize the physical constraints and empirical risks of the unit combination model's weight matrix and guide the initialization of model parameters. The second stage uses goal guidance, physical mechanism constraints, and local relaxation of integer variables to achieve secondary adjustment of model parameters. An adaptive penalty term update algorithm is introduced to balance the physical constraint weights and complete the convergence of the unit combination model, thus obtaining the trained unit combination model. Realize power system unit combination decisions based on trained unit combination models; The second stage, which employs goal-oriented approaches, physical mechanism constraints, and local relaxation of integer variables to achieve secondary adjustment of model parameters, includes the following: Relaxation constraints are introduced to relax the binarized variables of generator switching states in the power system, so that the relaxed binarized variables match the generator output. Constraints are added between the calculated generator output and the generator output input to the model. The generator output is calculated through the AC power flow model to ensure that the model learns the power flow mechanism of the power system. Unit start-up and shutdown time constraints are introduced to convert the relaxed start-up and shutdown variables output by the model into integer variables to determine the generator start-up and shutdown states, and then the model parameters are adjusted a second time. The formula for calculating the loss function of the relaxation constraint is as follows: , wherein, is a relaxed start-stop state variable, is a generator output; The process of introducing an adaptive penalty term update algorithm to optimize the model training process and obtaining the trained unit combination model includes: To address various constraints in model training, an adaptive penalty term update algorithm is introduced. This algorithm assigns a unique penalty parameter to each constraint and adaptively updates the corresponding penalty parameter based on the characteristics of the constraint. The expression for the adaptive penalty term update algorithm is as follows: In the formula, It is the first Class 1 The penalty parameter for the next iteration It is the first Class 1 The Lagrange multipliers of the next iteration, It is the first Class 1 The function of the nth iteration It is a smoothing constant. It is the global learning rate. It is a constant.
2. The method according to claim 1, characterized in that, The self-attention temporal convolutional layer employs a multi-head attention mechanism, transforming the input data into query matrices, key matrices, and value matrices through multiple sets of linear transformation matrices. Each transformed query matrix, key matrix, and value matrix is then input into the self-attention mechanism for computation. The outputs of the self-attention mechanism are concatenated using the Concat function to obtain a concatenated feature matrix. This concatenated feature matrix is then integrated and transformed through a fully connected layer to finally obtain the global correlation output features of the nodes.
3. The method according to claim 1, characterized in that, The expression for the spatial convolutional layer based on the graph convolutional network is as follows: , In the formula, , yes The degree matrix, It is a connection Layers and The weight parameter matrix.
4. The method according to claim 2, characterized in that, Before inputting the power system's operating data into the unit combination model for two-stage model training, the following steps are also included: Taking power system nodes as units, the time-series vector of a node is composed of load values and new energy forecast values for several time periods. The time-series vector of the node is then used to form the input feature. The input feature and its position code are added together to obtain the input of the spatiotemporal self-attention map convolutional neural network.
5. A power system unit combination system based on a data-physical hybrid driven spatiotemporal attention graph neural network, characterized in that, The method for implementing any one of claims 1-4 includes: a data acquisition module, a model building module, a first model training module, a second model training module, and a unit combination module; The data acquisition module is used to acquire the operating data of the power system, including load data and new energy forecast values. The model building module is used to build a spatiotemporal self-attention graph convolutional neural network, and to build a unit combination model based on the spatiotemporal self-attention graph convolutional neural network. The spatiotemporal self-attention graph convolutional neural network includes 3 layers of self-attention temporal convolutional layers and 3 layers of spatial convolutional layers based on graph convolutional networks. The first model training module is used to input the power system operation data into the unit combination model for two-stage model training. The first stage is based on the fusion strategy of physical mechanism, direct estimation and supervised pre-training to complete the physical constraints and empirical risk minimization of the weight matrix of the unit combination model and guide the initialization of model parameters. The second stage adopts target guidance, physical mechanism constraints and local relaxation of integer variables to achieve secondary adjustment of model parameters. The second model training module is used to introduce an adaptive penalty term update algorithm to balance the physical constraint weights and complete the convergence of the unit combination model, thereby obtaining the trained unit combination model. The unit combination module is used to make unit combination decisions for the power system based on the trained unit combination model.
6. 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 according to any one of claims 1-4.