Power system state prediction method and device based on spatiotemporal attention graph network

Through a method based on spatiotemporal attention graph networks, temporal convolution and graph convolution techniques are used to extract the spatiotemporal characteristics of the power system, which solves the problem that existing models cannot accurately capture the topological structure of the power system and achieves more accurate state prediction.

CN118780938BActive Publication Date: 2025-09-30SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410709561.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2025-09-30
Estimated Expiration
2044-06-03

AI Technical Summary

Technical Problem

Existing system state prediction models cannot accurately capture the complex topological structure characteristics of the power system, resulting in the inability to accurately predict the system state.

Method used

A method based on spatiotemporal attention graph network is adopted to extract and fuse features of adjacency matrix, node admittance matrix, system state matrix and renewable energy power generation through multiple network layers. Temporal convolution and graph convolution techniques are used to extract the spatiotemporal characteristics of the power system, and an adaptive graph is constructed to capture the complex topological structure of the power system.

Benefits of technology

It improves the accuracy of power system state prediction, can better capture the spatiotemporal characteristics and dynamic changes of the power system, and supports the stable operation and power control of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118780938B_ABST
    Figure CN118780938B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for predicting the state of an electric power system based on a spatiotemporal attention graph network, which belongs to the technical field of electric power systems. For each network layer, the first sublayer performs spatiotemporal feature extraction on the adjacency matrix and the output state feature of the previous network layer to obtain the first state feature of the network layer, the second sublayer performs spatiotemporal feature extraction on the node admittance matrix and the second state feature of the previous network layer to obtain the second state feature of the network layer, the third sublayer performs time feature extraction on the power generation timing feature of the previous network layer to obtain the power generation timing feature of the network layer, the output state feature of the previous network layer, the first state feature of the network layer, the second state feature of the network layer and the power generation timing feature of the network layer are feature fused to obtain the output state feature of the network layer, and the power system state is predicted based on multiple output state features of all network layers, which can improve the accuracy of system state prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power systems, and in particular to a method and device for predicting power system states based on a spatiotemporal attention graph network. Background Art

[0002] Reliable system state predictions, such as voltage, current, active power, and reactive power, facilitate power control and energy management in power systems. Power systems involve multiple nodes and the data transmission relationships between them, resulting in a complex topology. However, existing system state prediction models cannot accurately capture the complex topological features of power systems, such as the connectivity between nodes, resulting in an inability to accurately predict system states. Therefore, improving the accuracy of system state predictions has become an urgent challenge. Summary of the Invention

[0003] The main purpose of the embodiments of the present application is to propose a method and device for predicting the state of an electric power system based on a spatiotemporal attention graph network, aiming to improve the accuracy of system state prediction.

[0004] To achieve the above objectives, a first aspect of an embodiment of the present application proposes a method for predicting power system state based on a spatiotemporal attention graph network, the method comprising:

[0005] Obtain the adjacency matrix, node admittance matrix, system state matrix, and renewable energy generation of the power system in historical time slots;

[0006] Inputting the adjacency matrix, the node admittance matrix, the system state matrix, and the renewable energy power generation into a spatiotemporal attention graph network, wherein the spatiotemporal attention graph network includes a plurality of network layers, each of which includes a first sublayer, a second sublayer, and a third sublayer;

[0007] For the first network layer, the first sublayer extracts spatiotemporal features from the adjacency matrix and the system state matrix to obtain a first state feature, the second sublayer extracts spatiotemporal features from the node admittance matrix and the system state matrix to obtain a second state feature, the third sublayer extracts time features from the renewable energy power generation to obtain a power generation time series feature, and the first state feature, the second state feature, and the power generation time series feature are fused to obtain an output state feature of the first network layer;

[0008] For each network layer except the first network layer, the first sublayer is used to perform spatiotemporal feature extraction on the adjacency matrix and the output state feature of the previous network layer to obtain the first state feature of the network layer, the second sublayer is used to perform spatiotemporal feature extraction on the node admittance matrix and the second state feature of the previous network layer to obtain the second state feature of the network layer, the third sublayer is used to perform time feature extraction on the power generation time series feature of the previous network layer to obtain the power generation time series feature of the network layer, and feature fusion is performed on the output state feature of the previous network layer, the first state feature of the network layer, the second state feature of the network layer, and the power generation time series feature of the network layer to obtain the output state feature of the network layer;

[0009] The power system state is predicted based on multiple output state features of all the network layers.

[0010] In some embodiments, extracting spatiotemporal features from the adjacency matrix and the system state matrix using the first sublayer to obtain first state features includes:

[0011] Performing time convolution on the system state matrix to obtain a first state time series feature;

[0012] Perform graph convolution on the adjacency matrix and the first state time series feature to obtain the first state feature.

[0013] In some embodiments, performing time convolution on the system state matrix to obtain the first state time series feature includes:

[0014] Performing dilated convolution on the system state matrix according to a first preset weight matrix to obtain a first state convolution feature;

[0015] Performing dilated convolution on the system state matrix according to a second preset weight matrix to obtain a second state convolution feature;

[0016] Performing activation processing on the first state convolution feature to obtain a first activation feature;

[0017] Performing activation processing on the second state convolution feature to obtain a second activation feature;

[0018] The first activation feature and the second activation feature are multiplied element by element to obtain the first state time series feature.

[0019] In some embodiments, performing graph convolution on the adjacency matrix and the first state temporal feature to obtain the first state feature includes:

[0020] For each order, performing graph convolution on the adjacency matrix and the first state temporal features according to a third preset weight matrix of the order to obtain a state space feature of the order;

[0021] Feature fusion is performed on the state space features of each order to obtain the first state feature.

[0022] In some embodiments, performing spatiotemporal feature extraction on the node admittance matrix and the system state matrix through the second sublayer to obtain a second state feature includes:

[0023] Performing time convolution on the system state matrix to obtain a second state time series feature;

[0024] Performing linear mapping on the node admittance matrix to obtain a node relationship matrix;

[0025] Perform graph convolution on the second state time series feature and the node relationship matrix to obtain the second state feature.

[0026] In some embodiments, performing power system state prediction based on multiple output state features of all the network layers includes:

[0027] Performing feature splicing on a plurality of the output state features to obtain a spliced ​​state feature;

[0028] Performing a self-attention transformation on the splicing state feature to obtain an attention feature;

[0029] Perform a linear mapping on the attention features.

[0030] In some embodiments, the power system includes a plurality of power nodes, and the spatiotemporal attention graph network is trained by the following steps:

[0031] Obtaining a sample system state of each power node in a sample time slot;

[0032] Based on the AC power flow model, performing power flow calculation according to each of the sample system states to obtain a first predicted system state of each of the power nodes in multiple target time slots;

[0033] Based on a preset graph network, performing system state prediction according to each of the sample system states to obtain a second predicted system state of each of the power nodes in the plurality of target time slots;

[0034] For each of the target time slots, performing loss calculation according to the first predicted system state and the second predicted system state to obtain an initial loss;

[0035] Summing the initial losses to obtain the target loss;

[0036] The model parameters of the preset graph network are updated according to the target loss to obtain the spatiotemporal attention graph network.

[0037] To achieve the above objectives, a second aspect of an embodiment of the present application proposes a power system state prediction device based on a spatiotemporal attention graph network, the device comprising:

[0038] An acquisition module is used to obtain the adjacency matrix, node admittance matrix, system state matrix and renewable energy generation of the power system in historical time slots;

[0039] An input module, configured to input the adjacency matrix, the node admittance matrix, the system state matrix, and the renewable energy power generation into a spatiotemporal attention graph network, wherein the spatiotemporal attention graph network includes a plurality of network layers, each of which includes a first sublayer, a second sublayer, and a third sublayer;

