Power distribution network harmonic state estimation method and system

CN123018864APending Publication Date: 2026-10-30STATE GRID FUJIAN ELECTRIC POWER RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610947617.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

然而,此类方法普遍对配电网固有的拓扑结构特征关注不足,致使模型学习的特征维度受到制约,进而影响了谐波状态估计的精度与泛化能力

Benefits of technology

[0012]本发明的有益效果在于:获取配电网拓扑结构和部分节点谐波数据,基于配电网拓扑结构和部分节点谐波数据划分数据集,基于数据集对节点内注意力-二代图注意力网络模型进行训练,得到谐波状态估计模型,使用谐波状态估计模型对配电网进行谐波状态估计,以此通过引入节点内注意力机制,能够对谐波数据内部的关键特征进行自适应加权强化,有效解决了传统方法依赖精确物理参数且难以应对复杂谐波机理的难题,同时借助二代图注意力网络对配电网拓扑结构的深度挖掘与多跳邻域聚合能力,使模型在仅有部分节点监测数据的稀疏量测条件下,依然能够充分融合全局拓扑信息,突破了对全网可观性的依赖瓶颈,两者结合构建训练的谐波状态估计模型,不仅规避了谐波阻抗难以精确获取带来的误差累积问题,还能够自适应拓扑频繁变化,从而显著提高了谐波状态估计的精确度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123018864A_ABST
    Figure CN123018864A_ABST
Patent Text Reader

Abstract

The application provides a power distribution network harmonic state estimation method and system, obtains power distribution network topology structure and part node harmonic data, divides data sets based on the power distribution network topology structure and part node harmonic data, trains the node attention-second generation graph attention network model based on the data sets, obtains a harmonic state estimation model, and uses the harmonic state estimation model to perform harmonic state estimation on the power distribution network. The method can adaptively strengthen the key features in the harmonic data, deeply mine the power distribution network topology structure, and has a multi-hop neighborhood aggregation capability. Under the condition of sparse measurement of only part of the node monitoring data, the model can still fully integrate global topology information, break through the dependence bottleneck of the whole network observability, construct the trained harmonic state estimation model, avoid the error accumulation problem caused by the difficulty in accurately obtaining the harmonic impedance, and adapt to frequent changes in the topology, thereby significantly improving the accuracy of the harmonic state estimation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of harmonic state estimation technology, and particularly to a method and system for harmonic state estimation in distribution networks. Background Technology

[0002] The increasingly prominent characteristics of modern power distribution networks—high proportion of renewable energy integration, high proportion of power electronic equipment installation, and rapidly growing DC loads—pose new challenges to the new power system. With such a large-scale integration of nonlinear components into the grid, their inherent nonlinear characteristics lead to the injection of numerous harmonics into the grid during operation. This causes waveform distortion, harmonic pollution, and other power quality problems, and in severe cases, can affect the safe and stable operation of the power system. Furthermore, due to the widespread distribution of harmonic sources, harmonic pollution has a compounding effect on the point of common coupling (PCC), potentially leading to an expansion of harmonic pollution. Harmonic pollution is particularly prevalent in current distribution networks with high proportions of renewable energy integration. Harmonics can cause overheating of lines or transformers, reduce equipment operating efficiency, accelerate insulation aging, interfere with equipment operation, and increase enterprise operating costs.

[0003] With the increasing complexity of power distribution network structures, harmonic pollution is becoming increasingly severe. While comprehensive power quality monitoring of all nodes is the most intuitive solution, the sheer size and complex topology of current power distribution networks necessitate high capital expenditures for global deployment of monitoring terminals, creating an economic bottleneck. To achieve wide-area harmonic sensing under limited measurement constraints, research has developed and established the Harmonic State Estimation (HSE) technology system. The core logic of this technology lies in using harmonic data collected from sparse monitoring nodes to invert and estimate the harmonic voltage and current distribution at unmonitored nodes, thereby providing crucial information for subsequent harmonic responsibility quantification, disturbance source localization, and proactive mitigation.

