Power system load prediction method and device, storage medium and electronic equipment
By constructing the topological graph and graph features of the power system and optimizing the training of prediction models under power balance constraints, the problem of inflexible weight allocation when predicting load in traditional neural networks is solved, and high-accurate load prediction and classification are achieved.
Patent Information
- Application Number
- CN202510385143.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-07-01
AI Technical Summary
When predicting the load of the power system through traditional neural networks in the prior art, due to the limitations of convolution and cyclic operations, the weight allocation is inflexible and fuzzy, resulting in low prediction accuracy.
A power system load prediction method is adopted, by collecting the load information of the power system and dividing it into multiple time series data, the topological diagram of the power system and its graph characteristics are constructed, and the target prediction model is input for prediction. The target prediction model consists of a convolutional neural network, a graph attention neural network and a converter model, and is obtained under the optimization training of power balance constraints.
By extracting the complex spatial and temporal relationships in the power system, the precise classification of loads and accurate prediction of future load requirements are achieved, the accuracy and physical rationality of the prediction are improved, and the stable operation of the power grid is ensured.
Smart Images

Figure CN120234775A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power system load forecasting, and more particularly, to a method, device, storage medium, and electronic device for forecasting the load of a power system. Background Art
[0002] Since the change of power load is random, it is not only affected by time, but also affected by spatial factors such as weather and region, with very complex and changeable characteristics. It is difficult to accurately capture the load demand, making it difficult for the power dispatching department to formulate scientific and effective power generation plans. At the same time, in the face of the massive and complex types of load power consumption data collected by the data center, how to accurately classify the demand-side response data of the data center has become a challenge faced by the existing data processing center. In addition, due to the orderly development of the power market and the gradual opening of the power generation and consumption plans, this has brought about a huge change in the planned production mode of the power system. Therefore, there is an urgent need to improve the accuracy of power system load classification and forecasting.
[0003] When classifying and forecasting the load of a power system, in order to make full use of spatial and temporal data, neural network models such as convolutional neural networks are often used in the prior art to design models for load forecasting, emphasizing accurate spatio-temporal forecasting. However, due to the limitations of convolutional and recurrent operations, the weight allocation is inflexible and ambiguous, which affects the accuracy of the forecasting results.
[0004] Aiming at the problem in the related art that when accurately forecasting the load through a traditional neural network, due to the limitations of convolutional and recurrent operations, the weight allocation is inflexible and ambiguous, resulting in low forecasting accuracy, no effective solution has been proposed yet. Summary of the Invention
[0005] The main purpose of the present application is to provide a method, device, storage medium, and electronic device for forecasting the load of a power system, so as to solve the problem in the related art that when accurately forecasting the load through a traditional neural network, due to the limitations of convolutional and recurrent operations, the weight allocation is inflexible and ambiguous, resulting in low forecasting accuracy.
[0006] To achieve the above object, according to one aspect of the present application, a method for predicting the load of a power system is provided. The method includes: collecting the load information of the power system and splitting the load information into multiple segments of time-series data, where the load information at least includes: the power information of each part in the power system and the external environment information; constructing a topology graph of the power system based on the multiple segments of time-series data, and constructing the graph features of the topology graph; inputting the graph features of the topology graph into a target prediction model, and predicting the load demand information of the power system within a preset time period through the target prediction model; where the target prediction model is a prediction model obtained by training a preset prediction model according to the power balance constraint of the power system; the load demand information at least includes the load type and power information.
[0007] Further, the target prediction model is obtained by the following steps: extracting temporal features and spatial features from the topology graphs corresponding to multiple sample data through a convolutional neural network, where the widths of the temporal features and the spatial features are both equal to the number of node features of the topology graph; using a graph attention neural network to extract neighbor features from the temporal features and the spatial features respectively to obtain the node features corresponding to the multiple sample data; inputting the node features corresponding to the multiple sample data into a preset transformer model to obtain the prediction results of the load demand information of each node in the topology graphs corresponding to the multiple sample data; optimizing and training the transformer model according to the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain the target prediction model.
[0008] Further, before extracting the temporal features and spatial features from the topology graphs corresponding to multiple sample data through a convolutional neural network, the method further includes: collecting the historical sample data of the power system; splitting the historical sample data according to the time-series information, randomly extracting non-repeating sample data from the split historical sample data to obtain the multiple sample data; constructing the graph structures corresponding to the multiple sample data and setting the initial weight information of each node in the graph structures; setting the maximum number of iterations of the graph attention neural network.
[0009] Further, the converter model at least includes: an encoder and a decoder. Inputting the node features corresponding to the multiple sample data into a preset converter model to obtain the prediction results of the load demand information of each node in the topological graph corresponding to the multiple sample data, including: inputting the node features corresponding to the multiple sample data into the encoder for encoding to obtain an encoding result, where the encoder includes: a multi-head self-attention mechanism layer and a fully-connected feed-forward neural network layer, and the fully-connected feed-forward neural network layer uses residual connection and performs layer normalization; inputting the encoding result into the decoder for decoding to obtain the prediction results of the load demand information of each node in the graph structure corresponding to the multiple sample data, where the decoder includes: a masked multi-head self-attention mechanism layer, a multi-head self-attention mechanism layer, and a fully-connected feed-forward neural network layer, and each layer uses residual connection and layer normalization.
[0010] Further, optimizing and training the converter model according to the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain the target prediction model, including: constructing a constraint function based on the voltage amplitude of each node and the phase angle of each node in the topological graph; using the constraint function to optimize and adjust a preset loss function to obtain a target loss function, where the target loss function includes: the cross-entropy loss of a multi-classification task and the mean square error loss of a regression task; calculating the loss function value according to the prediction results of the load demand information of each node and the target loss function, and updating the weights of the converter model through the backpropagation algorithm until the loss function value is less than a preset value to obtain the target prediction model.
[0011] Further, collecting the load information of the power system and splitting the load information into multiple segments of time-series data, including: collecting the load information of the power system within a preset time period and the external environment information of the power system to obtain the original load information; where the external environment information at least includes one of the following: temperature information, humidity information, precipitation information, holiday information; using the horizontal processing method to process the data outliers of the original load information to obtain the original load information after outlier processing; performing data missing value processing on the original load information after outlier processing based on the load periodicity method to obtain the original load information after missing value processing; splitting the original load information after missing value processing into multiple segments of time-series data to obtain the multiple segments of time-series data.
[0012] Further, construct a topology graph of the power system based on the multi-segment time series data, and construct graph features of the topology graph, including: determining the electrical connection structure in the power system and the lines between the electrical connection structures; constructing nodes of the topology graph according to the electrical connection structure, and constructing edges between the nodes according to the lines between the electrical connection structures; constructing node features of the nodes according to the power information and the external environment information of the nodes in the power system; determining the graph features of the topology graph according to the edges between the nodes and the node features of the nodes.
[0013] To achieve the above object, according to another aspect of the present application, there is provided a prediction device for the load of a power system, the device includes: a first acquisition unit, configured to acquire load information of the power system and divide the load information into multi-segment time series data, where the load information at least includes: power information of each part in the power system and external environment information; a first construction unit, configured to construct a topology graph of the power system based on the multi-segment time series data, and construct graph features of the topology graph; a first prediction unit, configured to input the graph features of the topology graph into a target prediction model, and predict load demand information of the power system within a preset time period through the target prediction model; where the target prediction model is a prediction model obtained by training a preset prediction model according to the power balance constraint of the power system; the load demand information at least includes load type and power information.
[0014] Further, the device further includes: a first extraction unit, configured to extract temporal features and spatial features from the topology graphs corresponding to multiple sample data through a convolutional neural network, where the width of the temporal features and the width of the spatial features are both equal to the number of node features of the topology graph; a second extraction unit, configured to respectively extract neighbor features from the temporal features and the spatial features by using a graph attention neural network to obtain node features corresponding to the multiple sample data; a second prediction unit, configured to input the node features corresponding to the multiple sample data into a preset transformer model to obtain a prediction result of the load demand information of each node in the topology graphs corresponding to the multiple sample data; a training unit, configured to optimize and train the transformer model according to the power balance constraint of the power system and the prediction result of the load demand information of each node to obtain the target prediction model.
[0015] Further, the device further includes: a second acquisition unit, configured to acquire historical sample data of the power system before extracting temporal features and spatial features from the topological graphs corresponding to multiple sample data through a convolutional neural network; a segmentation unit, configured to segment the historical sample data according to temporal information, and randomly extract non-repeating sample data from the segmented historical sample data to obtain the multiple sample data; a second construction unit, configured to construct a graph structure corresponding to the multiple sample data and set initial weight information for each node in the graph structure; a configuration unit, configured to set a maximum number of iterations of the graph attention neural network.
[0016] Further, the converter model at least includes: an encoder and a decoder. The second prediction unit includes: an encoding subunit, configured to input node features corresponding to the multiple sample data into the encoder for encoding to obtain an encoding result, where the encoder includes: a multi-head self-attention mechanism layer and a fully-connected feed-forward neural network layer, and the fully-connected feed-forward neural network layer adopts residual connection and performs layer normalization; a decoding subunit, configured to input the encoding result into the decoder for decoding to obtain a prediction result of the load demand information for each node in the graph structure corresponding to the multiple sample data, where the decoder includes: a masked multi-head self-attention mechanism layer, a multi-head self-attention mechanism layer, and a fully-connected feed-forward neural network layer, and each layer adopts residual connection and layer normalization.
[0017] Further, the training unit includes: a first construction subunit, configured to construct a constraint function based on the voltage amplitude and phase angle of each node in the topological graph; an adjustment subunit, configured to optimize and adjust a preset loss function by using the constraint function to obtain a target loss function, where the target loss function includes: a cross-entropy loss for a multi-classification task and a mean squared error loss for a regression task; an update subunit, configured to calculate a loss function value based on the prediction result of the load demand information for each node and the target loss function, and update the weights of the converter model through a backpropagation algorithm until the loss function value is less than a preset value to obtain the target prediction model.
[0018] Further, the first acquisition unit includes: an acquisition subunit, configured to acquire the load information of the power system and the external environment information of the power system within a preset time period to obtain original load information; wherein the external environment information includes at least one of the following: temperature information, humidity information, precipitation information, holiday information; a first processing subunit, configured to perform data outlier processing on the original load information by using a horizontal processing method to obtain the original load information after outlier processing; a second processing subunit, configured to perform data missing value processing on the original load information after outlier processing based on a load periodicity method to obtain the original load information after missing value processing; a segmentation subunit, configured to segment the original load information after missing value processing into multiple segments of time series data to obtain the multiple segments of time series data.
[0019] Further, the first construction unit includes: a first determination subunit, configured to determine the electrical connection structure in the power system and the lines between the electrical connection structures; a second construction subunit, configured to construct the nodes of the topology graph according to the electrical connection structure and construct the edges between the nodes according to the lines between the electrical connection structures; a third construction subunit, configured to construct the node features of the nodes according to the power information and the external environment information of the nodes in the power system; a second determination subunit, configured to determine the graph features of the topology graph according to the edges between the nodes and the node features of the nodes.
[0020] To achieve the above object, according to one aspect of the present application, there is provided a computer program product, including a computer program, where when the computer program is executed by a processor, it implements the prediction method of the power system load described in any one of the above, and when the computer program is executed by a processor, it implements the steps of the prediction method of the power system load in various embodiments of the present application.
[0021] To achieve the above object, according to one aspect of the present application, there is provided a computer-readable storage medium, where the computer-readable storage medium includes stored computer instructions, and when the computer instructions are executed by a processor, the prediction method of the power system load described in any one of the above is implemented.
[0022] To achieve the above object, according to one aspect of the present application, there is provided an electronic device, including one or more processors and a memory, where the memory is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the prediction method of the power system load described in any one of the above.
[0023] Through this application, the following steps are adopted: collecting the load information of the power system and splitting the load information into multiple segments of time-series data, where the load information at least includes: the power information of each part in the power system and the external environment information; constructing the topology graph of the power system according to the multiple segments of time-series data, and constructing the graph features of the topology graph; inputting the graph features of the topology graph into a target prediction model, and predicting the load demand information of the power system within a preset time period through the target prediction model; where the target prediction model is a prediction model obtained by training a preset prediction model according to the power balance constraint of the power system; the load demand information at least includes the load type and power information, which solves the problem that in the related art, when accurately predicting the load through a traditional neural network, due to the limitations of convolution and cyclic operations, the weight distribution is not flexible and ambiguous, resulting in low prediction accuracy.
[0024] By collecting multiple segments of time-series data to construct the topology graph and corresponding graph features of the power system, complex relationships in space and time can be extracted from the power system, so as to achieve accurate classification of loads and accurate prediction of future load demands, and then deal with the classification and prediction problems of power loads. At the same time, by considering the spatio-temporal characteristics of historical load data and the physical constraint conditions of the power system, not only the prediction accuracy is improved, but also the physical rationality of the prediction results is ensured, so as to achieve the effect of effectively coping with load fluctuations and ensuring the stable operation of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings constituting a part of this application are used to provide a further understanding of this application. The schematic embodiments and descriptions thereof of this application are used to explain this application and do not constitute an improper limitation to this application. In the drawings:
[0026] Figure 1 is a flowchart of a method for predicting the load of a power system according to Embodiment 1 of this application;
[0027] Figure 2 is a schematic flowchart of an optional process for training a target prediction model and performing short-term load prediction according to Embodiment 1 of this application;
[0028] Figure 3 is a network structure diagram of an optional convolutional neural network (CNN) according to Embodiment 1 of this application;
[0029] Figure 4 is a network structure diagram of an optional graph attention neural network model (GAT) according to Embodiment 1 of this application;
[0030] Figure 5 is a network structure diagram of an optional Transformer model for load classification and prediction according to Embodiment 1 of this application;
[0031] Figure 6 It is a schematic diagram of a prediction device for the load of a power system provided in Embodiment 2 of the present application;
[0032] Figure 7 It is a schematic diagram of a prediction electronic device for the load of a power system provided in Embodiment 5 of the present application. Detailed implementation manners
[0033] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0034] It should be noted that the user information (including but not limited to user device information, user personal information, collected data, used data, generated data, processed data, etc.) and data (including but not limited to data for analysis, stored data, displayed data, collected information, used information, generated information, processed information, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties. And the processing of relevant data such as collection, storage, use, processing, transmission, provision, disclosure, and application complies with the relevant laws, regulations, and standards of relevant countries and regions, takes necessary confidentiality measures, does not violate public order and good customs, and provides corresponding operation entrances for users to choose to authorize or refuse. For example, an interface is set between the present system and relevant users or institutions. Before obtaining relevant information, a request for obtaining needs to be sent to the aforementioned users or institutions through the interface, and after receiving the consent information feedback from the aforementioned users or institutions, the relevant information is obtained.
[0035] It should be noted that the present application provides corresponding operation entrances for users to choose to agree or refuse the automated decision-making results; if the user chooses to refuse, the expert decision-making process will be entered.
[0036] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts should fall within the protection scope of the present application.
[0037] It should be noted that the terms "first", "second", etc. in the specification, claims and above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so as to implement the embodiments of this application described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0038] Embodiment 1
[0039] The present invention will be described below in conjunction with the preferred implementation steps. Figure 1 is a flowchart of a method for predicting the load of a power system according to Embodiment 1 of this application, as Figure 1 shown, the method includes the following steps:
[0040] Step S101, collect the load information of the power system, and divide the load information into multiple segments of time series data, where the load information at least includes: the power information of each part in the power system and the external environment information.
[0041] In this Embodiment 1, the load information refers to the power demand data of all power-consuming devices or areas in the power system. For example, the load can be households, commercial buildings, industrial facilities, electric vehicle charging stations, etc. The demand for electric energy in the power system by the load changes with time and is affected by various factors, such as production activities, weather changes, time periods (such as weekdays and weekends, day and night), etc. The collected load information usually appears as a continuous series of time series data, that is, the above-mentioned multiple segments of time series data.
[0042] The power information refers to the active power and reactive power of each part in the power system. The active power represents the actually consumed electric energy, and the reactive power represents the electric energy that is continuously converted with the magnetic field energy and cannot be converted into useful work.
[0043] The external environment information may include non-electrical factors that affect power demand, such as temperature, humidity, precipitation, wind speed, sunshine time, seasonal changes, holidays, etc.
[0044] Through the above process, the complex and continuous power load data can be converted into a structured and segmented time series data set, so that the subsequent prediction model can effectively learn the rules of load classification and prediction from it, thereby achieving the effect of improving the prediction accuracy and classification accuracy.
[0045] Step S102: Construct a topology graph of the power system based on multi-segment time-series data, and construct graph features of the topology graph.
[0046] In the first embodiment, the power system topology graph shows the connection relationships in the power network in a graphical manner. The nodes in the topology graph of the power system represent buses, and the edges represent the branches connecting the buses. A bus refers to the electrical connection structure in a substation, power plant, or any power network in the power system. For example, it is the connection point between two transmission lines (or loads). A branch refers to the edge connecting the transmission lines. For example, loads, lines, loads, and generators in the power system. Based on the multiple parameter information collected from the multi-segment time-series data, a multi-dimensional feature vector is constructed for each of the above nodes, and the above graph features are determined according to the node feature vectors of each node.
[0047] In an alternative embodiment, the node features in the topology graph can be expressed as: Where, and respectively represent the active power and reactive power injected into the i-th node observed at time t, is a seven-dimensional vector representing the meteorological and date features of the i-th node observed at time t, including temperature, humidity, precipitation, wind speed, sunshine duration, seasonal variation, and holidays.
[0048] Step S103: Input the graph features of the topology graph into the target prediction model, and predict the load demand information of the power system within a preset time period through the target prediction model; where the target prediction model is a prediction model obtained by training a preset prediction model based on the power balance constraint of the power system; the load demand information includes at least load type and power information.
[0049] In the first embodiment, the target prediction model is a prediction model obtained by further training on the basis of a preset prediction model in combination with the power balance constraint of the power system. The target prediction model processes the input graph features to predict the load demand information of the power system in the future (i.e., within the above preset time period).
[0050] When determining the load type, the loads are mainly classified into flexible loads such as photovoltaic, solar, wind energy, air conditioning, electric vehicles, etc., other general loads, and the situation of no load access. When predicting the future short-term load demand, it can be based on each moment of each day, mainly predicting the power load demand at each moment in the next one or several days. The characteristics of future short-term load prediction are that it has obvious weekly and daily periodicities and is also affected by meteorological factors and date types.
[0051] In an alternative embodiment, the output of the target prediction model can be expressed as: where Δ represents the predicted fixed time interval, and respectively represent the predicted active power and reactive power injected into the i-th node at time t+Δ, that is, the above power information, that is, the load demand of the i-th node at time t+Δ, T i is a seven-dimensional vector representing the load types connected to the i-th node. For example, photovoltaic, solar, wind, air conditioner, electric vehicle, other general loads, and no load.
[0052] In summary, the load prediction method for a power system provided in the first embodiment of the present application collects the load information of the power system and divides the load information into multiple segments of time-series data. Among them, the load information at least includes: the power information of each part in the power system and the external environment information; constructs a topological graph of the power system based on the multiple segments of time-series data, and constructs the graph features of the topological graph; inputs the graph features of the topological graph into the target prediction model, and predicts the load demand information of the power system within a preset time period through the target prediction model; among them, the target prediction model is a prediction model obtained by training a preset prediction model according to the power balance constraint of the power system; the load demand information at least includes load type and power information, which solves the problem in the related art that when accurately predicting the load through a traditional neural network, due to the limitations of convolution and cyclic operations, the weight allocation is inflexible and fuzzy, resulting in low prediction accuracy.
[0053] By collecting multiple segments of time-series data to construct the topological graph and corresponding graph features of the power system, complex relationships in space and time can be extracted from the power system, so as to achieve accurate classification of loads and accurate prediction of future load demands, and then process the classification and prediction problems of electric loads. At the same time, by considering the spatio-temporal characteristics of historical load data and the physical constraint conditions of the power system, not only the prediction accuracy is improved, but also the physical rationality of the prediction results is ensured, thus achieving the effect of effectively coping with load fluctuations and ensuring the stable operation of the power grid.
[0054] Optionally, in the load prediction method for a power system provided in the first embodiment of the present application, the target prediction model is trained by the following steps: extracting time features and spatial features from the topological graphs corresponding to multiple sample data through a convolutional neural network, where the width of the time features and the width of the spatial features are both equal to the number of node features of the topological graph; using a graph attention neural network to extract neighbor features from the time features and spatial features respectively to obtain the node features corresponding to multiple sample data; inputting the node features corresponding to multiple sample data into a preset transformer model to obtain the prediction results of the load demand information of each node in the topological graphs corresponding to multiple sample data; optimizing and training the transformer model according to the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain the target prediction model.
[0055] In the first embodiment, in order to make accurate load prediction and classification for charge data, a Convolutional Neural Network (hereinafter referred to as CNN for short) and a Graph Attention Network (hereinafter referred to as GAT for short), as well as a subsequent Transformer model, can be combined to efficiently extract the temporal and spatial features of the load from historical data, so as to generate classification results.
[0056] First, the CNN extracts temporal features and spatial features from the topological graphs corresponding to multiple sample data. It should be noted that the widths of the extracted temporal features and spatial features should match the number of node features in the topological graph, so that the CNN can not only capture the patterns that change over time, but also understand the relationships of the spatial distribution between nodes.
[0057] Then, the GAT is used to calculate the extracted temporal features and spatial features. The GAT stacks self-attention layers, uses the attention mechanism to obtain the neighborhood features of each node, and assigns different weights to different nodes in the neighborhood to further strengthen the extraction of neighbor features, so as to obtain a more refined node feature representation. For example, nodes that are closely connected geographically or interdependent in the power system. After being processed by the GAT, the node features corresponding to the above-mentioned multiple sample data are obtained.
[0058] Finally, the extracted node features are input into the Transformer model for classification and regression tasks. At the same time, physical knowledge (that is, the power balance constraint of the above-mentioned power system) is added to the loss function to further optimize the model and improve the classification and prediction ability of the model. The Transformer is a neural network architecture based on self-attention. By using the attention mechanism, it can effectively learn the correlations between different elements in the input sequence, thereby improving the accuracy and generalization ability of the model.
[0059] In addition, the loss functions for multi-classification and regression tasks are also considered, including cross-entropy loss and mean squared error loss, to comprehensively evaluate the classification and prediction performance of the model. By repeatedly iteratively adjusting the model parameters until all set constraint conditions and performance indicators are met, an accurate and physically reasonable load classification and prediction model is finally obtained.
[0060] Through the synergistic effect of the CNN, GAT, and Transformer, the temporal, spatial, and physical characteristics of historical load data are effectively integrated, significantly improving the accuracy and reliability of load prediction, and further achieving the effect of improving the decision-making accuracy of the power system.
[0061] Optionally, in the power system load prediction method provided in Embodiment 1 of this application, before extracting temporal features and spatial features from the topological graphs corresponding to multiple sample data through a convolutional neural network, the above method further includes: collecting historical sample data of the power system; segmenting the historical sample data according to temporal information, randomly extracting non-repeating sample data from the segmented historical sample data to obtain multiple sample data; constructing a graph structure corresponding to the multiple sample data, and setting the initial weight information of each node in the graph structure; setting the maximum number of iterations of the graph attention neural network.
[0062] In Embodiment 1, in order to train an accurate target prediction model for load classification and load demand prediction, it is necessary to prepare training data and model initialization.
[0063] First, collect the historical node load data of the power system, that is, the above historical sample data. Segment the collected historical sample data according to temporal features to form continuous sample data to ensure that the model can learn the periodicity and trend of load changes, and obtain the above segmented historical sample data. Randomly select samples from the segmented historical sample data without repetition to obtain the above multiple sample data for the diversity of model training and to prevent overfitting.
[0064] In an alternative embodiment, the sample data set composed of the graph structures corresponding to the above multiple sample data can be represented as an S×N×F tensor, where S represents the number of all topological graph structures, N represents the number of nodes under each graph structure, and F represents the total dimension of the features and labels on each node. Data segmentation is performed on the sample data set Lm using a window of size w. Among the segmented historical sample data, 60% of the data can be used for training, 20% of the data can be used for validation, and 20% of the data can be used for testing. It should be noted that the above ratio can be flexibly adjusted according to the actual production situation and is not specifically limited in Embodiment 1.
[0065] Then, construct a topological graph corresponding to each sample data and assign different initial weights to each node to reflect its unique status or load characteristics in the power system.
[0066] Finally, set the maximum number of iterations m of the GAT to determine the depth and breadth of the training process. Through iterative training, the GAT can gradually adjust the weights and optimize the extraction of node features, especially highlighting the relative importance of neighbor nodes through the attention mechanism, which is beneficial to generating more accurate node features and training a more accurate target prediction model.
[0067] Optionally, in the power system load prediction method provided in Embodiment 1 of this application, the converter model at least includes: an encoder and a decoder. Inputting the node features corresponding to multiple sample data into a preset converter model to obtain the prediction results of the load demand information of each node in the topological graph corresponding to the multiple sample data, including: inputting the node features corresponding to the multiple sample data into the encoder for encoding to obtain an encoding result, where the encoder includes: a multi-head self-attention mechanism layer and a fully connected feed-forward neural network layer, and the fully connected feed-forward neural network layer uses residual connection and performs layer normalization; inputting the encoding result into the decoder for decoding to obtain the prediction results of the load demand information of each node in the graph structure corresponding to the multiple sample data, where the decoder includes: a masked multi-head self-attention mechanism layer, a multi-head self-attention mechanism layer, and a fully connected feed-forward neural network layer, and each layer uses residual connection and layer normalization.
[0068] In Embodiment 1, the node features corresponding to multiple sample data are used as the input feature vectors of the Transformer. The Transformer consists of an encoder and a decoder. The model passes the node features corresponding to multiple sample data to the encoder for encoding, and the output of the encoder is passed to the decoder for decoding to perform classification and predict the output sequence.
[0069] The encoder includes a multi-head self-attention mechanism layer and a fully connected feed-forward neural network layer. Among them, the multi-head self-attention mechanism layer is used to learn the internal relationship of the sequence, and each layer uses residual connection and performs layer normalization. The decoder includes a masked multi-head self-attention mechanism layer, a multi-head self-attention mechanism layer, and a fully connected feed-forward neural network layer. Among them, the masked multi-head self-attention mechanism layer is used to calculate the similarity between the representation of each position in the decoder input sequence and other positions while ensuring that only known inputs are considered during output. The multi-head self-attention mechanism layer is used to calculate the similarity between the decoder output and the encoder input. The fully connected feed-forward neural network layer is used to perform a non-linear transformation mapping of the representation of each position to a new space, and each layer uses residual connection and layer normalization.
[0070] Further, the Transformer model is divided into two branches, which are respectively used for regression and classification tasks, to obtain the probability distribution of each node load type and the load demand prediction. Among them, the sum of the probabilities of all load types of each node is 1, and the load type corresponding to the maximum probability is selected as the load type of the node. At the same time, the active and reactive powers of the load of each node are predicted. The structure of the Transformer classification and prediction is as Figure 5 shown, and a new feature vector set of the load nodes is output
[0071] Optionally, in the power system load prediction method provided in Embodiment 1 of this application, the converter model is optimized and trained based on the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain a target prediction model, including: constructing a constraint function based on the voltage amplitude of each node and the phase angle of each node in the topological graph; using the constraint function to optimize and adjust a preset loss function to obtain a target loss function, where the target loss function includes: the cross-entropy loss of the multi-classification task and the mean squared error loss of the regression task; calculating the loss function value based on the prediction results of the load demand information of each node and the target loss function, and updating the weights of the converter model through the backpropagation algorithm until the loss function value is less than a preset value to obtain the target prediction model.
[0072] In Embodiment 1, in order to ensure the physical rationality and prediction accuracy of the model prediction results, when constructing the target prediction model, a loss function can be constructed according to the power flow constraint (i.e., the above-mentioned power balance constraint of the power system), so as to adjust the optimization strategy.
[0073] First, using the voltage amplitude and phase angle information of each node in the power system, a constraint function reflecting the power balance constraint is constructed. The constraint function can be as shown in Formula 1 and Formula 2.
[0074]
[0075] where P i and Q i are the active and reactive power injections at bus i respectively, N represents the number of buses, that is, the number of nodes in the topological graph structure, θ ik is the voltage phase angle difference between bus i and bus k, B ik and G ik are the real part and imaginary part of the (i,k)-th element in the bus admittance matrix respectively, V i represents the voltage at bus i, and V k represents the voltage at bus k.
[0076] Then, physical knowledge is incorporated into the loss function to guide the training process to better conform to the actual operation rules of the power system. The loss function L p after optimizing and adjusting the preset loss function according to the constraint function can be as shown in Formulas 3 to 5.
[0077]
[0078]
[0079] At the same time, the loss function also includes: the cross-entropy loss L c of the multi-classification task, and the mean squared error loss L r, it can be as shown in Formulas Six to Seven,
[0080]
[0081] where, represents the predicted probability of class c at node i, y i,c represents the value of the true label at node i in class c (if the class is the true class, it is 1, otherwise it is 0), represents the predicted value of the active power at node i, y i,P represents the true value of the active power at node i, represents the predicted value of the reactive power at node i, y i,Q represents the true value of the reactive power at node i. The objective loss function L established by physical constraints, classification, and regression can be as shown in Formula Eight,
[0082] L = L p + L c + L r (Eight)
[0083] During the training process, the Transformer model calculates the loss value based on the prediction results of the load demand of each node and the objective loss function, and uses the backpropagation algorithm to iteratively adjust the weight parameters of the Transformer model until the loss function value drops below a preset threshold, indicating that the training of the Transformer model is completed and the final target prediction model is obtained. The target prediction model can not only accurately predict the load demand of each node in the power system, including active and reactive power, but also accurately classify according to the load type.
[0084] By integrating physical constraints with model training, the accuracy and reliability of load prediction are significantly improved, while ensuring the practical feasibility of the prediction results, achieving the effect of improving the scientificity and accuracy of power system decision-making.
[0085] Optionally, in the power system load prediction method provided in Embodiment 1 of this application, the load information of the power system is collected and the load information is segmented into multiple segments of time series data, including: collecting the load information of the power system within a preset time period and the external environment information of the power system to obtain the original load information; where the external environment information includes at least one of the following: temperature information, humidity information, precipitation information, holiday information; using the horizontal processing method to process the data outliers of the original load information to obtain the original load information after outlier processing; based on the method of load periodicity, processing the data missing values of the original load information after outlier processing to obtain the original load information after missing value processing; segmenting the original load information after missing value processing into multiple segments of time series data to obtain multiple segments of time series data.
[0086] In the first embodiment, in order to improve the accuracy and reliability of prediction when dealing with the power system load forecasting problem, data preprocessing operations can be performed on the collected data.
[0087] First, collect the load information of the power system within a preset time period (for example, within 24 hours from the current moment or within 5 minutes from the current moment), and at the same time collect the key external environmental factors that may affect the load, such as temperature, humidity, precipitation, and holiday information.
[0088] Then, to eliminate the negative impact of data outliers on model training, the horizontal processing method is used to clean the original data to ensure the stability and authenticity of the data. In view of the periodic characteristics of power load, the periodic law of historical data in the same period is used to perform data missing value processing on the data after outlier processing, maintaining the time continuity and periodic characteristics of the data, and obtaining the original load information after the above missing value processing.
[0089] In an optional embodiment, normalization processing is performed to reduce the volatility of the data. Among them, min-max normalization can be used to normalize the original data into the interval (-1, 1), and the calculation formula can be as shown in Formula 9.
[0090]
[0091] Among them, X is the original load data collected, and X t is the data after normalization processing, and X max and X min are the maximum and minimum values in the collected load data respectively.
[0092] Finally, to meet the training requirements of the deep learning model, the processed original load information is segmented into multiple segments of time series data, and each segment of data represents the change of the power system load within a specific time window.
[0093] Through the above data preprocessing steps, not only the quality of the original data is improved, but also its format is formatted into a form suitable for input into the deep learning model, providing a data basis for subsequent load classification and short-term prediction based on physical knowledge and historical data. Further, the model can more accurately capture the law of load change over time and the influence of external environmental factors, improving the prediction accuracy and practicality.
[0094] Optionally, in the power system load prediction method provided in Embodiment 1 of this application, a topological graph of the power system is constructed based on multi-segment time series data, and the graph features of the topological graph are constructed, including: determining the electrical connection structure in the power system and the lines between the electrical connection structures; constructing the nodes of the topological graph according to the electrical connection structure, and constructing the edges between the nodes according to the lines between the electrical connection structures; constructing the node features of the nodes according to the power information and external environment information of the nodes in the power system; determining the graph features of the topological graph according to the edges between the nodes and the node features of the nodes.
[0095] In Embodiment 1, in order to construct the topological graph and determine the graph features of the topological graph, the electrical connection structure inside the power system can be analyzed and determined, including but not limited to: the connection methods between each component (such as power generation stations, substations, load points), and the line information between these electrical connection structures.
[0096] Then, each electrical connection structure is abstracted into a node on the topological graph. At the same time, the lines between each electrical connection structure are transformed into the edges connecting the nodes, thereby constructing a topological graph reflecting the topological relationship of the power system. On this basis, the node features are constructed by combining the power information (active power and reactive power) of the nodes and the external information (such as temperature, humidity, etc.) of the environment where they are located.
[0097] Finally, using the connection edges between the nodes in the graph and the constructed node features, the overall graph features of the power system topological graph are determined.
[0098] Through the above steps, the operating state of the complex power system can be effectively converted into a graphical representation, which is convenient for subsequent deep learning models (such as attention graph neural networks) to perform feature extraction and load classification and prediction, thereby achieving the effect of improving the accuracy and reliability of the prediction.
[0099] Optionally, in Embodiment 1, Figure 2 It is a schematic flow chart of training a target prediction model and performing short-term load prediction. First, outliers are identified and processed through the horizontal processing method to ensure that there are no abnormal readings or measurement errors. The periodic characteristics of the power load are used to estimate the missing data points to reduce the impact of data incompleteness on the model. Normalization processing is performed to convert the data to the same numerical range to avoid interference with model training caused by different feature scales. After the preprocessing is completed, electrical structures (such as buses, substations, etc.) are mapped to the nodes in the graph structure, and the lines connecting these structures are represented as the edges between the nodes. At the same time, input feature and output label data are constructed for each node. The input features include the active and reactive powers of the node and relevant external environment information (such as temperature, humidity, holidays, etc.), and the output label data involves the load type classification of the node and the prediction of future load demand.
[0100] Integrate the preprocessed data, constructed node features, and labels into a sample dataset, which is represented in the form of a tensor and suitable for training an attention graph neural network model. The sample dataset is reasonably split. Usually, 60% of the data is used for training, 20% for validation, and the remaining 20% for the final model testing. Input the split sample dataset into the CNN to extract temporal and spatial features. Then, input the output of the CNN into the GAT to enhance neighbor feature extraction, and the Transformer for classification and prediction. At the same time, utilize physical knowledge and the attention mechanism to optimize the performance of the model.
[0101] During the model execution, iterative training is carried out. By optimizing the objective loss function (including physical constraints, classification, and regression losses), continuously adjust the model parameters until the model converges to obtain a load classification and prediction model PAG Model that meets the physical knowledge constraints, which is the above-mentioned target prediction model. Check whether the model training reaches the termination condition according to the maximum number of iterations Mmax, or whether the value of the loss function drops below a preset threshold. If the condition is met, the algorithm terminates; otherwise, continue the training iteration. Use the trained target prediction model to classify the load types and predict the short-term demand in the power system to obtain the load type classification results and the predicted values of the load demand.
[0102] Optionally, in the first embodiment, Figure 3 is the network structure diagram of a convolutional neural network (CNN). The CNN includes: an input layer, a convolutional layer, a pooling layer, and a fully connected layer. The input layer receives the preprocessed historical load data and external environmental information related to the load (such as temperature, humidity, precipitation, holidays, etc.). The input data is converted into a format suitable for network processing, usually in the form of a multi-dimensional array (tensor). The convolutional layer slides over the input data and performs a convolutional operation with a local area to generate feature vectors. The main function of the pooling layer is to reduce the dimension of the feature map, which helps the model to abstract and concentrate the load features and improve the processing efficiency. The fully connected layer connects the features extracted by the convolutional and pooling layers to form a fixed-length vector, and then inputs it into one or more fully connected neural network layers for performing the final classification or regression task.
[0103] Optionally, in the first embodiment, Figure 4 is the network structure diagram of an attention graph neural network model (GAT). The GAT receives multi-dimensional data from the power system as input (such as Figure 3(x_1, x_2,..., x_N) therein. The input x is processed by a convolutional layer, and the data output by the convolutional layer is input into the Multi-head GAT module. The Multi-head GAT module processes the input node features through the multi-head attention mechanism. Each GAT module uses parameters to learn different types of attention, which enables the model to understand the relationships between nodes from multiple perspectives and improve the richness and accuracy of feature extraction. The output of each GAT module is sequentially input into the encoder and decoder in the Transformer model. The encoder receives the features processed by the GAT module, uses the self-attention mechanism to capture the dependencies within the sequence, and at the same time performs feature mapping through the fully connected feed-forward neural network layer. The decoder receives the output of the encoder and also uses the self-attention mechanism, but adds a masking mechanism to avoid leakage of future information and ensure the causal relationship of the prediction. The decoder output includes the probability distribution of the load classification and the predicted value of the load demand. The loss function L of the model comprehensively considers the physical constraints, the error of the load classification, and the load prediction. Among them, Lp reflects the degree of violation of the physical law, Lc is the cross-entropy loss of the classification task, and Lr is the mean square error loss of the regression task. The model updates the parameters through the backpropagation algorithm, starting from the loss function, calculating the gradient backward, and adjusting the parameters in the Multi-head GAT module, the Conv2d layer, and the Transformer encoder and decoder to gradually minimize the loss function L and improve the prediction accuracy and generalization ability of the model.
[0104] Optionally, in the first embodiment, Figure 5 is the network structure diagram of the Transformer model for load classification and prediction. The Transformer model includes an encoder and a decoder. The encoder includes a multi-head self-attention mechanism, sum & layer normalization, and a feed-forward neural network. The decoder includes a masked multi-head self-attention mechanism, multi-head self-attention mechanism sum & layer normalization, a feed-forward neural network, a linear layer, and a softmax layer. The regression task in the Transformer model is used to predict the load demand, and the classification task in the Transformer model classifies the load type, and finally outputs the classification probability and the predicted value.
[0105] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0106] Embodiment Two
[0107] Embodiment 2 of the present application further provides a prediction device for the load of a power system. It should be noted that the prediction device for the load of the power system in Embodiment 2 of the present application can be used to execute the prediction method for the load of the power system provided in Embodiment 1 of the present application. The following introduces the prediction device for the load of the power system provided in Embodiment 2 of the present application.
[0108] Figure 6 is a schematic diagram of the prediction device for the load of the power system according to Embodiment 2 of the present application. As Figure 6 shown, the device includes: a first acquisition unit 601, a first construction unit 602, and a first prediction unit 603.
[0109] Specifically, the first acquisition unit 601 is configured to acquire the load information of the power system and segment the load information into multiple segments of time series data, where the load information at least includes: the power information of each part in the power system and the external environment information.
[0110] The first construction unit 602 is configured to construct a topology map of the power system based on the multiple segments of time series data, and construct the graph features of the topology map.
[0111] The first prediction unit 603 is configured to input the graph features of the topology map into a target prediction model, and predict the load demand information of the power system within a preset time period through the target prediction model; where the target prediction model is a prediction model obtained by training a preset prediction model according to the power balance constraint of the power system; the load demand information at least includes the load type and the power information.
[0112] The prediction device for the load of the power system provided in Embodiment 2 of the present application acquires the load information of the power system through the first acquisition unit 601 and segments the load information into multiple segments of time series data, where the load information at least includes: the power information of each part in the power system and the external environment information; the first construction unit 602 constructs a topology map of the power system based on the multiple segments of time series data, and constructs the graph features of the topology map; the first prediction unit 603 inputs the graph features of the topology map into a target prediction model, and predicts the load demand information of the power system within a preset time period through the target prediction model; where the target prediction model is a prediction model obtained by training a preset prediction model according to the power balance constraint of the power system; the load demand information at least includes the load type and the power information, which solves the problem in the related art that when accurately predicting the load through a traditional neural network, due to the limitations of convolution and cyclic operations, the weight allocation is not flexible and fuzzy, resulting in low prediction accuracy.
[0113] By collecting multiple segments of time-series data to construct the topology graph of the power system and the corresponding graph features, complex relationships in both space and time can be extracted from the power system, thereby achieving accurate classification of loads and accurate prediction of future load demands. Furthermore, the problems of power load classification and prediction can be addressed. Meanwhile, by considering the spatio-temporal characteristics of historical load data and the physical constraints of the power system, not only the accuracy of the prediction is improved, but also the physical rationality of the prediction results is ensured, thus achieving the effect of effectively coping with load fluctuations and ensuring the stable operation of the power grid.
[0114] Optionally, in the power system load prediction device provided in Embodiment 2 of this application, the above-mentioned device further includes: a first extraction unit, configured to extract temporal features and spatial features from the topology graphs corresponding to multiple sample data through a convolutional neural network, where the widths of both the temporal features and the spatial features are equal to the number of node features of the topology graph; a second extraction unit, configured to extract neighbor features from the temporal features and the spatial features respectively by using a graph attention neural network to obtain the node features corresponding to multiple sample data; a second prediction unit, configured to input the node features corresponding to multiple sample data into a preset transformer model to obtain the prediction results of the load demand information of each node in the topology graphs corresponding to multiple sample data; and a training unit, configured to optimize and train the transformer model according to the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain a target prediction model.
[0115] Optionally, in the power system load prediction device provided in Embodiment 2 of this application, the above-mentioned device further includes: a second collection unit, configured to collect historical sample data of the power system before extracting temporal features and spatial features from the topology graphs corresponding to multiple sample data through a convolutional neural network; a segmentation unit, configured to segment the historical sample data according to time-series information, and randomly select non-repeated sample data from the segmented historical sample data to obtain multiple sample data; a second construction unit, configured to construct the graph structures corresponding to the multiple sample data and set the initial weight information of each node in the graph structures; and a configuration unit, configured to set the maximum number of iterations of the graph attention neural network.
[0116] Optionally, in the power system load prediction device provided in the second embodiment of the present application, the above converter model at least includes: an encoder and a decoder. The second prediction unit includes: an encoding subunit, configured to input the node features corresponding to multiple sample data into the encoder for encoding to obtain an encoding result. The encoder includes: a multi-head self-attention mechanism layer and a fully-connected feed-forward neural network layer. The fully-connected feed-forward neural network layer adopts residual connection and performs layer normalization. A decoding subunit, configured to input the encoding result into the decoder for decoding to obtain a prediction result of the load demand information of each node in the graph structure corresponding to the multiple sample data. The decoder includes: a masked multi-head self-attention mechanism layer, a multi-head self-attention mechanism layer, and a fully-connected feed-forward neural network layer. Each layer adopts residual connection and layer normalization.
[0117] Optionally, in the power system load prediction device provided in the second embodiment of the present application, the above training unit includes: a first construction subunit, configured to construct a constraint function based on the voltage amplitude of each node and the phase angle of each node in the topological graph; an adjustment subunit, configured to optimize and adjust a preset loss function using the constraint function to obtain a target loss function, where the target loss function includes: cross-entropy loss for a multi-classification task and mean squared error loss for a regression task; an update subunit, configured to calculate a loss function value based on the prediction result of the load demand information of each node and the target loss function, and update the weights of the converter model through the backpropagation algorithm until the loss function value is less than a preset value to obtain a target prediction model.
[0118] Optionally, in the power system load prediction device provided in the second embodiment of the present application, the above first acquisition unit 601 includes: an acquisition subunit, configured to acquire the load information of the power system and the external environment information of the power system within a preset time period to obtain original load information; where the external environment information at least includes one of the following: temperature information, humidity information, precipitation information, holiday information; a first processing subunit, configured to perform data outlier processing on the original load information using a horizontal processing method to obtain the original load information after outlier processing; a second processing subunit, configured to perform data missing value processing on the original load information after outlier processing based on the load periodicity method to obtain the original load information after missing value processing; a segmentation subunit, configured to segment the original load information after missing value processing into multiple segments of time series data to obtain multiple segments of time series data.
[0119] Optionally, in the power system load prediction device provided in the second embodiment of the present application, the above-mentioned first construction unit 602 includes: a first determination subunit, configured to determine the electrical connection structure in the power system and the lines between the electrical connection structures; a second construction subunit, configured to construct the nodes of the topology graph according to the electrical connection structure, and construct the edges between the nodes according to the lines between the electrical connection structures; a third construction subunit, configured to construct the node features of the nodes according to the power information and external environment information of the nodes in the power system; a second determination subunit, configured to determine the graph features of the topology graph according to the edges between the nodes and the node features of the nodes.
[0120] The power system load prediction device includes a processor and a memory. The above-mentioned first acquisition unit 601, first construction unit 602, first prediction unit 603, etc. are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.
[0121] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set, and the prediction accuracy of the power system load prediction can be improved by adjusting the kernel parameters.
[0122] The memory may include non-permanent memory in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one storage chip.
[0123] Embodiment 3 of the present invention provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, it implements the power system load prediction method.
[0124] Embodiment 4 of the present invention provides a processor, which is used to run a program, and when the program runs, it executes the power system load prediction method.
[0125] As Figure 7 shown, Embodiment 5 of the present invention provides an electronic device, which includes a processor, a memory, and a program stored on the memory and executable on the processor. When the processor executes the program, the following steps are implemented: collecting the load information of the power system, and dividing the load information into multiple segments of time series data, where the load information at least includes: the power information of each part in the power system and the external environment information; constructing the topology graph of the power system according to the multiple segments of time series data, and constructing the graph features of the topology graph; inputting the graph features of the topology graph into the target prediction model, and predicting the load demand information of the power system within a preset time period through the target prediction model; where the target prediction model is a prediction model obtained by training a preset prediction model according to the power balance constraint of the power system; the load demand information at least includes the load type and power information.
[0126] When the processor executes the program, the following steps are also implemented: The target prediction model is trained through the following steps: Extract temporal features and spatial features from the topological graphs corresponding to multiple sample data through a convolutional neural network, where the widths of the temporal features and the spatial features are both equal to the number of node features of the topological graph; Use a graph attention neural network to extract neighbor features from the temporal features and the spatial features respectively to obtain the node features corresponding to multiple sample data; Input the node features corresponding to multiple sample data into a preset transformer model to obtain the prediction results of the load demand information of each node in the topological graphs corresponding to multiple sample data; Optimize and train the transformer model according to the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain the target prediction model.
[0127] When the processor executes the program, the following steps are also implemented: Before extracting temporal features and spatial features from the topological graphs corresponding to multiple sample data through a convolutional neural network, the above method further includes: Collecting historical sample data of the power system; Segmenting the historical sample data according to the time sequence information, and randomly extracting non-repeating sample data from the segmented historical sample data to obtain multiple sample data; Constructing the graph structures corresponding to multiple sample data and setting the initial weight information of each node in the graph structures; Setting the maximum number of iterations of the graph attention neural network.
[0128] When the processor executes the program, the following steps are also implemented: The transformer model at least includes: an encoder and a decoder. Inputting the node features corresponding to multiple sample data into a preset transformer model to obtain the prediction results of the load demand information of each node in the topological graphs corresponding to multiple sample data includes: Inputting the node features corresponding to multiple sample data into the encoder for encoding to obtain an encoding result, where the encoder includes: a multi-head self-attention mechanism layer and a fully-connected feed-forward neural network layer, and the fully-connected feed-forward neural network layer uses residual connection and performs layer normalization; Inputting the encoding result into the decoder for decoding to obtain the prediction results of the load demand information of each node in the graph structures corresponding to multiple sample data, where the decoder includes: a masked multi-head self-attention mechanism layer, a multi-head self-attention mechanism layer, and a fully-connected feed-forward neural network layer, and each layer uses residual connection and layer normalization.
[0129] When the processor executes the program, the following steps are also implemented: optimizing and training the converter model according to the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain a target prediction model, including: constructing a constraint function based on the voltage amplitude of each node and the phase angle of each node in the topological graph; optimizing and adjusting a preset loss function by using the constraint function to obtain a target loss function, where the target loss function includes: the cross-entropy loss of the multi-classification task and the mean square error loss of the regression task; calculating the loss function value according to the prediction results of the load demand information of each node and the target loss function, and updating the weights of the converter model through the backpropagation algorithm until the loss function value is less than a preset value to obtain the target prediction model.
[0130] When the processor executes the program, the following steps are also implemented: collecting the load information of the power system and splitting the load information into multiple segments of time-series data, including: collecting the load information of the power system within a preset time period and the external environment information of the power system to obtain the original load information; where the external environment information includes at least one of the following: temperature information, humidity information, precipitation information, holiday information; performing data outlier processing on the original load information by using the horizontal processing method to obtain the original load information after outlier processing; performing data missing value processing on the original load information after outlier processing based on the load periodicity method to obtain the original load information after missing value processing; splitting the original load information after missing value processing into multiple segments of time-series data to obtain multiple segments of time-series data.
[0131] When the processor executes the program, the following steps are also implemented: constructing the topological graph of the power system according to multiple segments of time-series data and constructing the graph features of the topological graph, including: determining the electrical connection structure in the power system and the lines between the electrical connection structures; constructing the nodes of the topological graph according to the electrical connection structure and constructing the edges between the nodes according to the lines between the electrical connection structures; constructing the node features of the nodes according to the power information and external environment information of the nodes in the power system; determining the graph features of the topological graph according to the edges between the nodes and the node features of the nodes.
[0132] The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0133] The present application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with the following method steps: collecting load information of a power system and splitting the load information into multiple segments of time-series data, where the load information at least includes: power information of each part in the power system and external environment information; constructing a topological graph of the power system based on the multiple segments of time-series data, and constructing graph features of the topological graph; inputting the graph features of the topological graph into a target prediction model, and predicting load demand information of the power system within a preset time period through the target prediction model; where the target prediction model is a prediction model obtained by training a preset prediction model according to the power balance constraint of the power system; the load demand information at least includes load type and power information.
[0134] When executed on a data processing device, it is also adapted to execute a program initialized with the following method steps: the target prediction model is obtained by the following steps of training: extracting temporal features and spatial features from the topological graphs corresponding to multiple sample data through a convolutional neural network, where the width of the temporal features and the width of the spatial features are both equal to the number of node features of the topological graph; using a graph attention neural network to extract neighbor features from the temporal features and spatial features respectively to obtain node features corresponding to multiple sample data; inputting the node features corresponding to multiple sample data into a preset transformer model to obtain prediction results of the load demand information of each node in the topological graphs corresponding to multiple sample data; optimizing and training the transformer model according to the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain the target prediction model.
[0135] When executed on a data processing device, it is also adapted to execute a program initialized with the following method steps: before extracting temporal features and spatial features from the topological graphs corresponding to multiple sample data through a convolutional neural network, the above method further includes: collecting historical sample data of the power system; splitting the historical sample data according to time-series information, randomly extracting non-repeating sample data from the split historical sample data to obtain multiple sample data; constructing graph structures corresponding to the multiple sample data and setting initial weight information for each node in the graph structures; setting the maximum number of iterations of the graph attention neural network.
[0136] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: The converter model at least includes: an encoder and a decoder. Input the node features corresponding to multiple sample data into a preset converter model to obtain the prediction results of the load demand information of each node in the topological graph corresponding to the multiple sample data, including: input the node features corresponding to the multiple sample data into the encoder for encoding to obtain an encoding result, where the encoder includes: a multi-head self-attention mechanism layer and a fully-connected feed-forward neural network layer. The fully-connected feed-forward neural network layer uses residual connection and performs layer normalization; input the encoding result into the decoder for decoding to obtain the prediction results of the load demand information of each node in the graph structure corresponding to the multiple sample data, where the decoder includes: a masked multi-head self-attention mechanism layer, a multi-head self-attention mechanism layer, and a fully-connected feed-forward neural network layer. Each layer uses residual connection and layer normalization.
[0137] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: Optimize and train the converter model according to the power balance constraint of the power system and the prediction results of the load demand information of each node to obtain a target prediction model, including: construct a constraint function based on the voltage amplitude of each node and the phase angle of each node in the topological graph; use the constraint function to optimize and adjust a preset loss function to obtain a target loss function, where the target loss function includes: the cross-entropy loss of a multi-classification task and the mean square error loss of a regression task; calculate the loss function value according to the prediction results of the load demand information of each node and the target loss function, and update the weights of the converter model through the backpropagation algorithm until the loss function value is less than a preset value to obtain the target prediction model.
[0138] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: Collect the load information of the power system and divide the load information into multiple segments of time-series data, including: collect the load information of the power system within a preset time period and the external environment information of the power system to obtain the original load information; where the external environment information at least includes one of the following: temperature information, humidity information, precipitation information, holiday information; use the horizontal processing method to process the data outliers of the original load information to obtain the original load information after outlier processing; perform data missing value processing on the original load information after outlier processing based on the load periodicity method to obtain the original load information after missing value processing; divide the original load information after missing value processing into multiple segments of time-series data to obtain multiple segments of time-series data.
[0139] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: constructing a topological graph of a power system based on multi-segment time-series data, and constructing graph features of the topological graph, including: determining electrical connection structures in the power system and lines between the electrical connection structures; constructing nodes of the topological graph based on the electrical connection structures, and constructing edges between the nodes based on the lines between the electrical connection structures; constructing node features of the nodes based on the power information and external environment information of the nodes in the power system; and determining the graph features of the topological graph based on the edges between the nodes and the node features of the nodes.
[0140] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0142] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1Steps of the functions specified in one or more boxes.
[0144] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0145] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0146] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transitory media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0147] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but also other elements not expressly listed or elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0148] Those skilled in the art will appreciate that the embodiments of the present application may be provided as a method, system, or computer program product. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0149] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A method for predicting power system load, characterized in that: include: Collecting load information of the power system and dividing the load information into multiple time series data segments, wherein the load information at least includes: power information of each part of the power system and external environment information; Constructing a topological map of the power system according to the multiple time series data, and constructing graph features of the topological map; The graph features of the topology map are input into a target prediction model, and the load demand information of the power system within a preset time period is predicted by the target prediction model; wherein the target prediction model is a prediction model obtained by training a preset prediction model based on the power balance constraint of the power system; the load demand information includes at least load type and power information.
2. The method according to claim 1, characterized in that The target prediction model is trained by the following steps: Extracting time features and space features from a topological graph corresponding to a plurality of sample data by a convolutional neural network, wherein the width of the time feature and the width of the space feature are both equal to the number of node features of the topological graph; A graph attention neural network is used to extract neighbor features from the time features and the spatial features respectively to obtain node features corresponding to the multiple sample data; Inputting node features corresponding to the plurality of sample data into a preset converter model to obtain a prediction result of load demand information of each node in the topological graph corresponding to the plurality of sample data; The converter model is optimized and trained according to the power balance constraint of the power system and the prediction result of the load demand information of each node to obtain the target prediction model.
3. The method according to claim 2, characterized in that Before extracting the time features and the space features from the topological graphs corresponding to the plurality of sample data by using the convolutional neural network, the method further comprises: Collecting historical sample data of the power system; Segmenting the historical sample data according to the time series information, and randomly extracting non-repeated sample data from the segmented historical sample data to obtain the multiple sample data; Constructing a graph structure corresponding to the plurality of sample data, and setting initial weight information of each node in the graph structure; Sets the maximum number of iterations of the graph attention neural network.
4. The method according to claim 2, characterized in that: The converter model at least includes: an encoder and a decoder, which input the node features corresponding to the plurality of sample data into a preset converter model to obtain a prediction result of the load demand information of each node in the topological graph corresponding to the plurality of sample data, including: Inputting node features corresponding to the plurality of sample data into the encoder for encoding to obtain an encoding result, wherein the encoder comprises: a multi-head self-attention mechanism layer, a fully connected feedforward neural network layer, the fully connected feedforward neural network layer adopts residual connection and performs layer normalization; The encoding result is input into the decoder for decoding to obtain the prediction result of the load demand information of each node in the graph structure corresponding to the multiple sample data, wherein the decoder includes: a masked multi-head self-attention mechanism layer, a multi-head self-attention mechanism layer and a fully connected feedforward neural network layer, each layer adopts residual connection and layer normalization.
5. The method according to claim 2, characterized in that: The converter model is optimized and trained according to the power balance constraint of the power system and the prediction result of the load demand information of each node to obtain the target prediction model, including: Constructing a constraint function according to the voltage amplitude of each node and the phase angle of each node in the topological diagram; The constraint function is used to optimize and adjust the preset loss function to obtain a target loss function, wherein the target loss function includes: cross entropy loss of multi-classification tasks and mean square error loss of regression tasks; The loss function value is calculated based on the prediction result of the load demand information of each node and the target loss function, and the weight of the converter model is updated through the back propagation algorithm until the loss function value is less than a preset value to obtain the target prediction model.
6. The method according to claim 1, characterized in that Collecting load information of the power system and dividing the load information into multiple time series data segments, including: Collecting load information of the power system and external environment information of the power system within a preset time period to obtain original load information; wherein the external environment information includes at least one of the following: temperature information, humidity information, precipitation information, and holiday information; Performing data outlier processing on the original load information using a horizontal processing method to obtain the original load information after outlier processing; Performing data missing value processing on the original load information after the abnormal value processing based on a load periodicity method to obtain the original load information after the missing value processing; The original load information after the missing value processing is divided into multiple segments of time series data to obtain the multiple segments of time series data.
7. The method according to claim 1, characterized in that Constructing a topological map of the power system according to the multiple time series data, and constructing graph features of the topological map, including: determining electrical connection structures in the power system and lines between the electrical connection structures; Constructing nodes of the topological graph according to the electrical connection structures, and constructing edges between the nodes according to the lines between the electrical connection structures; Constructing node characteristics of the node according to power information of the node in the power system and the external environment information; The graph features of the topological graph are determined according to the edges between the nodes and the node features of the nodes.
8. A device for predicting power system load, characterized in that: include: A first collection unit is used to collect load information of the power system and divide the load information into multiple time series data segments, wherein the load information at least includes: power information of each part of the power system and external environment information; A first construction unit, configured to construct a topological map of the power system according to the multiple time series data segments, and to construct a graph feature of the topological map; The first prediction unit is used to input the graph features of the topology map into a target prediction model, and predict the load demand information of the power system within a preset time period through the target prediction model; wherein the target prediction model is a prediction model obtained by training a preset prediction model based on the power balance constraint of the power system; the load demand information includes at least load type and power information.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes stored computer instructions, wherein when the computer instructions are executed by a processor, the method for predicting the load of a power system as claimed in any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the power system load prediction method described in any one of claims 1 to 7.
Citation Information
Cited By
Power demand prediction method based on complex network and graph neural network
CN120911702A
Power system probability load prediction method, system and device, and storage medium
CN121216448A