[0040] a first feature extraction module, configured to, for a first network layer, perform spatiotemporal feature extraction on the adjacency matrix and the system state matrix via the first sublayer to obtain a first state feature, perform spatiotemporal feature extraction on the node admittance matrix and the system state matrix via the second sublayer to obtain a second state feature, perform time feature extraction on the renewable energy power generation via the third sublayer to obtain a power generation time series feature, and perform feature fusion on the first state feature, the second state feature, and the power generation time series feature to obtain an output state feature of the first network layer;

[0041] a second feature extraction module configured to, for each network layer except the first network layer, perform spatiotemporal feature extraction on the adjacency matrix and the output state feature of the previous network layer through the first sublayer to obtain the first state feature of the network layer, perform spatiotemporal feature extraction on the node admittance matrix and the second state feature of the previous network layer through the second sublayer to obtain the second state feature of the network layer, perform time feature extraction on the power generation time series feature of the previous network layer through the third sublayer to obtain the power generation time series feature of the network layer, and perform feature fusion on the output state feature of the previous network layer, the first state feature of the network layer, the second state feature of the network layer, and the power generation time series feature of the network layer to obtain the output state feature of the network layer;

[0042] The power system state prediction module is used to predict the power system state according to multiple output state characteristics of all the network layers.

[0043] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the power system state prediction method based on the spatiotemporal attention graph network of the above-mentioned first aspect.

[0044] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the power system state prediction method based on the spatiotemporal attention graph network of the above-mentioned first aspect.

[0045] The present application proposes a method for predicting the state of a power system based on a spatiotemporal attention graph network, a device for predicting the state of a power system based on a spatiotemporal attention graph network, an electronic device, and a computer-readable storage medium. By acquiring the adjacency matrix, node admittance matrix, system state matrix, and renewable energy generation of the power system in historical time slots, the system state in future time slots is predicted based on the adjacency relationship, load information, system state, renewable energy, and other data information in the historical time slots. In order to capture the spatiotemporal characteristics of this data information and enable the model to learn the temporal characteristics of the data information and the complex topological structure of the power system, the adjacency matrix, node admittance matrix, system state matrix, and renewable energy generation are input into the spatiotemporal attention graph network. The spatiotemporal attention graph network comprises multiple network layers, each consisting of a first sublayer, a second sublayer, and a third sublayer. The first sublayer extracts spatiotemporal features from the adjacency matrix and the system state matrix, capturing the spatiotemporal characteristics of the power system based on the node topology implicit in the adjacency matrix and the system state matrix, yielding the first state feature. The second sublayer extracts spatiotemporal features from the node admittance matrix and the system state matrix, capturing the spatiotemporal characteristics of the power system based on the node topology implicit in the node admittance matrix, load information, and the system state matrix, yielding the second state feature. Considering the impact of renewable energy on power system state prediction, the third sublayer extracts temporal features from renewable energy generation, yielding the generation time series feature. Feature fusion is performed on the first, second, and generation time series features to integrate multiple features, improving the model's ability to learn complex power system topologies. Output state features are then generated from the network layer. Power system state prediction is performed based on the multiple output state features from all network layers, fully utilizing multi-scale feature information and improving the accuracy of system state prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is a flow chart of a method for predicting power system status based on a spatiotemporal attention graph network provided by an embodiment of the present application;

[0047] Figure 2 yes Figure 1 Flowchart of step S130 in FIG.

[0048] Figure 3 yes Figure 2 Flowchart of step S210 in FIG.

[0049] Figure 4 yes Figure 2 Flowchart of step S220 in FIG.

[0050] Figure 5 yes Figure 1 Another flowchart of step S130 in FIG.

[0051] Figure 6 This is a network structure diagram of the spatiotemporal attention graph network provided by an embodiment of the present application;

[0052] Figure 7 yes Figure 1 Flowchart of step S150 in FIG.

[0053] Figure 8 This is a flow chart of the training process of the spatiotemporal attention graph network provided by an embodiment of the present application;

[0054] Figure 9A This is a rendering of the power system state prediction method based on the spatiotemporal attention graph network provided by an embodiment of the present application;

[0055] Figure 9B This is another effect diagram of the power system state prediction method based on the spatiotemporal attention graph network provided by an embodiment of the present application;

[0056] Figure 9C This is another effect diagram of the power system state prediction method based on the spatiotemporal attention graph network provided by an embodiment of the present application;

[0057] Figure 9D This is another effect diagram of the power system state prediction method based on the spatiotemporal attention graph network provided by an embodiment of the present application;

[0058] Figure 10 Schematic diagram of the structure of a power system state prediction device based on a spatiotemporal attention graph network provided in an embodiment of the present application;

[0059] Figure 11 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0061] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0063] Compared to traditional smart grid systems (power systems), modern smart grid systems exhibit greater diversity due to technological advancements, such as the widespread use of renewable energy (RES) and improved load efficiency. However, due to the instability and intermittency of renewable energy and loads, smart grid systems may still face rapidly changing unstable states, which affect the stability of system state variables. To address the uncertainties caused by RES and loads, estimating the dynamic changes in system state over time is crucial and further supports stable system operation and services. Therefore, in modern smart grid systems, reliable system state predictions, such as voltage, current, active power, and reactive power, facilitate power control and energy management. Related technologies use traditional statistical methods such as extended Kalman filters, statistical Gaussian mixture models, and nonparametric prediction to predict system states. With the availability of large amounts of dynamic system state data in modern smart grid systems, data-driven machine learning methods have emerged as an emerging solution for exploring the underlying nonlinear characteristics of the system. In particular, deep learning, a branch of machine learning, has successfully extracted latent features through neural networks. This precise prediction capability is of great significance for operations such as power system stability assessment. Power systems involve multiple nodes and the data transmission relationships between them, resulting in a complex topology. However, existing neural networks for system state prediction cannot accurately capture the complex topological features of power systems, such as the connections between nodes, resulting in an inability to accurately predict system states. Therefore, improving the accuracy of system state prediction has become an urgent issue.

[0064] Based on this, the embodiments of the present application provide a power system state prediction method based on a spatiotemporal attention graph network, a power system state prediction device based on a spatiotemporal attention graph network, an electronic device and a computer-readable storage medium, aiming to improve the accuracy of system state prediction.

[0065] The embodiments of the present application provide a method for predicting the state of a power system based on a spatiotemporal attention graph network, a device for predicting the state of a power system based on a spatiotemporal attention graph network, an electronic device, and a computer-readable storage medium. These are specifically described through the following embodiments. First, the method for predicting the state of a power system based on a spatiotemporal attention graph network in the embodiments of the present application is described.

[0066] The power system state prediction method based on the spatiotemporal attention graph network provided in the embodiment of the present application relates to the field of power system technology. The power system state prediction method based on the spatiotemporal attention graph network provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the power system state prediction method based on the spatiotemporal attention graph network, etc., but is not limited to the above forms.

[0067] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0068] Figure 1 This is an optional flowchart of the power system state prediction method based on the spatiotemporal attention graph network provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S110 to S150.

[0069] Step S110, obtaining the adjacency matrix, node admittance matrix, system state matrix, and renewable energy generation of the power system in the historical time slot;

[0070] Step S120: inputting the adjacency matrix, the node admittance matrix, the system state matrix, and the renewable energy power generation into a spatiotemporal attention graph network, where the spatiotemporal attention graph network includes multiple network layers, each of which includes a first sublayer, a second sublayer, and a third sublayer;

[0071] Step S130: For the first network layer, the first sublayer extracts spatiotemporal features from the adjacency matrix and the system state matrix to obtain a first state feature. The second sublayer extracts spatiotemporal features from the node admittance matrix and the system state matrix to obtain a second state feature. The third sublayer extracts temporal features from the renewable energy power generation to obtain a power generation time series feature. The first state feature, the second state feature, and the power generation time series feature are fused to obtain the output state feature of the first network layer.

