Active power distribution network anomaly identification and positioning method, system and computer storage medium
Patent Information
- Application Number
- CN202611245689.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-10-30
AI Technical Summary
基于物理模型的阻抗法、行波法、加权最小二乘状态估计方法,高度依赖精准的线路阻抗、网络拓扑参数;而分布式电源频繁投切会造成拓扑动态变化,参数更新存在滞后,参数误差易导致计算发散,同时迭代求解耗时较长,难以满足异动实时监测需求
[0017]本发明的有益效果为:通过对异动样本施加差异化的惩罚权重,强制模型关注少数类样本,显著提升了模型在数据不均衡场景下的分类性能,能够高精度地识别并定位分布式电源的接入与切除行为。
Smart Images

Figure CN123012746A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system distribution network technology, specifically relating to methods, systems and media for identifying and locating anomalies in active distribution networks. Background Technology
[0002] With the large-scale integration of distributed power sources such as photovoltaics, wind power, and energy storage into the distribution network, the traditional unidirectional radial distribution network has evolved into an active distribution network with bidirectional power flow. The random connection and disconnection of distributed power sources can instantaneously change the injected power at nodes, causing voltage deviations and power flow redistribution, which can easily lead to voltage exceeding limits and relay protection malfunctions. Therefore, accurate identification and node location of distributed power source switching anomalies are core requirements for ensuring the safe and stable operation of the active distribution network.
[0003] Existing distribution network anomaly monitoring technologies are mainly divided into two categories: physical model methods and data-driven methods. Impedance methods, traveling wave methods, and weighted least squares state estimation methods based on physical models rely heavily on accurate line impedance and network topology parameters; however, frequent switching of distributed generation causes dynamic changes in the topology, parameter updates are lagging, parameter errors can easily lead to calculation divergence, and iterative solutions are time-consuming, making it difficult to meet the needs of real-time anomaly monitoring.
[0004] Traditional data-driven methods often employ SVM and ordinary convolutional neural networks, treating power grid electrical quantities as ordinary two-dimensional matrices. They lack the ability to capture weak distributed power source switching anomaly signals, making it difficult for existing technologies to meet the requirements of anomaly identification and accurate location in active distribution networks with a high proportion of distributed power sources. Summary of the Invention
[0005] The purpose of this invention is to design a weighted joint loss function that integrates dynamic weights of samples and limits the loss weight of the classification task to be less than the loss weight of the localization task, thereby reducing the identification bias caused by sample imbalance and multi-task gradient conflict. This enables an active power distribution network anomaly identification and localization method with high-precision type identification and accurate node localization for distributed power source access and disconnection anomalies.
[0006] To achieve the above objectives, this invention proposes a method for identifying and locating anomalies in an active power distribution network, comprising:
[0007] Three power grid operating conditions were simulated using power flow simulation. Electrical data from each node was collected and labeled with anomaly tags to generate an original labeled dataset. This dataset was then split into three categories: training, validation, and testing samples. The three power grid operating conditions include normal operation, distributed generation access, and distributed generation disconnection. The original labeled dataset was processed by differential processing and multi-dimensional feature extraction. Combined with the power grid topology, a standardized graph dataset was generated. Based on the standardized graph dataset, a multi-head attention multi-task network model was constructed, with differentiated attention weights and dual output branches configured to obtain an initial identification and localization model. Based on the standardized graph dataset and the initial identification and localization model, the number of samples was counted, sample weights were calculated, and a weighted joint loss function was constructed. The loss weight for the classification task was set to be less than that for the localization task. The network parameters were iteratively updated based on the weighted joint loss function to obtain the anomaly identification and localization model. Real-time measurement data of the power grid was collected from the field. Real-time graph data was generated using the same processing methods as differential processing, multi-dimensional feature extraction, and topology transformation. The real-time graph data was input into the anomaly identification and localization model, which outputs the type of distributed generation access and disconnection switching behavior and the anomaly node number, thus completing the anomaly identification and localization.
[0008] In one optional implementation, based on the standardized graph dataset and the initialization identification and localization model, the number of samples is counted, sample weights are calculated, and a weighted joint loss function is constructed. The loss weight for the classification task is set to be less than the loss weight for the localization task. The network parameters are iteratively updated based on the weighted joint loss function to obtain the anomaly identification and localization model. Specifically, this includes: counting the total number of normal node samples and the total number of anomaly node samples in the standardized graph dataset, and calculating the positive sample weights; constructing a weighted binary cross-entropy loss corresponding to the localization task and a multi-class cross-entropy loss corresponding to the classification task based on the positive sample weights; setting the loss weights for the classification task and the localization task, with the loss weight for the classification task being less than the loss weight for the localization task, and fusing the two types of losses to obtain the weighted joint loss function; using an optimizer to backpropagate according to the weighted joint loss function to iteratively update the network parameters of the initialization identification and localization model until the model converges to obtain the anomaly identification and localization model.
[0009] In one optional implementation, the original labeled dataset is subjected to differential processing and multidimensional feature extraction, and a standardized graph dataset is generated by combining the power grid topology. Specifically, this includes: taking the electrical quantities at adjacent times in the original labeled dataset and performing differential processing to obtain differential data; extracting multidimensional features based on the differential data; and constructing an adjacency matrix based on the multidimensional features, with distribution network buses and distributed power sources as vertices and line branches as edges, to generate a standardized graph dataset.
[0010] In one optional implementation, the differential processing involves calculating the difference between electrical quantities at adjacent acquisition times.
[0011] In one optional implementation, the original labeled dataset is generated using Monte Carlo simulation, and stratified sampling is used to divide it into training set, validation set, and test set, with sample proportions of 70%, 15%, and 15% respectively.
[0012] In one alternative implementation, the multidimensional features include differential voltage, differential phase angle, differential active power, differential reactive power, and neighborhood voltage difference.
[0013] In one alternative implementation, the power flow simulation uses the Pandapower tool to solve the power flow, with a load fluctuation range of 0.6 to 1.4 times the rated load.
[0014] In one optional implementation, the multi-head attention multi-task network model has 8 attention heads and the hidden layer feature dimension is set to 256.
[0015] This invention also proposes an active distribution network anomaly identification and location system to implement the aforementioned active distribution network anomaly identification and location method. The system includes: a simulation data generation module, used to simulate three power grid operating conditions—normal operation, distributed power source integration, and distributed power source disconnection—through power flow simulation, collecting electrical data from each node and labeling them with anomaly tags to generate an original labeled dataset, which is then hierarchically split into training, validation, and test samples; a data preprocessing module, connected to the simulation data generation module, used to perform differential processing and multi-dimensional feature extraction on the original labeled dataset, and generate a standardized graph dataset based on the power grid topology; and a network construction module, connected to the data preprocessing module, used to construct a multi-head attention multi-task network model based on the standardized graph dataset, and configure differentiated attention weights. The system employs a dual-output branch to obtain an initialization identification and localization model. A model training module, connected to both the data preprocessing module and the network construction module, is used to construct a weighted joint loss function based on the standardized graph dataset and the initialization identification and localization model. This function calculates sample weights by counting the number of samples, sets the loss weight for classification tasks to be less than that for localization tasks, and iteratively updates network parameters based on the weighted joint loss function to obtain the anomaly identification and localization model. An online monitoring module, connected to the model training module, is used to collect real-time measurement data from the power grid, generate real-time graph data using the same processing methods of differential analysis, multi-dimensional feature extraction, and topology transformation, input the real-time graph data into the anomaly identification and localization model, and output the type of distributed power source access, disconnection / switching behavior, and the anomaly node number.
[0016] The present invention also proposes a computer storage medium storing a computer program, which, when executed by a processor, implements any of the active power distribution network anomaly identification and location methods described in the present invention.
[0017] The beneficial effects of this invention are as follows: by applying differentiated penalty weights to abnormal samples, the model is forced to focus on minority class samples, which significantly improves the classification performance of the model in the case of imbalanced data, and can accurately identify and locate the access and disconnection behavior of distributed power sources. Attached Figure Description
[0018] Figure 1 A flowchart of the active power distribution network anomaly identification and location method provided in the embodiments of the present invention;
[0019] Figure 2 This is an architecture diagram of the active power distribution network anomaly identification and location method provided in the embodiments of the present invention. Detailed Implementation
[0020] Frequent connection and random disconnection of distributed generation sources can cause instantaneous changes in the topology and power flow distribution of the distribution network, leading to problems such as voltage sags, frequency deviations, and even relay protection malfunctions. Therefore, how to achieve real-time perception, accurate identification, and anomaly location of distributed generation behavior in active distribution networks has become a critical issue that urgently needs to be addressed to improve the situational awareness capability of the distribution network and ensure the safe and stable operation of the system.
[0021] For distribution network anomaly identification and location, early physical model-based methods often utilized state estimation or analytical models for residual analysis. For example, some literature proposed an extended impedance-based fault location model, which achieved high location accuracy in radial networks by establishing analytical equations for fault current and measurement voltage. Regarding distribution network state awareness, some literature constructed classic distribution system state estimation frameworks, using measurement residual analysis to identify bad data and topology errors in the network. Furthermore, to address the bidirectional power flow problem brought about by distributed generation, some scholars proposed linearized state estimation methods based on miniature synchronous phasor measurement units to improve the observability of active distribution networks. However, these physical model-based methods have significant limitations in practical applications of active distribution networks. First, these methods heavily rely on accurate network topology parameters and line impedance information. However, in actual operation, the random switching of distributed generation leads to frequent changes in the distribution network topology, and the real-time acquisition of physical parameters is often delayed, making parameter errors highly susceptible to model divergence. Secondly, analytical methods typically involve complex iterative calculations, which result in low computational efficiency when dealing with massive amounts of high-dimensional measurement data, making it difficult to meet the need for millisecond-level real-time monitoring of anomaly events.
[0022] To overcome the dependence of physical models on parameters, data-driven methods have gradually become a research hotspot. Some literature utilizes support vector machines to construct multi-classifiers, extracting voltage sag amplitude and duration features to identify power quality disturbance sources. For example, some literature proposes a distribution network fault location method based on combined neural networks, utilizing deep learning to mine the spatiotemporal features of measurement data. However, traditional machine learning methods typically treat power grid data as a regular matrix in Euclidean space, ignoring the naturally existing physical connections and non-Euclidean topology between distribution network nodes, thus limiting the model's generalization ability in complex networks. In recent years, Graph Neural Networks (GNNs) have been introduced into power systems due to their powerful graph data processing capabilities. They can naturally model the topological connections and electrical coupling relationships of distribution networks, showing significant advantages in tasks such as node classification and link prediction. Some literature proposes a state estimation model based on message-passing graph neural networks, which effectively improves the estimation accuracy when measurement data is damaged through message aggregation mechanisms between nodes. Some literature has proposed a fault location framework for distribution networks based on graph convolutional networks for the first time. By using graph convolutional depth mining to explore the spatial correlation between node voltage and network topology, it demonstrates the advantages of graph algorithms in extracting network features. Other literature further utilizes graph multi-task learning models to achieve rapid convergence and distribution calculation of power flow in distribution networks. For the extraction of specific anomaly features, attention mechanisms are used to adaptively assign weights to different neighboring nodes, significantly enhancing the model's ability to capture key fault nodes. Although GCN and GAT have made some progress in fault location and feature extraction, most existing studies are based on the assumption of balanced training sample classes, and their applications are mostly in distribution network fault detection, rarely focusing on the identification and real-time location of distributed generation switching in distribution networks. In the actual operation of active distribution networks, distributed generation switching is a low-frequency, sporadic event, and the number of anomaly samples is far less than the number of normal samples. Severe sample imbalance can cause the model to overemphasize the majority class samples during training, resulting in missed detections of key anomaly events. Therefore, how to fully mine data features while overcoming data distribution bias is a key problem that urgently needs to be solved.
[0023] The purpose of this invention is to overcome the shortcomings of existing power distribution network monitoring schemes, such as difficulty in adapting to random switching scenarios of distributed power sources, inability of graph convolutional networks to adaptively distinguish the importance of neighboring nodes, imbalance in the distribution of abnormal and normal samples, lack of differentiated balance of classification and location weights in multi-task training, and susceptibility of raw electrical quantities to interference from steady-state load fluctuations. This invention provides an active power distribution network anomaly identification and location method and system based on a multi-head graph attention multi-task network.
[0024] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] In traditional distribution networks, electrical energy mainly flows from substations to the user side, with a single power flow direction. With the large-scale integration of distributed generation, distribution networks are gradually transforming into "active distribution networks" with multi-source and multi-directional flows. The random switching behavior of distributed generation significantly alters the operating state of the power grid, and accurate description of this behavior is a prerequisite for intelligent identification.
[0026] The "abnormal events" referred to in this invention mainly refer to the connection and disconnection behaviors of distributed generation sources in the distribution network. From a physical perspective, these two types of behaviors can be defined as instantaneous changes in node-injected power. When the grid connection switch of a distributed generation source is closed, the node changes from a pure load node to a power source node or a source-load node, injecting active and reactive power into the grid; when the distributed generation source disconnects from the grid due to a fault or dispatch requirements, the node-injected power instantaneously drops to zero, and the grid loses power support.
[0027] like Figure 1 As shown in the embodiments of the present invention, in one aspect, a method for identifying and locating anomalies in an active power distribution network is provided, comprising the following steps:
[0028] Step S101: Simulate three power grid operating conditions through power flow simulation, collect electrical data of each node and label them with abnormality tags to generate the original labeled dataset, and then split it into three types of samples: training, verification and testing. The three power grid operating conditions include normal operation, distributed power source access and distributed power source disconnection.
[0029] Step S103: Perform differential processing and multi-dimensional feature extraction on the original labeled dataset, and generate a standardized graph dataset by combining the power grid topology;
[0030] Step S105: Construct a multi-head attention multi-task network model based on a standardized graph dataset, configure differentiated attention weights and dual output branches, and obtain the initial recognition and localization model;
[0031] Step S107: Based on the standardized graph dataset and the initial recognition and localization model, count the number of samples, calculate the sample weights, construct a weighted joint loss function, set the loss weight of the classification task to be less than the loss weight of the localization task, iteratively update the network parameters based on the weighted joint loss function, and obtain the anomaly recognition and localization model.
[0032] Step S109: Collect real-time measurement data of the power grid on site, generate real-time graph data according to the same processing method of differential, multi-dimensional feature extraction and topology transformation, input the real-time graph data into the anomaly identification and location model, and output the type of distributed power source access, disconnection and switching behavior and the number of the anomaly node to complete the anomaly identification and location.
[0033] In this embodiment, the switching of DGs not only alters the power balance of nodes but also causes a redistribution of network voltage distribution and power flow. Let the voltage amplitude of node i in the distribution network be V, and the phase angle be... Active power injected is P, and reactive power injected is Q. When an anomaly occurs, the changes in node state variables satisfy the power flow equation constraints. At the instant the anomaly occurs, due to the existence of line impedance, power fluctuations will propagate along the network topology, causing voltage fluctuations throughout the network. Especially for long-distance radial IEEE 33-node systems, the voltage of the terminal nodes is particularly sensitive to power changes. Therefore, by monitoring the electrical quantities (P, Q, V, ...) of each node... The spatiotemporal distribution characteristics of electrical quantities (X) can theoretically be used to infer the location and type of anomalies. The goal of this invention is to establish a mathematical model F that, by observing the electrical quantity matrix X, can accurately identify the anomaly category Y and locate the node number where the anomaly occurred.
[0034] In this embodiment, the composition of the original feature set needs to be clarified before feature selection. The possible distribution network measurement data are regarded as candidate features. For a power system with n nodes, the power flow equation in polar coordinate form is shown in equation (1).
[0035] (1)
[0036] in, , These represent the active power and reactive power generated by the power source at node i, respectively. , These represent the active power and reactive power consumed by the load at node i, respectively. , These represent the injected active power and reactive power at node i, respectively. Let be the voltage amplitude at node i; The voltage phase angle difference between node i and node j; , These are the real and imaginary parts of the nodal admittance matrix, respectively.
[0037] As can be seen from equation (1), the state of any node i in the power system is determined by the following four parameters: node voltage amplitude, voltage phase angle difference between node i and node j, active power injected into the node, and reactive power.
[0038] Furthermore, the power flow simulation uses the Pandapower tool to solve the power flow problem, with the load fluctuation range being 0.6 to 1.4 times the rated load.
[0039] Pandapower, a professional power flow simulation tool, is used to accurately solve the power flow equations of active distribution networks and stably output complete electrical quantity data for each node. The simulation results closely match the actual physical operation of the distribution network, ensuring the authenticity and reliability of the generated dataset. The load is set to fluctuate within a range of 0.6 to 1.4 times the rated load, fully covering the high and low fluctuations of daily loads for residential and industrial users. This simulates the power grid operation under different load baselines, allowing the dataset to include diverse steady-state backgrounds. The trained model can adapt to varying load levels on-site, reducing the interference of steady-state load on anomaly identification.
[0040] The distribution network is a time-varying nonlinear system, and the electrical state quantities of nodes are affected by two types of factors: 1. Slow dynamic background: caused by random fluctuations in user loads; 2. Fast dynamic disturbances: caused by the instantaneous connection or disconnection of distributed generation (DG). Since the state offset caused by load fluctuations is often much larger than that caused by the switching of a single DG, differential processing is performed on all features. All features are represented by difference values rather than absolute values to eliminate ground-state bias, focus on changing quantities, effectively highlight abnormal signals, enhance the model's adaptability to different load levels, and reduce the interference of steady-state fluctuations on model detection.
[0041] Therefore, for any node i in the distribution network, a feature vector is constructed. As shown in equation (2):
[0042] (2)
[0043] in, It represents the voltage difference between the current moment and the reference steady-state moment, reflecting the voltage deviation caused by reactive or active power injection; The phase angle difference is highly sensitive to changes in active power flow. , These are the changes in active power injection and reactive power injection, physical quantities that directly reflect the changes in nodal source loads. The auxiliary feature, constructed by aggregating the voltage fluctuation amplitudes of adjacent nodes, is used to enhance the model's ability to perceive local topological anomalies, based on the voltage difference characteristics of the region.
[0044] By extracting change features through differential preprocessing, constructing a distribution network topology dataset, adopting multi-head attention adaptive aggregation of neighborhood features, and designing a weighted joint loss function that integrates dynamic weights of samples and limits the loss weight of classification tasks to be less than that of localization tasks, the identification bias caused by sample imbalance and multi-task gradient conflict is weakened, and high-precision type identification and accurate node localization of distributed power source access and disconnection anomaly behavior are achieved.
[0045] Graph Convolutional Neural Networks (GCNs) are a classic model in graph deep learning. Their core idea is to extend the translation invariance of traditional convolutional neural networks (CNNs) in Euclidean space to graph data in non-Euclidean space. Since the number of neighbors of nodes in a graph is not fixed, traditional fixed-length convolutional kernels cannot be directly applied. GCNs are based on Spectral Graph Theory (SGT) and define convolution operations on the graph domain through a first-order Chebyshev approximation, enabling the aggregation and updating of node information.
[0046] For a given graph G, the input data consists of two parts:
[0047] (1) The feature vector xi of each node i can be represented as an N×D feature matrix for the whole graph, where N is the number of nodes and D is the feature dimension.
[0048] (2) The matrix used to describe the graph structure is usually the adjacency matrix.
[0049] After inputting the data, GCN performs information transfer and feature learning at each node through multiple non-linear layers, generating the output features for each node. , where F represents the dimension of the output feature of each node. Furthermore, by introducing pooling operations, such as global average pooling, to aggregate information from the entire graph, the output features of the entire graph can also be generated. As shown in Equation (2), representing each neural network layer as a nonlinear function allows the network to learn more complex mapping relationships between graph structures and node features, thereby improving the performance and generalization ability of GCN.
[0050] The inter-layer feature update formula for GCN is Equation (3):
[0051] (3)
[0052] in, Let L be the node feature matrix of the l-th layer; To add a self-loop adjacency matrix (A is the original adjacency matrix, I is the identity matrix), ensure that the node's own characteristics are included in the aggregation; for The degree matrix (diagonal matrix) ), used to normalize feature scale; Let L be the learnable weight matrix of the l-th layer;
[0053] This is the activation function.
[0054] GCN has significant advantages in distribution network applications: it can effectively capture the local topological relationships of nodes, and its computational complexity is linearly related to the number of edges, making it suitable for large-scale networks. However, standard GCN uses fixed normalized weights determined by the degree matrix when performing neighborhood aggregation. This isotropic aggregation mechanism assumes that all neighboring nodes are of equal importance, and cannot adaptively focus on key nodes that contribute more to anomaly identification based on the current electrical state. To address this limitation, this invention further introduces a graph attention mechanism (GAT) to enhance the model's feature extraction capabilities.
[0055] To address the characteristics of distributed generation switching behavior in active distribution networks, such as high concealment, sparse sample distribution, and high topological dependence, an end-to-end graph deep learning anomaly identification framework is proposed. This framework takes graph data as input, adaptively extracts high-dimensional spatial features through a graph attention mechanism, and optimizes model training using a weighted loss function, ultimately achieving the dual tasks of "anomaly type identification" and "anomaly node localization."
[0056] GAT introduces an attention mechanism on top of GCN, assigning differentiated weights to different neighbors, thus overcoming the limitation of GCN's "equal treatment" of all neighbors. Its core improvement is to calculate the association strength between nodes through the attention mechanism, giving higher weights to important neighbor nodes, thereby enabling important neighbors to contribute more to node feature updates.
[0057] The attention weights of GAT are calculated using equation (4):
[0058] (4)
[0059] Where N(i) is the set of neighbors of node i; It is a linear transformation matrix; is the attention parameter vector; || denotes the vector concatenation operation; LeakyReLU is the activation function.
[0060] Furthermore, the multi-head attention multi-task network model has 8 attention heads and the hidden layer feature dimension is set to 256.
[0061] Eight sets of multi-head attention heads are set up to extract the topological correlation features of the distribution network in parallel. This can capture the propagation correlation of voltage and power disturbances between nodes from multiple dimensions in parallel. Compared with single-head attention, it can fully explore the abnormal coupling relationship between different branches and near and far nodes, and accurately identify the global power flow fluctuation characteristics caused by distributed power generation switching.
[0062] Setting the hidden layer feature dimension to 256 provides sufficient feature mapping space for the electrical differential features of the power grid and the neighborhood topology correlation features, fully preserving subtle anomaly information, avoiding the loss of key disturbance features due to insufficient feature dimension, and improving the characterization capability of weak DG switching signals.
[0063] The combination of 8 attention heads with 256-dimensional hidden layers is suitable for the source distribution network DG switching identification and localization task. It avoids the problems of insufficient feature extraction due to too few heads or dimensions, and the problems of redundant model parameters, slow training speed and high risk of overfitting due to too large parameter scale. It balances the model's recognition accuracy and training inference efficiency.
[0064] For the task of locating abnormal nodes in active distribution networks, it is necessary to identify all nodes in the network that have undergone state changes. Since the state of each node needs to be predicted independently, and a single abnormal event may involve multiple nodes, this task is essentially a multi-label classification problem. To comprehensively evaluate the accuracy and robustness of the model in abnormal node location, this invention selects the Exact Match Ratio, Hamming Loss, and Micro-F1 Score as evaluation metrics.
[0065] (1) Exact match ratio
[0066] The exact match ratio is the most stringent evaluation metric in multi-label classification. It aims to measure whether the model can completely and accurately reproduce the abnormal topology of the distribution network. A sample is considered to be correctly predicted only if the model's predicted state values for all L nodes in a sample are completely consistent with the actual values. Its calculation formula is shown in equation (5):
[0067] (5)
[0068] Where N is the total number of test samples, Indicates the first The true label vector of each sample For the first Predicted label vectors for each sample. This is an indicator function. This metric reflects the absolute accuracy of the model in system-level localization.
[0069] (2) Hamming's loss
[0070] Hamming loss is used to evaluate the proportion of incorrectly predicted node labels out of the total number of labels. Unlike exact match ratio, it focuses on the specific degree of misjudgment. The lower the Hamming loss value, the smaller the localization error of the model for a single node, and the better the performance. The calculation formula is shown in equation (6):
[0071] ;
[0072] in, For the first In the nth sample The actual state of each node (0 or 1); For the first In the nth sample The predicted state of each node (0 or 1); This represents the XOR operation.
[0073] (3) The average F1 score
[0074] In distribution network anomaly scenarios, the nodes experiencing anomalies typically account for only a small portion of the network nodes, resulting in significant sparsity and imbalance in the label distribution. To objectively reflect the model's ability to capture anomaly nodes, i.e., positive samples, and to avoid being masked by a large number of normal background nodes, i.e., negative samples, this invention employs a micro-average F1 score. This index is calculated based on globally statistical anomaly nodes (TP), false positives (FP), and false negatives (FN), and the calculation formula is shown in equation (7):
[0075] (7)
[0076] Micro-F1 can effectively balance the precision and recall of a model, and is a key indicator for evaluating imbalanced multi-label classification tasks.
[0077] The method of this invention first constructs a graph-structured data containing node electrical quantities and network topology features. It then utilizes a graph attention mechanism to adaptively learn the association weights between nodes, focusing on key neighborhood features that contribute more to anomaly identification, thus overcoming the rigidity of traditional GCN weight allocation. Secondly, to address the training imbalance problem caused by the sparsity of anomaly samples, an inverse class weighted loss function is designed. By applying differentiated penalty weights to anomaly samples, the model is forced to focus on minority class samples, significantly improving the model's classification performance in imbalanced data scenarios. Simulation experiments conducted on the IEEE 33-node power distribution system demonstrate that this method can accurately identify and locate the connection and disconnection of distributed power sources, achieving an F1 score of 98.98%, validating the effectiveness and superiority of the proposed method under complex operating conditions.
[0078] Furthermore, the original labeled dataset was generated using Monte Carlo simulation, and stratified sampling was used to divide it into training, validation, and test sets, with sample proportions of 70%, 15%, and 15%, respectively.
[0079] Monte Carlo simulation is used to generate a large number of distribution network simulation samples in batches, which can cover a variety of complex operating conditions such as different load fluctuations, output of multiple types of distributed power sources, and random switching of DG. This greatly expands the diversity of the dataset samples, avoids overfitting due to the model only learning a single fixed scenario, and improves the model's generalization ability under the complex operating conditions of real distribution networks.
[0080] By using stratified sampling to divide the training, validation, and test sets, the distribution ratio of various abnormal samples in the three sets of data—normal operation, DG access, and DG retraction—is kept consistent with the original dataset, avoiding the problem of sample class imbalance caused by random sampling. During training, the model can learn the characteristics of various working conditions evenly, and the validation and test results can objectively and truthfully reflect the model's recognition performance of various DG deployment and retraction anomalies, improving the reliability and persuasiveness of the model evaluation results.
[0081] By fixing the sample division ratios to 70%, 15%, and 15%, the training set samples are sufficient to fully complete the model feature learning, while a sufficient validation set is reserved for hyperparameter tuning and early stopping to prevent overfitting. The test set is large enough to support accurate quantification of model recognition and positioning accuracy, taking into account both model training effect and performance evaluation accuracy.
[0082] Step S103 involves performing differential processing and multi-dimensional feature extraction on the original labeled dataset, and generating a standardized graph dataset by combining it with the power grid topology. This specifically includes the following steps:
[0083] Step S1031: Take the electrical quantities at adjacent time points from the original labeled dataset and perform difference processing to obtain the difference data;
[0084] Step S1033: Extract multidimensional features based on differential data;
[0085] Step S1035: Based on multi-dimensional features, construct an adjacency matrix with distribution network bus and distributed power source as vertices and line branches as edges to generate a standardized graph dataset.
[0086] By performing differential processing on the raw electrical quantities between adjacent time points, the static ground state offset caused by long-term steady-state fluctuations of the load can be eliminated, and only the instantaneous changes in electrical quantities caused by distributed generation switching can be retained. This effectively removes irrelevant background interference signals, amplifies the weak switching anomaly characteristics of DG, improves the model's sensitivity to small power fluctuations and voltage fluctuations, and avoids the omission of anomaly signals caused by steady-state load changes masking anomaly signals.
[0087] By constructing an adjacency matrix with busbars and distributed power sources as vertices and line branches as edges to form a graph structure, the physical topology coupling relationship of the distribution network is naturally restored. This overcomes the shortcomings of traditional machine learning, which treats power grid data as an ordinary two-dimensional matrix and ignores the spatial correlation of nodes. The model can learn the propagation characteristics of disturbances along the line based on the graph structure, thereby more accurately mining the diffusion pattern of anomalies in the network and adapting to the topology characteristics of radial active distribution networks.
[0088] Differential preprocessing, multidimensional feature extraction, and topology graph combination form a standardized graph dataset, unifying the input data format and feature dimensions. This eliminates data differences caused by different load levels and different operating baselines, enhances the model's adaptability under varying distribution network conditions, and provides high-quality, highly recognizable graph samples for subsequent multi-head graph attention networks. This reduces the difficulty of model learning from the data source and simultaneously improves the overall accuracy of subsequent anomaly identification and node localization.
[0089] The differential processing method calculates the difference between electrical quantities at adjacent acquisition times. This method has a simple calculation logic, low computational overhead, and eliminates the need for complex benchmark steady-state data storage and matching. It enables rapid data preprocessing in online monitoring scenarios. The difference between adjacent times can directly filter out slow-dynamic long-term steady-state load offset components, retaining only instantaneous electrical quantity changes caused by distributed generation switching. This effectively removes continuously changing load background interference, amplifies weak source-load anomaly characteristics, and prevents steady-state load fluctuations from masking DG switching disturbance signals, reducing the chance of missed anomaly detection. Furthermore, using the time-series adjacent difference as the input benchmark eliminates differences in data dimensions and amplitudes caused by different operating baselines and load levels. This weakens the influence of the operating condition baseline on model judgment, improves the model's generalization performance under variable load scenarios, and eliminates the need for separate data calibration for different load intervals.
[0090] Among them, the multidimensional features include differential voltage, differential phase angle, differential active power, differential reactive power, and neighborhood voltage difference.
[0091] Based on differential data, a multi-dimensional feature vector is constructed, which includes differential voltage, differential phase angle, differential active power, differential reactive power, and neighborhood voltage difference. This vector comprehensively depicts the disturbance state of distribution network nodes from multiple dimensions, including reactive power offset, active power flow, and local neighborhood fluctuations. Compared with single electrical quantity features, this vector can more comprehensively capture the propagation law of power flow across the entire network caused by DG switching, enrich the model input feature information, and improve the ability to distinguish anomalies.
[0092] Furthermore, the multi-head attention multi-task network model has 8 attention heads and the hidden layer feature dimension is set to 256.
[0093] Further, in step S107, based on the standardized graph dataset and the initialized recognition and localization model, the number of samples is counted, sample weights are calculated, and a weighted joint loss function is constructed. The loss weight for the classification task is set to be less than the loss weight for the localization task. The network parameters are iteratively updated based on the weighted joint loss function to obtain the anomaly recognition and localization model. Specifically, this includes the following steps:
[0094] Step S1071: Calculate the total number of normal node samples and the total number of abnormal node samples in the standardized graph dataset, and obtain the weight of positive samples;
[0095] Step S1073: Construct a weighted binary cross-entropy loss for the localization task based on the positive sample weights, and construct a multi-class cross-entropy loss for the classification task.
[0096] Step S1075: Set the loss weights for the classification task and the localization task, with the loss weight for the classification task being less than the loss weight for the localization task, and fuse the two types of losses to obtain a weighted joint loss function;
[0097] Step S1077: The optimizer is used to backpropagate according to the weighted joint loss function to iteratively update the network parameters of the initial identification and localization model until the model converges, thus obtaining the anomaly identification and localization model.
[0098] In the node localization task, the number of abnormal nodes (positive samples) is far less than that of normal nodes (negative samples). Under the standard binary cross-entropy loss, the model is easily dominated by a large number of negative samples, resulting in "all-zero prediction". To address this, the present invention introduces dynamic positive sample weights. Before training begins, the ratio of positive to negative samples for all nodes in the training set is statistically analyzed, and the weight coefficients are calculated using equation (8). :
[0099] (8)
[0100] In the formula, This represents the total number of abnormal nodes in all training samples. This represents the total number of normal nodes.
[0101] As shown in equation (9), the improved We employ a weighted binary cross-entropy loss function:
[0102] (9)
[0103] This weight It can significantly amplify the loss value generated by abnormal nodes, forcing the model to pay more attention to sparse fault signals during backpropagation.
[0104] Since the ultimate goal of this invention is to accurately locate and identify the types of abnormal nodes, it is equivalent to simultaneously solving two levels of problems: graph-level abnormal type classification and node-level abnormal location. This is a typical multi-task learning scenario. Furthermore, in distribution network abnormality datasets, the number of samples of different types often varies significantly, causing the model to tend to favor the majority class, resulting in decreased performance in identifying the minority class. To address the extreme imbalance between positive and negative samples in distribution network abnormality location, this invention proposes a weighted joint loss function. This function introduces dynamic weights into the node location task, forcing the model to focus on the minority of "abnormal nodes," reducing the contribution of easily classified samples, and focusing on difficult-to-classify samples. This avoids the model falling into the "all-zero prediction" trap due to a large number of non-abnormal nodes. To collaboratively optimize these two tasks with different learning difficulties and sample distribution characteristics, a joint loss function based on positive sample weighting and task balancing is designed.
[0105] The weighted joint loss function is defined as equation (10):
[0106] (10)
[0107] in, The standard cross-entropy loss for pattern recognition tasks; This is the weighted binary cross-entropy loss; , This is the balance coefficient. After optimizing the experimental parameters, it was selected. , By significantly reducing the weight of the simple task of type recognition, gradient dominance is prevented, forcing the model to focus on optimizing the more challenging localization task in the later stages of training. The overall model architecture is as follows: Figure 2 As shown.
[0108] By calculating the dynamic positive sample weights by statistically analyzing the number of normal and abnormal node samples, a greater loss penalty is applied to sparse abnormal positive samples. This can balance the data distribution imbalance caused by the large disparity in the number of positive and negative samples in the node localization task, avoid the defect of the model biasing towards the majority of normal nodes during training and predicting all nodes as having no abnormality, and significantly reduce the false negative rate of DG switching abnormal events.
[0109] By distinguishing between the loss weights for classification and localization tasks and limiting the loss weight of classification tasks to be less than that of localization tasks, and considering the higher difficulty of node localization in DG projection scenarios, the model gradient update prioritizes optimizing the anomaly localization accuracy during training. This prevents the gradient from dominating the model update in simple classification tasks, solves the problem of mutual interference between gradients during multi-task training, and the difficulty in balancing the two performance aspects, and simultaneously improves the accuracy of anomaly type recognition and the precision of anomaly node localization.
[0110] The localization task uses weighted binary cross-entropy loss, and the classification task uses multi-class cross-entropy loss. It matches the output format and label features of the two tasks of "node binary classification localization + graph-level multi-class recognition". The loss function is more adaptable to the task and the model converges faster. Even under the complex power distribution network conditions of random switching of distributed power sources and extremely sparse samples, it can still maintain a high Micro-F1 and node matching accuracy.
[0111] The weighted joint loss strategy, combined with multi-head graph attention network and differential feature preprocessing scheme, fully leverages the advantages of graph attention in capturing the propagation characteristics of power grid topology fluctuations. At the same time, loss constraints correct the model bias caused by sample imbalance, ultimately achieving high-precision identification of distributed power source access and disconnection anomalies in active distribution networks and accurate location of nodes across the entire domain.
[0112] On the other hand, this invention also proposes a distribution network fault isolation system based on a DC ring network for realizing anomaly identification and location methods in active distribution networks. The system includes a simulation data generation module, a data preprocessing module, a network construction module, a model training module, and an online monitoring module. The simulation data generation module is used to simulate three power grid operating conditions—normal operation, distributed power source access, and distributed power source disconnection—through power flow simulation, collect electrical data from each node, label anomalies, generate an original labeled dataset, and hierarchically split it into three types of samples: training, validation, and testing. The data preprocessing module is connected to the simulation data generation module and is used to perform differential processing and multi-dimensional feature extraction on the original labeled dataset, and generate a standardized graph dataset based on the power grid topology. The network construction module is connected to the data preprocessing module and is used to construct a standardized graph dataset based on the standardized graph dataset. A multi-head attention multi-task network model is constructed, with differentiated attention weights and dual output branches configured to obtain an initial identification and localization model. The model training module is connected to the data preprocessing module and the network construction module, respectively. It is used to construct a weighted joint loss function based on the standardized graph dataset and the initial identification and localization model, by counting the number of samples and calculating the sample weights. The loss weight of the classification task is set to be less than that of the localization task. The network parameters are iteratively updated based on the weighted joint loss function to obtain the anomaly identification and localization model. The online monitoring module is connected to the model training module to collect real-time measurement data of the power grid on site. Real-time graph data is generated according to the same processing method of differential, multi-dimensional feature extraction and topology transformation. The real-time graph data is input into the anomaly identification and localization model, and the output is the type of distributed power source access, disconnection and switching behavior and the number of the anomaly node.
[0113] Application example:
[0114] 1. Dataset Construction
[0115] Based on the IEEE 33-bus distribution system model, a large-scale dataset containing three operating conditions—normal operation, distributed power source integration, and distributed power source disconnection—was constructed using the pandapower simulation platform.
[0116] To reflect the actual operating conditions of the power distribution network, where there are many normal operating scenarios and few scenarios of distributed power generation switching, the proportion of normal and abnormal samples is shown in Table 1.
[0117] Table 1 Sample Proportion Division
[0118]
[0119] In the simulation scenario, to conform to the actual operation of the distribution network and to accommodate the diversity and complexity of the samples, the load random fluctuation of 0.6-1.4 is simulated for normal samples; for samples with distributed generation, the different outputs of three types of DG are simulated, as shown in Table 2.
[0120] Table 2 DG Simulation Conditions
[0121]
[0122] When obtaining the dataset for simulation, the Monte Carlo simulation method is used to simulate the stochastic behavior of complex systems through a large number of repeated random trials. Each trial selects different scenarios, DG types, and output conditions. Based on a standard 33-node radial distribution network, pandapower implements the process of "physical model → mathematical model → numerical solution," completing one power flow calculation and obtaining the feature construction of one sample until the required number of samples is reached. Then, a stratified sampling method is used to divide the dataset into training, validation, and test sets to ensure consistent class distribution across subsets: the training set accounts for 70% for model parameter learning; the validation set accounts for 15% for hyperparameter tuning and early shutdown detection; and the test set accounts for 15% for evaluating the model's generalization ability.
[0123] 2. Parameter Settings
[0124] Based on the test scenario in Section 1, the parameter settings for obtaining the optimal model performance through multiple training tests are shown in Table 3. These parameters are only applicable to the distribution network diagram model described in this invention; for different distribution network diagram models, further optimization and parameter tuning are required.
[0125] Table 3 Hyperparameter Settings
[0126]
[0127] 3. Test Results of the IEEE 33-bus distribution system
[0128] 3.1 Fixed Distributed Power Supply Access Point
[0129] The distribution network dataset used in this section follows the pandapower simulation data generated in Section 1. Distributed generation (DG) connection points are only located at fixed nodes 6, 12, 18, 22, 25, 30, and 33. Node 6 is located in the front half of the feeder, close to the root node, but not directly connected, allowing observation of its impact on the nodes before and after it. Node 18 is one of the nodes with the lowest voltage; installing DG there can significantly improve voltage quality. Node 22 is located at the end of the feeder, allowing testing of the DG's voltage boosting effect at the end. Node 25 is located at the end of another branch and typically has a large load; installing DG there can reflect the volatility of renewable energy. Node 33, located at the very end of the feeder, is one of the nodes with the lowest voltage; installing DG there allows observation of its support for the weakest node. These nodes were chosen because they are also locations where distributed generation switching is most likely to occur in actual distribution network operation.
[0130] With a sample size of 30,000, after data cleaning, 26,129 samples were available. The GCN model with dynamic weighted loss function was selected, and the node location accuracy on the test set reached 96.02%, with an error rate of only 0.13%. This means that only 0.13% of the abnormal sample locations were predicted incorrectly, while the remaining 3.85% were due to the prediction of individual node anomalies, and the failure to identify the locations of all abnormal nodes.
[0131] 3.2 Distributed power supply access point is random
[0132] To verify the model's versatility, the abnormal scenarios were expanded to include all nodes except the root node, which can switch on and off distributed power sources, with a maximum of 6 nodes being connected / disconnected simultaneously. This better reflects the complexity of actual distribution network operation and verifies whether the model truly learns the physical laws of distribution network operation rather than simply memorizing specific node patterns.
[0133] Similarly, a dataset of 30,000 samples was generated. After cleaning the data and removing samples that did not converge, the remaining 25,591 samples were used as the dataset to train and test the model. The results on different models are shown in Table 4.
[0134] Table 4 Training Results
[0135]
[0136] When the distributed power generation access points are random throughout the distribution network, the learning difficulty of the model increases. It can be seen that the performance and accuracy of the model using the GCN fusion loss function are significantly reduced. At this time, the GAT fusion dynamic weighted loss function model proposed in this invention is used. In the prediction results, the accuracy reaches 98.33%, the error rate is only 0.05%, and the F1 index reaches 98.98%.
[0137] This invention focuses on the challenge of anomaly localization caused by frequent switching of distributed generation in active distribution networks. It constructs a distribution network anomaly dataset and proposes an anomaly identification and localization method based on graph attention network fusion weighted loss function, which has the following beneficial technical effects:
[0138] (1) Compared with the standard GCN, which uses isotropic fixed weights to aggregate neighborhood information, the graph attention mechanism introduced in this invention can adaptively assign aggregation weights to different neighboring nodes according to the dynamic changes in the electrical state of the nodes. This anisotropic aggregation strategy enables it to effectively capture the critical propagation path of voltage sags or power fluctuations in the network when anomalies occur, thereby significantly improving the model's localization accuracy for distributed power supply access and disconnection behaviors.
[0139] (2) To address the extreme sample imbalance caused by the sparse occurrence of abnormal events in actual power distribution network operation, the weighted loss function based on inverse class frequency designed in this invention plays a crucial role. Experiments show that this strategy effectively corrects the decision boundary bias of the model dominated by the majority class by applying a larger gradient penalty to minority class abnormal samples during backpropagation. While ensuring overall accuracy, it significantly reduces the false negative rate of key abnormal events, ultimately achieving an F1 exponent of 98.98%.
[0140] (3) The proposed method has good end-to-end learning ability and robustness. Even in complex scenarios with random changes in distributed power sources, the model of this invention can maintain stable recognition performance. This shows that the method can not only mine the static topological features of the distribution network, but also adapt to the dynamic operating condition changes brought about by source-load fluctuations, providing effective technical support for real-time situational awareness of active distribution networks.
[0141] On the other hand, the present invention proposes an electronic device, characterized in that it includes: at least one processor; a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the active power distribution network anomaly identification and location methods.
[0142] On the other hand, the present invention proposes a computer storage medium storing a computer program, which, when executed by a processor, implements any one of the active power distribution network anomaly identification and location methods.
[0143] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Dual Data SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM). The various embodiments described in this specification are presented in a progressive manner, and similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, for embodiments of apparatus, devices, and non-volatile computer storage media, since they are substantially similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to the description of the method embodiments.
[0144] The above embodiments are merely illustrative examples and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for identifying and locating anomalies in an active power distribution network, characterized in that, include: Three power grid operating conditions are simulated by power flow simulation. Electrical data of each node is collected and labeled with anomalies to generate an original labeled dataset. Then, the dataset is split into three types of samples: training, verification, and testing. The three power grid operating conditions include normal operation, distributed power source access, and distributed power source disconnection. The original labeled dataset is subjected to differential processing and multidimensional feature extraction, and a standardized graph dataset is generated by combining the power grid topology. Based on the standardized graph dataset, a multi-head attention multi-task network model is constructed, and differentiated attention weights and dual output branches are configured to obtain the initial recognition and localization model; Based on the standardized graph dataset and the initial recognition and localization model, the number of samples is counted, the sample weights are calculated, and a weighted joint loss function is constructed. The loss weight of the classification task is set to be less than the loss weight of the localization task. Based on the weighted joint loss function, the network parameters are iteratively updated to obtain the anomaly recognition and localization model. Real-time power grid measurement data is collected from the site, and real-time graph data is generated using the same processing methods of differential, multi-dimensional feature extraction, and topology transformation. The real-time graph data is then input into the anomaly identification and location model, which outputs the type of distributed power source access, disconnection and switching behavior, as well as the anomaly node number, to complete the anomaly identification and location.
2. The active power distribution network anomaly identification and location method according to claim 1, characterized in that, Based on the standardized graph dataset and the initialization recognition and localization model, the number of samples is counted, sample weights are calculated, and a weighted joint loss function is constructed. The loss weight for the classification task is set to be less than the loss weight for the localization task. The network parameters are iteratively updated based on the weighted joint loss function to obtain the anomaly recognition and localization model, specifically including: The total number of normal node samples and the total number of abnormal node samples in the standardized graph dataset are counted, and the weight of positive samples is calculated. We construct a weighted binary cross-entropy loss for the localization task based on the positive sample weights, and a multi-class cross-entropy loss for the classification task. Set the loss weights for classification tasks and localization tasks, with the loss weight for classification tasks being less than the loss weight for localization tasks, and then fuse the two types of losses to obtain a weighted joint loss function. An optimizer is used to backpropagate based on a weighted joint loss function to iteratively update the network parameters of the initial identification and localization model until the model converges, thus obtaining the anomaly identification and localization model.
3. The active power distribution network anomaly identification and location method according to claim 1, characterized in that, The original labeled dataset is subjected to differencing and multidimensional feature extraction. A standardized graph dataset is then generated by combining the power grid topology. Specifically, this includes: The original labeled dataset is processed by taking the difference between electrical quantities at adjacent time points to obtain differential data; Multidimensional features are extracted based on the differential data; Based on the aforementioned multidimensional features, an adjacency matrix is constructed with distribution network busbars and distributed power sources as vertices and line branches as edges to generate a standardized graph dataset.
4. The active power distribution network anomaly identification and location method according to claim 3, characterized in that, The differential processing involves calculating the difference between electrical quantities at adjacent acquisition times.
5. The active power distribution network anomaly identification and location method according to claim 1, characterized in that, The original labeled dataset was generated using Monte Carlo simulation, and stratified sampling was used to divide it into training, validation, and test sets, with sample proportions of 70%, 15%, and 15%, respectively.
6. The active power distribution network anomaly identification and location method according to claim 1, characterized in that, The multidimensional features include differential voltage, differential phase angle, differential active power, differential reactive power, and neighborhood voltage difference.
7. The active power distribution network anomaly identification and location method according to claim 1, characterized in that, The power flow simulation uses the Pandapower tool to solve the power flow problem, with the load fluctuation range being 0.6 to 1.4 times the rated load.
8. The active power distribution network anomaly identification and location method according to claim 1, characterized in that, The multi-head attention multi-task network model has 8 attention heads and the hidden layer feature dimension is set to 256.
9. An active power distribution network anomaly identification and location system, characterized in that, The system is used to implement the active power distribution network anomaly identification and location method as described in any one of claims 1 to 8, the system comprising: The simulation data generation module is used to simulate three power grid operating conditions: normal operation, distributed power source access, and distributed power source disconnection. It collects electrical data of each node and labels them with anomaly tags to generate the original labeled dataset, and splits it into three types of samples: training, verification, and testing. The data preprocessing module, connected to the simulation data generation module, is used to perform differential processing and multidimensional feature extraction on the original labeled dataset, and generate a standardized graph dataset by combining the power grid topology. The network construction module, connected to the data preprocessing module, is used to construct a multi-head attention multi-task network model based on the standardized graph dataset, configure differentiated attention weights and dual output branches, and obtain an initial recognition and localization model. The model training module is connected to the data preprocessing module and the network construction module respectively. It is used to construct a weighted joint loss function based on the standardized graph dataset and the initial recognition and localization model, count the number of samples, calculate the sample weights, set the loss weight of the classification task to be less than the loss weight of the localization task, and iteratively update the network parameters based on the weighted joint loss function to obtain the anomaly recognition and localization model. The online monitoring module, connected to the model training module, is used to collect real-time measurement data of the power grid on site, generate real-time graph data according to the same processing method of differential, multi-dimensional feature extraction and topology transformation, input the real-time graph data into the anomaly identification and location model, and output the type of distributed power source access, disconnection and switching behavior and the number of the anomaly node.
10. A computer storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the active power distribution network anomaly identification and location method as described in any one of claims 1 to 8.