[0004] With the continuous advancement of new power distribution network construction, the deployment scale of harmonic monitoring devices in power distribution networks is gradually expanding, leading to a certain improvement in the richness of harmonic-related measurement data. Simultaneously, the continuous integration of nonlinear and power electronic harmonic source devices into power distribution networks exacerbates the complexity of harmonic coupling effects and makes the physical mechanisms of harmonic generation and propagation exhibit significant multi-source and diversified characteristics, thus greatly increasing the difficulty of harmonic modeling. In modern power distribution systems, the increased interconnected devices give power distribution networks active control capabilities and flexible topologies. When facing power distribution networks with complex harmonic mechanisms and frequent topological changes, traditional physical mechanism-based harmonic state estimation methods are affected by increased modeling complexity and limited applicability.

[0005] Currently, the methods used for harmonic state estimation mainly include traditional methods such as least squares method and improved least squares method, Kalman filter model, and data-driven artificial intelligence methods.

[0006] The least squares method establishes system observation equations that account for measurement errors, and then solves for the harmonic state of the entire network based on known network parameters and partial measurement data. Improved least squares methods include robust least squares, which can obtain more accurate estimates when measurement data contains errors. The Kalman filter model is an effective method applied to the time domain; it is a state estimation algorithm that combines prior experience with measurement updates. The basic idea of ​​Kalman filtering is to comprehensively utilize the previous state and measurement values ​​to predict and estimate the state of physical quantities.

[0007] These methods primarily employ physical modeling to analyze and describe the relationships between nodes, estimating the state of unknown nodes based on the harmonic states of monitoring points. However, insufficient monitoring devices in the power grid lead to the harmonic states not being observable across the entire network, making it difficult to establish measurement equations. Furthermore, in actual measurements, only nodes equipped with synchronous phasor measurement units (PMUs) can obtain relatively accurate harmonic current and voltage phases; inaccurate data from other nodes contributes to decreased estimation accuracy. Additionally, the high complexity and strong nonlinearity of modern power systems reduce the state estimation capabilities of traditional methods, making it difficult to meet high-precision estimation requirements. Moreover, traditional methods require parameters such as harmonic impedance, which are difficult to obtain accurately in practical engineering, thus leading to significant errors.

[0008] Data-driven artificial intelligence methods use big data on the power grid as input and employ mathematical models to systematically process power quality measurement information. This allows them to uncover and reconstruct the high-dimensional intrinsic mapping mechanism between power grid state variables and observed data. Such methods are not constrained by statistical data or precise system network parameters. However, these methods generally do not pay enough attention to the inherent topological characteristics of the distribution network, which limits the feature dimensions of the model learning and consequently affects the accuracy and generalization ability of harmonic state estimation. Summary of the Invention

[0009] The technical problem to be solved by the present invention is to provide a method and system for estimating the harmonic state of a power distribution network, which can improve the accuracy of harmonic state estimation.

[0010] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for estimating the harmonic state of a distribution network includes: Acquire the distribution network topology and harmonic data of some nodes; Data sets are divided based on the power distribution network topology and the harmonic data of some nodes; Based on the dataset, the node-internal attention-second generation graph attention network model is trained to obtain the harmonic state estimation model; The harmonic state estimation model is used to estimate the harmonic state of the distribution network.

[0011] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A distribution network harmonic state estimation system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the aforementioned distribution network harmonic state estimation method.

[0012] The beneficial effects of this invention are as follows: It acquires the distribution network topology and harmonic data of some nodes; divides the dataset based on the distribution network topology and harmonic data of some nodes; trains a node-internal attention-second-generation graph attention network model based on the dataset to obtain a harmonic state estimation model; and uses the harmonic state estimation model to estimate the harmonic state of the distribution network. By introducing an intra-node attention mechanism, it can adaptively weight and strengthen key features within the harmonic data, effectively solving the problem that traditional methods rely on precise physical parameters and are difficult to handle complex harmonic mechanisms. Simultaneously, by leveraging the deep mining and multi-hop neighborhood aggregation capabilities of the second-generation graph attention network for the distribution network topology, the model can still fully integrate global topology information even under sparse measurement conditions with only some node monitoring data, breaking through the bottleneck of dependence on the observability of the entire network. The combined use of these two methods to construct the trained harmonic state estimation model not only avoids the error accumulation problem caused by the difficulty in accurately obtaining harmonic impedance but also adapts to frequent topology changes, thereby significantly improving the accuracy of harmonic state estimation. Attached Figure Description