[0072] Step S140: For each network layer except the first network layer, perform spatiotemporal feature extraction on the adjacency matrix and the output state feature of the previous network layer through the first sublayer to obtain the first state feature of the network layer; perform spatiotemporal feature extraction on the node admittance matrix and the second state feature of the previous network layer through the second sublayer to obtain the second state feature of the network layer; perform time feature extraction on the power generation time series feature of the previous network layer through the third sublayer to obtain the power generation time series feature of the network layer; perform feature fusion on the output state feature of the previous network layer, the first state feature of the network layer, the second state feature of the network layer, and the power generation time series feature of the network layer to obtain the output state feature of the network layer;

[0073] Step S150 , performing power system state prediction based on multiple output state features of all network layers.

[0074] In step S110 of some embodiments, the power system includes multiple power nodes, namely common buses, including generator nodes, load nodes, and renewable energy generation nodes. Power systems typically exist in the form of a graph structure, exhibiting high-dimensional features and inter-node dependencies. Based on graph theory, let N be the indexed set of nodes and ε be the indexed edges between nodes. The power system's common buses are used as nodes, and transmission lines are used as edges to model the power system as a directed graph. The directed graph is represented as g(N,ε), where N represents a set of common buses and ε represents a set of transmission lines. A preset historical period is represented as T, which is the operating period of the power system and can be a day. The preset historical period is divided into multiple time periods to obtain multiple historical time slots. T = {1, 2, ..., |T|}, where T is a set of multiple historical time slots and |T| represents the number of historical time slots. Unlike systems that combine system states with fixed topological features and fixed time patterns, the present application uses an adaptive graph to implement node adjacency and considers heterogeneous renewable energy sources to perform short-term, multi-timescale power system state prediction. Specifically, based on the directed graph, the connection relationship between the power nodes of the power system in multiple time slots is obtained to construct the adjacency matrix, which is a learnable relationship matrix. The adjacency matrix of the preset historical period is represented by g f ={g f1 ,...,g fi ,...,g fT}, i represents the i-th historical time slot. For example, if the sensor sampling interval is 15 minutes, then T is 96, and 96 adjacency matrices for different historical time slots can be obtained. The node admittance matrix for each historical time slot is obtained. The node admittance matrix is ​​used to describe the electrical connection relationship between each power node in the power system, and is used to represent the load information of the load node and the connection relationship between each power node. The node admittance matrix is ​​a square matrix with the number of rows and columns equal to the number of power nodes. The node admittance matrix is ​​obtained as:

[0075]

[0076] Where y is the node admittance matrix; |N| is the number of power nodes in the power system; y ij represents the admittance between the i-th power node and the j-th power node, y ij =g ij +jb ij , g ij is the conductance of the transmission line (i, j)∈ε, g ij ≥0, b ij is the susceptance of the transmission line (i, j)∈ε, b ij ≤0. There may be capacitors across the power nodes, which can convert the capacitive reactance of the capacitor into admittance, and c ij =cji , c ij is the admittance of the capacitance between power node i and power node j. R = 1 / Real(Y), where Real represents the real part.

[0077] The local power inflow of the i-th power node is defined as S i =P i +jQ i , P i is the active power inflow, i.e., the active power, Q i The reactive power inflow is the reactive power. The power inflow is closely related to power generation scheduling. The active power generation of the power system covers conventional power generation and renewable energy generation. Conventional power generation uses generator nodes to generate power, and renewable energy generation uses renewable energy generation nodes to generate power. The load node is used to consume the power generated by the generator node and the renewable energy generation node. The active power generation and reactive power generation of the tth historical time slot are expressed as and t∈T, the active load and reactive load of the tth historical time slot are expressed as and Active load is the active power consumed by the load node, and reactive load is the reactive power consumed by the load node. The active power of the i-th power node in the t-th historical time slot is expressed as:

[0078]

[0079] The reactive power of the i-th power node in the t-th historical time slot is expressed as:

[0080]

[0081] For any two power nodes i and j in the power system, the complex power flow is represented as S ij =P ij +jQ ij , complex power flow includes active power flow (active power) P ij Also covers reactive power flow Q ij , the relationship between the complex power flow (local power inflow) at power node i and its nearby complex power flow is expressed as:

[0082]

[0083] Among them, Ω i represents the set of transmission lines connected near the power node i.

[0084] In order to perform power flow analysis, the system state matrix is ​​obtained. The system state matrix includes the state vector of each power node in each historical time slot. The system state matrix is ​​used to represent the dynamic system state of the power system that changes over time. The state vector includes the voltage amplitude, voltage phase, active power and reactive power of the node. The voltage can be represented by voltage amplitude and voltage phase. The state vector of the i-th power node in the t-th historical time slot is expressed as:

[0085]

[0086] Among them, |V i | represents the voltage amplitude; θ i Indicates voltage phase; P i is the active power; Q i is the reactive power; H represents the transposition operator.

[0087] It should be noted that among the |N| power nodes in a historical time slot, |N|-1 nodes contribute two state variables: voltage amplitude and voltage phase, and one balancing node contributes one state variable: voltage phase. The voltage phases of the |N|-1 nodes can be specified based on the voltage phase of the balancing node. The voltage amplitude of the balancing node can be set to 0. In this case, all 2|N|-1 state variables, namely N voltage amplitudes and N-1 voltage phases, are explicitly included in the power system voltage. The system state matrix is ​​expressed as:

[0088]

[0089] Where X represents the system state matrix; |N| is the number of power nodes; |T| is the number of historical time slots; x ij represents the state vector of power node i at historical time slot j.

[0090] Taking full account of the impact of renewable energy in the time-varying power system, the renewable energy power generation of the renewable energy generation node in each power node of the power system in each historical time slot is obtained. The renewable energy generation node in each power node can be a homogeneous renewable energy or a heterogeneous renewable energy. Heterogeneous renewable energy will increase the complexity of the power system. The renewable energy power generation in each historical time slot can reflect the change of the power generation generated by renewable energy generation nodes such as solar energy and wind energy over time. The renewable energy power generation is the power generation of the renewable energy generation node. The power generation of the renewable energy generation node in the i-th power node in the historical time slot t is expressed as RES i,t , public data can be used directly.

[0091] In step S120 of some embodiments, conventional methods such as extended Kalman filters, statistical Gaussian mixture models, and nonparametric prediction tools are used in related technologies to predict power system states. However, these methods only address obvious linear or nonlinear system patterns and ignore hidden nonlinear characteristics in power systems, such as the state conditions that may cause system instability. With the increasing complexity of power networks, deep learning methods have become a method for fully exploiting hidden nonlinear spatial and temporal characteristics. In power systems, power flows between power nodes may change over time, causing relationships between power nodes, such as power network connectivity and adjacency, to change over time. For example, industrial and household electricity demand have different peaks and valleys. Industrial electricity demand typically peaks during the day, while household electricity demand typically peaks at night, resulting in different power consumption fluctuations for industrial and household electricity. In this context, the relationship between generator nodes and load nodes may change periodically over time. Due to the complex graph structures of power systems, convolutional neural networks cannot accurately predict system states. However, existing graph structures fail to fully represent the adjacency relationships of common buses in complex power systems. To maintain the non-Euclidean structure of the power grid, namely its connectivity and adjacency information, this application uses graph-based neural networks to predict system states. To accurately predict dynamic system states, this application uses dynamic adjacency information between power nodes from a multi-timescale perspective (multiple historical time slots), and considers renewable energy and load information to predict dynamic power system states at multiple timescales.

[0092] State prediction is defined as a spatiotemporal prediction task. Considering the spatial structure and temporal dependency of the power system, the power system network is modeled as a directed graph g(N,ε). The spatiotemporal prediction task is expressed as:

[0093]

