Power distribution network harmonic prediction method and device based on cascade space-time diagram network
Through the method based on the cascading spatio-temporal graph network, high-precision prediction of the 2-25 harmonic voltage content rate and total harmonic distortion rate in the distribution network is realized, and the problems of low harmonic prediction accuracy and high cost in the existing technology are solved, and real-time response to dynamic changes in the power grid topology are supported.
Patent Information
- Application Number
- CN202510690087.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The prior art is difficult to achieve accurate prediction of harmonics in distribution networks, especially in terms of time dimensions and spatial propagation, and there are problems of high deployment costs and limited prediction accuracy.
Using a cascading space-time graph network method, a cascading architecture based on single-point timing prediction, spatial estimation and index fusion calculation can realize high-precision prediction of the 2-25th harmonic voltage content rate of the full nodes of the distribution network and automatic calculation of the total harmonic distortion rate.
The accurate estimation of the 2-25th harmonic voltage content rate and the total distortion rate of the harmonic voltage of the unmeasured node is realized, which reduces the cost of the monitoring system and supports real-time response to dynamic changes in the power grid topology.
Smart Images

Figure CN120222367A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power quality monitoring of distribution networks, and particularly to a method and device for predicting harmonics in distribution networks based on a cascaded spatio-temporal graph network. Background Art
[0002] In recent years, with the large-scale access of distributed new energy and nonlinear loads, the problem of harmonic pollution in distribution networks has become increasingly serious. Excessive harmonic content can lead to safety hazards such as overheating of transformers, misoperation of relay protection, and reduced energy efficiency, thus causing serious economic and safety losses. Therefore, accurately predicting the propagation distribution of harmonics is the key to optimizing harmonic suppression strategies and ensuring the safe and stable operation of the power grid. However, the existing technical solutions have significant limitations: traditional harmonic analysis in power systems mainly relies on harmonic state estimation, which is essentially a static fitting inversion of harmonic parameters at grid nodes. It can only evaluate the harmonic distribution state at the same moment based on redundant measurement data, and can neither achieve the prediction function in the time dimension nor, due to relying on high-density measurement devices, lead to high deployment costs in actual engineering; although neural network technology has been introduced in recent years to break through the static analysis bottleneck of traditional methods, existing research mostly focuses on harmonic signal feature recognition or harmonic time series prediction for single nodes or single nonlinear loads, and its model architecture does not consider the spatio-temporal coupling characteristics of harmonic propagation among multiple nodes in the distribution network, resulting in the inability of the model to estimate harmonic parameters of unmeasured nodes using grid topology information in actual applications, and the need to deploy additional interpolation algorithms with limited accuracy; at the same time, due to the lack of a collaborative learning mechanism for harmonic time series characteristics and spatial propagation laws, spatio-temporal decoupled modeling leads to distortion of harmonic phase information during cross-module transmission; in addition, existing neural networks generally adopt an end-to-end black box structure and do not embed physical constraints such as harmonic energy conservation and fundamental-harmonic power coupling, and are prone to generate incorrect predictions that violate electrical laws when the training data is insufficient or the operating conditions of the power grid change suddenly. Summary of the Invention
[0003] In view of the above problems, the present invention proposes a method for predicting harmonics in distribution networks based on a cascaded spatio-temporal graph network. This method realizes high-precision prediction of the harmonic voltage content rate (HRU) of 2 - 25 times and automatic calculation of the total harmonic distortion rate (THD) for all nodes in the distribution network through a cascaded architecture of single-point time series prediction, spatial estimation, and index fusion calculation. The present invention applies time series - space joint modeling to harmonic analysis, and effectively improves the prediction accuracy of node harmonic THD in dynamic topology and sparse measurement scenarios through network cascading of multifunctional modules, and can be integrated into the power grid energy management system to provide real-time decision support for harmonic governance.
[0004] One of the objectives of the present invention is achieved by adopting the following technical solutions: A method for predicting harmonics in distribution networks based on a cascaded spatio-temporal graph network, the method comprising the following steps:
[0005] Step 1: Collect the historical time-series data of the injected active power, reactive power of the deployed measurement nodes in the distribution network, and the harmonic voltage content rate of the 2nd to 25th harmonics, perform single-point time-series prediction, and obtain the predicted values of the harmonic voltage content rate of the 2nd to 25th harmonics corresponding to each measurement node;
[0006] Step 2: According to the predicted values of the harmonic voltage content rate of each harmonic of the deployed measurement nodes obtained in Step 1, combined with the distribution network topology information and the predicted values of the injected active power and reactive power of all nodes, establish the mapping relationship between the harmonic voltages of the existing measurement nodes and the harmonic voltages of the unmeasured nodes through spatial estimation, and then obtain the predicted values of the harmonic voltage content rate of the unmeasured nodes;
[0007] Step 3: According to the predicted values of the harmonic voltage content rate of each harmonic of all nodes obtained in Step 1 and Step 2, perform index fusion calculation to obtain the predicted values of the total harmonic distortion rate of the harmonic voltage of each node.
[0008] Further, the single-point time-series prediction in Step 1 is implemented based on the Transformer architecture. The historical time-series data of the distribution network measurement nodes are collected to form feature vectors, which are divided into multiple local time blocks according to the time dimension to form a block sequence. Each feature channel of the feature vector is independently linearly projected to generate a channel-specific block embedding representation. After splicing, a learnable position encoding is superimposed to form an initial embedding representation, which is input into the encoder composed of channel-independent multi-head self-attention layers. Each layer calculates the multi-head attention weights, and the outputs of each attention head are weighted and aggregated. After splicing, a linear transformation is performed to generate multi-head attention features, which are spliced into a complete vector and used as the input of the next layer until the final output of the encoder is obtained. Based on the decoder prediction head, the predicted values of the harmonic HRU of each harmonic in the future minutes are generated through a channel-independent linear projection layer.
[0009] Further, the spatial estimation in Step 2 is implemented based on the graph neural network architecture. The specific architecture and operation process include the following steps:
[0010] Step 2.1: Based on the electrical connection relationship and node admittance matrix of the distribution network, construct an undirected weighted graph , where the node set contains all the measured nodes and unmeasured nodes in the distribution network topology; the edge set represents the node pairs with direct electrical connection; the edge weight of the adjacency matrix is obtained by normalizing the reciprocal of the harmonic impedance amplitude between nodes;
[0011] Step 2.2: The future The predicted values of the harmonic voltage content rate for each minute and the predicted values of the active power and reactive power injected into all nodes are used as the initial node features;
[0012] Step 2.3: Use the hopping graph attention mechanism to perform neighbor node message passing, complete message aggregation, fuse the previous hop state of the current node with the aggregated message, update the node state, perform channel-sensitive weighting on the K-hop output, complete adaptive fusion, and generate the predicted values of the harmonic voltage content rate for each order of the final unmeasured node.
[0013] Furthermore, the index fusion calculation in step 3 is implemented based on the artificial neural network ANN architecture. The specific architecture and operation process include the following steps:
[0014] Step 3.1: The predicted values of the harmonic voltage content rate for each order of the measured nodes obtained by single-point time series prediction , and the predicted values of the harmonic voltage content rate for each order of the unmeasured nodes obtained by spatial estimation , are concatenated into a full-node harmonic data matrix according to the node dimension. For each node-time step combination , the feature vector is extracted and input into the artificial neural network ANN:
[0015] Step 3.2: For each node-time step combination the feature vector is subjected to adaptive normalization calculation. By dynamically adjusting the scaling coefficients of each harmonic channel, enhanced perception of each order of harmonics is achieved:
[0016]
[0017] Among them, is the enhanced feature vector, and are the mean and standard deviation, which are updated every 5 minutes according to historical data; is the Hadamard product; and are the learnable scaling and offset parameters, initialized to , ; is the numerical stability constant, h represents the hth harmonic, and represent the learnable scaling and offset parameters of the hth harmonic;
[0018] Step 3.3: The enhanced feature vector is input into a fully connected network containing L residual blocks. The structure of each residual block is as follows:
[0019]
[0020] Among them, and are the weight matrix and bias vector in the -th residual block respectively, GELU is the activation function, Dropout represents random inactivation, and LayerNorm represents layer normalization; the initial input of the fully connected network is , satisfying: ; among them, is a linear transformation that maps the enhanced feature vector to the hidden space of the network to make it conform to the input dimension of the residual block, represents the output of the -th residual block;
[0021] After passing through L residual blocks, the network finally outputs the predicted values of the total harmonic distortion rate of the harmonic voltage at each node.
[0022] Furthermore, the construction of the undirected weighted graph supports dynamic topology update. When the topology of the distribution network changes, the harmonic propagation path information of the input network is adaptively adjusted by real-time updating the adjacency matrix and edge weights estimated in the space.
[0023] Furthermore, the cascaded spatio-temporal graph network includes three parts: a single-point time series prediction module, a space estimation module, and an index fusion calculation. The training method adopts a phased training strategy, which specifically includes the following steps:
[0024] Step A: Based on the training data set, the historical time series data of each node is intercepted by a sliding time window, and the single-point time series prediction part is independently pre-trained; in this stage, a phase-sensitive loss function is designed, which combines the dynamic time warping DTW term with the harmonic voltage amplitude error to constrain the phase alignment accuracy of the harmonic waveform; the loss function The complete expression is:
[0025]
[0026] Among them, respectively represent the true value and predicted value of the -th harmonic voltage of the -th node, is a hyperparameter, represents the dynamic time warping calculation;
[0027] Step B: Based on the space estimation, jointly optimize the space topology features and the predicted values of the harmonic voltage. N represents the total number of nodes; the harmonic coupling between nodes is modeled through the graph attention mechanism, and the loss function is defined as:
[0028]
[0029] Among them, \(E\) represents the edge set of the network topology; is the predicted value of the harmonic voltage content rate of the \(h\)-th harmonic of node \(i\); is the predicted value of the harmonic voltage content rate of the \(h\)-th harmonic of node \(j\); is the predicted value of the harmonic current of line \(ij\). If there is no relevant predicted value for some lines, it is taken as 0; is the \(h\)-th impedance of line \(ij\), is a hyperparameter used to balance the weights of the impedance relationship term and the topology constraint term. KLD represents the KL divergence, is the dynamic graph attention weight distribution learned and calculated by the jump graph attention mechanism, is the prior knowledge distribution of the network topology, satisfying:
[0030]
[0031] Among them, represents the topological prior knowledge of line \(ij\), is the line weight of line \(ij\), the weight of edge \(kl\) of the network topology, is the line impedance of line \(ij\). The first term in the above loss function enforces the harmonic voltage-current impedance relationship between nodes; the second term, the KL divergence, constrains the consistency between the graph attention weight distribution and the topological prior knowledge When the spatial estimation error fluctuates stably within the interval, the parameter solidification is completed;
[0032] Step C: Freeze the parameters of the time-sequence - space module and construct the fusion loss function is:
[0033]
[0034] Among them, and are weight hyperparameters; and are respectively the predicted value and the true value of the total harmonic distortion THD of the harmonic voltage of node \(i\); is the total number of nodes; is the Hadamard product; is the predicted value of the harmonic voltage content rate of the 2 - 25th harmonics of node \(i\); is the weight vector of each node. The first term in the above function is the mean square error main loss term; the second term is the harmonic order weighted correction term. When the error of the validation set decreases by less than 0.5% for 5 consecutive training cycles, it is determined to converge and its network parameters are frozen.
[0035] Furthermore, the distribution of the measurement nodes satisfies the connectivity constraint of the distribution network topology.
[0036] In a second aspect, the present invention further provides a distribution network harmonic prediction device based on a cascaded spatio-temporal graph network, which includes a processor, a storage medium, and a computer program. The computer program is stored in the storage medium, and when the computer program is executed by the processor, the distribution network harmonic prediction method based on the cascaded spatio-temporal graph network is implemented.
[0037] In a third aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the distribution network harmonic prediction method based on the cascaded spatio-temporal graph network is implemented.
[0038] In a fourth aspect, the present invention further provides a computer program product, including a computer program. When the computer program is executed by a processor, a distribution network harmonic prediction method based on the cascaded spatio-temporal graph network is implemented.
[0039] Advantages of the present invention:
[0040] (1) Through the cascaded spatio-temporal graph network architecture, the present invention collaboratively models temporal and spatial features, breaking through the limitations of traditional harmonic prediction and analysis methods that rely on steady-state assumptions, ignore topological correlations, and cannot cover unmeasured nodes. It realizes the accurate estimation of the harmonic voltage content rate and the total harmonic voltage distortion rate of 2 - 25 times for unmeasured nodes, and supports real-time response to dynamic changes in the power grid topology, which can effectively reduce the cost of the monitoring system.
[0041] (2) By integrating the physical constraint of harmonic energy conservation and the online fine-tuning mechanism through the artificial neural network module, the present invention breaks through the limitation of the traditional THD calculation that relies on the linear superposition formula, resulting in phase errors, and reduces the calculation error of the total harmonic distortion rate, providing an accurate regulation benchmark for harmonic control equipment. Description of the Drawings
[0042] Figure 1 It is an architecture diagram of a distribution network harmonic prediction method based on a cascaded spatio-temporal graph network in Embodiment 1.
[0043] Figure 2 It is an architecture diagram of the single-point time series prediction module in Embodiment 1.
[0044] Figure 3 It is an architecture diagram of the spatial estimation module in Embodiment 1.
[0045] Figure 4 It is an architecture diagram of the index fusion calculation module in Embodiment 1.
[0046] Figure 5 It is a flow chart of the cascaded spatio-temporal graph network staged training strategy in Embodiment 2.
[0047] Figure 6It is the network topology diagram of the IEEE 33-node case in Embodiment 3.
[0048] Figure 7 It is the electrical model of the new energy photovoltaic injection node power generation unit and the output values of partial sub-harmonic currents in Embodiment 3.
[0049] Figure 8 It is the Norton equivalent model diagram adopted by the non-linear load access node in Embodiment 3.
[0050] Figure 9 It is the true values and predicted values of the partial sub-harmonic voltage content rates of the existing measurement node 33 in Embodiment 3.
[0051] Figure 10 It is the true values and predicted values of the partial sub-harmonic voltage content rates of the unmeasured node 28 in Embodiment 3.
[0052] Figure 11 It is the true values and predicted values of the total harmonic voltage distortion rates of each node in Embodiment 3 at a certain predicted time section.
[0053] Figure 12 It is the structural block diagram of a distribution network harmonic prediction device based on a cascaded spatio-temporal graph network in Embodiment 4. Specific implementation manners
[0054] The present invention will be described in more detail below with reference to the accompanying drawings. It should be noted that the description of the present invention with reference to the accompanying drawings below is illustrative rather than restrictive. Various different embodiments can be combined with each other to form other embodiments not shown in the following description.
[0055] Embodiment 1: Embodiment 1 provides a distribution network harmonic prediction method based on a cascaded spatio-temporal graph network, aiming to utilize the historical time series data of the harmonic voltage content rates of limited nodes in the distribution network and the injection power of all nodes, and through a cascaded spatio-temporal graph network composed of a single-point time series prediction module, a spatial estimation module, and an index fusion calculation module, to achieve high-precision prediction of the 2-25th harmonic voltage content rate (HRU) of all nodes in the distribution network and automatic calculation of the total harmonic distortion rate (THD).
[0056] As Figure 1 shown, a distribution network harmonic prediction method based on a cascaded spatio-temporal graph network includes the following steps:
[0057] Step 1: Collect the historical time series data of the injected active power, reactive power, and 2-25th harmonic voltage content rates of the deployed measurement nodes in the distribution network, input them into the single-point time series prediction module, and obtain the predicted values of the 2-25th harmonic voltage content rates corresponding to each measurement node. Among them, the single-point time series prediction module is implemented based on the Transformer architecture as Figure 2As shown, the specific architecture and operations include the following steps:
[0058] Step 1.1: Define the historical event window length as minutes, with a time resolution of 1 minute. Collect the historical time-series data of the measurement nodes in the distribution network, including the harmonic voltage content rate of the 2nd - 25th harmonics , the injected active power and the reactive power , and form a feature vector with a feature dimension of :
[0059]
[0060] Divide the feature vectors for consecutive minutes into multiple local time blocks along the time dimension to form a block sequence :
[0061]
[0062] Among them, is the time length of a single block (default value is 16 minutes), represents the feature vector of the th block; is the sliding step between adjacent blocks (default value is 8 minutes); is the total number of blocks, .
[0063] Step 1.2: Independently perform linear projection on each feature channel of the feature vector to generate a channel-specific block embedding representation :
[0064]
[0065] Among them, is the th block of the cth feature channel of the input block sequence ; is the learnable projection matrix of the cth channel, with a default value of 64; is the bias vector of the cth channel in the encoder.
[0066] Concatenate the embedding vectors of all channels and then add the learnable position encoding to form the initial embedding representation :
[0067]
[0068] Among them, is the block-level position encoding matrix. This step assigns absolute temporal position information to each block through position encoding while maintaining the independence of different harmonic features.
[0069] Step 1.3: Input the generated embedding representation into an encoder composed of layers of channel-independent multi-head self-attention sub-layers stacked. Each layer splits the input into independent sub-tensors along the channel dimension:
[0070]
[0071] where is the block embedding sequence corresponding to the th feature channel in the th layer; represents the tensor slicing operation, indicating slicing the three-dimensional tensor with shape along the channel dimension to obtain the data of all blocks and embedding dimensions corresponding to the cth channel;
[0072] For each feature channel, query vectors , , are generated through learnable parameter matrices , key vectors , value vectors . The multi-head attention weights are calculated, and the outputs of each attention head are weighted and aggregated. After concatenation, the multi-head attention features are generated through a linear transformation. The embedding representation is updated through residual connection Concat and layer normalization LayerNorm:
[0073]
[0074]
[0075]
[0076]
[0077]
[0078] where is the number of attention heads; is the channel-specific output projection matrix;
[0079] The updated embeddings of each channel are re-concatenated into a complete tensor as the input for the next layer :
[0080]
[0081] According to the above method, Layer attention sublayer to obtain the final output of the encoder .
[0082] Step 1.4: Output the encoder Input decoder prediction head, generate future HRU prediction value of each harmonic in minutes :
[0083]
[0084] in, For Channel The projection matrix, Predicting header channels for the decoder The bias vector of .
[0085] Step 2: Based on the predicted values of the harmonic voltage content of the deployed measurement nodes obtained in step 1, combined with the distribution network topology information and the predicted values of active power and reactive power injected into all nodes, the spatial estimation module is used to establish a mapping relationship between the harmonic voltages of the existing measurement nodes and the harmonic voltages of the unmeasured nodes, and then obtain the predicted values of the harmonic voltage content of the unmeasured nodes. The spatial estimation module is implemented based on the graph neural network architecture. Figure 3 As shown, the specific architecture and operation process include the following steps:
[0086] Step 2.1: Construct an undirected weighted graph based on the electrical connection relationship and node admittance matrix of the distribution network , where the node set Contains all measured nodes and unmeasured nodes in the distribution network topology; edge set Represents pairs of nodes that are electrically directly connected; adjacency matrix The edge weight It is obtained by normalizing the inverse of the harmonic impedance amplitude between nodes. The calculation formula is:
[0087]
[0088] in, For Node and Between Impedance value under subharmonics.
[0089] The construction of the undirected weighted graph supports dynamic topology updates. When the topology of the distribution network changes, the adjacency matrix and edge weights of the spatial estimation module are updated in real time to adaptively adjust the harmonic propagation path information of the input network.
[0090] Step 2.2: Use the predicted values of the harmonic voltage content rates of each harmonic order at the measurement nodes in the future minutes output by the single-point time series prediction module and the predicted values of the active and reactive power injections at all nodes as the initial node features , where is the number of measurement nodes, is the order of each predicted harmonic, and the superscript represents the th minute:
[0091]
[0092] Among them, respectively represent the predicted values of the harmonic voltage content rates, injected active power, and reactive power at the th minute;
[0093] Step 2.3: Adopt the skip graph attention mechanism for neighbor node message passing, and repeat the following operations for each hop :
[0094] Aggregate the neighbor nodes of node to calculate the weighted message :
[0095]
[0096] Among them, is the learnable message transformation matrix, represents the node feature of the neighbor node j at the (k - 1)th hop; is the dynamic attention weight, and the calculation formula is:
[0097]
[0098] Among them, is the learnable parameter vector, and LeakyReLU represents the rectified linear unit function;
[0099] After completing the message aggregation, fuse the state of the previous hop of this node with the aggregated message to update the node state:
[0100]
[0101] Among them, is the learnable matrix.
[0102] Step 2.4: Perform channel-sensitive weighting on the K-hop output, complete adaptive fusion, and generate the predicted value of the harmonic voltage content rate of each order for the final unmeasured node :
[0103]
[0104] wherein, is the weight coefficient of the h-th harmonic for the k-th hop; for the h-th harmonic; for the k-th hop; is the harmonic output matrix.
[0105] Step 3: Based on the predicted values of the harmonic voltage content rate of each order of each node obtained in Steps 1 and 2, input them into the index fusion calculation module, and further obtain the predicted value of the total harmonic distortion rate of the harmonic voltage of each node. Among them, the spatial estimation module is implemented based on the artificial neural network ANN architecture as Figure 4 shown, and the specific architecture and operation process include the following steps:
[0106] Step 3.1: Concatenate the predicted values of the harmonic voltage content rate of each order of the measured nodes output by the single-point time series prediction module , and the predicted values of the harmonic voltage content rate of each order of the unmeasured nodes output by the spatial estimation module , into a full-node harmonic data matrix by node dimension. For each node-time step combination , extract the following feature vectors and input them into the artificial neural network ANN:
[0107]
[0108] wherein, represents the harmonic content rate of the h-th harmonic in the i-th node at the t-th time step; the whole radical represents the harmonic THD calculated using the harmonic content rates of the 2nd to 25th harmonics in the i-th node at the t-th time step;
[0109] Step 3.2: Perform adaptive normalization calculation on the above feature vectors, and realize enhanced perception of each harmonic by dynamically adjusting the scaling coefficients of each harmonic channel:
[0110]
[0111] wherein, is the enhanced feature vector, and are the mean and standard deviation, updated every 5 minutes according to historical data; is the Hadamard product; and For learnable scaling and offset parameters, initialized as , ; is a numerical stability constant, h represents the h-th harmonic, and represent the learnable scaling and offset parameters of the h-th harmonic.
[0112] Step 3.3: Input the enhanced feature vector into a fully connected network containing L residual blocks. The structure of each residual block is as follows:
[0113]
[0114] where and are the weight matrix and bias vector in the -th layer residual block respectively, GELU is the activation function, Dropout represents random inactivation, and LayerNorm represents layer normalization; the initial input of the fully connected network is , satisfying: ; where is a linear transformation that maps the enhanced feature vector to the hidden space of the network to make it conform to the input dimension of the residual block, represents the output of the -th layer residual block;
[0115] After passing through L layer residual blocks, the network finally outputs the predicted value of the total harmonic distortion rate of each node's harmonic voltage as follows:
[0116]
[0117] where and are the learnable weight matrix and bias term of the output layer respectively, and Sigmoid represents the non-linear activation function.
[0118] In summary, the method of this embodiment can, without the premise of monitoring the whole network for points, through the historical harmonic time series data of a limited number of measurement nodes, combined with the predicted values of the full-node injection power, obtain the future predicted values of the harmonic voltage content rate and total distortion rate of all nodes including unmeasured nodes in a data-driven manner through a cascaded spatio-temporal graph network, and can provide real-time decision support for harmonic governance.
[0119] Embodiment 2: Embodiment 2 is based on Embodiment 1, aiming to train the cascaded spatio-temporal graph network using a phased training strategy to improve the model convergence efficiency and enhance the prediction accuracy stability.
[0120] In the existing technology, the end-to-end joint training method may lead to the conflict of the gradient directions between the spatio-temporal features and the index fusion parameters, making the model prone to falling into local optimal solutions. At the same time, the joint update of multi-module parameters may cause overfitting due to the excessive parameter coupling degree, thereby affecting the generalization ability of the model under complex power grid conditions. Therefore, it is necessary to design a phased progressive optimization strategy.
[0121] Please refer to Figure 5 as shown in the figure, the cascaded spatio-temporal graph network is trained in stages, which specifically includes the following steps:
[0122] Step 1.1: Based on the training data set, the historical time series data of each node is intercepted by using a sliding time window, and the single-point time series prediction module is independently pre-trained. In this stage, a phase-sensitive loss function is designed, which combines the dynamic time warping (DTW) term with the harmonic voltage amplitude error to constrain the phase alignment accuracy of the harmonic waveform. The loss function The complete expression is:
[0123]
[0124] where respectively represent the true value and the predicted value of the th harmonic voltage of the th node. N represents the total number of nodes. The dynamic time warping DTW calculation is defined as:
[0125]
[0126] where is the set of all alignment paths of the sequence , is the th data point in sequence A, and is the
[0127] th data point in sequence B; is a hyperparameter (default value is 0.7). When the decrease rate of the time series prediction error of the validation set is less than 0.5% for 5 consecutive training cycles, it is determined that the time series module converges and freezes its network parameters.
[0128]
[0129] where E represents the edge set of the network topology; is the predicted value of the th harmonic voltage content rate of node i; is the predicted harmonic current value of line ij. If there is no relevant predicted value for some lines, 0 is taken; is the h-th impedance of line ij, is a hyperparameter used to balance the weights of the impedance relationship term and the topological constraint term. KLD represents the KL divergence, is the dynamic graph attention weight distribution learned and calculated by the jump graph attention mechanism, is the prior knowledge distribution of the network topology, satisfying:
[0130]
[0131] where, represents the topological prior knowledge of line ij, is the line weight of line ij, the weight of edge kl of the network topology, is the line impedance of line ij; the first term in the above loss function enforces the harmonic voltage-current impedance relationship between nodes; the second term, the KL divergence, constrains the consistency between the graph attention weight distribution and the topological prior knowledge When the spatial estimation error fluctuates stably within the interval, the parameter solidification is completed;
[0132] Step 1.3: Freeze the parameters of the time-series and space module and construct the fusion loss function is:
[0133]
[0134] where, and are weight hyperparameters; and are respectively the predicted value and the true value of the total harmonic distortion THD of the harmonic voltage of node i; is the total number of nodes; is the Hadamard product; is the predicted value of the harmonic voltage content rate of nodes i from 2 to 25 times; is the weight vector of each node; the first term in the above function is the mean square error main loss term; the second term is the harmonic order weighted correction term. When the error of the validation set decreases by less than 0.5% for 5 consecutive training cycles, it is determined that the module converges and freezes its network parameters.
[0135] Example 3: Example 3 is an experimental simulation carried out according to the methods described in Example 1 and Example 2.
[0136] In this embodiment, in order to fully reflect the actual effect of the distribution network harmonic prediction method based on the cascaded spatio-temporal graph network, the IEEE 33-node distribution network standard example is used as the basis.
[0137] In this embodiment, the IEEE 33-node distribution network topology contains 33 nodes, 32 lines and 5 tie switches. The system voltage level is 12.66 kV, and the system base capacity is 1 MVA. In this embodiment, a distribution network model as shown in Figure 6 is built on the MATLAB / Simulink platform, in which all 5 tie switches are disconnected. Node 1 is selected as the slack node, and the remaining 32 nodes are PQ nodes. Among them, nodes 18, 22, 25, 33, 12, 15, 21, 24, 28, 31 are new energy photovoltaic injection nodes; nodes 4, 7, 8, 9, 13, 19, 23, 27, 29, 32 are non-linear load access nodes; nodes 2, 3, 5, 6, 10, 11, 14, 16, 17, 20, 26, 30 are linear load access nodes; nodes 2, 6, 9, 12, 13, 15, 18, 20, 22, 23, 25, 29, 31, 33 are harmonic measurement nodes. The new energy photovoltaic injection nodes are equivalent to large-scale photovoltaic power stations, and the harmonic domain modeling method is adopted. Two 500 kW photovoltaic inverters and a double split transformer are modeled as a single power generation unit, and the equivalent modeling of large-scale photovoltaic power stations is realized by parallel connection of multiple power generation units, as shown in Figure 7 shown. The non-linear load access nodes simulate typical harmonic sources in industrial loads and are modeled as independent harmonic current sources using the Norton equivalent method, as shown in Figure 8 shown. The linear load access nodes simulate typical non-harmonic sources such as residential or commercial loads and are modeled by means of equivalent impedance. The harmonic measurement nodes simulate the nodes in the actual power grid equipped with measurement devices such as PMUs. Such nodes can obtain accurate real-time measurement values of the harmonic voltage content rate of the 2nd - 25th harmonics. The distribution of the harmonic measurement nodes satisfies the connectivity constraint of the distribution network topology; in addition, the power data of all nodes can be obtained completely through metering, dispatching and other systems by default.
[0138] Based on the real light curve, temperature curve, and the operating curves of linear and non-linear loads in a certain area in southern China, a large amount of historical data is generated through the above model, including the injection power of all nodes, the harmonic voltage content rate of the 2nd - 25th harmonics of the measurement nodes, etc. The predicted value of the injection power of all nodes is obtained through the traditional LSTM neural network. Combining the above historical data with the model topology information and line parameters and inputting them into the cascaded spatio-temporal graph network, the predicted values of the harmonic voltage content rate of the 2nd - 25th harmonics of all nodes and the predicted values of the total harmonic distortion rate of the harmonic voltage of each node can be calculated. Figure 9 are the true values and predicted values of the harmonic voltage content rate of some harmonics of the existing measurement node 33; Figure 10 are the true values and predicted values of the harmonic voltage content rate of some harmonics of the unmeasured node 28; Figure 11are the true value and predicted value of the total harmonic voltage distortion rate of each node at a certain predicted time section. It can be seen that the method described in the present invention can accurately obtain the predicted values of the harmonic voltage content rate and the total harmonic voltage distortion rate of each node of the entire network.
[0139] Embodiment 4: Figure 12 is a schematic structural diagram of a distribution network harmonic prediction device based on a cascaded spatio-temporal graph network provided by Embodiment 4 of the present invention. As Figure 12 shown, the device includes a processor 310, a memory 320, an input device 330, and an output device 340; the number of processors 310 in the computer device can be one or more. Figure 12 Here, one processor 310 is taken as an example; the processor 310, the memory 320, the input device 330, and the output device 340 in the electronic device can be connected through a bus or other means. Figure 12 Here, connection through a bus is taken as an example.
[0140] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the distribution network harmonic prediction method based on the cascaded spatio-temporal graph network in the embodiments of the present invention. The processor 310 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 320, that is, to implement the distribution network harmonic prediction method based on the cascaded spatio-temporal graph network in Embodiments 1 to 3 above.
[0141] The memory 320 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 320 may further include a memory remotely set relative to the processor 310, and these remote memories may be connected to the distribution network harmonic prediction device based on the cascaded spatio-temporal graph network through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0142] The input device 330 can be used to receive input user identity information, historical data of system state parameters, etc. The output device 340 may include a display device such as a display screen.
[0143] Embodiment 5: Embodiment 5 of the present invention further provides a storage medium containing computer-executable instructions. This storage medium can be used by a computer to execute the distribution network harmonic prediction method based on the cascaded spatio-temporal graph network. The method includes:
[0144] Obtain historical time-series data such as the active power, reactive power, and the harmonic voltage content ratios of the 2nd to 25th harmonics of the measurement node, input them into the single-point time-series prediction module, and obtain the predicted values of the active power, reactive power, and the harmonic voltage content ratios of the 2nd to 25th harmonics of the measurement node;
[0145] Combine the obtained predicted values with the topological connection relationship of the distribution network, line parameters, and the power prediction data of the unmeasured nodes, input them into the spatial estimation module, and obtain the predicted values of the harmonic voltage content ratios of the 2nd to 25th harmonics of the unmeasured nodes;
[0146] Input the predicted values of the harmonic voltage content ratios of the 2nd to 25th harmonics of all nodes into the index fusion module, and obtain the predicted values of the total harmonic distortion rate of the harmonic voltage of all nodes.
[0147] Of course, for a storage medium containing computer-executable instructions provided by an embodiment of the present invention, the computer-executable instructions are not limited to the method operations described above, and can also execute related operations in the distribution network harmonic prediction method based on the cascaded spatio-temporal graph network provided by any embodiment of the present invention.
[0148] For those skilled in the art, various corresponding changes and deformations can be made according to the technical solutions and concepts described above, and all these changes and deformations should fall within the protection scope of the claims of the present invention.
Claims
1. A harmonic prediction method for a distribution network based on a cascaded spatio-temporal graph network, characterized in that, The method includes the following steps: Step 1: Collect the historical time series data of the injected active power, reactive power of the deployed measurement nodes in the distribution network, and the harmonic voltage content rates of the 2nd - 25th harmonics, perform single - point time series prediction, and obtain the predicted values of the harmonic voltage content rates of the 2nd - 25th harmonics corresponding to each measurement node; Step 2: According to the predicted values of the harmonic voltage content rates of each harmonic of the deployed measurement nodes obtained in Step 1, combined with the distribution network topology information and the predicted values of the injected active power and reactive power of all nodes, establish a mapping relationship between the harmonic voltages of the existing measurement nodes and the harmonic voltages of the unmeasured nodes through spatial estimation, and then obtain the predicted values of the harmonic voltage content rates of the unmeasured nodes; Step 3: According to the predicted values of the harmonic voltage content rates of all nodes obtained in Step 1 and Step 2, perform index fusion calculation to obtain the predicted values of the total harmonic distortion rates of the harmonic voltages of each node.
2. The harmonic prediction method for a distribution network based on a cascaded spatio-temporal graph network according to claim 1, wherein The single-point time series prediction in step 1 is implemented based on the Transformer architecture. Historical time series data of measurement nodes in the distribution network are collected to form feature vectors, which are divided into multiple local time blocks according to the time dimension to form a block sequence. Each feature channel of the feature vector is independently linearly projected to generate a channel-specific block embedding representation. After concatenation, learnable position encoding is superimposed to form an initial embedding representation, which is input into the encoder composed of channel-independent multi-head self-attention layers. Each layer calculates the multi-head attention weights, and the outputs of each attention head are weighted and aggregated. After concatenation, multi-head attention features are generated through linear transformation. After being concatenated into a complete vector, it is used as the input of the next layer until the final output of the encoder is obtained. Based on the decoder prediction head, the predicted values of each harmonic HRU in the future minutes are generated through a channel-independent linear projection layer.
3. A harmonic prediction method for a distribution network based on a cascaded spatio-temporal graph network according to claim 1, characterized in that, The spatial estimation in Step 2 is implemented based on a graph neural network architecture. The specific architecture and operation process include the following steps: Step 2.1: Construct an undirected weighted graph based on the electrical connection relationship of the distribution network and the nodal admittance matrix , where the node set includes all measured nodes and unmeasured nodes in the distribution network topology; the edge set represents pairs of nodes with direct electrical connections; the edge weight of the adjacency matrix is obtained by normalizing the reciprocal of the harmonic impedance amplitude between nodes; Step 2.2: Use the predicted values of the harmonic voltage content rate for each harmonic of the measurement node in the future minutes output by the single-point time series prediction and the predicted values of the active power and reactive power injected into all nodes as the initial node features; Step 2.3: Use the skip graph attention mechanism to perform neighbor node message passing, complete message aggregation, fuse the previous-hop state of the current node with the aggregated message, update the node state, perform channel-sensitive weighting on the K-hop output, complete adaptive fusion, and generate the predicted values of the harmonic voltage content rates of each order for the final unmeasured nodes.
4. A harmonic prediction method for a distribution network based on a cascaded spatio-temporal graph network according to claim 1, characterized in that, The index fusion calculation in Step 3 is implemented based on an artificial neural network ANN architecture. The specific architecture and operation process include the following steps: Step 3.1: The predicted values of the harmonic voltage content rates of each measurement node obtained from single-point time series prediction , and the predicted values of the harmonic voltage content rates of each unmeasured node obtained from spatial estimation , are concatenated into a full-node harmonic data matrix according to the node dimension ; For each node-time step combination , the feature vectors are extracted and input into the artificial neural network ANN: Step 3.2: For each node-time step combination Extract the feature vector Perform adaptive normalization calculation. By dynamically adjusting the scaling coefficients of each harmonic channel, enhanced perception of each harmonic is achieved: ; Among them, is the enhanced feature vector, and are the mean and standard deviation, updated every 5 minutes according to historical data; is the Hadamard product; and are the learnable scaling and offset parameters, initialized to 、 ; is the numerical stability constant, h represents the h-th harmonic, and represent the learnable scaling and offset parameters of the h-th harmonic; Step 3.3: Input the enhanced feature vectors into a fully - connected network containing L residual blocks. The structure of each residual block is as follows: ; Among them, and are the weight matrix and bias vector in the -th residual block respectively, GELU is the activation function, Dropout represents random inactivation, and LayerNorm represents layer normalization; the initial input of the fully connected network is , satisfying: ; among them, is a linear transformation that maps the enhanced feature vector to the hidden space of the network to make it conform to the input dimension of the residual block, represents the output of the -th residual block; After passing through L residual blocks, the network finally outputs the predicted values of the total harmonic distortion rates of the harmonic voltages of each node.
5. A harmonic prediction method for a distribution network based on a cascaded spatio-temporal graph network according to claim 1, wherein The construction of the undirected weighted graph supports dynamic topology update. When the distribution network topology changes, by real - time updating the adjacency matrix and edge weights of the spatial estimation, the harmonic propagation path information input to the network is adaptively adjusted.
6. The harmonic prediction method for a distribution network based on a cascaded spatio-temporal graph network according to claim 1, wherein, The cascaded spatio - temporal graph network includes three parts: a single - point time series prediction module, a spatial estimation module, and an index fusion calculation. The training method adopts a phased training strategy, which specifically includes the following steps: Step A: Use a sliding time window to intercept the historical time series data of each node based on the training data set, and perform independent pre-training on the single-point time series prediction part; at this stage, design a phase-sensitive loss function, combine the dynamic time warping DTW term with the harmonic voltage amplitude error, and constrain the phase alignment accuracy of the harmonic waveform; the loss function The complete expression is: ; Among them, respectively represent the true value and the predicted value of the th harmonic voltage of the th node. N represents the total number of nodes, is a hyperparameter, represents the dynamic time warping calculation; Step B: Jointly optimize the spatial topological features and the predicted harmonic voltage values based on spatial estimation; model the harmonic coupling between nodes through the graph attention mechanism, and the loss function is defined as: ; Among them, $E$ represents the edge set of the network topology; is the predicted value of the $h$-th harmonic voltage content rate of node $i$; is the predicted value of the $h$-th harmonic voltage content rate of node $j$; is the predicted value of the harmonic current of line $ij$. If there is no relevant predicted value for some lines, it is taken as 0; is the $h$-th impedance of line $ij$, is a hyperparameter used to balance the weights of the impedance relation term and the topological constraint term. KLD represents the KL divergence, is the dynamic graph attention weight distribution learned and calculated by the skip graph attention mechanism, is the prior knowledge distribution of the network topology, satisfying: ; Among them, represents the topological prior knowledge of line ij, is the line weight of line ij, the weight of edge kl in the network topology, is the line impedance of line ij; the first term in the above loss function enforces the harmonic voltage-current impedance relationship between nodes; the second KL divergence constrains the consistency between the graph attention weight distribution and the topological prior knowledge ; parameter curing is completed when the spatial estimation error variation stabilizes within the interval. Step C: Freeze the parameters of the temporal-spatial module and construct a fusion loss function It is as follows: ; Among them, and are weight hyperparameters; and are the predicted value and the true value of the total harmonic distortion THD of the harmonic voltage of node i, respectively; is the total number of nodes; is the Hadamard product; is the predicted value of the harmonic voltage content rate of the 2nd to 25th harmonics of node i; is the weight vector of each node; the first term in the above function is the mean square error main loss term; the second term is the harmonic order weighted correction term; when the error of the validation set decreases by less than 0.5% for 5 consecutive training cycles, it is determined to converge and freeze its network parameters.
7. A harmonic prediction method for a distribution network based on a cascaded spatio-temporal graph network according to claim 1, characterized in that The distribution of the measurement nodes satisfies the connectivity constraint of the distribution network topology.
8. A harmonic prediction device for a distribution network based on a cascaded spatio-temporal graph network, which includes a processor, a storage medium, and a computer program. The computer program is stored in the storage medium, and is characterized in that, When the computer program is executed by a processor, it implements the distribution network harmonic prediction method based on the cascaded spatio - temporal graph network according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the distribution network harmonic prediction method based on the cascaded spatio - temporal graph network according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements a distribution network harmonic prediction method based on a cascaded spatio - temporal graph network according to any one of claims 1 - 7.
Citation Information
Patent Citations
Harmonic source positioning method based on space-time diagram convolutional network
CN115015631A
Construction method of harmonic estimation model of unknown distribution feeder topology and parameters
CN116628901A
Harmonic source positioning method and system
CN116826705A
Novel electric power system harmonic wave real-time positioning method, system, device and medium
CN118884135A
Cited By
Intelligent power distribution harmonic monitoring and dynamic compensation system
CN120749743A
Voltage transformer error evaluation method and device, electronic equipment and storage medium
CN121388505A
LSTM-RBF-based charging pile harmonic prediction value determination method
CN122525215A
A power distribution network fault classification method, system and device
CN122796619A