[0013] Figure 1 This is a flowchart of a method for estimating the harmonic state of a distribution network according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the internal data processing of the harmonic state estimation model in a distribution network harmonic state estimation method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the intra-node attention mechanism in a distribution network harmonic state estimation method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a power distribution network harmonic state estimation system according to an embodiment of the present invention. Detailed Implementation

[0014] Definitions:

[0015] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0016] Existing technologies primarily employ physical model-based methods for modeling and analysis, describing the relationships between nodes and estimating the state of unknown nodes through harmonic states at monitoring points. However, insufficient monitoring devices in the power grid lead to incomplete observation of harmonic states across the entire network, making it difficult to establish measurement equations. Furthermore, in actual measurements, only nodes equipped with synchronous phasor measurement units can obtain relatively accurate harmonic current and voltage phases; inaccurate data from other nodes contributes to decreased estimation accuracy. Additionally, the high complexity and strong nonlinearity of modern power systems reduce the state estimation capabilities of traditional methods, making it difficult to meet high-precision estimation requirements. Traditional methods also require parameters such as harmonic impedance, which are difficult to obtain accurately in practical engineering, leading to significant errors. While data-driven artificial intelligence methods are not constrained by statistical data and precise system network parameters, they generally lack sufficient attention to the inherent topological characteristics of the distribution network, limiting the feature dimensions of model learning and consequently affecting the accuracy and generalization ability of harmonic state estimation.

[0017] To address at least the aforementioned issues, this study acquires the distribution network topology and harmonic data from some nodes. A dataset is then partitioned based on this topology and harmonic data. A node-internal attention-second-generation graph attention network model is trained on this dataset to obtain a harmonic state estimation model. This model is then used to estimate the harmonic state of the distribution network. By introducing an intra-node attention mechanism, key features within the harmonic data can be adaptively weighted and strengthened, effectively solving the problem that traditional methods rely on precise physical parameters and struggle to handle complex harmonic mechanisms. Simultaneously, leveraging the deep mining and multi-hop neighborhood aggregation capabilities of the second-generation graph attention network, the model can still fully integrate global topological information even with sparse measurements from only a subset of node monitoring data, overcoming the bottleneck of dependence on the observability of the entire network. The combined approach to constructing the trained harmonic state estimation model not only avoids the error accumulation problem caused by the difficulty in accurately obtaining harmonic impedance but also adapts to frequent topological changes, thus significantly improving the accuracy of harmonic state estimation.

[0018] The following details a method for estimating the harmonic state of a distribution network according to the present invention. Please refer to [link / reference]. Figure 1 The method 100 includes steps 101 to 104: Step 101: Obtain the distribution network topology and harmonic data of some nodes.

[0019] Step 102: Divide the dataset based on the power distribution network topology and the harmonic data of some nodes.

[0020] Step 103: Train the node-internal attention-second generation graph attention network model based on the dataset to obtain the harmonic state estimation model.

[0021] The harmonic state estimation model includes a node feature enhancement layer, a four-layer node intra-attention-second generation graph attention network layer, and two fully connected layers connected in sequence.

[0022] The original Graph Attention Network (GAT) suffers from static attention. A 2021 study by Brody et al. revealed an inherent limitation in the original GAT's attention mechanism: its calculated attention coefficients are static, meaning that regardless of changes in the query node, a certain key node always receives the highest attention score. This implies that the actual attention ranking expressed by GAT is independent of the query node, limiting the model's expressive power. Therefore, to address this issue, Brody et al. proposed the Version Two Graph Attention Network (GATv2), which adjusts the calculation order of the attention mechanism as follows: ; In the formula, Representing neighboring nodes j For nodes i The original attention score, The weight vector represents the learnable attention mechanism. , Represents a non-linear activation function. This represents the shared linear transformation weight matrix. , This indicates that the network layer generates new node features (which may have different dimensions). Represents a node i The input feature vector, Represents a node j The input feature vector, , Indicates the dimension of the input features.