[0094] Among them, [X t-|T|+1 ,...,X t ] represents the system state of the power system in T historical time slots, i.e., the state vector; J represents the length of the prediction data, and represents J time slots; f represents the prediction function; g represents the adjacency matrix; y represents the node admittance matrix; represents the predicted system state for J future time slots.

[0095] Existing models fail to fully utilize graph-based information retrieved from power networks, and thus fail to fully capture the complexity of different power system topologies. Unlike methods that fail to capture the complexity of different power system topologies, this application designs a spatiotemporal attention graph network based on graph information to better mine power networks with time characteristics. With the availability of a large amount of spatiotemporal system state data, and in view of the complexity of graph structure data, the adjacency matrix, node admittance matrix, system state matrix and renewable energy power generation of each historical time slot are input into the spatiotemporal attention graph network for adaptive dynamic system prediction. Taking into account the time-varying characteristics of the adjacency matrix, node admittance matrix, system state matrix and renewable energy power generation, as well as spatial data in the power system such as non-Euclidean spatial features (network topology), the spatiotemporal attention graph network is used to mine and utilize the spatial and temporal dependencies of the time-varying system state. The spatiotemporal attention graph network includes multiple stacked network layers for extracting the spatiotemporal relationship of the power system state, each network layer includes a first sublayer, a second sublayer and a third sublayer, and the first sublayer, the second sublayer and the third sublayer perform data processing in parallel. The first sublayer is the feature module, the second sublayer is the bus module, and the third sublayer is the energy module. Both the first and second sublayers are equipped with temporal convolution and graph convolution, while the third sublayer is equipped with temporal convolution. Temporal features are extracted through temporal convolution operations, and spatial features are extracted through adaptive graph neural networks (graph convolution).

[0096] To effectively capture the changing dynamics of the power system state while accounting for the impact of various renewable energy sources and the fixed relationships between common buses in complex power systems, the feature module in each network layer takes the power system state as input and pairs the feature dimensions through convolution operations. Feature extraction uses a temporal convolutional network (TCN) and a graph convolutional network (GCN) for temporal and spatial feature extraction, respectively. A temporal convolutional network (TCN) is a variant of a convolutional neural network that can capture long-term dependencies in time series data. To better capture the evolving system state over a predefined historical period, a separate, learnable adjacency matrix is ​​constructed for each historical time slot within the predefined historical period. Backpropagation is then performed to obtain the adjacency matrix for all historical time slots, which serves as the input to the GCN. Similar to the feature module, the bus module also uses both TCN and GCN for temporal and spatial feature extraction, but the GCN input is the bus relationship matrix y (node ​​admittance matrix) derived from the transmission line matrix. Considering the temporal dependencies between renewable energy sources and loads, the energy module uses only the TCN for temporal feature extraction.

[0097] Specifically, for the first network layer, the first sublayer extracts spatiotemporal features from the adjacency matrix and system state matrix of a preset historical period to capture the dynamic changes in the system state and the spatial topological structure of the power system, thereby obtaining the first state feature. The second sublayer extracts spatiotemporal features from the node admittance matrix and the system state matrix to capture the dynamic changes in the system state and the relationship between the common buses, thereby obtaining the second state feature. In order to determine the impact of various renewable energy sources on the power system, the third sublayer extracts time features from the renewable energy generation to obtain the power generation timing feature. The hidden states extracted from the above three modules are combined to fully extract the nonlinear characteristics of the power system. Specifically, the first state feature, the second state feature, and the power generation timing feature are added together to obtain the output state feature of the first network layer.

[0098] See also Figure 2 In some embodiments, step S130 may include but is not limited to steps S210 to S220:

[0099] Step S210, performing time convolution on the system state matrix to obtain a first state time series feature;

[0100] Step S220: Perform graph convolution on the adjacency matrix and the first state temporal feature to obtain the first state feature.

[0101] In step S210 of some embodiments, in the power system, the power flow between common buses may vary according to the time of day. For example, the peaks and valleys of industrial and household loads follow different patterns, causing the relationship between generators and loads to change periodically over time. In order to achieve multi-time scale prediction of the power system state, an adaptive graph is constructed to model the time-varying adjacency between common buses to obtain a system state matrix. The system state matrix of a preset historical period is temporally convolved by the time convolution network set in the first sublayer, and time features are extracted from the historical states to obtain first state time series features. Time features are time-related data attributes that describe the time dependence of data over time. The first state time series features are used to characterize the dynamic changes of system states at different times. The first state time series features can be voltage amplitude features, voltage phase features, active power features, and reactive power features of different historical time slots, or relationship features between system states under different historical time slots.

[0102] In step S220 of some embodiments, the spatial relationship between nodes is crucial for the system state prediction task. The adjacency matrix and first state time series features for a preset historical period are concatenated, and graph convolution is performed on the concatenated features using a graph convolutional network provided in the first sublayer to extract spatial features, such as the spatial relationship between power nodes, to obtain first state features. Spatial features are data attributes related to spatial location, describing the distribution, structure, and relationships of data in spatial dimensions. First state features are spatial features extracted from the system state based on the adjacency matrix.

[0103] Through the above steps S210 to S220, the dynamic characteristics of the system status changing over time and the spatial topological relationship of the power system changing over time can be captured to fully express the diverse complexity of the power system, and then accurately and quickly predict the status of the power system.

[0104] See also Figure 3 In some embodiments, step S210 may include, but is not limited to, steps S310 to S350:

[0105] Step S310, performing dilated convolution on the system state matrix according to a first preset weight matrix to obtain a first state convolution feature;

[0106] Step S320, performing dilated convolution on the system state matrix according to the second preset weight matrix to obtain a second state convolution feature;

[0107] Step S330, performing activation processing on the first state convolution feature to obtain a first activation feature;

[0108] Step S340, performing activation processing on the second state convolution feature to obtain a second activation feature;

[0109] Step S350 : multiply the first activation feature and the second activation feature element by element to obtain a first state time series feature.

[0110] In step S310 of some embodiments, the temporal convolutional network with expansion operation can significantly reduce the time complexity compared with the recurrent neural network used in traditional time series tasks. The temporal convolutional network includes a temporal convolution kernel and a gated convolution kernel, and the first preset weight matrix is ​​a matrix composed of the weight parameters of the temporal convolution kernel. The gated convolution kernel introduces a gating mechanism, through which its response can be dynamically adjusted according to the characteristics of the sequence data. The first state convolution feature is a local feature in the time series extracted by the temporal convolution kernel that can reflect the dynamic changes of the system state, such as short-term change trends and periodic change patterns. If the first preset weight matrix of the first sublayer of the lth network layer is expressed as The dilated convolution is represented by *, then the first state convolution feature is represented as

[0111] In step S320 of some embodiments, the second preset weight matrix is ​​a matrix composed of weight parameters of the gated convolution kernel. The second state convolution feature is a long-term dependency feature that reflects the dynamic change of the system state in the time series extracted by the gated convolution kernel. If the second preset weight matrix of the first sublayer of the lth network layer is expressed as The dilated convolution is represented by *, then the second state convolution feature is represented as

[0112] In step S330 of some embodiments, the first activation function uses the inverse tangent function tanh. In order to enable the network to learn and simulate complex function mappings, the first state convolution feature is activated by the first activation function to obtain the first activation feature.

[0113] In step S340 of some embodiments, the second activation function adopts the sigmoid function. The activation function is nonlinear, which can enable the network to learn and simulate complex function mappings. The second state convolution feature is activated by the second activation function to obtain the second activation feature.

[0114] In step S350 of some embodiments, the first activation feature and the second activation feature are element-wise multiplied to obtain a first state temporal feature output by the temporal convolution kernel in the first sublayer of the first network layer. The first state temporal feature output by the first sublayer of the first network layer is calculated as follows:

[0115]

[0116] in, Represents the first state time series feature; tanh is the first activation function; σ is the second activation function; ⊙ represents element-by-element multiplication; * represents dilated convolution.

