Power system state prediction method and device based on space-time attention graph network
Through the method based on the spatiotemporal attention graph network, the spatiotemporal characteristics of the power system are extracted, which solves the problem of inaccurate power system state prediction in the existing technology and achieves higher prediction accuracy and dynamic change capture.
Patent Information
- Application Number
- CN202410709561.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-06-03
AI Technical Summary
Existing power system state prediction models cannot accurately capture complex topological structure characteristics, resulting in inaccurate system state prediction.
Using a method based on the spatiotemporal attention graph network, the adjacency matrix, node admittance matrix and system state matrix of the historical time slots of the power system are obtained, and then input into the spatiotemporal attention graph network for feature extraction and feature fusion, and multiple network layers are used to extract the spatiotemporal features to improve prediction accuracy.
It improves the accuracy of power system state prediction, can better capture the complex topological structure and spatiotemporal characteristics of the power system, and enhances the ability to predict dynamic changes in system state.
Smart Images

Figure CN118780938A_ABST
Abstract
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, reactive power, etc. help power systems to perform power control and energy management. The power system involves multiple nodes and data transmission relationships between multiple nodes, making its topology complex. However, the existing system state prediction model cannot accurately capture the complex topological structure characteristics of the power system, such as the connection relationship between nodes, resulting in the model being unable to accurately predict the system state. Therefore, how to improve the accuracy of system state prediction has become an urgent problem to be solved. 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 is used to extract the spatiotemporal features of the adjacency matrix and the system state matrix to obtain the first state features, the second sublayer is used to extract the spatiotemporal features of the node admittance matrix and the system state matrix to obtain the second state features, the third sublayer is used to extract the time features of the renewable energy power generation to obtain the power generation timing features, and the first state features, the second state features and the power generation timing features are feature fused to obtain the output state features of the first network layer;
[0008] For each network layer except the first network layer, the first sublayer is used to extract the spatiotemporal features of the adjacency matrix and the output state features of the previous network layer to obtain the first state features of the network layer, the second sublayer is used to extract the spatiotemporal features of the node admittance matrix and the second state features of the previous network layer to obtain the second state features of the network layer, the third sublayer is used to extract the time features of the power generation timing features of the previous network layer to obtain the power generation timing features of the network layer, the output state features of the previous network layer, the first state features of the network layer, the second state features of the network layer and the power generation timing features of the network layer are feature fused to obtain the output state features of the network layer;
[0009] The power system state prediction is performed based on multiple output state characteristics of all the network layers.
[0010] In some embodiments, extracting spatiotemporal features from the adjacency matrix and the system state matrix through 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 timing feature includes:
[0014] Performing a 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 timing 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 time series feature according to a third preset weight matrix of the order to obtain a state space feature of the order;
[0021] The state space features of each order are subjected to feature fusion to obtain the first state feature.
[0022] In some embodiments, the step of extracting spatiotemporal features of 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 according to multiple output state characteristics 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, power flow calculation is performed according to each of the sample system states to obtain a first predicted system state of each of the power nodes in a plurality of target time slots;
[0033] Based on a preset graph network, a system state prediction is performed 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-mentioned purpose, 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 the historical time slot;
[0039] An input module, used 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 is used for extracting spatiotemporal features of the adjacency matrix and the system state matrix through the first sublayer for the first network layer to obtain a first state feature, extracting spatiotemporal features of the node admittance matrix and the system state matrix through the second sublayer to obtain a second state feature, extracting time features of the renewable energy power generation through the third sublayer to obtain a power generation timing feature, and performing feature fusion on the first state feature, the second state feature and the power generation timing feature to obtain an output state feature of the first network layer;
[0041] A second feature extraction module is used for, for each network layer except the first network layer, performing 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, performing 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, performing time feature extraction on the power generation timing feature of the previous network layer through the third sublayer to obtain the power generation timing feature of the network layer, and performing 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 timing 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, the electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the power system state prediction method based on the spatiotemporal attention graph network of the above-mentioned first aspect is implemented.
[0044] To achieve the above-mentioned objectives, 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, the power system state prediction method based on the spatiotemporal attention graph network of the above-mentioned first aspect is implemented.
[0045] The power system state prediction method based on the spatiotemporal attention graph network, the power system state prediction device based on the spatiotemporal attention graph network, the electronic device and the computer-readable storage medium proposed in this application obtain the adjacency matrix, node admittance matrix, system state matrix and renewable energy power generation of the power system in the historical time slot, so as to predict the system state of the future time slot based on the adjacency relationship, load information, system state, renewable energy and other data information of the historical time slot. In order to capture the spatiotemporal characteristics of these data information, so that the model can learn the time series 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 power generation are input into the spatiotemporal attention graph network. The spatiotemporal attention graph network includes multiple network layers, each of which includes 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, so that the spatiotemporal features of the power system can be captured based on the node topology structure implied by the adjacency matrix and the system state matrix, and the first state feature is obtained. The second sublayer extracts spatiotemporal features from the node admittance matrix and the system state matrix, so that the spatiotemporal features of the power system can be captured based on the node topology structure, load information and system state matrix implied by the node admittance matrix, and the second state feature is obtained. Considering the impact of renewable energy on the prediction of the power system state, the third sublayer extracts the time feature of the renewable energy power generation to obtain the power generation time series feature. The first state feature, the second state feature and the power generation time series feature are fused to integrate multiple features, improve the model's ability to learn the complex topology structure of the power system, and obtain the output state feature of the network layer output. The power system state is predicted based on multiple output state features of all network layers, so that the system state prediction is made by making full use of multi-scale feature information, which improves the accuracy of the system state prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flow chart of a method for predicting power system state based on a spatiotemporal attention graph network provided in an embodiment of the present application;
[0047] Figure 2 yes Figure 1 Flow chart of step S130 in FIG.
[0048] Figure 3 yes Figure 2 Flow chart of step S210 in FIG.
[0049] Figure 4 yes Figure 2 Flow chart of step S220 in FIG.
[0050] Figure 5 yes Figure 1 Another flowchart of step S130 in FIG.
[0051] Figure 6 It 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 Flow chart of step S150 in FIG.
[0053] Figure 8 It is a flow chart of the training process of the spatiotemporal attention graph network provided in an embodiment of the present application;
[0054] Fig.9A It is a rendering of a power system state prediction method based on a spatiotemporal attention graph network provided in an embodiment of the present application;
[0055] Fig. 9B It is another effect diagram of the power system state prediction method based on the spatiotemporal attention graph network provided in an embodiment of the present application;
[0056] Fig. 9C It is another effect diagram of the power system state prediction method based on the spatiotemporal attention graph network provided in an embodiment of the present application;
[0057] Fig.9D It is another effect diagram of the power system state prediction method based on the spatiotemporal attention graph network provided in an embodiment of the present application;
[0058] Fig.10 It is a structural schematic diagram of a power system state prediction device based on a spatiotemporal attention graph network provided in an embodiment of the present application;
[0059] Fig.11 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0063] Compared with traditional smart grid systems (power systems), modern smart grid systems present more diverse characteristics due to technological advances, 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, affecting the stability of system state variables. In order to cope with the uncertainty caused by RES and loads, it is crucial to estimate the dynamic changes of system states over time, and further support the stable operation and service of the system. Therefore, in modern smart grid systems, reliable system state predictions such as voltage, current, active power, reactive power, etc. are helpful for power control and energy management of power systems. Traditional statistical methods such as extended Kalman filter, statistical Gaussian mixture model, and non-parametric prediction are used in related technologies to predict system states. With the availability of a large amount of dynamic system state data in modern smart grid systems, data-driven machine learning methods have gradually become an emerging solution to explore potential nonlinear features in the system. In particular, as a branch of machine learning methods, deep learning successfully extracts potential features through neural networks. This accurate prediction capability is of great significance for operations such as stability assessment of power systems. The power system involves multiple nodes and data transmission relationships between multiple nodes, making its topology complex. However, the existing neural network based on system state prediction cannot accurately capture the complex topological structure characteristics of the power system, such as the connection relationship between nodes, resulting in the model being unable to accurately predict the system state. Therefore, how to improve the accuracy of system state prediction has become an urgent problem to be solved.
[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. The method is 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 technical field of power systems. 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 a server cluster or a distributed system composed of multiple physical servers, and can also be configured 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 a power system state prediction method based on a 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, etc. 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, etc. 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 through 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 is an optional flowchart of a power system state prediction method based on a spatiotemporal attention graph network provided in an 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 power 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 the spatiotemporal attention graph network, the spatiotemporal attention graph network comprising a plurality of network layers, each network layer comprising a first sublayer, a second sublayer, and a third sublayer;
[0071] Step S130: for the first network layer, the first sublayer is used to extract the spatiotemporal features of the adjacency matrix and the system state matrix to obtain the first state features, the second sublayer is used to extract the spatiotemporal features of the node admittance matrix and the system state matrix to obtain the second state features, the third sublayer is used to extract the time features of the renewable energy power generation to obtain the power generation timing features, the first state features, the second state features and the power generation timing features are feature fused to obtain the output state features of the first network layer;
[0072] Step S140, for each network layer except the first network layer, extract the spatiotemporal features of the adjacency matrix and the output state features of the previous network layer through the first sublayer to obtain the first state features of the network layer, extract the spatiotemporal features of the node admittance matrix and the second state features of the previous network layer through the second sublayer to obtain the second state features of the network layer, extract the time features of the power generation timing features of the previous network layer through the third sublayer to obtain the power generation timing features of the network layer, perform feature fusion on the output state features of the previous network layer, the first state features of the network layer, the second state features of the network layer and the power generation timing features of the network layer to obtain the output state features of the network layer;
[0073] Step S150, predicting the state of the power system according to multiple output state characteristics of all network layers.
[0074] In step S110 of some embodiments, the power system includes a plurality of power nodes, namely, a common bus, and the power nodes include a generator node, a load node, and a renewable energy generation node. The power system usually exists in the form of a graph structure, with high-dimensional features and dependencies between nodes. Based on graph theory, let N be the index set of nodes, and ε be the index edge between nodes. The common bus of the power system is used as a node, and the transmission line is used as an edge to model the power system as a directed graph. The directed graph is represented by g(N,ε), where N represents a set of common buses and ε represents a set of transmission lines. The preset historical period is represented by T, and the preset historical period is the operating time period of the power system, which can be one day. The preset historical period is divided into multiple time periods to obtain multiple historical time slots. T = {1, 2, ..., |T|}, T is a set of multiple historical time slots, and |T| represents the number of historical time slots. Different from the combination of system state with fixed topological features and fixed time patterns, the present application adopts an adaptive graph to realize node adjacency and considers heterogeneous renewable energy to perform short-term multi-time scale power system state prediction. Specifically, the connection relationship between power nodes in the power system in multiple time slots is obtained based on the directed graph to construct an 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 sampling interval of the sensor is 15 minutes, then T is 96, and 96 adjacency matrices of different historical time slots can be obtained. The node admittance matrix of 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 characterize the load information of the load node and the connection relationship between each power node. The node admittance matrix is a square matrix, and the number of rows and columns of the square matrix is 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. Capacitors may be connected across power nodes, and the capacitive reactance of the capacitor can be converted into admittance, and c ij =cji , c ij is the admittance of the capacitor between the power node i and the 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 is the reactive power inflow, i.e., reactive power. The amount of power inflow is closely related to power generation scheduling. The active power generation of the power system covers conventional power generation and renewable energy power generation. Conventional power generation uses generator nodes to generate power, and renewable energy power generation uses renewable energy generation nodes to generate power. Load nodes are used to consume the power generated by generator nodes and renewable energy generation nodes. 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 both active power flow (active power) P ij It 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 vectors of each power node in each historical time slot. The system state matrix is used to characterize 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 the 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 operator of the transposition operation.
[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 phase of |N|-1 nodes can be specified according to 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 voltage of the power system. 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 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, in the related art, traditional methods such as extended Kalman filter, statistical Gaussian mixture model, non-parametric prediction tools are used to predict the state of the power system, but these methods only solve obvious linear or nonlinear system modes, ignoring the hidden nonlinear characteristics in the power system, such as the state conditions of system instability problems. With the increase in the complexity of the power network, deep learning methods have become a method for fully mining hidden nonlinear spatial features and nonlinear time features. In the power system, the power flow between each power node may change over time, so that the relationship between each power node, such as the connectivity and adjacency of the power network, may change over time. For example, there are differences in the peak and valley demand for industrial electricity and household electricity. The peak of industrial electricity is usually during the day, and the peak of household electricity is usually at night, so that the power consumption of industrial electricity and household electricity fluctuates differently. In this context, the relationship between the generator node and the load node may change periodically over time. Due to the differences in the complex graph structure of the power system, the convolutional neural network cannot accurately predict the system state. However, the existing graph structure fails to fully represent the adjacency relationship of the common bus in a complex power system. In order to maintain the non-Euclidean structure of the power network, that is, the connectivity and adjacency information of the power network, this application uses a graph-based neural network to predict the system state. In order to accurately predict the dynamic system state, this application uses the dynamic adjacency information between power nodes under a multi-time scale perspective (multiple historical time slots), and considers renewable energy and load information to predict the dynamic power system state at multiple time scales.
[0092] The state prediction is defined as a spatiotemporal prediction task. Considering the spatial structure and time dependency of the power system, the power system network is modeled as a directed graph g(N,ε), and 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 of T historical time slots, i.e., the state vector; J represents the length of the prediction data, 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 the graph-based information retrieved from the power network, 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, the present 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 generation of each historical time slot are input into the spatiotemporal attention graph network for adaptive dynamic system prediction. Considering the time-varying characteristics of the adjacency matrix, node admittance matrix, system state matrix, and renewable energy 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 a feature module, the second sublayer is a bus module, and the third sublayer is an energy module. Both the first and second sublayers are provided with time convolution and graph convolution, and the third sublayer is provided with time convolution. Time features are extracted through time convolution operations, and spatial features are extracted through adaptive graph neural networks (graph convolution).
[0096] In order to effectively capture the changing dynamics of the system state in the power system, while considering the impact of various renewable energy sources and the fixed relationship between common buses in complex power systems, in each network layer, the feature module takes the power system state as input and pairs the feature dimensions through convolution operations. When performing feature extraction, the temporal convolutional network (TCN) and graph convolutional network (GCN) operations are used to extract temporal and spatial features respectively. The temporal convolutional network is a variant of the convolutional neural network that can capture long-term dependencies in time series data. In order to better capture the changing system state of the preset historical period, a separate, learnable adjacency matrix is constructed for different historical time slots in the preset historical period and back-propagated to obtain the adjacency matrix of all historical time slots, which is used as the input of the GCN. Similar to the feature module, the bus module also uses TCN and GCN for temporal and spatial feature extraction, but the input of its GCN is the bus relationship matrix y (node admittance matrix) derived from the transmission line matrix. Considering the timing dependency of renewable energy and load, the energy module only uses TCN to perform temporal feature extraction.
[0097] Specifically, for the first network layer, the first sublayer extracts spatiotemporal features from the adjacency matrix and the system state matrix of the preset historical period to capture the dynamic changes of the system state and the spatial topological structure of the power system, and obtains 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 of the system state and the relationship between the common busbars, and obtains the second state feature. In order to determine the impact of various renewable energy sources on the power system, the third sublayer extracts the time feature of the renewable energy power 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 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, performing graph convolution on the adjacency matrix and the first state time series feature to obtain the first state feature.
[0101] In step S210 of some embodiments, in the power system, the power flow between the common buses may vary according to the time of the day. For example, the peak and valley values of industrial and household loads follow different patterns, so that the relationship between the generator and the load changes 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 the common buses to obtain a system state matrix. The system state matrix of the preset historical period is temporally convolved by the time convolution network set in the first sublayer, and the time features are extracted from the historical state to obtain the first state time series features. The time feature is a data attribute related to time, which describes the time dependence of the data over time. The first state time series feature is used to characterize the dynamic changes of the system state at different times. The first state time series feature can be the voltage amplitude feature, voltage phase feature, active power feature and reactive power feature of different historical time slots, or the relationship feature between the system states under different historical time slots.
[0102] In step S220 of some embodiments, the spatial relationship between nodes is crucial to the system state prediction task. The adjacency matrix of the preset historical period and the first state time series feature are spliced, and the spliced features are convolved through the graph convolution network set in the first sublayer to extract spatial features such as the spatial relationship between power nodes to obtain the first state feature. Spatial features are data attributes related to spatial positions, which describe the distribution, structure, relationship, etc. of data in the spatial dimension. The first state feature is a spatial feature 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, thereby accurately and quickly predicting 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 a 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, compared with the recurrent neural network used in traditional time series tasks, the temporal convolutional network with expansion operation can significantly reduce the time complexity. 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 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 uses a sigmoid function. The activation function is nonlinear, and 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 a 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 the first state temporal feature output by the temporal convolution kernel in the first sublayer of the first network layer. The calculation method of the first state temporal feature output by the first sublayer of the first network layer is 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 time series feature 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 a matrix composed of weight parameters of the u-th order graph convolution, where 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 added to obtain a first state feature, which is expressed as: U is the order of graph convolution.
[0123] The above steps S410 to S420 perform spatial feature extraction 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, linearly mapping the node admittance matrix to obtain a node relationship matrix;
[0127] Step S530, performing 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 sublayer, the second sublayer also uses TCN and GCN to extract spatiotemporal features. The system state matrix of the preset historical period is temporally convolved by the temporal convolution network set in the second sublayer to obtain the second state time series feature. The specific process of temporal convolution can refer to steps S310 to S350, which 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 time series feature and the node relationship matrix to extract the spatial feature and obtain the second state feature, which is used to reflect the physical connection relationship between different power nodes in the power system. The second state feature is expressed as The second state time series feature of the t-th historical time slot is represented. The specific graph convolution process can refer to step S410 to step S420, which will not be repeated 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 time series dependence of renewable energy, the time convolution network set in the third sub-layer extracts the time features of renewable energy power generation to obtain 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 sublayer 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 expressed as 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 network layer l for F l-1 The extracted first state time series 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 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, the 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 The extracted second state time series 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 sublayer; 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 sublayer Perform time feature extraction to obtain the power generation timing characteristics of the network layer. The process of time feature extraction in the third sublayer is as follows:
[0143]
[0144] Among them, W l and b l Represent the weight and bias of the third sub-layer respectively.
[0145] Skip connections are used to alleviate the gradient vanishing problem when the network is deep, and the output state feature F of the previous network layer is 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] In order 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 output state features (hidden features) of each network layer are combined using a fusion module equipped with a self-attention mechanism and a linear layer to predict the power system state in future time slots. The specific 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, linear mapping is performed 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 respectively combining the input matrix, i.e., the spliced state feature 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 according to the number of future time slots to be predicted, so as to obtain the system state of multiple consecutive future time slots, and 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 hidden 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, based on the AC power flow model, power flow calculation is performed according to each sample system state to obtain a first predicted system state of each power node in multiple target time slots;
[0160] Step S830, based on the preset graph network, perform system state prediction according to each sample system state to obtain 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 according to 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 the 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, where the sample time slots are historical time periods, and 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, the AC power flow model is used to obtain the actual measurement value of the system state, and the AC power flow model can 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 with a nonlinear equation, which is expressed as:
[0166]
[0167] Among them, 0 represents an all-zero matrix; g(X) represents the AC power balance condition; ΔP represents the gradient of active power; Δ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, and update the voltage phase according to the voltage phase correction. Determine whether the voltage amplitude correction and the voltage phase correction 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, and 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 of each power node at multiple target time slots. The second predicted system state is a system state predicted by the preset graph network.
[0170] In step S840 of some embodiments, as a quantitative indicator of model performance, the loss function is used to guide the optimization process to reduce the gap between the predicted state and the actual state, thereby improving the accuracy of model prediction. The present application uses mean square error as a loss function to optimize the model parameters of the preset graph network. For each target time slot, the first predicted system state and the second predicted system state of each power node are 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; represents 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] Wherein, L represents the target loss; 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, the bus and bus information is extracted according to the IEEE common data format. The details of the three test systems are 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 includes 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 in total. The solar and wind turbines in the test case are deployed on 17 and 69 buses, respectively.
[0182] For the three power systems, the busbars with the most connected transmission lines are selected to install heterogeneous solar and wind generators. Time-varying historical power system data, such as power system data in the past year, are used for model training and testing. The data are divided into three different sets of training, validation and test sets, which contain 60%, 20% and 20% of the time, respectively. The separation process is evaluated by cross-validation. The time interval of the system state sampling cycle is 15 minutes. Sample construction is performed separately on each data set through a sliding window, and the data is normalized to the range of [0,1] by Z-score normalization. In addition, the time-varying power system state data and loads adopted are scaled to adapt to the above four power systems.
[0183] The proposed spatiotemporal attention graph network and baseline model are implemented in Python using PyTorch. The learning rate used in deep learning is 1e -3, the batch size is 50, and the number of iterations is 100. The Adam optimizer is used for model optimization, and early stopping is implemented to reduce the risk of overfitting. All tests are 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 spatiotemporal attention graph networks, the spatiotemporal attention graph networks are compared with baseline models such as GW-Net, LSTM, dynamic multifaceted spatiotemporal graph convolutional network (DMSTGCN), multivariate time series graph neural network (MTGNN), LSTM-CNN, and spatiotemporal graph convolutional network (STGCN) in terms of root mean square error (RMSE) and mean absolute error (MAE). Among them, GW-Net learns an adaptive dependency matrix through node embedding to dynamically capture spatial dependencies. LSTM uses stacked LSTM networks to obtain time series inputs and predict system states. DMSTGCN is a variant of GCN that uses dynamic graph convolutional networks 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 uses a multi-level recognition method that combines innovative vectors, LSTM, and convolutional neural networks to detect false data and improve the accuracy of power system state estimation. STGCN considers the fixed connection between buses in the power system and applies ordinary GCN and GRN layers to predict the state.
[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 are tested on three power systems of different sizes, and the system states are predicted for the next 1, 2, and 3 hours. Since the time interval of 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, the IEEE 118 power system, and the IEEE 145 power system are shown in Table 1, Table 2, and Table 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 spatiotemporal attention graph network proposed in this application can capture the spatial and temporal dependencies of the system state from different dimensions, with low RMSE and MAE on all three test systems, high accuracy of dynamic system state prediction, and better prediction accuracy than other baselines. This application uses the spatiotemporal attention graph network to fully capture the time-varying complex system topology and the adjacent node information of the dynamic graph, and can accurately predict the state of the dynamic power system. Its network structure is particularly suitable for the state prediction task of the power system. As the prediction window expands, the prediction task becomes more and more challenging, resulting in a decrease in the prediction accuracy of all models. Therefore, in practical applications, a trade-off between prediction accuracy and prediction window is required. In addition, compared with LSTM and LSTM-CNN, most spatiotemporal models achieve better prediction results, indicating that spatial information is crucial for the state prediction problem. In addition, the accuracy of predicting the power system decreases as the scale of the power system increases. This difference can be attributed to their 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 with integrated solar power generation, the data of bus No. 37 in December and three days of that month are visualized. The data of the three days are the data in the dashed box, which contains actual data and prediction results. The prediction time windows are 4, 8 and 12 respectively. The fluctuation curve of voltage phase is shown in Fig.9A As shown in the figure, the fluctuation curve of voltage amplitude is as follows Fig. 9BAs shown in the figure. It can be seen from the fluctuation curve 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 state of the power system, although there are occasional sudden fluctuations between the predicted and actual values at the detailed level, which is particularly obvious when H = 12, which is largely attributed to the error accumulation caused by the longer prediction time window. Fig.9A and Fig. 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 replaced with the true bus connection relationship.
[0200] Fig. 9C The RMSE performance of different variants is shown, Fig.9D The MAE performance of different variants is shown, Fig. 9C and Fig.9D The prediction accuracy of different variants for all prediction time windows on the IEEE 57 power system is shown. Fig. 9C and Fig.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 state of the power system. When any of these modules is removed, the prediction accuracy decreases. In addition, by comparing the original spatiotemporal attention graph network with the "w edges", it can be observed that using the true bus connection graph instead of the graph g in the bus module b This will affect the prediction accuracy, which indicates that the node admittance matrix y is more effective in capturing the spatial relationship and dependency between buses than the actual bus connections. The spatiotemporal attention graph network can effectively capture the topology and dependency of the power system.
[0201] The selection of hyperparameters is crucial to the model performance. Based on the IEEE 57 power system with a 1-hour prediction time window, the effects of learning rate and batch size on the model performance are evaluated. The evaluation results are shown in Table 4.
[0202]
[0203] Table 4
[0204] Table 4 shows the relatively stable performance of the spatiotemporal attention graph network under various learning rate and batch size configurations. Despite changing 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 show only slight changes. The RMSE value remains in a narrow range of 0.0037 to 0.0048, while the MAE value fluctuates minimally between 0.0009 and 0.0020. Despite the changes in the tested hyperparameters, the early stopping mechanism and the robustness of the proposed spatiotemporal attention graph network can effectively maintain the performance and avoid the obvious impact of the hyperparameter selection on the model results.
[0205] See also Fig.10 The embodiment of the present application also provides 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 used 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, for inputting the adjacency matrix, the node admittance matrix, the system state matrix and the renewable energy power generation into the spatiotemporal attention graph network, the spatiotemporal attention graph network comprising a plurality of network layers, each of which comprises a first sublayer, a second sublayer and a third sublayer;
[0208] The first feature extraction module 1030 is used for extracting spatiotemporal features of the adjacency matrix and the system state matrix through the first sublayer for the first network layer to obtain a first state feature, extracting spatiotemporal features of the node admittance matrix and the system state matrix through the second sublayer to obtain a second state feature, extracting time features of the renewable energy power generation through the third sublayer to obtain a power generation time series feature, and performing 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] The second feature extraction module 1040 is used to extract the spatiotemporal features of the adjacency matrix and the output state features of the previous network layer through the first sublayer for each network layer except the first network layer, so as to obtain the first state features of the network layer, extract the spatiotemporal features of the node admittance matrix and the second state features of the previous network layer through the second sublayer, so as to obtain the second state features of the network layer, extract the time features of the power generation timing features of the previous network layer through the third sublayer, so as to obtain the power generation timing features of the network layer, and perform feature fusion on the output state features of the previous network layer, the first state features of the network layer, the second state features of the network layer, and the power generation timing features of the network layer, so as to obtain the output state features 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 characteristics 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 embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned power system state prediction method based on the spatiotemporal attention graph network when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0213] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0214] The processor 1110 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used 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 applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is 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 in the embodiment of the present application;
[0216] Input / output interface 1130, used to implement information input and output;
[0217] The communication interface 1140 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0218] bus 1150 , which transmits information between the 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 connected to each other in communication within the device via the 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 disposed 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 the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present 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 the present application are also applicable to similar technical problems.
[0223] Those skilled in the art will appreciate 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, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0225] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of 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, and the computer software product is stored in a storage medium, including multiple instructions to enable 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: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0227] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights 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 is used to extract the spatiotemporal features of the adjacency matrix and the system state matrix to obtain the first state features, the second sublayer is used to extract the spatiotemporal features of the node admittance matrix and the system state matrix to obtain the second state features, the third sublayer is used to extract the time features of the renewable energy power generation to obtain the power generation timing features, and the first state features, the second state features and the power generation timing features are feature fused to obtain the output state features of the first network layer; For each network layer except the first network layer, the first sublayer is used to extract the spatiotemporal features of the adjacency matrix and the output state features of the previous network layer to obtain the first state features of the network layer, the second sublayer is used to extract the spatiotemporal features of the node admittance matrix and the second state features of the previous network layer to obtain the second state features of the network layer, the third sublayer is used to extract the time features of the power generation timing features of the previous network layer to obtain the power generation timing features of the network layer, the output state features of the previous network layer, the first state features of the network layer, the second state features of the network layer and the power generation timing features of the network layer are feature fused to obtain the output state features of the network layer; The power system state prediction is performed based on multiple output state characteristics 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 step of extracting spatiotemporal features from 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 a 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 timing 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 time series feature to obtain the first state feature includes: For each order, performing graph convolution on the adjacency matrix and the first state time series feature according to a third preset weight matrix of the order to obtain a state space feature of the order; The state space features of each order are subjected to feature fusion 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 step of extracting spatiotemporal features of 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 power system state prediction is performed according to the multiple output state characteristics of all the network layers, including: 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, power flow calculation is performed according to each of the sample system states to obtain a first predicted system state of each of the power nodes in a plurality of target time slots; Based on a preset graph network, a system state prediction is performed 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 the historical time slot; An input module, used 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 is used for extracting spatiotemporal features of the adjacency matrix and the system state matrix through the first sublayer for the first network layer to obtain a first state feature, extracting spatiotemporal features of the node admittance matrix and the system state matrix through the second sublayer to obtain a second state feature, extracting time features of the renewable energy power generation through the third sublayer to obtain a power generation timing feature, and performing feature fusion on the first state feature, the second state feature and the power generation timing feature to obtain an output state feature of the first network layer; A second feature extraction module is used for, for each network layer except the first network layer, performing 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, performing 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, performing time feature extraction on the power generation timing feature of the previous network layer through the third sublayer to obtain the power generation timing feature of the network layer, and performing 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 timing 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 the processor implements the power system state prediction method based on the spatiotemporal attention graph network as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for predicting the state of a power system based on a spatiotemporal attention graph network as 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
Signature identification for power system events
US20210088563A1
Cited By
Crowd density evaluation and abnormal aggregation early warning method based on big data analysis
CN121580242A
A crowd density evaluation and abnormal gathering early warning method based on big data analysis
CN121580242B