[0023] Compared to the original design of graph attention networks: , Represents a node i The eigenvector after linear transformation Represents a node jAfter linear transformation, GATv2 places the LeakyReLU feature vector after feature concatenation and linear transformation, and... Before the dot product, the attention mechanism is made a function of the query node, which enables the expression of more complex attention patterns and the realization of true dynamic attention. Therefore, for scenarios with complex topologies, such as distribution radio stations with multiple topologies, this invention considers GATv2 as the preferred choice.

[0024] Current graph attention networks model relationships between nodes through attention mechanisms, implicitly assuming that all features within each node are equally important, thus ignoring the discriminative differences in features within nodes. To address this issue, Intra-node Attention (INAT) is introduced, which aims to explicitly quantify the relative importance of features within a node, thereby improving the discriminative power of node representations.

[0025] In graph data, node features typically exhibit an implicit hierarchy of importance: components that significantly deviate from the feature mean often carry stronger discriminative signals. Although this deviation is not absolutely equivalent to semantic importance (for example, noise can also present extreme values), statistically, the magnitude of the deviation can serve as an initial indicator of feature importance. INAT borrows the idea of ​​using deviation analysis to capture local salient patterns in anomaly detection, assigning differentiated weights by calculating the degree of local outliers of features, while introducing learnable parameters to achieve task-adaptive recalibration.

[0026] Since the model input node features are harmonic data and the entire input is sparse graph structure data, it is necessary to design 4 layers of GATv2-INAT to fully aggregate the node features.

[0027] Step 104: Use the harmonic state estimation model to estimate the harmonic state of the distribution network.

[0028] In one embodiment of the present invention, step 102 includes: The power distribution network topology and some node harmonic data are divided into training set, validation set and test set according to a preset ratio.

[0029] In one optional implementation, the power distribution network topology and the partial node harmonic data are divided into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0030] The distribution network topology consists of the original distribution network topology data and the topology data when a single tie-line switch is closed. The partial node harmonic data includes the real and imaginary parts of the harmonic voltage and current of some nodes, and these nodes are the monitored nodes.

[0031] As described above, the distribution network topology and some node harmonic data are divided into training set, validation set and test set according to a preset ratio. Through the division of independent datasets, the generalization ability and reliability assessment of the model are systematically guaranteed.

[0032] In one embodiment of the present invention, step 103 includes: The training set is used to train the node-internal attention-second generation graph attention network model to obtain the harmonic state estimation model.

[0033] As described above, by using the training set to train the intra-node attention-second generation graph attention network model, the high-dimensional nonlinear mapping relationship between limited measurement data and the harmonic state of the entire distribution network is fully explored through the data-driven approach.

[0034] In one embodiment of the present invention, the training set is used to train the intra-node attention-second-generation graph attention network model to obtain a harmonic state estimation model, including: Construct an adjacency matrix based on the distribution network topology in the training set; Construct a node feature matrix based on partial node harmonic data from the training set; The adjacency matrix and the node feature matrix are used to train the intra-node attention-second generation graph attention network model until the number of training iterations reaches the preset maximum number of training iterations, thereby obtaining the harmonic state estimation model.

[0035] The elements of the adjacency matrix Indicates the node i With nodes j Does a connection exist between them? If a connection exists, Otherwise, it equals 0.

[0036] In one alternative implementation, the intra-node attention-second generation graph attention network model selects the fixed learning rate (0.0001) strategy with the best convergence effect and performance; after gradient comparison experiments, the model training batch is set to 64, and the best performance is achieved when the GATv2 hidden layer parameters are set to 64; and the model uses the Adam (Adaptive Moment Estimation) optimizer as the optimization algorithm.