[0117] Through the above steps S310 to S350, the time characteristics reflecting the dynamic changes of the system state can be extracted from the time series of the system state matrix to capture the hidden time dependency of the power system, and then accurately predict the system state based on the hidden time dependency.

[0118] See also Figure 4 In some embodiments, step S220 may include but is not limited to steps S410 to S420:

[0119] Step S410: for each order, performing graph convolution on the adjacency matrix and the first state temporal features according to a third preset weight matrix of the order to obtain a state space feature of the order;

[0120] Step S420 , performing feature fusion on the state space features of each order to obtain a first state feature.

[0121] In step S410 of some embodiments, GCN is used to perform graph convolution to extract spatial features. Unlike traditional GCN, the present application constructs a learnable adjacency matrix as the input of GCN, and updates the adjacency relationship of each node in different time slots through back propagation. GCN uses multiple graph convolutions of different orders. The order of graph convolution usually refers to the range of neighbor nodes considered in the graph convolution operation. For example, the first-order graph convolution considers the neighbor nodes directly adjacent to the current node, and the second-order graph convolution considers the neighbor nodes of the node connected to the current node by an edge. The higher the order of the graph convolution, the more distant adjacent nodes will be considered. If the order is u, then the third preset weight matrix of the order is expressed as W u , the third preset weight matrix is ​​the matrix composed of the weight parameters of the u-th order graph convolution, and u represents the uth power. The state space feature obtained by the u-th order graph convolution operation is expressed as where g ft represents the adjacency matrix of the t-th historical time slot, represents the first state time series feature of the tth historical time slot, W u Represents the third preset weight matrix of the u-th order graph convolution.

[0122] In step S420 of some embodiments, the state space features of each order are summed to obtain a first state feature, which is expressed as: U is the order of graph convolution.

[0123] In the above steps S410 to S420, spatial feature extraction is performed through graph convolutions of different orders, which can fully consider the bus relationship between power nodes at different distances, thereby capturing the time-varying spatial topological relationship between different power nodes.

[0124] See also Figure 5 In some embodiments, step S130 may include but is not limited to steps S510 to S530:

[0125] Step S510, performing time convolution on the system state matrix to obtain a second state time series feature;

[0126] Step S520, performing linear mapping on the node admittance matrix to obtain a node relationship matrix;

[0127] Step S530: Perform graph convolution on the second state time series feature and the node relationship matrix to obtain the second state feature.

[0128] In step S510 of some embodiments, similar to the first sub-layer, the second sub-layer also uses TCN and GCN to extract spatiotemporal features. The temporal convolutional network provided in the second sub-layer performs temporal convolution on the system state matrix for a preset historical period to obtain second state time series features. The specific process of temporal convolution can be referred to steps S310 to S350 and will not be repeated here.

[0129] In step S520 of some embodiments, the node relationship matrix is ​​a bus relationship matrix derived from the node admittance matrix, which is used to characterize the physical connectivity between any two power nodes in the power system. The node admittance matrix is ​​linearly mapped using weights and biases to obtain the node relationship matrix. The node relationship matrix is ​​represented by g b ={α ij} |N|×|N| , α ij It is used to characterize the connectivity between power node i and power node j, which can be defined as: ij =W ij *(g ij ,b ij )+B ij , W ij represents weight, B represents bias, * represents dilated convolution, g ij represents the conductance between power node i and power node j, b ij represents the susceptance between power node i and power node j.

[0130] In step S530 of some embodiments, graph convolution is performed on the second state temporal features and the node relationship matrix to extract spatial features and obtain the second state features. The second state features are used to reflect the physical connection relationship between different power nodes in the power system. The second state features are represented as The specific graph convolution process can refer to steps S410 to S420 and will not be described in detail here.

[0131] In the above steps S510 to S530, the dynamic changes of the system state can be captured through time convolution, and the time-varying physical connection relationship between the nodes of the power system can be captured through graph convolution, so as to fully extract the spatiotemporal characteristics of the power network.

[0132] Taking into account the temporal dependence of renewable energy, the temporal convolutional network set up in the third sub-layer extracts the temporal features of renewable energy power generation and obtains the power generation time series features. The third sub-layer performs feature expansion through linear operations, and its feature extraction process is expressed as: W l and b lRepresent the weight and bias of the third sub-layer respectively. The power generation time series feature is used to reflect the dynamic change of power generation of various homogeneous or heterogeneous renewable energy sources over time. If the first state feature is represented by The second state feature is expressed as The power generation timing characteristics are expressed as Then the output state feature of the first network layer is expressed as Where l is equal to 1.

[0133] In step S140 of some embodiments, Figure 6 As shown, for each network layer l except the first network layer, 2≤l≤L, L represents the number of network layers in the spatiotemporal attention graph network, the adjacency matrix g is calculated by the first sublayer. f and the output state feature F of the previous network layer l-1 Perform spatiotemporal feature extraction to obtain the first state feature of the network layer. The process of spatiotemporal feature extraction is expressed as:

[0134]

[0135]

[0136] Among them, F l-1 Represents the output state characteristics of the previous network layer l-1; Represents the temporal convolutional network of the first sublayer in the network layer l for F l-1 Extracted first state temporal features; Represents the graph convolutional network of the first sublayer in network layer l for and the adjacency matrix g f Extracted first state features; and are all weight parameters of the temporal convolutional network; W u is the weight parameter of the u-th order graph convolution.

[0137] Through the second sub-layer node admittance matrix y and the second state feature of the previous network layer Perform spatiotemporal feature extraction to obtain the second state features of the network layer. The process of spatiotemporal feature extraction is expressed as:

[0138]

[0139] g b =W ij *(g ij ,b ij )+B ij , formula (12)

[0140]

[0141] in, Indicates the second state characteristics of the previous network layer l-1; Represents the temporal convolutional network of the second sublayer in network layer l for Extracted second state temporal features; g b is the node relationship matrix derived from the node admittance matrix; Represents the graph convolutional network of the second sublayer in network layer l for and g b Extracted second state features; and are the weight parameters of the temporal convolutional network in the second sub-layer; W u is the weight parameter of the u-th order graph convolution in the second sub-layer.

[0142] The power generation timing characteristics of the upper network layer are obtained through the third sub-layer Perform time feature extraction to obtain the power generation timing characteristics of the network layer. The process of time feature extraction in the third sub-layer is as follows:

[0143]

[0144] Among them, W l and b l denote the weight and bias of the third sub-layer respectively.

[0145] Apply skip connections to alleviate the gradient vanishing problem when the network is deep, and the output state feature F of the previous network layer l-1 , the first state characteristics of the network layer Second state characteristics of the network layer and the power generation timing characteristics of the network layer Add the features to get the output state feature F of the network layer l .Right now,

[0146] To accurately model the power system, a fusion module is used to combine the spatiotemporal features obtained from the feature module, bus module, and energy module. The fusion module, equipped with a self-attention mechanism and a linear layer, combines the output state features (hidden features) of each network layer to predict the power system state in future time slots. The detailed processing of the fusion module is shown below.

[0147] See also Figure 7 In some embodiments, step S150 may include but is not limited to steps S710 to S730:

[0148] Step S710, performing feature splicing on multiple output state features to obtain a spliced ​​state feature;

[0149] Step S720, performing self-attention transformation on the splicing state feature to obtain an attention feature;

[0150] Step S730: perform linear mapping on the attention features.

[0151] In step S710 of some embodiments, in order to utilize the hidden features of each level output by each network layer, the output hidden features (output state features) of different network layers are connected to obtain the spliced ​​state features. The spliced ​​state features are expressed as F = [F 1 ,F 2 ,...,F l ,...,F L ], L represents the number of network layers.

