Line loss prediction method and device for photovoltaic high-permeability power grid
Through the graph embedding and sliding time window technology combined with the graph conversion network, the complexity of line loss changes in the power system after the addition of new energy is solved, and the accurate prediction of the line loss change rate is achieved, providing support for grid optimization decisions.
Patent Information
- Application Number
- CN202411039005.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-07-31
AI Technical Summary
The addition of new energy has led to uncertainty and complex nonlinearity in line loss changes in power systems, and it is difficult for the prior art to accurately calculate line loss.
Graph embedding technology is used to optimize historical input features, combine the sliding time window to reconstruct features, and use graph conversion network to perform deep feature processing to output the predicted value of line loss change rate.
By comprehensively capturing factors that affect line loss changes, enhancing feature correlation, dynamic updates and real-time processing of historical data, automatically learning nonlinear relationships in data, obtaining accurate line loss change rates, and providing support for intelligent decision-making of power grids .
Smart Images

Figure CN119005410A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of prediction of line loss changes for new energy grid connection, and in particular, relates to a method and device for predicting line loss in a photovoltaic high-penetration power grid. Background Art
[0002] With the rapid development of social economy and the improvement of people's living standards, people's demand for electricity is growing, which puts higher requirements on the stability and economy of the power system. At the same time, the widespread application of new energy, especially the popularization of photovoltaic power generation, has brought new opportunities and challenges to the power system. As an important form of distributed energy, photovoltaic power generation has significantly changed the power flow distribution of the power grid after its high penetration rate is connected to the power grid, making the line loss problem more complicated and uncertain. As an important indicator of the operation of the power system, line loss directly affects the economic and social benefits of power companies. Therefore, accurate calculation of line loss is of great significance to optimizing the operation of the power grid and improving the economy and stability of the power system.
[0003] In the related art, for example, the patent document with publication number CN106156892A discloses a method for establishing a power grid line loss rate prediction model, which solves the regression equation by performing regression analysis on the causal relationship between the dependent variable and multiple independent variables, and verifies the regression equation to obtain the predicted value. However, the addition of new energy sources is not considered, which makes the line loss change uncertain and complex nonlinear. Therefore, if the power system includes new energy sources, the line loss cannot be accurately calculated by the above method or some conventional algorithms.
[0004] Therefore, it is necessary to invent a method for analyzing the impact of renewable energy grid connection on line loss, so as to solve the problem that the addition of renewable energy causes uncertainty and complex nonlinearity in line loss changes. Summary of the invention
[0005] The embodiments of the present application provide a method and device for predicting line losses in a photovoltaic high-penetration power grid, which can solve the problem of uncertainty and complex nonlinearity in line loss changes caused by the addition of new energy.
[0006] This application is implemented through the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a method for predicting line losses in a photovoltaic high penetration power grid, comprising:
[0008] Obtain various historical input characteristics of renewable energy grid connection; historical input characteristics include weather characteristics, renewable energy power generation active power, load and grid bus loss;
[0009] Based on the correlation between multiple historical input features, graph embedding is performed, and multiple historical input features are optimized to obtain an optimized feature sequence;
[0010] Use sliding time windows to reconstruct multiple historical input features to obtain a reconstructed feature sequence;
[0011] The Graph Transformer Network (GTN) is used to process the optimized feature sequence and the reconstructed feature sequence, and output the predicted value of the final line loss change rate.
[0012] In a possible implementation of the first aspect, graph embedding is performed based on the correlation between multiple historical input features, and the multiple historical input features are optimized to obtain an optimized feature sequence, including:
[0013] Embed each original feature sequence of multiple historical input features into a node in a graph structure;
[0014] Use pairwise correlation analysis to determine the edge information between any two nodes in the graph structure;
[0015] Use the sparse operation to process the edge information between nodes in the graph structure and obtain optimized edge information;
[0016] Based on the optimized edge information, the optimized adjacency matrix is determined; the adjacency matrix represents the optimized feature sequence, and the optimized adjacency matrix is used to describe the graph structure.
[0017] In a possible implementation of the first aspect, the edge information includes edge weight;
[0018] Using the sparse operation, the edge information between nodes in the graph structure is processed to obtain optimized edge information, including:
[0019] Use the sparse operation to delete the edges in the graph structure whose edge weights are less than the weight threshold; where the weight threshold is the lower limit of the box diagram formed by all edge weights;
[0020] The remaining edges and edge weights in the graph structure are used as optimized edge information.
[0021] In a possible implementation of the first aspect, a plurality of historical input features are reconstructed using a sliding time window to obtain a reconstructed feature sequence, including:
[0022] Reconstruct multiple historical input features into feature structures of multiple image blocks through sliding time windows;
[0023] Based on the length of the sliding time window, a reconstructed adjacency matrix of each image block in the feature structure is determined; the reconstructed adjacency matrix represents the reconstructed feature sequence.
[0024] In a possible implementation of the first aspect, if the dimension of the adjacency matrix of each original feature sequence of the multiple historical input features is N×N, the dimension of the reconstructed adjacency matrix is τN×τN, where τ is the length of the sliding time window.
[0025] In a possible implementation of the first aspect, the graph conversion network includes an encoder, a decoder, and a fully connected layer; wherein the encoder includes a multi-layer first multi-head graph self-attention module; the decoder includes a masked multi-head graph self-attention module and a second multi-head graph self-attention module;
[0026] The multi-layer first multi-head graph self-attention module is used to process the reconstructed feature sequence input to the encoder, and fuse the processed reconstructed feature sequence with the optimized feature sequence to obtain a vector correlation matrix with side information, and input the vector correlation matrix into the masked multi-head graph self-attention module;
[0027] The masked multi-head graph self-attention module is used to process the reconstructed feature sequence and the vector correlation matrix of the embedded zero sequence to obtain masked feature data, and input the masked feature data into the second multi-head graph self-attention module;
[0028] The second multi-head graph self-attention module obtains the final input feature sequence based on the correlation between each vector in the mask feature data, and inputs the final input feature sequence into the fully connected layer;
[0029] The fully connected layer is used to output the predicted value of the final line loss change rate.
[0030] In a possible implementation of the first aspect, the correlation Z′ between each vector in the mask feature data l It is expressed as:
[0031]
[0032] Among them, the middle Q l is the query index of the first layer of the multi-head graph self-attention module, K l is the query key of the first layer of the multi-head graph self-attention module; M l is the mask matrix of the masked multi-head graph self-attention module corresponding to the l-th layer of the first multi-head graph self-attention module; is the tensor product operation.
[0033] In a possible implementation of the first aspect, the fully connected layer includes a first fully connected layer and a second fully connected layer;
[0034] The first fully connected layer is used to adjust the number of channels so that the number of channels is equal to the time length of the prediction domain;
[0035] The second fully connected layer is connected to the first fully connected layer and is used to adjust the number of nodes so that the number of nodes is equal to the number of nodes in the original space.
[0036] In a possible implementation manner of the first aspect, the predicted value of the final line loss change rate is The expression is:
[0037]
[0038] Where σ is the Selu activation function, W1 is the weight coefficient matrix in the first fully connected layer; W2 is the weight coefficient matrix in the second fully connected layer; H f It is the final input feature sequence of the first fully connected layer.
[0039] In a second aspect, an embodiment of the present application provides a line loss prediction device for a photovoltaic high penetration power grid, which executes a line loss prediction method for a photovoltaic high penetration power grid as in the first aspect, including:
[0040] The feature acquisition module is used to acquire a variety of historical input features; the historical input features include weather characteristics, active power of renewable energy generation, load and grid bus loss;
[0041] A feature optimization module is used to perform graph embedding based on the correlation between multiple historical input features, optimize multiple historical input features, and obtain an optimized feature sequence;
[0042] A feature reconstruction module is used to reconstruct multiple historical input features using a sliding time window to obtain a reconstructed feature sequence;
[0043] The feature processing and prediction output module is used to process the optimized feature sequence and the reconstructed feature sequence using a graph conversion network, and output the predicted value of the final line loss change rate.
[0044] Compared with the related art, the embodiments of the present application have the following beneficial effects:
[0045] The line loss prediction method and device for photovoltaic high-penetration power grid in the embodiment of the present application comprehensively captures various factors that affect line loss changes by comprehensively considering multiple historical input features, optimizes feature sequences using graph embedding technology, further enhances the correlation between features, and then reconstructs historical input features using a sliding time window, which can realize dynamic updating and real-time processing of historical data, and uses a self-attention network for deep feature processing, which can simultaneously extract the time correlation and interaction information of multivariate sequences, fully mine the effective features of multivariate sequences, and automatically learn nonlinear relationships in data, so as to obtain accurate line loss change rates in the future, and provide support for intelligent decision-making of power grids.
[0046] The beneficial effects of the above-mentioned second aspect embodiment refer to the beneficial effects of the first aspect embodiment, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0048] Figure 1 This is an application scenario diagram of the line loss prediction method and device for photovoltaic high penetration power grid provided by an embodiment of the present application
[0049] Figure 2 It is a flow chart of a method for predicting line loss in a photovoltaic high-penetration power grid provided in an embodiment of the present application;
[0050] Figure 3 is a schematic diagram of an adjacency matrix provided in an embodiment of the present application;
[0051] Figure 4 It is a structural schematic diagram of a line loss prediction device for a photovoltaic high-penetration power grid provided in one embodiment of the present application. DETAILED DESCRIPTION
[0052] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0053] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0054] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0055] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0056] References to "an embodiment", "one embodiment" or "some embodiments" described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0057] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0058] Reference Figure 1 As shown, it is an application scenario diagram of an embodiment of the line loss prediction method and device for photovoltaic high penetration power grid of the present invention. The prediction method and device run in the server 101. The server 101 is connected to a database 102 and multiple terminals 103 through the Internet. The server 101 is an application server that provides network services and application services, and processes service requests sent by the terminal 103. The database 102 is used to store files and various table data. The terminal 103 is a terminal for collecting data such as weather characteristics, active power of new energy power generation, load and power grid bus loss.
[0059] Figure 2 is a flow chart of a method for predicting line loss in a photovoltaic high penetration power grid provided in an embodiment of the present application, with reference to Figure 2 The line loss prediction method of the photovoltaic high penetration power grid includes:
[0060] Step 201, obtaining various historical input features of new energy grid connection.
[0061] Among them, historical input features include weather characteristics, active power of renewable energy generation, load and total grid loss. Weather is an important factor affecting renewable energy generation (especially solar and wind energy). By collecting and analyzing historical weather data (such as temperature, wind speed, light intensity, etc.), a more accurate renewable energy generation prediction model can be established. Historical renewable energy generation active power data reflects the actual operating conditions and power generation capacity of renewable energy generation equipment. By analyzing these data, we can understand the volatility and regularity of renewable energy generation, and provide a basis for subsequent power generation prediction and optimization scheduling. Load is an important parameter in the power system, reflecting the power demand of the power system. By collecting and analyzing historical load data, we can understand the changing rules and characteristics of the load, and provide a basis for the scheduling and supply and demand balance of the power system. Total grid loss is an important indicator to measure the operation quality of the power system. By collecting and analyzing historical grid total grid loss data, we can understand the loss of the power grid and the influencing factors.
[0062] The final output feature is the line loss change rate at each time point in the future time period compared to the previous time period. Therefore, before training, the line loss change rate at each time point in the historical time period compared to the previous time period can also be obtained to prepare for the subsequent training process.
[0063] The k-nearest neighbor classification algorithm (KNN) is used to interpolate missing values for all historical input features. Data with large missing values are directly deleted. After the missing values are processed, the data of each feature is normalized.
[0064] Step 202, graph embedding is performed based on the correlation between multiple historical input features, and multiple historical input features are optimized to obtain an optimized feature sequence.
[0065] Exemplarily, step 202 includes:
[0066] Step 2021, embed each original feature sequence of multiple historical input features into a node in the graph structure.
[0067] The various historical input features are embedded into the graph as multi-component original feature sequences, and the intrinsic relationship between the multi-component original feature sequences is represented by the graph structure. In the graph embedding process, each original feature sequence is regarded as a node in the graph structure.
[0068] Step 2022, using pairing correlation analysis to determine the edge information between any two nodes in the graph structure.
[0069] The edge information includes edge weights. Pairwise correlation analysis is used to confirm the edge weights between any two nodes. Assume that X and are the original feature sequences of the two inputs, X and It can represent the characteristics of the two nodes in the graph structure. The edge weight between the two original feature sequences is represented by the absolute value of the Pearson coefficient of the historical sequence corresponding to the two nodes. The expression of the absolute value of the Pearson coefficient of the historical sequence corresponding to the two nodes is:
[0070]
[0071] Among them, E is the edge weight between two original feature sequences, and are the average values of the two original feature sequences, X i is the i-th element of the original feature sequence X, Y i is the i-th element of the original feature sequence Y.
[0072] Step 2023, using a sparse operation, processes the edge information between nodes in the graph structure to obtain optimized edge information.
[0073] The nodes are interconnected, and since the edge weights between some nodes are very small, they can be ignored. Therefore, a sparse operation is performed, that is, edges with smaller edge weights are deleted from the graph. The weight threshold for deleting edges is the lower limit of the box plot composed of all edge weights. In graph neural networks, a box plot usually refers to a box plot visualization of the node embedding space.
[0074] Node embedding refers to the process of mapping each node in a graph into a low-dimensional vector space. This vector is usually called a node embedding vector, which contains the structural information and feature information of the node. A box plot is a commonly used statistical chart used to show the distribution of data. In graph neural networks, box plots can be used to visualize the distribution of node embedding space. Box plots can be used to view the distribution of node embedding vectors in different dimensions. For example, you can draw a box plot on each dimension to view the distribution range, median, quartile, and other information of the node embedding vector on that dimension. Compare the distribution of node embedding space under different graph neural network models or different training parameters. By comparing different box plots, you can evaluate the impact of different models or parameters on the node embedding space. Identify abnormal nodes or outliers. The embedding vectors of abnormal nodes may be at the edge of the box plot or beyond the range of the box plot, and these nodes can be identified through box plots. Evaluate the generalization performance of graph neural network models.
[0075] Exemplarily, a sparsification operation is used to process edge information between nodes in a graph structure to obtain optimized edge information, including: using a sparsification operation to delete edges in the graph structure whose edge weights are less than a weight threshold; wherein the weight threshold is the lower limit of a box diagram composed of all edge weights; and using the remaining edges and edge weights in the graph structure as optimized edge information.
[0076] The specific calculation process of the weight threshold ε is as follows:
[0077] ε=QL-1.5IQR (2)
[0078] Among them, IQR is the interquartile range of edge weight, that is, the difference between the upper quartile QU of edge weight and the lower quartile QL of edge weight.
[0079] Step 2024, based on the optimized edge information, determine the optimized adjacency matrix; the adjacency matrix represents the optimized feature sequence, and the optimized adjacency matrix is used to describe the graph structure.
[0080] In the original adjacency matrix, the edges with weights less than ε are deleted, and the remaining edge weights form the optimized adjacency matrix A, as shown in Figure 3 shown.
[0081] While determining the optimized feature sequence, the historical input features are reconstructed into the feature structure of multiple image patches through a sliding time window.
[0082] In this embodiment, the paired correlation analysis operation uses the Pearson correlation coefficient, which can effectively measure the degree of linear correlation between two variables. In the new energy grid-connected data, there are often complex relationships between different historical input features, such as weather characteristics, new energy power generation, load, etc. Paired correlation analysis using the Pearson correlation coefficient can accurately quantify the linear correlation between these features, providing a reliable basis for subsequent graph embedding and feature optimization. In complex data sets, there is often redundant information and noise, which will have an adverse effect on data analysis and model building. Through the box plot lower limit threshold method, the sparse operation can be performed to eliminate those side information with weak correlation, that is, it is believed that these side information contributes less to the overall characteristics of the description of the graph structure, which may be generated by noise or redundant data. This can not only reduce the amount of calculation, but also improve the robustness and generalization ability of the model. Thus, the adjacency matrix not only reflects the direct relationship between the original feature sequences, but also removes unnecessary redundancy and noise through the sparse operation, making the representation of the feature sequence more concise and effective.
[0083] Step 203: Reconstruct the various historical input features using a sliding time window to obtain a reconstructed feature sequence.
[0084] Then, step 203 includes:
[0085] A variety of historical input features are reconstructed into a feature structure of multiple image blocks through a sliding time window; based on the length of the sliding time window, a reconstructed adjacency matrix of each image block in the feature structure is determined; and the reconstructed adjacency matrix represents the reconstructed feature sequence.
[0086] For example, if the dimension of the adjacency matrix of each original feature sequence of multiple historical input features is N×N, the dimension of the reconstructed adjacency matrix is τN×τN; τ is the length of the sliding time window. The reconstructed adjacency matrix consists of the original adjacency matrix A, the identity matrix E and the zero matrix O. The reconstructed adjacency matrix is expressed as:
[0087]
[0088] After step 202 and step 203 are performed in parallel, an optimized feature sequence and a reconstructed feature sequence are obtained respectively. Next, the optimized feature sequence and the reconstructed feature sequence are input into the graph conversion network.
[0089] Step 204: Use a graph conversion network to process the optimized feature sequence and the reconstructed feature sequence, and output a predicted value of the final line loss change rate.
[0090] The graph transformer network is used to extract deep features from the reconstructed features and fuse them with the optimized feature sequence, and then a two-layer fully connected network is used to obtain the final prediction value. The output feature is the rate of change of line loss at each time point in the future time period compared with the previous time period. The Huber function is used as the loss function and Adam is used as the optimization algorithm when training the prediction network.
[0091] Exemplarily, the graph conversion network includes an encoder, a decoder, and a fully connected layer. The encoder encodes a variable-length input sequence into a fixed-length vector; the decoder decodes the fixed-length vector into a variable-length output sequence.
[0092] Among them, the encoder includes a multi-layer first multi-head image self-attention module; the decoder includes a masked multi-head image self-attention module and a second multi-head image self-attention module.
[0093] The multi-layer first multi-head graph self-attention module is used to process the reconstructed feature sequence input to the encoder. The l-th layer reconstructed feature sequence input to each first multi-head graph self-attention module includes the input feature H l and position encoding feature P l , H l ∈R N×C , P l ∈R N×C .
[0094] Position encoding features are usually represented by trigonometric function position encoding:
[0095]
[0096] in, The position encoding feature of the jth time channel of the i-th node of the reconstructed feature sequence of the l-th layer, i is the subscript of the node of the reconstructed feature sequence, j is the subscript of the time channel of the reconstructed feature sequence. odd represents an odd number, even represents an even number; N is the number of nodes, and C is the number of time channels.
[0097] Then, the processed reconstructed feature sequence and optimized feature sequence are fused to obtain a vector correlation matrix with side information.
[0098] Before fusion, the query index (Query), query key (Key) and value (Value) of the first multi-head self-attention module are calculated. The specific calculation process is as follows:
[0099]
[0100] Among them, Q l , K l and V l They are the Query, Key and Value of the first layer of the multi-head graph self-attention module, and are the weights of the three perceptrons in the first layer of the multi-head graph self-attention module.
[0101] Then, we use each vector in the Query to calculate the dot product with each vector in the Key to get the correlation Z between the Query and Key in the first layer of the multi-head graph self-attention module. l :
[0102] Z l =Q l ×(K l ) T (6)
[0103] Among them, Zl∈R N × N , (K l ) T is the transpose of Kl.
[0104] Finally, the correlation Z l After multiplying the corresponding position with the adaptive side information, the vector correlation matrix with side information is obtained, which is normalized by Softmax to stabilize the gradient during training and achieve fusion. After normalization, the vector correlation matrix A of the first layer of the multi-head self-attention module with side information is formed. l It is expressed as:
[0105]
[0106] in, E lis the side information of the optimized feature sequence of the first layer of the multi-head self-attention module, C e is the number of channels of the side information, that is, the number of heads of the first multi-head graph self-attention module, and σ is the Softmax activation function.
[0107] It should be noted that ordinary edges are connections between nodes in a graph, which are usually predefined and remain unchanged during the training of graph neural networks. Ordinary edges usually use fixed adjacency matrices or edge weights to describe the connections between nodes. The update of nodes depends on the information transmitted by neighboring nodes through ordinary edges. Adaptive edges are edges that are dynamically generated or adjusted during the training process based on the characteristics of the nodes or the overall structure of the graph. Adaptive edges can capture high-order relationships and global structural information between nodes. By dynamically adjusting the weights of edges or generating new edges, adaptive edges can capture long-range dependencies and high-order interactions between nodes, thereby improving the expressive power of graph neural networks. The edge weights or connection relationships of adaptive edges are dynamically calculated based on the characteristics of nodes or the global information of the graph. Common methods include attention mechanisms, gating mechanisms, etc., to achieve adaptive adjustment of edges.
[0108] In this embodiment, both normal edges and adaptive edges can be used. Normal edges describe the inherent topological structure of the graph structure, while adaptive edges capture the high-order relationship between nodes. The two types of edges complement each other and together provide a more comprehensive and effective information transmission and node interaction mechanism for the graph transformation network, improving the performance of the graph transformation network in various tasks.
[0109] The above process obtains the vector correlation matrix of the first multi-head graph self-attention module layer l. Next, we analyze the first multi-head graph self-attention module layer l+1. By averaging the vector correlation matrix A of the first multi-head graph self-attention module layer l with side information for each channel l With V l The product of obtains the vector features of all nodes in the next layer (l+1 layer):
[0110]
[0111] Among them, H l+1 is the input feature of the reconstructed feature sequence of the l+1th layer of the first multi-headed graph self-attention module, c is the cth channel of the lth layer of the first multi-headed graph self-attention module, and the number of channels of the lth layer is generally set to 2. is the vector correlation matrix of the cth channel of the lth layer of the first multi-head graph self-attention module.
[0112] After multiple layers of the first multi-head graph self-attention module, the processed reconstructed feature sequence and the optimized feature sequence are fused to obtain the vector correlation matrix with edge information corresponding to all nodes, and then the vector correlation matrix is input into the decoder.
[0113] In the decoder part, the masked multi-head graph self-attention module is used to process the reconstructed feature sequence and vector correlation matrix of the embedded zero sequence to obtain masked feature data, and input the masked feature data into the second multi-head graph self-attention module.
[0114] The implementation of embedding zero sequences is to set the predicted target part of the long input sequence received by the decoder to 0. If the decoder can receive the complete input sequence information when predicting, it may cause information leakage, thus affecting the generalization ability of the model. By setting the part before the predicted target to 0, this information leakage can be avoided, allowing the model to focus more on current and future predictions.
[0115] For example, the purpose of using the masked multi-head graph self-attention mechanism is to generate outputs in a specific order when processing input sequences. If no mask is added, the output of the current position may contain information about the next position, which is obviously inconsistent with the logic of sequential translation. The masked multi-head graph self-attention mechanism can prevent the model from using future information during training. The difference between masked multi-head graph self-attention and self-attention is that in the masked multi-head graph self-attention module, the correlation between each vector is calculated through Q l , K l and the mask matrix M l Obtained.
[0116] Exemplarily, the correlation Z′ between each vector in the mask feature data l It is expressed as:
[0117]
[0118] Among them, Z′ l ∈R N×N , Q l is the query index of the first layer of the multi-head graph self-attention module, K l is the query key of the first layer of the multi-head graph self-attention module; M l is the mask matrix of the masked multi-head graph self-attention module corresponding to the l-th layer of the first multi-head graph self-attention module; is the tensor product operation.
[0119] The second multi-head graph self-attention module is used to obtain the final input feature sequence based on the correlation between each vector in the mask feature data, and input the final input feature sequence into the fully connected layer; the fully connected layer is used to output the predicted value of the final line loss change rate.
[0120] The second multi-head image self-attention module is used to process the mask feature data in the same way as the first multi-head image self-attention module. l After multiplying the corresponding position with the adaptive side information, the final vector correlation matrix with side information is obtained. The final input feature sequence H is calculated using the final vector correlation matrix with side information and the Value of the second multi-head graph self-attention module layer l f , the final input feature sequence H of the processed data f Input a double-layer fully connected layer for deep feature extraction.
[0121] Exemplarily, the fully connected layer includes a first fully connected layer and a second fully connected layer. The first fully connected layer is used to adjust the number of channels so that the number of channels is equal to the time length of the prediction domain; the second fully connected layer is connected to the first fully connected layer and is used to adjust the number of nodes so that the number of nodes is equal to the number of nodes in the original space.
[0122] Exemplarily, the first fully connected layer may be a grammar module, and the second fully connected layer may be a regression module. The output sequence, i.e., the predicted value of the final line loss change rate, is obtained by calculating the last input feature of the grammar module through the two fully connected regression modules. The expression is:
[0123]
[0124] Where σ is the Selu activation function, W1 is the weight coefficient matrix in the first fully connected layer; W2 is the weight coefficient matrix in the second fully connected layer; H f is the final input feature sequence of the first fully connected layer. The final input feature sequence H f The number of nodes in the reconstructed graph is the same as the number of nodes in each reconstructed feature sequence.
[0125] The above prediction model needs a large number of samples to be trained before it can be used. In the model training process, the Adam algorithm is used as the training optimizer, and the loss function of the output layer is Huber. Huber's expression is as follows:
[0126]
[0127] Among them, δ is a hyperparameter, and its size determines the emphasis of the Huber loss function on MSE and MAE. The Huber loss function has the advantages of both MSE and MAE, reduces the sensitivity to outliers, and realizes the function of being differentiable everywhere.
[0128] In summary, the line loss prediction method for a photovoltaic high-penetration power grid provided in the embodiment of the present application comprehensively captures various factors that affect line loss changes by comprehensively considering multiple historical input features, optimizes the feature sequence using graph embedding technology, further enhances the correlation between features, and then reconstructs the historical input features using a sliding time window. It can realize dynamic updating and real-time processing of historical data, and uses a self-attention network for deep feature processing. It can simultaneously extract the time correlation and interaction information of multivariate sequences, fully mine the effective features of multivariate sequences, and automatically learn the nonlinear relationships in the data, thereby obtaining accurate line loss change rates in the future, providing support for intelligent decision-making of power grids.
[0129] Taking into full consideration the multivariate time series provided by renewable energy after grid connection, the graph embedding analysis method is adopted to obtain the graph structure representation of the internal relationship of the multivariate sequence through paired correlation analysis and sparsity method, and then embedded into the feature extraction module in the form of an adjacency matrix, which can integrate the multivariate sequence features in feature extraction. The sliding time window method is used to divide the historical features into multiple patches, and then the features are extracted, so that the time correlation and interaction information of each multivariate series can be obtained simultaneously. And the graph Transformer model prediction method is adopted to simultaneously mine the time correlation of historical data and the interaction information between different features, extract hidden features, better mine the global information of all input features, and make full use of the hidden features of observable information to improve the prediction accuracy.
[0130] See also Figure 4 An embodiment of the present application provides a line loss prediction device for a photovoltaic high-penetration power grid, which executes a line loss prediction method for a photovoltaic high-penetration power grid as in the above embodiment, including a feature acquisition module 301, a feature optimization module 302, a feature reconstruction module 303 and a feature processing and prediction output module 304.
[0131] The feature acquisition module 301 is used to acquire a variety of historical input features; the historical input features include weather characteristics, active power of renewable energy generation, load and grid bus loss;
[0132] A feature optimization module 302 is used to perform graph embedding based on the correlation between multiple historical input features, optimize the multiple historical input features, and obtain an optimized feature sequence;
[0133] A feature reconstruction module 303 is used to reconstruct a variety of historical input features using a sliding time window to obtain a reconstructed feature sequence;
[0134] The feature processing and prediction output module 304 is used to process the optimized feature sequence and the reconstructed feature sequence using a graph conversion network, and output a predicted value of the final line loss change rate.
[0135] Exemplarily, the feature optimization module 302 is specifically used for:
[0136] Embed each original feature sequence of multiple historical input features into a node in a graph structure;
[0137] Use pairwise correlation analysis to determine the edge information between any two nodes in the graph structure;
[0138] Use the sparse operation to process the edge information between nodes in the graph structure and obtain optimized edge information;
[0139] Based on the optimized edge information, the optimized adjacency matrix is determined; the adjacency matrix represents the optimized feature sequence, and the optimized adjacency matrix is used to describe the graph structure.
[0140] Exemplarily, the edge information includes edge weights.
[0141] In the feature optimization module 302, the edge information between nodes in the graph structure is processed by using a sparse operation to obtain optimized edge information, including:
[0142] Use the sparse operation to delete the edges in the graph structure whose edge weights are less than the weight threshold; where the weight threshold is the lower limit of the box diagram formed by all edge weights;
[0143] The remaining edges and edge weights in the graph structure are used as optimized edge information.
[0144] Exemplarily, in the feature optimization module 302, a plurality of historical input features are reconstructed using a sliding time window to obtain a reconstructed feature sequence, including:
[0145] Reconstruct multiple historical input features into feature structures of multiple image blocks through sliding time windows;
[0146] Based on the length of the sliding time window, a reconstructed adjacency matrix of each image block in the feature structure is determined; the reconstructed adjacency matrix represents the reconstructed feature sequence.
[0147] Exemplarily, if the dimension of the adjacency matrix of each original feature sequence of multiple historical input features is N×N, the dimension of the reconstructed adjacency matrix is τN×τN; τ is the length of the sliding time window.
[0148] Exemplarily, in the feature processing and prediction output module 304, the graph conversion network includes an encoder, a decoder and a fully connected layer; wherein the encoder includes a multi-layer first multi-head graph self-attention module; the decoder includes a masked multi-head graph self-attention module and a second multi-head graph self-attention module;
[0149] The multi-layer first multi-head graph self-attention module is used to process the reconstructed feature sequence input to the encoder, and fuse the processed reconstructed feature sequence with the optimized feature sequence to obtain a vector correlation matrix with side information, and input the vector correlation matrix into the masked multi-head graph self-attention module;
[0150] The masked multi-head graph self-attention module is used to process the reconstructed feature sequence and the vector correlation matrix of the embedded zero sequence to obtain masked feature data, and input the masked feature data into the second multi-head graph self-attention module;
[0151] The second multi-head graph self-attention module obtains the final input feature sequence based on the correlation between each vector in the mask feature data, and inputs the final input feature sequence into the fully connected layer;
[0152] The fully connected layer is used to output the predicted value of the final line loss change rate.
[0153] Exemplarily, in the feature processing and prediction output module 304, the correlation Z′ between each vector in the mask feature data l It is expressed as:
[0154]
[0155] Among them, the middle Q l is the query index of the first layer of the multi-head graph self-attention module, K l is the query key of the first layer of the multi-head graph self-attention module; M l is the mask matrix of the masked multi-head graph self-attention module corresponding to the l-th layer of the first multi-head graph self-attention module; is the tensor product operation.
[0156] Exemplarily, in the feature processing and prediction output module 304, the fully connected layer includes a first fully connected layer and a second fully connected layer;
[0157] The first fully connected layer is used to adjust the number of channels so that the number of channels is equal to the time length of the prediction domain;
[0158] The second fully connected layer is connected to the first fully connected layer and is used to adjust the number of nodes so that the number of nodes is equal to the number of nodes in the original space.
[0159] For example, in the feature processing and prediction output module 304, the predicted value of the final line loss change rate is The expression is:
[0160]
[0161] Where σ is the Selu activation function, W1 is the weight coefficient matrix in the first fully connected layer; W2 is the weight coefficient matrix in the second fully connected layer; H f It is the final input feature sequence of the first fully connected layer.
[0162] It should be noted that although several units / modules or sub-units / modules of the line loss prediction device for photovoltaic high penetration power grid are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the embodiment of the present application, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules for embodiment.
[0163] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0164] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the line loss prediction method for the photovoltaic high-penetration power grid provided in the above-mentioned embodiment of the present application is implemented.
[0165] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0166] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for predicting line losses in a photovoltaic high penetration power grid, characterized in that: include: Acquire multiple historical input characteristics of renewable energy grid connection; the historical input characteristics include weather characteristics, renewable energy power generation active power, load and grid bus loss; Performing graph embedding based on the correlation between the multiple historical input features, optimizing the multiple historical input features, and obtaining an optimized feature sequence; Reconstructing the multiple historical input features using a sliding time window to obtain a reconstructed feature sequence; A graph conversion network is used to process the optimized feature sequence and the reconstructed feature sequence, and a predicted value of the final line loss change rate is output.
2. The line loss prediction method for photovoltaic high penetration power grid according to claim 1, characterized in that: The performing graph embedding based on the correlation between the multiple historical input features and optimizing the multiple historical input features to obtain an optimized feature sequence includes: Embed each original feature sequence of multiple historical input features into a node in a graph structure; Using pairwise correlation analysis to determine edge information between any two nodes in the graph structure; Using a sparse operation, processing edge information between nodes in the graph structure to obtain optimized edge information; Based on the optimized edge information, an optimized adjacency matrix is determined; the adjacency matrix represents the optimized feature sequence, and the optimized adjacency matrix is used to describe the graph structure.
3. The line loss prediction method for photovoltaic high penetration power grid according to claim 2, characterized in that: The edge information includes edge weight; The step of processing the edge information between nodes in the graph structure by using a sparse operation to obtain optimized edge information includes: Using a sparse operation, delete edges in the graph structure whose edge weights are less than a weight threshold; wherein the weight threshold is the lower limit of the box diagram formed by all edge weights; The remaining edges and edge weights in the graph structure are used as the optimized edge information.
4. The line loss prediction method for photovoltaic high penetration power grid according to claim 1, characterized in that: The method of reconstructing the multiple historical input features using a sliding time window to obtain a reconstructed feature sequence includes: Reconstructing the multiple historical input features into feature structures of multiple image blocks through a sliding time window; Based on the length of the sliding time window, a reconstructed adjacency matrix of each image block in the feature structure is determined; the reconstructed adjacency matrix represents the reconstructed feature sequence.
5. The line loss prediction method for photovoltaic high penetration power grid according to claim 4, characterized in that: If the dimension of the adjacency matrix of each original feature sequence of the multiple historical input features is N×N, the dimension of the reconstructed adjacency matrix is τN×τN; τ is the length of the sliding time window.
6. The line loss prediction method for photovoltaic high penetration power grid according to claim 1, characterized in that: The graph conversion network includes an encoder, a decoder and a fully connected layer; wherein the encoder includes a multi-layer first multi-head graph self-attention module; the decoder includes a masked multi-head graph self-attention module and a second multi-head graph self-attention module; The multi-layer first multi-head graph self-attention module is used to process the reconstructed feature sequence input to the encoder, and fuse the processed reconstructed feature sequence with the optimized feature sequence to obtain a vector correlation matrix with side information, and input the vector correlation matrix into the masked multi-head graph self-attention module; The masked multi-head graph self-attention module is used to process the reconstructed feature sequence embedded in the zero sequence and the vector correlation matrix to obtain masked feature data, and input the masked feature data into the second multi-head graph self-attention module; The second multi-head graph self-attention module obtains a final input feature sequence based on the correlation between each vector in the mask feature data, and inputs the final input feature sequence into the fully connected layer; The fully connected layer is used to output the predicted value of the final line loss change rate.
7. The line loss prediction method for photovoltaic high penetration power grid according to claim 6, characterized in that: The correlation Z′ between each vector in the mask feature data l It is expressed as: Among them, the middle Q l is the query index of the first layer of the multi-head graph self-attention module, K l is the query key of the first layer of the multi-head graph self-attention module; M l is the mask matrix of the masked multi-head graph self-attention module corresponding to the l-th layer of the first multi-head graph self-attention module; is the tensor product operation.
8. The line loss prediction method for photovoltaic high penetration power grid according to claim 6, characterized in that: The fully connected layer includes a first fully connected layer and a second fully connected layer; The first fully connected layer is used to adjust the number of channels so that the number of channels is equal to the time length of the prediction domain; The second fully connected layer is connected to the first fully connected layer and is used to adjust the number of nodes so that the number of nodes is equal to the number of nodes in the original space.
9. The line loss prediction method for photovoltaic high penetration power grid according to claim 8, characterized in that: The predicted value of the final line loss change rate The expression is: Where σ is the Selu activation function, W1 is the weight coefficient matrix in the first fully connected layer; W2 is the weight coefficient matrix in the second fully connected layer; H f It is the final input feature sequence of the first fully connected layer.
10. A line loss prediction device for a photovoltaic high penetration power grid, using the line loss prediction method for a photovoltaic high penetration power grid as claimed in any one of claims 1 to 9, characterized in that: include: A feature acquisition module is used to acquire a variety of historical input features; the historical input features include weather characteristics, active power of renewable energy generation, load and grid bus loss; A feature optimization module, configured to perform graph embedding based on the correlation between the multiple historical input features, optimize the multiple historical input features, and obtain an optimized feature sequence; A feature reconstruction module, used to reconstruct the multiple historical input features using a sliding time window to obtain a reconstructed feature sequence; The feature processing and prediction output module is used to process the optimized feature sequence and the reconstructed feature sequence using a graph conversion network, and output a predicted value of the final line loss change rate.
Citation Information
Patent Citations
Power distribution network line loss prediction method based on maximum mutual information coefficient and deep learning
CN114881338A
Traffic flow prediction method based on clustering and heterogeneous graph neural network
CN116681176A
Line loss rate online prediction method based on Bayesian optimization deep neural network
CN116882589A
Pedestrian trajectory prediction method
US20230342948A1