[0037] As described above, by accurately characterizing the electrical connections between nodes using an adjacency matrix, the model can strictly follow the physical topology for information propagation, avoiding the dependence of traditional methods on the precise values ​​of network parameters. At the same time, by constructing a feature matrix using harmonic data from some nodes, sparse measurements are transformed into initial embeddings in a high-dimensional feature space. This allows the model to automatically optimize intra-node attention weights and graph attention aggregation coefficients through end-to-end gradient descent during training, ultimately generating a harmonic state estimation model that combines topology awareness and data-driven fitting capabilities. This provides reliable technical support for high-precision state estimation under sparse measurement conditions.

[0038] In one optional implementation, while training the intra-node attention-second-generation graph attention network model using the training set to obtain the harmonic state estimation model, the method further includes: The validation set is used to monitor the performance of the intra-node attention-second generation graph attention network model in real time to guide hyperparameter tuning and perform early stopping to prevent overfitting. After training the intra-node attention-second-generation graph attention network model using the training set to obtain the harmonic state estimation model, the method further includes: The accuracy of the harmonic state estimation model is evaluated using the test set.

[0039] Please refer to Figure 2 In one embodiment of the present invention, step 104 includes steps 1041 to 1043: Step 1041: Obtain the real-time distribution network topology and real-time harmonic data of some nodes.

[0040] Step 1042: Construct an adjacency matrix based on the real-time distribution network topology. A And construct a node feature matrix based on the real-time partial node harmonic data. X .

[0041] Step 1043: Input the adjacency matrix and the node feature matrix into the harmonic state estimation model. Add a dimension to the node feature matrix using the node feature enhancement layer. Perform neighborhood aggregation on the dimension-added node feature matrix and the adjacency matrix using the four-layer intra-node attention-second-generation graph attention network layer to obtain a node feature matrix after sufficient spatial aggregation. Perform node-by-node multi-layer linear transformation and nonlinear mapping on the node feature matrix after sufficient spatial aggregation using the two fully connected layers to output the harmonic voltage of the node to be estimated. The harmonic voltage of the node to be estimated includes both real and imaginary parts.

[0042] As described above, the node feature enhancement layer improves the model's ability to represent the original harmonic data by increasing the feature dimension, providing a richer information foundation for subsequent processing. The four-layer intra-node attention-second-generation graph attention network layer enables the features of each node to propagate layer by layer along the topology and fuse global electrical information within four hops through stacked neighborhood aggregation operations. This allows for effective perception of the harmonic state of the entire network under the condition of relying only on measurements of some nodes, breaking through the dependence on measurement completeness. The two fully connected layers independently map the aggregated high-dimensional features to specific harmonic voltage values ​​node by node, completing the accurate regression from spatial features to physical quantities. The entire process does not require precise harmonic impedance parameters and can adapt to topology changes, significantly improving estimation accuracy and engineering practicality.

[0043] In one embodiment of the present invention, adding a dimension to the node feature matrix using the node feature enhancement layer includes: In the node feature enhancement layer, a first feature value is added to the monitored nodes in the node feature matrix, and a second feature value is added to the unmonitored nodes in the node feature matrix.

[0044] Wherein, the first feature value is 1, and the second feature value is 0.

[0045] As described above, by adding a first eigenvalue to the monitored nodes in the node feature matrix and a second eigenvalue to the unmonitored nodes, the monitored nodes are marked with the first eigenvalue, which enhances the neural network's focus on key node features. This allows the model to identify reliable measurement sources and prioritize the propagation of real collected data during neighborhood aggregation. Simultaneously, the unmonitored nodes are marked with the second eigenvalue, indicating to the model that the node's features are in a state to be estimated and that inference requires relying on neighbor information. This binarized feature enhancement strategy provides clear measurement confidence guidance for the graph attention network without increasing model complexity. It effectively suppresses the interference of inaccurate features of unmonitored nodes on the aggregation process, guides the attention mechanism to allocate weights more rationally, and thus improves the accuracy and robustness of harmonic state estimation under limited monitoring device conditions.