[0152] In step S720 of some embodiments, a self-attention mechanism is applied to fuse the output hidden features of each network layer. The calculation process of the self-attention mechanism involves three components: the query matrix Q, the key matrix K, and the value matrix V. The query matrix Q, the key matrix K, and the value matrix V are obtained by combining the input matrix, i.e., the spliced ​​state features F, with the corresponding weight matrix W. q 、W k and W v The attention feature output by the self-attention mechanism can be calculated as follows:

[0153]

[0154] Among them, d k is the dimension of the key matrix K; Z represents the attention feature; T represents the transpose operation.

[0155] In step S730 of some embodiments, a linear layer is applied to linearly map the attention features to obtain the future dynamic system state. The length of the linear layer can be determined based on the number of future time slots to be predicted, thereby obtaining the system state for multiple consecutive future time slots. The system state includes the voltage amplitude, voltage phase, active power, and reactive power of each power node.

[0156] Through the above steps S710 to S730, the latent spatial features and time-dependent features of different scales of each network layer can be integrated to fully extract the spatiotemporal characteristics of the power network, thereby improving the accuracy of dynamic system state prediction.

[0157] See also Figure 8 In some embodiments, the training process of the spatiotemporal attention graph network may include but is not limited to steps S810 to S860:

[0158] Step S810, obtaining a sample system state of each power node in a sample time slot;

[0159] Step S820 , performing power flow calculation based on each sample system state based on the AC power flow model to obtain a first predicted system state of each power node in a plurality of target time slots;

[0160] Step S830 , based on the preset graph network, performing system state prediction according to each sample system state, and obtaining a second predicted system state of each power node in a plurality of target time slots;

[0161] Step S840 , for each target time slot, performing loss calculation based on the first predicted system state and the second predicted system state to obtain an initial loss;

[0162] Step S850, summing up the initial losses to obtain the target loss;

[0163] Step S860: Update the model parameters of the preset graph network according to the target loss to obtain a spatiotemporal attention graph network.

[0164] In step S810 of some embodiments, sample system states of each power node in multiple sample time slots are obtained. The sample time slots are historical time periods. The sample system states include voltage amplitude, voltage phase, active power, and reactive power of the power node.

[0165] In step S820 of some embodiments, an AC power flow model is used to obtain actual measured values ​​of the system state. The AC power flow model may be a Newton-Raphson power flow model, a Gauss-Seidel power flow model, a fast decoupling power flow model, etc. Considering the complexity of the power system, the Newton-Raphson power flow model is used to express the satisfaction of the AC power balance condition using a nonlinear equation, which is expressed as:

[0166]

[0167] Where 0 represents an all-zero matrix; g(X) represents the AC power balance condition; ΔP represents the gradient of active power; and ΔQ represents the gradient of reactive power.

[0168] For each iteration k, obtain ΔP k and ΔQ k , according to ΔP k and ΔQ k Calculate the system Jacobian matrix and calculate the voltage amplitude correction value Δ|V for the kth iteration based on the system Jacobian matrix k | and voltage phase correction Δθ k, update the voltage amplitude according to the voltage amplitude correction amount, and update the voltage phase according to the voltage phase correction amount. Determine whether the voltage amplitude correction amount and the voltage phase correction amount are less than the preset allowable error. If the judgment result is yes, the iteration ends, and the voltage amplitude and voltage phase of the most recent iteration are obtained, and the active power and reactive power are calculated according to the voltage amplitude and voltage phase respectively, so as to obtain the first predicted system state of multiple target time slots according to the voltage amplitude, voltage phase, active power and reactive power. The target time slot is a future time period, and each target time slot is after each sample time slot. The number of target time slots is equal to the number of future time slots for which the system state needs to be predicted. The allowable error can be 10 -5 .

[0169] In step S830 of some embodiments, an adjacency matrix, a node admittance matrix, and renewable energy generation of the power system at each sample time slot are constructed. The sample system state, the adjacency matrix, the node admittance matrix, and the renewable energy generation are input into a preset graph network to obtain a second predicted system state for each power node at a plurality of target time slots. The second predicted system state is the system state predicted by the preset graph network.

[0170] In step S840 of some embodiments, a loss function is used as a quantitative indicator of model performance to guide the optimization process to reduce the gap between the predicted state and the actual state, thereby improving the accuracy of the model prediction. This application uses mean square error as the loss function to optimize the model parameters of the preset graph network. For each target time slot, the loss of the first predicted system state and the second predicted system state of each power node is calculated according to the mean square error loss function to obtain the initial loss. The initial loss is expressed as:

[0171]

[0172] Where N represents the number of power nodes in the power system, i.e. the number of buses; x i,t represents the first predicted system state of the i-th power node at the t-th target time slot; Denotes the second predicted system state of the i-th power node at the t-th target time slot.

[0173] In step S850 of some embodiments, the initial losses of each target time slot are summed to obtain a target loss. The target loss is expressed as:

[0174]

[0175] Where L represents the target loss and H represents the number of target time slots.

[0176] In step S860 of some embodiments, based on the gradient descent algorithm, the model parameters of the preset graph network are updated by minimizing the target loss to refine the model parameters, optimize the model performance, and obtain the spatiotemporal attention graph network.

[0177] In the above steps S810 to S860, the spatiotemporal attention graph network is trained based on the topological information of the graph and a data set with spatiotemporal attributes, so that the model can learn the complex topological structure of the power system and develop a complex neural network architecture suitable for the power system, thereby accurately predicting the system status of the power system in multiple time slots in the future.

[0178] This application conducts ablation experiments to evaluate the model performance of the spatiotemporal attention graph network. Three power systems of different sizes are used in the simulation, including IEEE 57-Bus, IEEE 118-Bus, and IEEE 145-Bus systems. For each power system, bus and bus information is extracted according to the IEEE common data format. The detailed information of the three test systems is as follows:

[0179] IEEE 57 power system: This system consists of 57 buses and 80 transmission lines. In the test case, solar and wind turbines are deployed on 13 and 37 buses, respectively.

[0180] IEEE 118 power system: This system consists of a total of 118 buses and 186 transmission lines. The solar and wind turbines in the test case are deployed on 49 and 69 buses, respectively.

[0181] IEEE 145 power system: This system consists of 145 buses and 153 transmission lines. The solar and wind turbines in the test case are deployed on 17 and 69 buses, respectively.

[0182] For each of the three power systems, buses with the most connected transmission lines were selected to install heterogeneous solar and wind turbines. Model training and testing were performed using time-varying historical power system data, such as data from the past year. The data was divided into three sets: training, validation, and test, with a time-varying percentage of 60%, 20%, and 20%, respectively. This separation was evaluated through cross-validation. The system state sampling period was 15 minutes. Sample construction was performed on each dataset separately using a sliding window, and the data was normalized to the range [0, 1] using Z-score normalization. Furthermore, the time-varying power system state data and loads employed were scaled to accommodate the four power systems described above.

[0183] The spatiotemporal attention graph network and baseline model proposed in this application are implemented in Python using PyTorch. The learning rate used in deep learning is 1e -3, with a batch size of 50 and an epoch of 100. Model optimization was performed using the Adam optimizer, with early stopping implemented to reduce the risk of overfitting. All tests were run on a server equipped with an Intel(R) Xeon(R) E5-2620 v4 CPU and an nVidia GeForce RTX 2080Ti GPU.

[0184] To evaluate the performance of the spatiotemporal attention graph network, the network was compared with baseline models, including GW-Net, Long Short-Term Memory (LSTM) networks, dynamic multifaceted spatiotemporal graph convolutional networks (DMSTGCN), multivariate time series graph neural networks (MTGNN), LSTM-CNN, and spatiotemporal graph convolutional networks (STGCN), using root mean square error (RMSE) and mean absolute error (MAE) metrics. GW-Net dynamically captures spatial dependencies by learning an adaptive dependency matrix through node embedding. LSTM-CNN employs stacked LSTM networks to acquire time series inputs and predict system states. DMSTGCN, a variant of GCN, uses dynamic graph convolutional networks (GCNs) to capture time-varying relationships and estimate the state of graph systems. MTGNN is a deep spatiotemporal model for multivariate time series prediction based on graph neural networks. LSTM-CNN employs a multi-level recognition approach combining innovative vectors, long short-term memory, and convolutional neural networks to detect false data and improve the accuracy of power system state estimation. STGCN considers the fixed connections between buses in the power system and applies conventional GCN and GRN layers to predict states.

