Line loss prediction method and device for photovoltaic high penetration power grid
By using graph embedding and sliding time window to reconstruct feature sequences, combined with graph transformation networks, the uncertainty and complexity of line loss changes in high-penetration photovoltaic power grids are addressed, enabling accurate prediction of line loss change rates and supporting intelligent decision-making in the power grid.
Patent Information
- Application Number
- CN202411039005.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Existing technologies cannot accurately calculate line loss changes in photovoltaic high-penetration power grids, especially the uncertainties and complex nonlinear problems that arise after new energy sources are connected to the grid.
By acquiring various historical input features of new energy grid connection, the feature sequence is optimized using graph embedding technology, and the feature sequence is reconstructed by combining a sliding time window. The graph transformation network is then used for processing to output the predicted value of the line loss change rate.
It achieves accurate prediction of changes in line losses in photovoltaic high-penetration power grids, enhances feature correlation, can dynamically update and process historical data in real time, and automatically learn nonlinear relationships, providing support for intelligent decision-making in the power grid.
Smart Images

Figure CN119005410B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of line loss change prediction of new energy grid connection, and particularly relates to a line loss prediction method and device for a photovoltaic high-penetration power grid. BACKGROUND
[0002] With the rapid development of social economy and the improvement of people's living standards, people's demand for electricity is increasing, which puts higher requirements on the stability and economy of the power system. At the same time, the wide application of new energy, especially the popularization of photovoltaic power generation, brings new opportunities and challenges to the power system. Photovoltaic power generation as an important form of distributed energy, after high penetration rate access to the power grid, significantly changes the power flow distribution of the power grid, making the line loss problem more complex and uncertain. As an important indicator of power system operation, line loss directly affects the economic and social benefits of power enterprises. Therefore, accurate calculation of line loss is of great significance to optimize power grid operation and improve the economy and stability of the power system.
[0003] In related technologies, 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 through regression analysis of the causal relationship between dependent variables and multiple independent variables, and obtains the prediction value by testing the regression equation. However, the addition of new energy makes the line loss change uncertain and complex nonlinear, so if the power system including new energy is considered, 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 influence of new energy grid connection on line loss to solve the problem of uncertainty and complex nonlinearity of line loss change caused by the addition of new energy. SUMMARY
[0005] The embodiments of the application provide a line loss prediction method and device for a photovoltaic high-penetration power grid, which can solve the problem of uncertainty and complex nonlinearity of line loss change caused by the addition of new energy.
[0006] The application is realized by the following technical solutions:
[0007] In a first aspect, the embodiments of the application provide a line loss prediction method for a photovoltaic high-penetration power grid, comprising:
[0008] Obtaining a plurality of historical input features of new energy grid connection; the historical input features include weather features, new energy active power, load and total line loss of the power grid;
[0009] Performing graph embedding based on the correlation between the plurality of historical input features, optimizing the plurality of historical input features to obtain an optimized feature sequence;
[0010] The plurality of historical input features are reconstructed by using a sliding time window to obtain a reconstructed feature sequence.
[0011] The optimized feature sequence and the reconstructed feature sequence are processed by using a graph transformer network (GTN), and a predicted value of the line loss change rate is output.
[0012] In a possible implementation of the first aspect, the plurality of historical input features are optimized based on graph embedding between the plurality of historical input features to obtain an optimized feature sequence, including:
[0013] Each original feature sequence of the plurality of historical input features is embedded into a node in the graph structure.
[0014] Pairwise correlation analysis is used to determine edge information between any two nodes in the graph structure.
[0015] The edge information between the nodes in the graph structure is processed by using a sparsification operation to obtain optimized edge information.
[0016] 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.
[0017] In a possible implementation of the first aspect, the edge information includes edge weights.
[0018] The edge information between the nodes in the graph structure is processed by using a sparsification operation to obtain optimized edge information, including:
[0019] The sparsification operation is used to delete edges with edge weights less than a weight threshold in the graph structure; the weight threshold is a lower limit of a box plot formed by all the edge weights.
[0020] The remaining edges and edge weights in the graph structure are used as the optimized edge information.
[0021] In a possible implementation of the first aspect, the plurality of historical input features are reconstructed by using a sliding time window to obtain a reconstructed feature sequence, including:
[0022] The plurality of historical input features are reconstructed into a feature structure of a plurality of image blocks by using the sliding time window.
[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 plurality of 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 comprises an encoder, a decoder, and a fully connected layer; the encoder comprises a first multi-head graph self-attention module of multiple layers; the decoder comprises a masked multi-head graph self-attention module and a second multi-head graph self-attention module.
[0026] The first multi-head graph self-attention module of multiple layers is configured to process the reconstructed feature sequence input into the encoder, fuse the processed reconstructed feature sequence and the optimized feature sequence, obtain a vector correlation matrix with edge 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 configured to process the reconstructed feature sequence embedded with a zero sequence and the vector correlation matrix, 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 is configured to obtain a final input feature sequence based on the correlation between each vector in the masked feature data, and input the final input feature sequence into the fully connected layer.
[0029] The fully connected layer is configured to output a 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 masked feature data is l is represented as:
[0031]
[0032] wherein Q l is the query index of the lth layer of the first multi-head graph self-attention module, K l is the query key of the lth layer of the first multi-head graph self-attention module, and M l is the mask matrix of the lth layer of the masked multi-head graph self-attention module corresponding to the first multi-head graph self-attention module. is a tensor product operation.
[0033] In a possible implementation of the first aspect, the fully connected layer comprises a first fully connected layer and a second fully connected layer.
[0034] The first fully connected layer is configured 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 full connection layer is connected with the first full connection layer, and is used for adjusting 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 of the first aspect, the predicted value of the final line loss change rate is expressed as:
[0037]
[0038] wherein σ is a Selu activation function, W1 is a weight coefficient matrix in the first full connection layer, W2 is a weight coefficient matrix in the second full connection layer, H f is a final input feature sequence input into the first full connection layer.
[0039] In the second aspect, the embodiments of the present application provide a line loss prediction device for a photovoltaic high-penetration power grid, which executes the line loss prediction method for the photovoltaic high-penetration power grid as in the first aspect, and comprises:
[0040] a feature acquisition module configured to acquire a plurality of historical input features, wherein the historical input features include weather features, active power of new energy power generation, load, and total line loss of the power grid;
[0041] a feature optimization module configured to perform graph embedding based on correlations between the plurality of historical input features, to optimize the plurality of historical input features, and to obtain an optimized feature sequence;
[0042] a feature reconstruction module configured to reconstruct the plurality of historical input features by using a sliding time window, and to obtain a reconstructed feature sequence;
[0043] a feature processing and prediction output module configured to process the optimized feature sequence and the reconstructed feature sequence by using a graph conversion network, and to output a predicted value of a 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 the photovoltaic high-penetration power grid according to the embodiments of the present application comprehensively consider a plurality of historical input features, comprehensively capture various factors affecting line loss change, optimize a feature sequence by using graph embedding technology, further enhance correlations between features, then reconstruct historical input features by using a sliding time window, can realize dynamic updating and real-time processing of historical data, perform deep feature processing by using a self-attention network, can simultaneously extract time correlations and interaction information of multivariate sequences, sufficiently mine effective features of the multivariate sequences, can automatically learn nonlinear relationships in data, and thus obtain an accurate line loss change rate in the future, thereby providing support for intelligent decision-making of the power grid.
[0046] The beneficial effects of the second aspect embodiment are described with reference to the beneficial effects of the first aspect embodiment, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or related description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0048] Figure 1 is an application scenario of the photovoltaic high-penetration power grid line loss prediction method and device provided by an embodiment of the present application
[0049] Figure 2 is a flowchart of the photovoltaic high-penetration power grid line loss prediction method provided by an embodiment of the present application
[0050] Figure 3 is a schematic diagram of an adjacency matrix provided by an embodiment of the present application
[0051] Figure 4 is a structural schematic diagram of the photovoltaic high-penetration power grid line loss prediction device provided by an embodiment of the present application DETAILED DESCRIPTION
[0052] In the following description, specific details such as specific system structures, techniques, etc. are presented in order to thoroughly understand the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can 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 avoid unnecessary details that hinder the description of the present application.
[0053] It should be understood that when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or sets thereof.
[0054] It should also be understood that the term "and / or" used in the specification and the appended claims of the present application refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0055] In addition, in the description of the specification and the appended claims of the present application, the terms "first", "second", "third", etc. are only used for differentiation in description, and cannot be understood as indicating or implying relative importance.
[0056] Reference within the specification to "one embodiment" or "an embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in one embodiment" or "in some embodiments" in various places within specified sections of the specification are not necessarily all referring to the same embodiment, however, and are used to describe one or more embodiments of the application, unless otherwise specified. The terms "including," "containing," "having," and variations thereof are meant to encompass the terms "consisting of" and "consisting essentially of" unless otherwise noted.
[0057] In order to better understand the technical scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0058] Referring to Figure 1 Fig. 1 is an application scenario diagram of an embodiment of a line loss prediction method and device for a photovoltaic high-penetration power grid according to the present application. The prediction method and device run in a server 101. The server 101 is in communication connection with a database 102 and a plurality of terminals 103 through the Internet. The server 101 is an application program server that provides network services and application program services and processes service requests sent by the terminals 103. The database 102 is used to store files and various table data. The terminals 103 are data collection terminals for weather characteristics, active power of new energy power generation, load, and total line loss of the power grid.
[0059] Figure 2 Fig. 2 is a flowchart of a line loss prediction method for a photovoltaic high-penetration power grid according to an embodiment of the present application. Referring to Fig. 2, the line loss prediction method for the photovoltaic high-penetration power grid comprises the following steps. Figure 2
[0060] Step 201: Obtain a plurality of historical input characteristics of new energy grid connection.
[0061] The historical input features include weather features, new energy active power, load, and power grid bus loss, etc. Weather is an important factor affecting new energy power generation (especially solar and wind power). By collecting and analyzing historical weather data (such as temperature, wind speed, and light intensity), a more accurate new energy power generation prediction model can be established. Historical new energy active power data reflects the actual operation status and power generation capacity of new energy power generation equipment. By analyzing these data, the volatility and regularity of new energy power generation can be understood, providing a basis for subsequent power generation prediction and optimal 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, the variation law and characteristics of the load can be understood, providing a basis for power system scheduling and supply and demand balance. Power grid bus loss is an important indicator to measure the quality of power system operation. By collecting and analyzing historical power grid bus loss data, the loss of the power grid and the influencing factors can be understood.
[0062] The final output feature is the line loss change rate of each time point in the future time period compared with the previous time period. Therefore, before training, the line loss change rate of each time point in the historical time period compared with 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 fill in the missing values of all historical input features. For data with a large amount of missing values, the data is directly deleted. After the missing value processing of the data is completed, the data normalization processing is performed on each kind of feature.
[0064] In step 202, the correlation between the multiple historical input features is used for graph embedding, and the multiple historical input features are optimized to obtain an optimized feature sequence.
[0065] For example, step 202 includes:
[0066] In step 2021, each original feature sequence of the multiple historical input features is embedded into a node in the graph structure.
[0067] The multiple historical input features are embedded into the graph as multiple-component original feature sequences, and the internal relationship between the multiple-component original feature sequences is represented through the graph structure. In the graph embedding process, each original feature sequence is regarded as a node in the graph structure.
[0068] In step 2022, the paired correlation analysis is used to determine the edge information between any two nodes in the graph structure.
[0069] The edge information includes edge weights. The paired correlation analysis is used to determine the edge weights between any two nodes. Assuming that X and are two input original feature sequences, X and The features of the two nodes in the graph structure can be represented, and the edge weight between the two original feature sequences is represented by the absolute value of the Pearson coefficient of the two nodes corresponding to the historical sequence. The expression of the absolute value of the Pearson coefficient of the two nodes corresponding to the historical sequence is:
[0070]
[0071] wherein E is the edge weight between the 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, and Y i is the i-th element of the original feature sequence Y.
[0072] In step 2023, the edge information between the nodes in the graph structure is processed by using a sparse operation to obtain optimized edge information.
[0073] The nodes are interconnected, and the edge weight between some nodes is small and can be ignored. Therefore, a sparse operation is performed, that is, edges with small edge weights in the graph are deleted, and the threshold value of the edge weight is the lower limit of the box plot formed by all edge weights. In graph neural networks, the box plot usually refers to the box plot visualization of the node embedding space.
[0074] Node embedding refers to the process of mapping each node in a graph to a low-dimensional vector space. This vector is usually called a node embedding vector, which contains the structural and feature information of the node. Box plot is a commonly used statistical chart to show the distribution of data. In graph neural networks, box plot can be used to visualize the distribution of node embedding space. Box plot can be used to view the distribution of node embedding vectors in different dimensions. For example, a box plot can be drawn for each dimension to view the distribution range, median, quartile, etc. of the node embedding vector in that dimension. Compare the node embedding space distribution of different graph neural network models or different training parameters. By comparing different box plots, the influence of different models or parameters on the node embedding space can be evaluated. Identify abnormal nodes or outliers. The embedding vector of an abnormal node may be located at the edge of the box plot or beyond the range of the box plot, which can be identified through the box plot. Evaluate the generalization performance of the graph neural network model.
[0075] For example, the edge information between the nodes in the graph structure is processed by using a sparse operation to obtain optimized edge information, including: using a sparse operation to delete edges with edge weights less than a weight threshold in the graph structure; wherein the weight threshold is the lower limit of the box plot formed by all edge weights; and the remaining edges and edge weights in the graph structure are used as the optimized edge information.
[0076] The weight threshold value ε is specifically calculated as follows:
[0077] ε = QL - 1.5IQR (2)
[0078] wherein IQR is the interquartile range of the edge weight, that is, the difference between the upper quartile QU of the edge weight and the lower quartile QL of the edge weight.
[0079] In step 2024, an optimized adjacency matrix is determined based on the optimized edge information; the adjacency matrix represents an optimized feature sequence, and the optimized adjacency matrix is used to describe the graph structure.
[0080] wherein the edges with a weight less than ε in the original adjacency matrix are deleted, and the remaining edge weights form an optimized adjacency matrix A, as shown in Figure 3 .
[0081] While determining the optimized feature sequence, the historical input features are reconstructed into the feature structure of multiple image blocks through a sliding time window.
[0082] In this embodiment, the paired correlation analysis operation adopts the Pearson correlation coefficient, which can effectively measure the linear correlation degree between two variables. In new energy grid-connected data, different historical input features, such as weather features, new energy power generation, and load, often have complex mutual relationships. Using the Pearson correlation coefficient for paired correlation analysis 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 adversely affect data analysis and model construction. Through the lower threshold method of the box plot, the edges with weak correlation can be removed, that is, it is considered that these edge information has little contribution to the overall feature of describing the graph structure, which may be caused by noise or redundant data. In this way, not only the calculation amount can be reduced, but also the robustness and generalization ability of the model can be improved. Thus, the adjacency matrix not only reflects the direct relationship between the original feature sequence, but also removes unnecessary redundancy and noise through the sparsification operation, so that the representation of the feature sequence is more concise and effective.
[0083] In step 203, multiple historical input features are reconstructed by using a sliding time window to obtain a reconstructed feature sequence.
[0084] Then, step 203 includes:
[0085] The multiple historical input features are reconstructed into the 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 a reconstructed feature sequence.
[0086] Exemplarily, if the dimension of the adjacency matrix of each original feature sequence of the plurality of historical input features is N x N, the dimension of the reconstructed adjacency matrix is τN x τN; τ is the length of the sliding time window. The reconstructed adjacency matrix is composed of the original adjacency matrix A, the unit matrix E and the zero matrix O, and the reconstructed adjacency matrix is represented as:
[0087]
[0088] After steps 202 and 203 are performed in parallel, the optimized feature sequence and the reconstructed feature sequence are obtained, respectively. Next, the optimized feature sequence and the reconstructed feature sequence are input into the graph conversion network.
[0089] In step 204, the graph conversion network 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.
[0090] The reconstructed features are subjected to deep feature extraction by using the graph Transformer network, and are fused with the optimized feature sequence, and then a double-layer fully connected network is used to obtain the final predicted value. The output feature is the line loss change rate of each time point in a future time period compared with the last time period. When training the prediction network, the Huber function is used as the loss function and the Adam is used as the optimization algorithm.
[0091] Exemplarily, the graph conversion network includes an encoder (Encoder), a decoder (Decoder) and a fully connected layer. The Encoder encodes a variable-length input sequence into a fixed-length vector; the Decoder decodes a fixed-length vector into a variable-length output sequence.
[0092] The Encoder includes a plurality of first multi-head graph self-attention modules; and the Decoder includes a masked multi-head graph self-attention module and a second multi-head graph self-attention module.
[0093] The plurality of first multi-head graph self-attention modules are used to process the reconstructed feature sequence input into the Encoder, and the input of the reconstructed feature sequence of the first layer of each first multi-head graph self-attention module includes an input feature H l and a position encoding feature P l , H l ∈R N×C , P l ∈R N×C .
[0094] The position encoding feature is usually represented by a trigonometric function position encoding:
[0095]
[0096] wherein, The position encoding feature of the i-th node and the j-th time channel of the reconstructed feature sequence of the l-th layer is encoded, 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 odd, even represents even; N is the number of nodes, C is the number of time channels.
[0097] Then the processed reconstructed feature sequence and the optimized feature sequence are fused to obtain a vector correlation matrix with side information.
[0098] Before fusion, the query index (Query), the query key (Key) and the value (Value) of the first multi-head graph self-attention module are calculated, and the specific calculation process is as follows:
[0099]
[0100] Among them, Q l , K l and V l are the Query, Key and Value of the first multi-head graph self-attention module, respectively. and are the weights of the three perceptrons of the first multi-head graph self-attention module.
[0101] Then, the dot product of each vector in Query and each vector in Key is calculated to obtain the correlation Z l between Query and Key of the first multi-head graph self-attention module of the l-th layer.
[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 is multiplied by the adaptive side information at the corresponding position to obtain a vector correlation matrix with side information, which is normalized by Softmax to make the gradient stable during training, and the fusion is realized. After normalization, the vector correlation matrix A l of the first multi-head graph self-attention module of the l-th layer with side information after fusion is formed, which is represented as:
[0105]
[0106] Among them, E lThe edge information of the optimized feature sequence input into the first layer of the first multi-head graph self-attention module, C e The number of channels of the edge information, that is, the number of heads of the first multi-head graph self-attention module, and σ is a Softmax activation function.
[0107] It should be noted that the ordinary edge is the connection between the nodes in the graph, which is usually predefined and remains unchanged during the training of the graph neural network. The ordinary edge usually uses a fixed adjacency matrix or edge weight to describe the connection between the nodes. The update of the node depends on the information transmitted by the neighbor nodes through the ordinary edge. The adaptive edge can be dynamically generated or adjusted during the training according to the features of the nodes or the overall structure of the graph. The adaptive edge can capture the high-order relationship and global structure information between the nodes, and through the dynamic adjustment of the weight or the generation of new edges, the adaptive edge can capture the long-range dependence and high-order interaction between the nodes, thereby improving the expression ability of the graph neural network. The edge weight or connection relationship of the adaptive edge is dynamically calculated according to the node features or the global information of the graph. Common methods include attention mechanism and gating mechanism to realize the adaptive adjustment of the edge.
[0108] In the present embodiment, both the ordinary edge and the adaptive edge can be used. The ordinary edge describes the inherent topological structure of the graph structure, while the adaptive edge captures the high-order relationship between the nodes. The two types of edges complement each other and provide a more comprehensive and effective information transmission and node interaction mechanism for the graph conversion network, thereby improving the performance of the graph conversion network in various tasks.
[0109] The above process obtains the vector correlation matrix of the first layer of the first multi-head graph self-attention module, and the (l+1)th layer of the first multi-head graph self-attention module is analyzed next. The vector correlation matrix A l and V l of the first layer of the first multi-head graph self-attention module with edge information of each channel are averaged to obtain the vector features of all nodes in the next layer (l+1 layer):
[0110]
[0111] wherein H l+1 is the input feature of the reconstructed feature sequence of the (l+1)th layer of the first multi-head graph self-attention module, c is the cth channel of the first layer of the first multi-head graph self-attention module, and the number of channels of the first layer is generally set to 2, is the vector correlation matrix of the cth channel of the first layer of the first multi-head graph self-attention module.
[0112] After the processed reconstruction feature sequence and the optimized feature sequence are fused by the first multi-head graph self-attention module through multiple layers, a vector correlation matrix corresponding to all nodes with edge information is obtained, and then the vector correlation matrix is input into the decoder.
[0113] In the decoder part, the mask multi-head graph self-attention module is used to process the reconstruction feature sequence embedded with the zero sequence and the vector correlation matrix to obtain mask feature data, and the mask feature data is input into the second multi-head graph self-attention module.
[0114] The implementation of the zero sequence embedding is to set the predicted target part in the long input sequence received by the Decoder part to 0. If the Decoder part can receive complete input sequence information during prediction, information leakage may occur, thereby affecting the generalization ability of the model. By setting the part before the predicted target to 0, such information leakage can be avoided, and the model can focus more on current and future prediction.
[0115] For example, the purpose of using the mask multi-head graph self-attention mechanism is to generate output in a specific order when processing the input sequence. If no mask is added, the output at the current position may contain information of the next position, which obviously does not conform to the logic of sequential translation. The mask multi-head graph self-attention mechanism can prevent the model from using future information during training. The difference between the mask multi-head graph self-attention and the self-attention is that in the mask multi-head graph self-attention module, the correlation between each vector is obtained through Q l , K l and the mask matrix M l .
[0116] For example, the correlation Z′ l between each vector in the mask feature data is represented as:
[0117]
[0118] wherein Z′ l ∈R N×N , Q l is the query index of the lth layer of the first multi-head graph self-attention module, K l is the query key of the lth layer of the first multi-head graph self-attention module, M l is the mask matrix of the mask multi-head graph self-attention module corresponding to the lth 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 configured to obtain a final input feature sequence based on the correlation between each vector in the mask feature data and input the final input feature sequence into a fully connected layer; and the fully connected layer is configured to output a predicted value of the final line loss change rate.
[0120] The second multi-head graph self-attention module is configured to obtain a final input feature sequence based on the correlation between each vector in the mask feature data and input the final input feature sequence into a fully connected layer; and the fully connected layer is configured to output a predicted value of the final line loss change rate. l The final vector correlation matrix with edge information is obtained by performing a multiplication operation on the corresponding positions of the adaptive edge information and the vector correlation matrix Z' (i). f The final input feature sequence H (i) of the processed data is input into a double-layer fully connected layer for deep feature extraction. f The final input feature sequence H (i) of the processed data is input into a double-layer fully connected layer for deep feature extraction.
[0121] The fully connected layer includes a first fully connected layer and a second fully connected layer. The first fully connected layer is configured to adjust the number of channels so that the number of channels is equal to the time length of the prediction domain; and the second fully connected layer is connected with the first fully connected layer and is configured to adjust the number of nodes so that the number of nodes is equal to the number of nodes in the original space.
[0122] The first fully connected layer can be a syntax module, and the second fully connected layer can be a regression module. The last input feature of the syntax module is calculated by the two-layer fully connected regression module to obtain an output sequence, i.e., a predicted value of the final line loss change rate. The expression of the output sequence is as follows:
[0123]
[0124] wherein σ is a Selu activation function, W1 is a weight coefficient matrix in the first fully connected layer, W2 is a weight coefficient matrix in the second fully connected layer, H (i) is the final input feature sequence input into the first fully connected layer, and H (i) is the final input feature sequence output by the first fully connected layer. f The final input feature sequence H (i) is the final input feature sequence input into the first fully connected layer, and H (i) is the final input feature sequence output by the first fully connected layer. f The number of nodes of the reconstructed graph of each reconstructed feature sequence is the same.
[0125] The prediction model needs to be trained with a large number of samples before use. In the model training process, the Adam algorithm is used as the training optimizer, and the Huber function is selected as the loss function of the output layer. The expression of the Huber function is as follows:
[0126]
[0127] Wherein, delta is a hyper parameter, the size determines the Huber loss function on the MSE and MAE, Huber loss function has the advantages of MSE and MAE, reduces the sensitivity problem to outliers, realizes everywhere derivable function.
[0128] In summary, the line loss prediction method of the photovoltaic high penetration power grid provided by the embodiment of the application comprehensively considers various historical input characteristics, comprehensively captures various factors affecting line loss change, optimizes the characteristic sequence by using graph embedding technology, further enhances the correlation between characteristics, then reconstructs the historical input characteristics by using a sliding time window, can realize dynamic updating and real-time processing of historical data, uses a self-attention network for deep feature processing, can simultaneously extract the time correlation and interaction information of multivariate sequences, fully excavates the effective features of multivariate sequences, can automatically learn the nonlinear relationship in the data, so as to obtain the accurate line loss change rate in the future, and provide support for intelligent decision-making of the power grid.
[0129] The multi-element time series provided after the new energy is connected to the grid is fully considered, a graph embedding analysis method is used, the graph structure representation of the internal relationship of the multivariate sequence is obtained by using the paired correlation analysis and the sparsity method, and is embedded into the feature extraction module in the form of an adjacency matrix, so that the multivariate sequence features can be fused in the feature extraction. The historical features are segmented into multiple patches by using the sliding time window method, and then the features are extracted, so that the time correlation and interaction information of each multivariate sequence can be obtained simultaneously. And a graph Transformer model prediction method is used, the time correlation and interaction information between different features of the historical data can be simultaneously mined, hidden features can be extracted, the global information of all input features can be better mined, and the prediction accuracy is improved by fully utilizing the hidden features of the observable information.
[0130] Referring to Figure 4 The embodiment of the application provides a line loss prediction device of a photovoltaic high penetration power grid, which executes the line loss prediction method of the photovoltaic high penetration power grid as described above, and comprises 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 for acquiring a plurality of historical input characteristics; the historical input characteristics include weather characteristics, new energy active power, load and power grid bus loss.
[0132] The feature optimization module 302 is used for performing graph embedding based on the correlation between the plurality of historical input characteristics, optimizing the plurality of historical input characteristics, and obtaining an optimized characteristic sequence.
[0133] The feature reconstruction module 303 is used for reconstructing the plurality of historical input characteristics by using a sliding time window to obtain a reconstructed characteristic sequence.
[0134] The feature processing and prediction output module 304 is configured to process the optimized feature sequence and the reconstructed feature sequence by using a graph conversion network, and output a predicted value of the final line loss change rate.
[0135] For example, the feature optimization module 302 is specifically configured to:
[0136] embed each original feature sequence of the plurality of historical input features into a node in a graph structure;
[0137] determine edge information between any two nodes in the graph structure by using a pair correlation analysis;
[0138] process the edge information between the nodes in the graph structure by using a sparsification operation to obtain optimized edge information;
[0139] determine an optimized adjacency matrix based on the optimized edge information; the adjacency matrix represents the optimized feature sequence, and the optimized adjacency matrix is used to describe the graph structure.
[0140] For example, the edge information includes edge weights.
[0141] In the feature optimization module 302, the edge information between the nodes in the graph structure is processed by using the sparsification operation to obtain the optimized edge information, including:
[0142] delete edges with edge weights less than a weight threshold in the graph structure by using the sparsification operation; the weight threshold is a lower limit of a box plot formed by all the edge weights;
[0143] use the remaining edges and edge weights in the graph structure as the optimized edge information.
[0144] For example, in the feature optimization module 302, the plurality of historical input features are reconstructed by using a sliding time window to obtain a reconstructed feature sequence, including:
[0145] reconstruct the plurality of historical input features into a feature structure of a plurality of image blocks by using the sliding time window;
[0146] determine a reconstructed adjacency matrix of each image block in the feature structure based on a length of the sliding time window; the reconstructed adjacency matrix represents the reconstructed feature sequence.
[0147] For example, if the dimension of the adjacency matrix of each original feature sequence of the plurality of 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 comprises an encoder, a decoder and a fully connected layer; wherein the encoder comprises a first multi-head graph self-attention module of multiple layers; the decoder comprises a masked multi-head graph self-attention module and a second multi-head graph self-attention module;
[0149] The first multi-head graph self-attention module of multiple layers is used for processing the reconstructed feature sequence input into the encoder, and fusing the processed reconstructed feature sequence and the optimized feature sequence to obtain a vector correlation matrix with edge information, and inputting the vector correlation matrix into the masked multi-head graph self-attention module;
[0150] The masked multi-head graph self-attention module is used for processing the reconstructed feature sequence embedded with a zero sequence and the vector correlation matrix to obtain masked feature data, and inputting the masked feature data into the second multi-head graph self-attention module;
[0151] The second multi-head graph self-attention module is used for obtaining a final input feature sequence based on the correlation between each vector in the masked feature data, and inputting the final input feature sequence into the fully connected layer;
[0152] The fully connected layer is used for outputting 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 masked feature data l is represented as:
[0154]
[0155] wherein Q l is the query index of the lth layer of the first multi-head graph self-attention module, K l is the query key of the lth layer of the first multi-head graph self-attention module; M l is the mask matrix of the masked multi-head graph self-attention module corresponding to the lth layer of the first multi-head graph self-attention module; is a tensor product operation.
[0156] Exemplarily, in the feature processing and prediction output module 304, the fully connected layer comprises a first fully connected layer and a second fully connected layer;
[0157] The first fully connected layer is used for adjusting 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 with the first fully connected layer, and is used for adjusting the number of nodes so that the number of nodes is equal to the number of nodes of the original space.
[0159] Exemplarily, in the feature processing and prediction output module 304, the predicted value of the final line loss change rate The expression is:
[0160]
[0161] wherein, σ is a Selu activation function, W1 is a weight coefficient matrix in the first fully connected layer; W2 is a weight coefficient matrix in the second fully connected layer; H f is the final input feature sequence input into 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 foregoing detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments 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 embodied by multiple units / modules.
[0163] Further, although the operations of the method of the present application are described in a particular order in the accompanying drawings, this is not required or implied as to the particular order or that all of the illustrated operations be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, combined into a single step, and / or divided into multiple steps.
[0164] The present application also provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, when the processor executes the computer execution instructions, the line loss prediction method for photovoltaic high-penetration power grid provided by the above-mentioned embodiments of the present application is realized.
[0165] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in a certain embodiment can be referred to the relevant description of other embodiments.
[0166] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should 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 various historical input characteristics of renewable energy grid connection; these historical input characteristics include weather characteristics, active power of renewable energy generation, load, and grid bus losses; Graph embedding is performed based on the correlation between the various historical input features to optimize the various historical input features and obtain an optimized feature sequence; The various historical input features are reconstructed using a sliding time window to obtain a reconstructed feature sequence; A graph transformation network is used to process the optimized feature sequence and the reconstructed feature sequence, and outputs the predicted value of the final line loss rate of change. The graph transformation network includes an encoder, a decoder, and a fully connected layer. The encoder includes a multi-layered 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-layered first multi-head graph self-attention module processes the reconstructed feature sequence input to the encoder and fuses the processed reconstructed feature sequence with the optimized feature sequence to obtain a vector correlation matrix with edge information. This vector correlation matrix is then input to the masked multi-head graph self-attention module. The masked multi-head graph self-attention module processes the reconstructed feature sequence with embedded zero sequences and the vector correlation matrix to obtain masked feature data, which is then input to the second multi-head graph self-attention module. The second multi-head graph self-attention module uses the correlation between each vector in the masked feature data to obtain the final input feature sequence, which is then input to the fully connected layer. The fully connected layer outputs the predicted value of the final line loss rate of change.
2. The method for predicting line losses in a high-penetration photovoltaic power grid as described in claim 1, characterized in that, The step of performing graph embedding based on the correlation between the various historical input features to optimize the various historical input features and obtain an optimized feature sequence includes: Embed each original feature sequence of multiple historical input features into nodes in a graph structure; Pairwise correlation analysis is used to determine the edge information between any two nodes in the graph structure; By using sparsification operations to process the edge information between nodes in the graph structure, optimized edge information is obtained. Based on the optimized edge information, an optimized adjacency matrix is determined; the adjacency matrix represents the optimized feature sequence and is used to describe the graph structure.
3. The method for predicting line losses in a high-penetration photovoltaic power grid as described in claim 2, characterized in that, The edge information includes edge weights; The process of using sparsity operations to process edge information between nodes in the graph structure to obtain optimized edge information includes: The sparsity operation is used to delete edges in the graph structure whose weights are less than a weight threshold; wherein, the weight threshold is the lower limit of the box graph formed by all edge weights; The remaining edges and edge weights in the graph structure are used as the optimized edge information.
4. The method for predicting line losses in a high-penetration photovoltaic power grid as described in claim 1, characterized in that, The process of reconstructing the multiple historical input features using a sliding time window to obtain a reconstructed feature sequence includes: The various historical input features are reconstructed into feature structures for multiple image blocks by using a sliding time window; Based on the length of the sliding time window, the reconstructed adjacency matrix of each image block in the feature structure is determined; the reconstructed adjacency matrix represents the reconstructed feature sequence.
5. The method for predicting line losses in a high-penetration photovoltaic power grid as described in claim 4, characterized in that, If the dimension of the adjacency matrix of each original feature sequence of the various historical input features is Then the dimension of the reconstructed adjacency matrix is ; The length of the sliding time window.
6. The method for predicting line losses in a high-penetration photovoltaic power grid as described in claim 1, characterized in that, The correlation between each vector in the mask feature data Represented as: Among them, China For the first multi-head graph self-attention module Layer query index, For the first multi-head graph self-attention module l The query key for the layer; The masked multi-head graph self-attention module corresponds to the first multi-head graph self-attention module. l The mask matrix of the layer; This is for tensor product operations.
7. The method for predicting line losses in a high-penetration photovoltaic power grid as described in claim 1, 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.
8. The method for predicting line losses in a high-penetration photovoltaic power grid as described in claim 7, characterized in that, The predicted value of the final line loss change rate The expression is: in, For Selu activation function, This is the weight coefficient matrix in the first fully connected layer; This is the weight coefficient matrix in the second fully connected layer; This is the final input feature sequence for the first fully connected layer.
9. A line loss prediction device for a photovoltaic high-penetration power grid, employing the line loss prediction method for a photovoltaic high-penetration power grid as described in any one of claims 1 to 8, characterized in that, include: The feature acquisition module is used to acquire various historical input features, including weather features, active power of new energy generation, load, and grid bus loss. The feature optimization module is used to perform graph embedding based on the correlation between the various historical input features, and to optimize the various historical input features to obtain an optimized feature sequence; The feature reconstruction module is used to reconstruct the various historical input features using a sliding time window to obtain a reconstructed feature sequence; A feature processing and prediction output module is used to process the optimized feature sequence and the reconstructed feature sequence using a graph transformation network, and output the predicted value of the final line loss rate of change. The graph transformation network includes an encoder, a decoder, and a fully connected layer. The encoder includes a multi-layered 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-layered first multi-head graph self-attention module processes the reconstructed feature sequence input to the encoder and fuses the processed reconstructed feature sequence with the optimized feature sequence to obtain a signal with side signals. The vector correlation matrix of the information is input into the masked multi-head graph self-attention module; the masked multi-head graph self-attention module processes the reconstructed feature sequence with embedded zero sequences and the vector correlation matrix to obtain masked feature data, and inputs the masked feature data into the second multi-head graph self-attention module; the second multi-head graph self-attention module obtains the final input feature sequence based on the correlation between each vector in the masked 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.
Citation Information
Patent Citations
Establishment method of power grid line loss rate prediction model
CN106156892A
Power distribution network line loss prediction method based on maximum mutual information coefficient and deep learning
CN114881338A