[0046] In one embodiment of the present invention, the four-layer intra-node attention-second-generation graph attention network layer is used to perform neighborhood aggregation on the node feature matrix after the dimensionality increase and the adjacency matrix to obtain a node feature matrix after sufficient spatial aggregation, including: In each layer of the in-node attention-second generation graph attention network, the in-node attention mechanism is used to assign internal weights to the node features of the node feature matrix output by the previous layer, and the updated node feature matrix is ​​output. Based on the updated node feature matrix and the adjacency matrix, the second generation graph attention network layer is used to perform feature aggregation to obtain the aggregated node feature matrix.

[0047] As described above, the intra-node attention mechanism in each layer first assigns adaptive weights to each dimension of the current node's feature vector, enabling the model to dynamically focus on the information-rich key frequencies in each harmonic component, effectively suppressing the interference of noise and redundant features on the estimation results. On this basis, the second-generation graph attention network uses the updated node features and adjacency matrix to perform learnable weighted aggregation of neighboring nodes along the topology, enabling information to propagate efficiently along the multi-hop path of the distribution network. The alternating action of the two ensures that after four layers of stacking, the output features of each node fully integrate the global electrical information of its neighborhood within four hops, while the internal key harmonic features are accurately enhanced, laying a reliable feature foundation for subsequent high-precision harmonic voltage regression.

[0048] Please refer to Figure 3 In one embodiment of the present invention, an intra-node attention mechanism is used to assign internal weights to the node feature matrix output by the previous layer, and the updated node feature matrix output includes: Calculate the deviation of each feature within a node from its mean and the local outlier degree of the deviation; The local outlier degree and the average outlier degree within the node are calculated to obtain the hypothesis of the relative importance of each feature; The internal weights of node features are calculated based on the relative importance assumption, scaling factor, and bias. The updated node feature matrix is ​​output based on the internal weights of the node features.

[0049] Please refer to Figure 3 In one embodiment of the present invention, the deviation of each feature within a node from its mean and the local outlier degree of the deviation are calculated as follows: ; In the formula, This represents the deviation of each feature within a node from its mean. Represents a node i Each eigenvalue, , d Indicates the input dimension of the node. V Represents a set of nodes. Represents a node i The mean of all eigenvalues. This represents the local dispersion of the deviation. This indicates element-wise multiplication; the squaring operation eliminates the sign of the deviation on the one hand, and amplifies the influence of features that deviate significantly from the mean on the other.

[0050] The local outlier degree and the average outlier degree within a node are calculated to obtain the relative importance assumptions of each feature, specifically: ; In the formula, This represents the assumption of the relative importance of each feature. Represents a node i Inner average outlier Represents a small constant that prevents zero; when When a certain dimension value is much greater than 1, it indicates that the deviation of that feature is much higher than the average level, and it may contain key discriminative information.

[0051] Use directly Using these as weights carries two risks: first, it may amplify interference when the extreme values ​​are noise; second, a fixed scale may over-suppress low-scoring features. Therefore, we introduce only two learnable parameters: a scaling factor and a bias, as detailed below.

[0052] Based on the aforementioned relative importance assumption, scaling factor, and bias, the internal weights of the node features are calculated as follows: ; In the formula, Represents a node i Internal weights of features Indicates the scaling factor. Indicates bias. Represents a nonlinear activation function; The model is allowed to adaptively adjust the adoption of biased hypotheses based on the current task and data: learning is more efficient when feature bias is strongly correlated with node representations. However, when the extreme features are mainly noise, the value can approach zero. Provide a baseline gating level to prevent low-scoring features from being completely erased and to prevent information loss.

[0053] The updated node feature matrix is ​​output based on the internal weights of the node features, including: The internal weights of the node features are applied to the node features to generate updated node features, specifically as follows: ; In the formula, Indicates the updated node i feature; The updated node feature matrix is ​​obtained based on the updated node features.

[0054] It maintains the dimensional structure of the original features but strengthens components with high discriminative power and suppresses low-contribution or redundant components, thus providing higher-quality input for downstream graph learning modules. Taking integration into GATv2 as an example, the edge attention score... The calculation becomes: ; In the formula, Indicates the updated node j feature.