[0185] Considering the existence of negative values ​​in the power system state, RMSE and MAE are defined as follows:

[0186]

[0187]

[0188] Where N represents the number of power nodes in the power system, i.e., the number of buses; H represents the number of predicted time slots; x i,t represents the actual state of the i-th power node at the t-th time slot; represents the predicted state of the i-th power node at the t-th time slot.

[0189] The spatiotemporal attention graph network and various baseline models were tested on power systems of three different sizes, predicting system states for the next 1, 2, and 3 hours. Since the system state sampling period is 15 minutes, the prediction time slots H are {4, 8, 12}, respectively. The evaluation results of each model on the IEEE 57 power system, IEEE 118 power system, and IEEE 145 power system are shown in Tables 1, 2, and 3, respectively.

[0190]

[0191] Table 1

[0192]

[0193]

[0194] Table 2

[0195]

[0196] Table 3

[0197] As can be seen from Tables 1, 2, and 3, the proposed spatiotemporal attention graph network is able to capture the spatial and temporal dependencies of system states from different dimensions. It achieves low RMSE and MAE on all three test systems, achieves high accuracy in dynamic system state prediction, and outperforms other baselines in terms of prediction accuracy. The proposed spatiotemporal attention graph network fully captures the time-varying, complex system topology and the adjacent node information of the dynamic graph, enabling accurate prediction of dynamic power system states. Its network structure is particularly well-suited for power system state prediction. As the prediction window expands, the prediction task becomes increasingly challenging, resulting in a decrease in the prediction accuracy of all models. Therefore, a trade-off between prediction accuracy and prediction window is necessary in practical applications. Furthermore, most spatiotemporal models achieve better prediction results than LSTM and LSTM-CNN, demonstrating the critical importance of spatial information for state prediction. Furthermore, the accuracy of power system predictions decreases with increasing power system size. This difference can be attributed to the more complex topology, which reduces the effectiveness of different models to a certain extent.

[0198] Focusing on bus No. 37 in the IEEE 57 power system, which integrates solar power generation, the data of bus No. 37 for the entire month of December and three days of that month are visualized. The three days of data are in the dotted box, which contains actual data and forecast results. The forecast time windows are 4, 8, and 12 respectively. The voltage phase fluctuation curve is as follows Figure 9A As shown, the fluctuation curve of voltage amplitude is as follows Figure 9BAs shown in the fluctuation curve, it can be seen that when the prediction time window is set to 4, the model more accurately represents the actual value of the phase angle of bus No. 37. The prediction results effectively reflect the daily changes in the power system state, although there are occasional sudden fluctuations between the predicted and actual values ​​at the detailed level, which is particularly obvious when H = 12. This is largely attributed to the error accumulation caused by the longer prediction time window. Figure 9A and Figure 9B It can be seen that the predicted values ​​of most voltage amplitudes and voltage phases at bus 37 are closely consistent with the actual values, which illustrates the effectiveness of the spatiotemporal attention graph network in capturing the spatiotemporal characteristics within the power system.

[0199] This application also conducts comprehensive ablation experiments to evaluate the impact of each module of the feature module, bus module and energy module on the overall performance of the model. The original spatiotemporal attention graph network is called "vanilla", and the following four variants of the spatiotemporal attention graph network are carefully studied: w / o fusion, w / o power, w / o bus and w edges, w / o fusion represents the spatiotemporal attention graph network without fusion module, w / o power represents the spatiotemporal attention graph network without energy module, w / o bus represents the spatiotemporal attention graph network without bus module, w edges represents the node relationship matrix g b The spatiotemporal attention graph network is replaced with the true bus connection relationship.

[0200] Figure 9C The RMSE performance of different variants is shown, Figure 9D The MAE performance of different variants is shown, Figure 9C and Figure 9D The prediction accuracy of different variants for all prediction time windows on the IEEE 57 power system is shown. Figure 9C and Figure 9D It can be seen that each module contributes to its prediction accuracy. The fusion module, energy module, and bus module all play a vital role in the model's ability to accurately predict the power system state. When any of these modules is removed, the prediction accuracy decreases. In addition, by comparing the original spatiotemporal attention graph network with "w edges", it can be observed that using the real bus connection graph instead of the graph g in the bus module b This affects the prediction accuracy, indicating that the node admittance matrix y is more effective in capturing the spatial relationships and dependencies between buses than the actual bus connections. The spatiotemporal attention graph network is able to effectively capture the topology and dependencies of the power system.

[0201] The choice of hyperparameters is crucial to model performance. Based on the IEEE 57 power system with a 1-hour forecast window, we evaluated the impact of learning rate and batch size on model performance. The evaluation results are shown in Table 4.

[0202]

[0203] Table 4

[0204] Table 4 demonstrates the relatively stable performance of the spatiotemporal attention network under various learning rate and batch size configurations. Despite varying the learning rate by several orders of magnitude, from 1e-2 to 1e-4, and adjusting the batch size from 25 to 100, the RMSE and MAE metrics exhibit only slight changes. RMSE values ​​remain within a narrow range of 0.0037 to 0.0048, while MAE values ​​fluctuate minimally between 0.0009 and 0.0020. Despite the variations in the tested hyperparameters, the early stopping mechanism and the robustness of the proposed spatiotemporal attention network effectively maintain performance, preventing the hyperparameter selection from significantly influencing the model results.

[0205] See also Figure 10 The present application also provides an embodiment of a power system state prediction device based on a spatiotemporal attention graph network, which can implement the above-mentioned power system state prediction method based on a spatiotemporal attention graph network. The power system state prediction device based on a spatiotemporal attention graph network includes:

[0206] An acquisition module 1010 is configured to acquire an adjacency matrix, a node admittance matrix, a system state matrix, and renewable energy generation of the power system in a historical time slot;

[0207] An input module 1020 is configured to input the adjacency matrix, the node admittance matrix, the system state matrix, and the renewable energy power generation into the spatiotemporal attention graph network, where the spatiotemporal attention graph network includes multiple network layers, each of which includes a first sublayer, a second sublayer, and a third sublayer;

[0208] A first feature extraction module 1030 is configured to extract spatiotemporal features of the adjacency matrix and the system state matrix in the first sublayer for the first network layer to obtain a first state feature, extract spatiotemporal features of the node admittance matrix and the system state matrix in the second sublayer to obtain a second state feature, extract time features of renewable energy power generation in the third sublayer to obtain a power generation time series feature, and perform feature fusion on the first state feature, the second state feature, and the power generation time series feature to obtain an output state feature of the first network layer;

[0209] A second feature extraction module 1040 is configured to, for each network layer except the first network layer, perform spatiotemporal feature extraction on the adjacency matrix and the output state feature of the previous network layer via the first sublayer to obtain the first state feature of the network layer, perform spatiotemporal feature extraction on the node admittance matrix and the second state feature of the previous network layer via the second sublayer to obtain the second state feature of the network layer, perform time feature extraction on the power generation time series feature of the previous network layer via the third sublayer to obtain the power generation time series feature of the network layer, and perform feature fusion on the output state feature of the previous network layer, the first state feature of the network layer, the second state feature of the network layer, and the power generation time series feature of the network layer to obtain the output state feature of the network layer;

[0210] The power system state prediction module 1050 is used to predict the power system state according to multiple output state features of all network layers.

[0211] The specific implementation of the power system state prediction device based on the spatiotemporal attention graph network is basically the same as the specific implementation of the power system state prediction method based on the spatiotemporal attention graph network mentioned above, and will not be repeated here.

[0212] The present application also provides an electronic device comprising a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method for predicting power system states based on a spatiotemporal attention graph network. The electronic device can be any intelligent terminal, including a tablet computer and an in-vehicle computer.

[0213] See also Figure 11 , Figure 11 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0214] The processor 1110 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0215] The memory 1120 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1120 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1120, and the processor 1110 calls and executes the power system state prediction method based on the spatiotemporal attention graph network according to the embodiments of this application.

[0216] Input / output interface 1130, used for information input and output;

[0217] Communication interface 1140, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0218] bus 1150 , which transmits information between various components of the device (e.g., processor 1110 , memory 1120 , input / output interface 1130 , and communication interface 1140 );

[0219] The processor 1110 , the memory 1120 , the input / output interface 1130 , and the communication interface 1140 are communicatively connected to each other within the device via a bus 1150 .

[0220] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned power system state prediction method based on the spatiotemporal attention graph network.

[0221] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0222] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0223] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0224] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0225] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0226] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0227] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A power system state prediction method based on spatiotemporal attention graph network, characterized in that: The method comprises: Obtain the adjacency matrix, node admittance matrix, system state matrix, and renewable energy generation of the power system in historical time slots; Inputting the adjacency matrix, the node admittance matrix, the system state matrix, and the renewable energy power generation into a spatiotemporal attention graph network, wherein the spatiotemporal attention graph network includes a plurality of network layers, each of which includes a first sublayer, a second sublayer, and a third sublayer; For the first network layer, the first sublayer extracts spatiotemporal features from the adjacency matrix and the system state matrix to obtain a first state feature, the second sublayer extracts spatiotemporal features from the node admittance matrix and the system state matrix to obtain a second state feature, the third sublayer extracts time features from the renewable energy power generation to obtain a power generation time series feature, and the first state feature, the second state feature, and the power generation time series feature are fused to obtain an output state feature of the first network layer; For each network layer except the first network layer, the first sublayer is used to perform spatiotemporal feature extraction on the adjacency matrix and the output state feature of the previous network layer to obtain the first state feature of the network layer, the second sublayer is used to perform spatiotemporal feature extraction on the node admittance matrix and the second state feature of the previous network layer to obtain the second state feature of the network layer, the third sublayer is used to perform time feature extraction on the power generation time series feature of the previous network layer to obtain the power generation time series feature of the network layer, and feature fusion is performed on the output state feature of the previous network layer, the first state feature of the network layer, the second state feature of the network layer, and the power generation time series feature of the network layer to obtain the output state feature of the network layer; The power system state is predicted based on multiple output state features of all the network layers.

2. The power system state prediction method based on spatiotemporal attention graph network according to claim 1 is characterized in that The performing spatiotemporal feature extraction on the adjacency matrix and the system state matrix through the first sublayer to obtain a first state feature includes: Performing time convolution on the system state matrix to obtain a first state time series feature; Perform graph convolution on the adjacency matrix and the first state time series feature to obtain the first state feature.

3. The power system state prediction method based on spatiotemporal attention graph network according to claim 2 is characterized in that The performing time convolution on the system state matrix to obtain a first state time series feature includes: Performing dilated convolution on the system state matrix according to a first preset weight matrix to obtain a first state convolution feature; Performing dilated convolution on the system state matrix according to a second preset weight matrix to obtain a second state convolution feature; Performing activation processing on the first state convolution feature to obtain a first activation feature; Performing activation processing on the second state convolution feature to obtain a second activation feature; The first activation feature and the second activation feature are multiplied element by element to obtain the first state time series feature.

4. The power system state prediction method based on spatiotemporal attention graph network according to claim 2 is characterized in that: The performing graph convolution on the adjacency matrix and the first state temporal feature to obtain the first state feature includes: For each order, performing graph convolution on the adjacency matrix and the first state temporal features according to a third preset weight matrix of the order to obtain a state space feature of the order; Feature fusion is performed on the state space features of each order to obtain the first state feature.

5. The power system state prediction method based on spatiotemporal attention graph network according to any one of claims 1 to 4, characterized in that: The performing spatiotemporal feature extraction on the node admittance matrix and the system state matrix through the second sublayer to obtain a second state feature includes: Performing time convolution on the system state matrix to obtain a second state time series feature; Performing linear mapping on the node admittance matrix to obtain a node relationship matrix; Perform graph convolution on the second state time series feature and the node relationship matrix to obtain the second state feature.

6. The power system state prediction method based on spatiotemporal attention graph network according to any one of claims 1 to 4, characterized in that: The performing of power system state prediction according to the multiple output state characteristics of all the network layers includes: Performing feature splicing on a plurality of the output state features to obtain a spliced ​​state feature; Performing a self-attention transformation on the splicing state feature to obtain an attention feature; Perform a linear mapping on the attention features.

7. The power system state prediction method based on spatiotemporal attention graph network according to any one of claims 1 to 4, characterized in that: The power system includes multiple power nodes, and the spatiotemporal attention graph network is trained by the following steps: Obtaining a sample system state of each power node in a sample time slot; Based on the AC power flow model, performing power flow calculation according to each of the sample system states to obtain a first predicted system state of each of the power nodes in multiple target time slots; Based on a preset graph network, performing system state prediction according to each of the sample system states to obtain a second predicted system state of each of the power nodes in the plurality of target time slots; For each of the target time slots, performing loss calculation according to the first predicted system state and the second predicted system state to obtain an initial loss; Summing the initial losses to obtain the target loss; The model parameters of the preset graph network are updated according to the target loss to obtain the spatiotemporal attention graph network.

8. A power system state prediction device based on a spatiotemporal attention graph network, characterized in that: The device comprises: An acquisition module is used to obtain the adjacency matrix, node admittance matrix, system state matrix and renewable energy generation of the power system in historical time slots; An input module, configured to input the adjacency matrix, the node admittance matrix, the system state matrix, and the renewable energy power generation into a spatiotemporal attention graph network, wherein the spatiotemporal attention graph network includes a plurality of network layers, each of which includes a first sublayer, a second sublayer, and a third sublayer; a first feature extraction module, configured to, for a first network layer, perform spatiotemporal feature extraction on the adjacency matrix and the system state matrix via the first sublayer to obtain a first state feature, perform spatiotemporal feature extraction on the node admittance matrix and the system state matrix via the second sublayer to obtain a second state feature, perform time feature extraction on the renewable energy power generation via the third sublayer to obtain a power generation time series feature, and perform feature fusion on the first state feature, the second state feature, and the power generation time series feature to obtain an output state feature of the first network layer; a second feature extraction module configured to, for each network layer except the first network layer, perform spatiotemporal feature extraction on the adjacency matrix and the output state feature of the previous network layer through the first sublayer to obtain the first state feature of the network layer, perform spatiotemporal feature extraction on the node admittance matrix and the second state feature of the previous network layer through the second sublayer to obtain the second state feature of the network layer, perform time feature extraction on the power generation time series feature of the previous network layer through the third sublayer to obtain the power generation time series feature of the network layer, and perform feature fusion on the output state feature of the previous network layer, the first state feature of the network layer, the second state feature of the network layer, and the power generation time series feature of the network layer to obtain the output state feature of the network layer; The power system state prediction module is used to predict the power system state according to multiple output state characteristics of all the network layers.

9. An electronic device, characterized in that The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the power system state prediction method based on the spatiotemporal attention graph network described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the power system state prediction method based on the spatiotemporal attention graph network described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Power system unit commitment optimization method and system based on spatio-temporal feature fusion

    CN116760115A

  • Microgrid group fault diagnosis method and device based on multi-source data fusion

    CN116990631A