[0055] As described above, by calculating the deviation of each feature from the mean and the local outlier, abnormal harmonic components that deviate from the normal distribution in the node feature vector can be effectively identified. These outliers often contain key disturbance or harmonic source information. Furthermore, by comparing the local outlier with the average outlier, the relative importance of each feature within the node can be objectively measured, avoiding the limitations of subjectively setting thresholds. By introducing scaling factors and biases for learnable adjustment, the model can adapt to the differences in feature distributions of different nodes and output an updated feature matrix after nonlinear mapping. This mechanism significantly enhances the discriminability of features within the node and reduces noise interference, enabling subsequent graph attention aggregation to be performed on a higher quality feature basis, significantly improving the model's sensitivity and estimation accuracy to key harmonic features.

[0056] In one alternative implementation, the root mean square error (RMSE) is selected as the evaluation metric for the harmonic state estimation model.

[0057] RMSE measures the deviation between a model's predictions and the actual values. It calculates the square root of the error, restoring the error to the same order of magnitude as the original data, providing a direct measure of prediction accuracy. A smaller RMSE indicates higher model accuracy. The formula for calculating RMSE is as follows: ; In the formula, For the sample size, For the model targeting the first i The predicted value for each sample, For the first i The true value of each sample.

[0058] Please refer to Figure 4 The present invention also provides a distribution network harmonic state estimation system 200, including a memory 201, a processor 202, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the distribution network harmonic state estimation method as described above.

[0059] In summary, the above-described method and system for estimating the harmonic state of a distribution network in this invention acquires the distribution network topology and harmonic data of some nodes. Based on the distribution network topology and the harmonic data of some nodes, a dataset is partitioned. A node-internal attention-second-generation graph attention network model is trained on the dataset to obtain a harmonic state estimation model. This model is then used to estimate the harmonic state of the distribution network. By introducing an intra-node attention mechanism, key features within the harmonic data can be adaptively weighted and strengthened, effectively solving the problem that traditional methods rely on precise physical parameters and struggle to handle complex harmonic mechanisms. Simultaneously, leveraging the deep mining and multi-hop neighborhood aggregation capabilities of the second-generation graph attention network, the model can still fully integrate global topological information even under sparse measurement conditions with only some node monitoring data, overcoming the bottleneck of dependence on the observability of the entire network. The combination of these two methods constructs the trained harmonic state estimation model. This approach not only avoids the error accumulation problem caused by the difficulty in accurately obtaining harmonic impedance, but also adapts to frequent topology changes, thus significantly improving the accuracy of harmonic state estimation. In addition, the node feature enhancement layer improves the model's ability to represent the original harmonic data by increasing the feature dimension, providing a richer information foundation for subsequent processing. The four-layer intra-node attention-second-generation graph attention network layer enables the features of each node to propagate layer by layer along the topology and fuse global electrical information within four hops through stacked neighborhood aggregation operations. This allows for effective perception of the harmonic state of the entire network under the condition of relying only on measurements of some nodes, breaking through the dependence on measurement completeness. The two fully connected layers independently map the aggregated high-dimensional features to specific harmonic voltage values ​​node by node, completing the accurate regression from spatial features to physical quantities. The entire process does not require precise harmonic impedance parameters and can adapt to topology changes, significantly improving estimation accuracy and engineering practicality.

[0060] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for estimating the harmonic state of a distribution network, characterized in that, include: Acquire the distribution network topology and harmonic data of some nodes; Data sets are divided based on the power distribution network topology and the harmonic data of some nodes; Based on the dataset, the node-internal attention-second generation graph attention network model is trained to obtain the harmonic state estimation model; The harmonic state estimation model is used to estimate the harmonic state of the distribution network.

2. The method according to claim 1, characterized in that, The dataset, based on the power distribution network topology and the harmonic data of some nodes, includes: The power distribution network topology and some node harmonic data are divided into training set, validation set and test set according to a preset ratio.

3. The method according to claim 2, characterized in that, Based on the aforementioned dataset, an intra-node attention-second-generation graph attention network model was trained to obtain a harmonic state estimation model, including: The training set is used to train the node-internal attention-second generation graph attention network model to obtain the harmonic state estimation model.

4. The method according to claim 3, characterized in that, The harmonic state estimation model is obtained by training the intra-node attention-second-generation graph attention network model using the training set, including: Construct an adjacency matrix based on the distribution network topology in the training set; Construct a node feature matrix based on partial node harmonic data from the training set; The adjacency matrix and the node feature matrix are used to train the intra-node attention-second generation graph attention network model until the number of training iterations reaches the preset maximum number of training iterations, thereby obtaining the harmonic state estimation model.

5. The method according to claim 1, characterized in that, The harmonic state estimation model includes a node feature enhancement layer, a four-layer node intra-node attention-second generation graph attention network layer, and two fully connected layers connected in sequence. Using the aforementioned harmonic state estimation model to estimate the harmonic state of the distribution network includes: Acquire real-time distribution network topology and real-time harmonic data of some nodes; An adjacency matrix is ​​constructed based on the real-time distribution network topology, and a node feature matrix is ​​constructed based on the real-time partial node harmonic data. The adjacency matrix and the node feature matrix are input into the harmonic state estimation model. The node feature matrix is ​​augmented with a dimension using the node feature enhancement layer. The four-layer intra-node attention-second-generation graph attention network layer is used to perform neighborhood aggregation on the node feature matrix and the adjacency matrix after the dimension is increased, resulting in a node feature matrix after sufficient spatial aggregation. The two fully connected layers are used to perform node-by-node multi-layer linear transformation and nonlinear mapping on the node feature matrix after sufficient spatial aggregation, and the harmonic voltage of the node to be estimated is output.

6. The method according to claim 5, characterized in that, Adding a dimension to the node feature matrix using the node feature enhancement layer includes: In the node feature enhancement layer, a first feature value is added to the monitored nodes in the node feature matrix, and a second feature value is added to the unmonitored nodes in the node feature matrix.

7. The method according to claim 5, characterized in that, The four-layer intra-node attention-second-generation graph attention network is used to perform neighborhood aggregation on the node feature matrix after the increase in dimension and the adjacency matrix, resulting in a node feature matrix after sufficient spatial aggregation, including: In each layer of the in-node attention-second generation graph attention network, the in-node attention mechanism is used to assign internal weights to the node features of the node feature matrix output by the previous layer, and the updated node feature matrix is ​​output. Based on the updated node feature matrix and the adjacency matrix, the second generation graph attention network layer is used to perform feature aggregation to obtain the aggregated node feature matrix.

8. The method according to claim 7, characterized in that, The node feature matrix output from the previous layer is assigned internal weights using an intra-node attention mechanism. The updated node feature matrix output includes: Calculate the deviation of each feature within a node from its mean and the local outlier degree of the deviation; The local outlier degree and the average outlier degree within the node are calculated to obtain the relative importance assumptions of each feature; The internal weights of node features are calculated based on the relative importance assumption, scaling factor, and bias. The updated node feature matrix is ​​output based on the internal weights of the node features.

9. The method according to claim 8, characterized in that, Calculate the deviation of each feature within a node from its mean, and the local outlier degree of the deviation, specifically as follows: ; In the formula, This represents the deviation of each feature within a node from its mean. Represents a node i Each eigenvalue, Represents a node i The mean of all eigenvalues. This represents the local dispersion of the deviation. Indicates element-wise multiplication; The local outlier degree and the average outlier degree within a node are calculated to obtain the relative importance assumptions of each feature, specifically: ; In the formula, This represents the assumption of the relative importance of each feature. Represents a node i Inner average outlier Represents a zero-valued constant; Based on the aforementioned relative importance assumption, scaling factor, and bias, the internal weights of the node features are calculated as follows: ; In the formula, Represents a node i Internal weights of features Indicates the scaling factor. Indicates bias. This represents a non-linear activation function.

10. A distribution network harmonic state estimation system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements each step of the method for estimating the harmonic state of a distribution network as described in any one of claims 1 to 9.