Active distribution network fault location and identification method and system based on space-time graph network

By using a fault diagnosis model based on a spatiotemporal graph network, combined with dynamic data enhancement and transfer learning, the accuracy and adaptability problems of fault location and identification in active distribution networks are solved, efficient fault location and identification are achieved, and the operational stability and intelligent perception capabilities of the power grid are improved.

CN120354254BActive Publication Date: 2025-09-30SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510854703.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-09-30
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

The existing fault location and identification methods in active distribution networks have low accuracy and poor scenario adaptability, as well as insufficient training data quality and adaptability to scenario changes. This leads to an increased risk of misdiagnosis and missed faults, affecting the safe and stable operation of the power grid and the efficiency of fault tracing.

Method used

A fault diagnosis model based on spatiotemporal graph network is adopted, combined with dynamic data augmentation method and transfer learning strategy. Through multi-scale attention mechanism and dynamic kernelized maximum mean difference transfer learning, a fault diagnosis model is constructed to achieve synchronous judgment of fault location and type.

Benefits of technology

It improves the accuracy and adaptability of fault location and identification, shortens the fault location time, reduces power outage losses, and enhances the intelligent perception level and operational stability of the active distribution network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354254B_ABST
    Figure CN120354254B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for locating and identifying faults in an active distribution network based on a spatiotemporal graph network, which relates to the technical field of locating and identifying faults in an active distribution network. The method comprises the following steps: obtaining data of each node in the active distribution network after a fault occurs, constructing structured graph data, marking the fault nodes and types, and constructing a sample data set; using the sample data set as source domain data, pre-training a fault diagnosis model based on a spatiotemporal graph network; in each iterative process, using a multi-scale adversarial perturbation addition method based on gradient optimization to generate adversarial sample data; filtering data and adding it to the data set through a dynamic balancing mechanism of data categories and a confidence assessment mechanism, and using the updated data set to train the model; introducing target domain data, and fine-tuning the pre-trained model using a transfer learning strategy based on dynamic kernelized maximum mean difference; and inputting the actually obtained node data into the model to achieve accurate positioning of the fault node and accurate identification of the fault type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of active distribution network fault location and identification, and in particular to a method and system for active distribution network fault location and identification based on a space-time graph network. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] In recent years, the development of high-reliability and smart grids has driven the widespread adoption of real-time intelligent measurement devices such as synchronized phasor measurement units (PMUs), providing new opportunities for the application of data-driven machine learning methods in practical distribution systems. However, the widespread integration of distributed power sources and new loads has significantly altered the network structure, power flow direction, and load characteristics of distribution networks, leading to more complex operating characteristics and fault mechanisms. These issues have reduced the applicability and identification capabilities of traditional fault location and identification methods, increasing the risk of misdiagnosis and missed faults, and seriously impacting the safe and stable operation of active distribution networks and the tracing, troubleshooting, and repair of faults.

[0004] To address the challenges of fault diagnosis in active distribution networks, artificial intelligence (AI) technology, leveraging its feature extraction and powerful nonlinear fitting capabilities, has been widely applied in this field. Currently, mainstream AI diagnostic methods include expert systems, artificial neural networks, Bayesian networks, fuzzy set theory, Petri nets, and various optimization algorithms. Given the complex and ever-changing topology and operating conditions of active distribution networks, as well as the massive amount of data, the processing and analysis of fault data depends heavily on the chosen method. However, current AI-integrated fault diagnosis and location methods often utilize a single model or algorithm. These methods often fail to fully exploit the spatiotemporal correlations of distribution network fault data during data processing and lack the ability to dynamically process changing data. This results in low fault location and identification accuracy and poor adaptability to changing scenarios. Furthermore, existing methods are limited by their over-reliance on training data quality. The use of additional models, such as traditional generative adversarial networks and variational autoencoders, to enhance data further increases training resource consumption. Summary of the Invention

[0005] To address the deficiencies of the above-mentioned prior art, the present invention provides a method and system for locating and identifying faults in an active distribution network based on a spatiotemporal graph network. By designing a dynamic data enhancement method and introducing a transfer learning strategy, a fault diagnosis model based on a spatiotemporal graph network is constructed to locate and identify faults in the active distribution network. This enables simultaneous judgment of the fault location and fault type in complex scenarios, improves the adaptability and reliability of fault location and identification, and solves the problems of poor training data quality, poor adaptability to scenario changes, and low fault diagnosis accuracy in existing methods.

[0006] In a first aspect, the present invention provides a method for locating and identifying faults in an active distribution network based on a spatiotemporal graph network.

[0007] A method for locating and identifying faults in an active distribution network based on a spatiotemporal graph network, comprising:

[0008] Obtain data from each node of the active distribution network in the target domain, input the node data into the fault diagnosis model, locate the fault node and identify the fault type; the training process of the fault diagnosis model is as follows:

[0009] Obtain data from each node of the active distribution network after a fault occurs, build a structured graph, annotate the fault nodes and types, and construct a sample data set;

[0010] Using a sample dataset as source domain data, a fault diagnosis model based on a spatiotemporal graph network is pre-trained. In each iteration, a multi-scale adversarial perturbation addition method based on gradient optimization is used to generate adversarial sample data. Through a dynamic data category balancing mechanism and a confidence assessment mechanism, the data is filtered and added to the dataset, and the model is trained using the updated dataset.

[0011] The target domain data is introduced, and a transfer learning strategy based on dynamic kernelized maximum mean difference is adopted to fine-tune the pre-trained model.

[0012] According to a further technical solution, the node data includes the amplitude and phase angle of the three-phase voltage at the current node within a window of T time steps.

[0013] A further technical solution is to pre-train the fault diagnosis model based on the spatiotemporal graph network using the sample dataset as the training dataset, including:

[0014] In each iteration, multi-scale adversarial perturbations with multiple steps are generated and added to the sample data in the training dataset to generate adversarial sample data, and the gradient of the added perturbation is accumulated to optimize the generation of perturbations in the next iteration;

[0015] Based on the sample data and the generated adversarial sample data, a data category dynamic balance mechanism is introduced to monitor the distribution of all samples of each fault type, determine whether the category balance judgment conditions are met, and update the training dataset based on the category balance judgment results combined with the confidence evaluation mechanism;

[0016] The updated training data set is used to continue training the fault diagnosis model, optimizing the model parameters to meet the optimization goal of minimizing the classification error in the current iteration, and then the next round of iteration is performed until the maximum number of iterations is reached and the model training is completed.

[0017] Further technical solutions, based on the category balance judgment results and combined with the confidence assessment mechanism, update the training dataset, including:

[0018] If the balance judgment condition is not met, then according to the confidence of the generated adversarial samples, adversarial samples with a confidence level higher than the set threshold are selected for expansion and the training dataset is updated;

[0019] On the contrary, if the balance judgment condition is met, the current training data set is judged to be a data-balanced training data set, and the training data set is no longer updated.

[0020] In a further technical solution, the fault diagnosis model is built using a spatiotemporal graph network based on a multi-scale attention mechanism, including a time module, a space module and an identification module;

[0021] The sample data is input into the spatiotemporal graph network. The time series data of each node in the sample data is first extracted with multi-time scale features through the time module, and then the time features of each node are obtained through the multi-scale spatiotemporal attention mechanism.

[0022] The temporal features of all nodes are input into the spatial module to extract multi-scale spatial features. The multi-scale spatial features are fused through the graph attention network with multi-hop mechanism and gating mechanism to obtain spatiotemporal features.

[0023] The spatiotemporal features are input into the identification module. After feature transformation, they are converted into category probability distribution through the softmax layer, and the fault node location and fault category identification results are output.

[0024] Further technical solutions introduce target domain data and adopt a transfer learning strategy based on dynamic kernelized maximum mean difference to fine-tune the pre-trained model, including:

[0025] Freeze the temporal module and spatial module of the pre-trained model and use the frozen pre-trained model to extract features of the target domain data;

[0026] Calculate the dynamic kernelized maximum mean difference loss between the target domain data features and the original domain data features to achieve feature alignment;

[0027] A total loss function is constructed based on the dynamic kernelized maximum mean difference loss and the fault localization and identification task loss. The frozen pre-trained model is fine-tuned in combination with the target domain features. The parameters and kernel weights of the identification module are continuously optimized through the iterative process of forward propagation and backpropagation until the maximum number of iterations is reached, completing the fine-tuning of the pre-trained model.

[0028] In a second aspect, the present invention provides an active distribution network fault location and identification system based on a spatiotemporal graph network.

[0029] A fault location and identification system for active distribution network based on spatiotemporal graph network, comprising:

[0030] The data acquisition module is used to obtain data from each node of the active distribution network after a fault occurs, build a structured graph data, mark the fault nodes and types, and construct a sample data set;

[0031] The model pre-training module is used to pre-train the fault diagnosis model based on the spatiotemporal graph network using the sample dataset as the source domain data. In each iteration, a multi-scale adversarial perturbation addition method based on gradient optimization is used to generate adversarial sample data. Through a dynamic data category balancing mechanism and a confidence assessment mechanism, the data is filtered and added to the dataset, and the model is trained using the updated dataset.

[0032] The model fine-tuning module is used to introduce target domain data and fine-tune the pre-trained model using a transfer learning strategy based on dynamic kernelized maximum mean difference;

[0033] The fault location and identification module is used to obtain the data of each node in the active distribution network of the target domain, input the node data into the fault diagnosis model, locate the fault node and identify the fault type.

[0034] In a third aspect, the present invention further provides an electronic device comprising: a memory for storing executable instructions; and a processor for implementing the above-mentioned active distribution network fault location and identification method based on a spatiotemporal graph network when executing the executable instructions stored in the memory.

[0035] In a fourth aspect, the present invention further provides a computer-readable storage medium storing executable instructions for causing a processor to execute the executable instructions to implement the above-mentioned active distribution network fault location and identification method based on a spatiotemporal graph network.

[0036] In a fifth aspect, the present invention also provides a computer program product, which includes executable instructions, and the executable instructions are stored in a computer-readable storage medium; wherein, when the processor of the electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the above-mentioned active distribution network fault location and identification method based on the space-time graph network is implemented.

[0037] One or more of the above technical solutions have the following beneficial effects:

[0038] 1. The present invention proposes a method and system for locating and identifying faults in an active distribution network based on a spatiotemporal graph network. By designing a dynamic data enhancement method and introducing a transfer learning strategy, a fault diagnosis model based on a spatiotemporal graph network is constructed to locate and identify faults in the active distribution network, achieving simultaneous judgment of fault location and fault type in complex scenarios. The dynamic data enhancement method is used to effectively process the original data to solve the problem of poor training data quality. The spatiotemporal graph network based on a multi-scale attention mechanism is used to locate and identify known faults, improving the accuracy of fault diagnosis. The transfer learning strategy is used to cope with changes in the operating scenarios of the active distribution network and improve the adaptability of scenario changes. The above-mentioned highly adaptable and reliable fault location and identification method can effectively identify the location and type of faults such as short circuits and line breaks in the distribution network, and can specifically solve the problems of low accuracy and long training time in fault location and identification of active distribution networks. It helps to improve the intelligent perception level of the active distribution network, shorten the location and identification time of faults such as short circuits and line breaks, reduce power outage losses, and help the active distribution network quickly recover to normal operation.

[0039] 2. The present invention proposes a dynamic data enhancement method that combines adversarial sample generation and a dynamic balance mechanism. By embedding the dynamic data enhancement method into the iterative training process of the fault location and identification model, adversarial samples are continuously generated, the proportion of each type of samples is automatically identified, and the number of minority class samples is expanded, providing a high-quality data foundation for fault location and identification tasks. Moreover, by dynamically generating adversarial and category-balanced training samples, the consumption of computing resources can be greatly reduced, and the model's adaptability to out-of-distribution samples can be improved.

[0040] 3. The present invention proposes a spatiotemporal graph network model based on a multi-scale attention mechanism. The spatiotemporal graph network model is divided into a time module, a space module and an identification module. The time and space modules respectively introduce a multi-scale time and space attention mechanism to extract the multi-hop spatial correlation characteristics between different nodes in the distribution network and the timing dependence characteristics at different time scales, so as to flexibly capture and dynamically integrate the spatial topology information and timing fluctuation characteristics of different scales in the active distribution network operation data, and input them into the identification module for fault location and identification, thereby improving the model's accuracy in locating and identifying complex faults.

[0041] 4. The present invention proposes a target domain unsupervised transfer learning strategy based on dynamic kernelized maximum mean difference. It aligns the distribution differences between source domain and target domain data through the multi-kernel maximum mean difference method, effectively improves the model's adaptability to unknown operating scenarios, enhances the model's learning ability for dynamic distribution changes, and better identifies fault states under complex and changeable operating conditions.

[0042] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0044] Figure 1 This is an overall flow chart of the active distribution network fault location and identification method based on the space-time graph network according to an embodiment of the present invention;

[0045] Figure 2 This is a flow chart of dynamic data enhancement and model training in an embodiment of the present invention;

[0046] Figure 3 Schematic diagram of a fault diagnosis model based on a spatiotemporal graph network in an embodiment of the present invention;

[0047] Figure 4 This is a flow chart of transfer learning based on DK-MMD in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] It should be noted that the following detailed descriptions are exemplary only and are intended to describe specific embodiments and provide further explanation of the present invention, and are not intended to limit the exemplary embodiments according to the present invention. Unless otherwise indicated, all technical and scientific terms used herein have the same meanings as those commonly understood by those of ordinary skill in the art to which the present invention belongs. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0049] Example 1

[0050] This embodiment provides a method for locating and identifying faults in an active distribution network based on a spatiotemporal graph network. This method is based on a multi-task learning framework for fault location and identification, uses a dynamic data enhancement method to effectively process raw data, locates and identifies known faults through a spatiotemporal graph network based on a multi-scale attention mechanism, and uses a transfer learning strategy to cope with changes in the operating scenarios of the active distribution network. This method can specifically address the problems of low accuracy and long training time in fault location and identification in the active distribution network. Specifically, Figure 1 As shown, the method specifically includes the following steps:

[0051] Step S1: Obtain data from each node of the active distribution network after a fault occurs, build a structured graph data, mark the fault nodes and types, and construct a sample data set.

[0052] Specifically, for active distribution networks, this embodiment uses distribution network measurement devices such as micro-synchronized phasor measurement units, advanced metering infrastructure, and smart meters to collect voltage data at each node in the distribution network after different types of faults occur, and constructs non-Euclidean structured graph data.

[0053] The generation of graph data is as follows: In graph theory, a graph consists of nodes and edges. The busbars of the active distribution network are considered as nodes of the graph, and the connecting lines are considered as edges of the graph. The real-time measurement data of the active distribution network can be associated with the topological structure through graph data. The graph data can be expressed as:

[0054] (1)

[0055] in, is a node set, n is the number of nodes, Indicates the n nodes, is an edge set, m is the number of edges. and There is a straight line between them, then ( i , j )and( j , i ) are included in Thus, a bidirectional graph topology is formed. Due to the bidirectionality of power flow in active distribution network, the constructed graph data should be an undirected graph.

[0056] Furthermore, each node are all associated with the time series voltage phase measurement, then the node characteristic data is the three-phase voltage (A, B, C) at T The amplitude within the time step window and phase angle , its mathematical expression is:

[0057] (2)

[0058] in, Indicates the t The data point i The feature vector of each node.

[0059] The overall input feature tensor of the structured graph constructed above is , it is assumed that the voltage phase of the key nodes is observable, while for the unobservable nodes, their features are filled with zeros to maintain the consistency of the structure.

[0060] Afterwards, the acquired data is labeled with fault nodes and fault types, and the labeled data is used as sample data to construct a sample data set.

[0061] Step S2: Using the sample dataset as the source domain data, pre-train the fault diagnosis model based on the spatiotemporal graph network; in each iteration, a multi-scale adversarial perturbation addition method based on gradient optimization is used to generate adversarial sample data. Through the data category dynamic balance mechanism and confidence evaluation mechanism, the data is screened and added to the dataset, and the model is trained using the updated dataset.

[0062] Specifically, this embodiment proposes a dynamic data enhancement method, which is directly embedded in the training process of the model, continuously generates adversarial samples and dynamically expands minority class samples, screens and retains samples with higher confidence, and gradually achieves a balanced data distribution during the training process.

[0063] Furthermore, the dynamic data enhancement and model training process proposed above is as follows Figure 2 As shown, the sample data set obtained in the above step S1 is used as the training data set. For the sample data in the data set, multi-scale perturbations are first added to generate adversarial samples, and the gradients of all scales are aggregated by cumulative gradients to facilitate the update of the perturbations in the next iteration. Then, based on the original samples and the generated adversarial samples, the number of samples of each category is calculated, and a dynamic balance mechanism is used to determine whether the samples are evenly distributed. If they are unbalanced, minority class samples with high confidence are screened for supplementation and added to the training data set. If they are balanced, the balanced data set is used to continue training the model. The above training process continues until the maximum number of iterations is reached, until the training of the fault diagnosis model is completed. The above process is specifically as follows:

[0064] Step S2.1: In each iteration, generate multi-step multi-scale adversarial perturbations and add them to the sample data in the training dataset to generate adversarial sample data, and accumulate the gradient of the added perturbations to optimize the generation of perturbations in the next iteration.

[0065] In this embodiment, the adversarial perturbation based on gradient iteratively enhances node features to generate adversarial samples that can generalize beyond the initial input. In adversarial training, the goal of sample generation can be summarized as a min-max optimization problem. The goal of the minimum optimization is to adjust the model parameters. , so that the classification error is minimized under the maximum perturbation. The maximum optimization is achieved by adjusting the adversarial perturbation , so that the current classification error is maximized. The mathematical formula of the minimum maximum optimization problem is as follows:

[0066] (3)

[0067] in, represents the classification loss of the model, Represents the norm limit of the perturbation, which is used to control the generation range of adversarial samples. represents a parameterized classifier, Represents the predicted classification results, Indicates the actual classification result.

[0068] That is, the generation of adversarial samples adopted in this embodiment is based on the feature perturbation addition method of gradient direction optimization. The core idea is to mine the vulnerable areas of the model by maximizing the classification loss of the model. However, considering the addition of single-scale perturbations in traditional gradient optimization methods, it is difficult to cover multiple feature distributions outside the original area. To this end, this embodiment introduces multi-step-generated multi-scale adversarial perturbations for adversarial training based on traditional PGD (Projected Gradient Descent) perturbations. By introducing multiple steps to generate diverse adversarial samples, the current classification error is maximized. The calculation formula of the perturbation is:

[0069] (4)

[0070] in, Indicates the perturbation scale; represents the step size of multi-scale perturbations, simulating abnormal fluctuations of different degrees; It is a projection operation used to limit the perturbation to the constraint range; represents the gradient of the perturbation.

[0071] Furthermore, in the process of generating multi-scale perturbations, each perturbation introduces a new set of gradient updates, which significantly increases the computational cost of the iterative process. To reduce computational cost, this embodiment introduces cumulative gradient optimization, which aggregates gradients of all scales in one backpropagation to facilitate model updates in the next iteration. The formula is:

[0072] (5)

[0073] in, represents the total number of steps of multi-scale perturbation; represents the learning rate; is the gradient with respect to the model parameters.

[0074] Through the above-mentioned cumulative gradient, the model update in each iterative optimization can comprehensively consider the gradient direction of all disturbance scales, avoiding the local optimality caused by single-scale disturbance and the additional consumption caused by repeated calculations.

[0075] Step S2.2: Based on the sample data and the generated adversarial sample data, a data category dynamic balance mechanism is introduced to monitor the distribution of all samples of each fault type, determine whether the category balance judgment conditions are met, and update the training dataset based on the category balance judgment results combined with the confidence evaluation mechanism.

[0076] Specifically, since data category imbalance not only affects the robustness of model training but also further worsens the distribution bias of adversarial samples, this embodiment proposes a category dynamic balancing mechanism. By monitoring the distribution of various types of samples during each iteration, the minority class dataset is gradually expanded until the category distribution is balanced. The balance judgment conditions are:

[0077] (6)

[0078] in, Indicates the number of samples of the category, Indicates the tolerated deviation of the class distribution.

[0079] Furthermore, if the above-mentioned balance judgment condition is not met, based on the confidence evaluation mechanism, according to the confidence of the generated adversarial samples, adversarial samples with a confidence level higher than the set threshold are selected for expansion and added to the dataset to update the training dataset; conversely, if the above-mentioned balance judgment condition is met, the current training dataset is judged to be a data-balanced training dataset.

[0080] In this embodiment, during the sample expansion process, the confidence evaluation mechanism is combined to retain only high-confidence samples for expansion, thereby reducing the negative impact of pseudo samples. The confidence calculation formula is:

[0081] (7)

[0082] In this embodiment, only when And when the sample belongs to the minority class, it is added to the balanced data set. In the above formula, Indicates the adversarial examples, Indicates the set confidence threshold, which is used to filter high-confidence samples.

[0083] Step S2.3: Continue to train the fault diagnosis model using the updated training data set, optimize the model parameters to meet the optimization goal of minimizing the classification error in the current iteration, and then proceed to the next round of iteration, that is, loop through the above steps S2.1 to S2.3, re-iterate the generation process and model training process until the maximum number of iterations is reached, and complete the training of the fault diagnosis model.

[0084] As an implementation method, during the above-mentioned iterative training process, the number of iterations of model training may not be equal to the number of iterations of adversarial sample generation. For example, if the model is iteratively trained for 200 rounds, the initially constructed sample dataset may reach category balance after data enhancement at 30 rounds of iterations and has been updated to a balanced dataset. At this time, the balanced dataset can be used to directly train the model for subsequent iterative rounds.

[0085] In this embodiment, the data augmentation process is embedded in the training process of the spatiotemporal graph network model without the help of an additional adversarial model. During the entire training process, multi-scale adversarial perturbations are generated while the parameters of the spatiotemporal graph network model are updated, realizing parallel calculation of parameter and perturbation updates, which can effectively reduce training costs.

[0086] Furthermore, in the above training process, the fault diagnosis model based on the spatiotemporal graph network is pre-trained using the sample data in the training sample data set as the source domain data.

[0087] This embodiment formulates fault diagnosis of active distribution networks as a multi-task learning problem, which includes two main tasks:

[0088] 1) Fault Type Identification: Classify fault types into multiple predefined categories. This task is a graph-level multi-classification problem. The model needs to capture the overall features and patterns in the graph to distinguish the fault type.

[0089] 2) Fault Localization: Predicting the exact node where the fault occurred. This task is a node-level classification problem, requiring the model to independently determine the status of each node to accurately locate the faulty node.

[0090] Based on the above multi-tasks, combined with the updated training sample dataset ,in It is k A sample picture, Including type identification labels and node-level location labels, the design of spatiotemporal graph network model consists of a shared spatiotemporal backbone and two mission-specific headers and , whose overall goal is to jointly minimize the weighted sum of the losses of the two tasks, which is:

[0091] (8)

[0092] in, is the cross entropy loss for fault type identification, is the node-level classification loss for fault localization; the weight and Control the relative importance of the two tasks and adjust it based on experience.

[0093] Furthermore, the fault diagnosis model based on the spatiotemporal graph network constructed in this embodiment is divided into a three-layer structure of time module, space module and identification module. By introducing a multi-scale time and space attention mechanism, it deeply explores the node timing characteristics and network structure characteristics at different scales, and improves the feature extraction ability of the model. Specifically, the architecture of the spatiotemporal graph network model based on the multi-scale attention mechanism is as follows: Figure 3 Shown, including:

[0094] (1) Space module

[0095] For graph data Each node , and its neighbor node set is recorded as The basic graph attention network uses the attention mechanism to focus on the central node and its neighboring nodes for weighted aggregation to update the node representation, then the node output feature The basic update rule is:

[0096] (9)

[0097] in, A new feature that integrates neighborhood information for each node, is the concatenation operator, K Indicates the number of heads of the multi-head attention mechanism, is a nonlinear activation function, is a learnable linear change matrix; Representation node With node The attention weight between nodes reflects For Node The specific calculation formula is:

[0098] (10)

[0099] (11)

[0100] in, is the unnormalized attention weight, which is normalized by the Softmax function. ;LeakyReLU is an activation function that is often used to introduce nonlinearity and prevent gradient disappearance; is a learnable attention vector.

[0101] In order to mine more extensive spatial relationship information in the network, this embodiment introduces a multi-hop mechanism and a gating mechanism based on the basic graph attention layer for multi-scale spatial feature fusion. , each central node Output features The update rule changes to:

[0102] (12)

[0103] in, H is the number of hops from neighboring nodes, indicating the aggregation range of spatial information at different scales; is the gating coefficient, which is dynamically generated through the gating mechanism and is used to balance the contribution of spatial features of different scales in node updates. Its calculation formula is:

[0104] (13)

[0105] in, is the dynamically adjusted gating weight matrix; is the activation function, which limits the gating coefficient to between.

[0106] (2) Time module

[0107] Since most graph neural networks, such as graph convolutional networks and graph attention networks, focus on mining the spatial characteristics of data and do not fully consider the temporal dependencies of node features, this embodiment introduces a multi-scale temporal attention mechanism to enhance the network's temporal feature extraction capabilities.

[0108] Specifically, the time series features of each node are initially extracted through time convolution. In order to quickly extract the time series features, the convolution operation is performed through a one-dimensional convolution layer. Assume that M time scales, and the size of each time scale window is , further, for the m time scale, define the temporal attention mechanism as:

[0109] (14)

[0110] Among them, it represents the mAttention output at time scales, 、 and The time step window The query, key, and value matrices generated above are the three basic elements of the self-attention mechanism; is the scaling factor of the attention head, used to prevent the value from being too large.

[0111] The multi-scale temporal attention mechanism also introduces a gating mechanism, and its calculation formula is:

[0112] (15)

[0113] in, For the m The gating coefficient of the time scale reflects the m The importance of each scale in the fusion process.

[0114] (3) Identification module

[0115] The identification module is the output layer of the spatiotemporal graph network and is mainly used to identify the fault type and fault location of the distribution network nodes. This module is based on the multi-scale spatiotemporal feature vectors extracted by the first two modules. and , forming a joint representation vector through feature concatenation , and input it into the multi-layer perceptron network to complete the fault location and identification tasks.

[0116] First, the feature vector is compressed and structured through maximum pooling and flattening operations to obtain a fixed-dimensional input vector Subsequently, the input is transformed through several layers of fully connected layers with nonlinear activation functions. The output of the layer is represented as:

[0117] (16)

[0118] in, and Respectively The weight matrix and bias term of the layer, represents the activation function, .

[0119] The final output is converted into a category probability distribution through the softmax layer, which is defined as follows:

[0120] (17)

[0121] in, Represents the prediction result of fault type identification or fault node location; for the fault type identification task, represents the probability of each fault type; for node-level positioning tasks, Indicates the probability that each node is a failure point.

[0122] In this embodiment, the sample data is input into the spatiotemporal graph network, and the time series data of each node in the sample data is first extracted with multi-time-scale features through the time module, and the time features of each node are obtained through the multi-scale spatiotemporal attention mechanism; the time features of all nodes are then input into the space module to extract multi-scale spatial features, and the multi-scale spatial features are fused through the graph attention network that introduces a multi-hop mechanism and a gating mechanism to obtain spatiotemporal features; the spatiotemporal features are finally input into the identification module, and after feature transformation, they are converted into category probability distribution through the softmax layer, and the fault node location and fault category identification results are output.

[0123] Furthermore, in order to improve the adaptability of the fault diagnosis model, this embodiment also introduces a transfer learning strategy, which mainly includes two processes: using source domain data for model pre-training and using target domain for fine-tuning: First, in the pre-training stage (i.e., the process of step S2 above), the source domain data is dynamically enhanced, and the time module, space module and identification module (MLP network) are input in sequence to calculate the total loss of fault location and identification. And optimize the model parameters through back propagation.

[0124] Secondly, in the fine-tuning stage, this embodiment freezes the temporal and spatial modules, extracts target domain data features, and achieves feature alignment by calculating the DK-MMD loss between the source and target domain features. This loss is combined with the loss of the fault localization and identification task to form a total loss function. The identification module parameters and kernel weights are continuously optimized through the iterative process of forward propagation and backpropagation. After reaching the maximum number of iterations, the fault localization and identification results of the target domain are output, namely:

[0125] Step S3: Introduce target domain data and adopt a transfer learning strategy based on dynamic kernelized maximum mean difference to fine-tune the pre-trained model.

[0126] like Figure 4 As shown in the figure, first, the temporal module and spatial module of the pre-trained model are frozen, and the features of the target domain data are extracted using the frozen pre-trained model; secondly, the dynamic kernelized maximum mean difference loss between the target domain data features and the original domain data features is calculated to achieve feature alignment.

[0127] Among them, the design of dynamic kernelized maximum mean difference loss includes:

[0128] Considering that transfer learning aims to improve the performance of the model in the new domain by transferring knowledge from the source domain to the target domain, however, when there is a difference in the distribution of data in the source domain and the target domain, direct migration will lead to a decline in model performance. Therefore, this embodiment is based on the distribution alignment method based on the maximum mean difference (MMD). By improving the multi-kernel maximum mean difference (MK-MMD), a dynamic kernelized maximum mean difference method (DK-MMD) is proposed to enhance the flexible alignment capability of different distribution differences.

[0129] MMD is a parameter-free statistic that measures the difference between two distributions. Its core idea is to transform the source domain distribution into and target domain distribution The samples are mapped to the Reproducing Kernel Hilbert Space (RKHS), and the distance between the distributions is measured by calculating the difference in the kernel means of the source and target domain samples. The difference between the distributions is usually described by statistics. If and Respectively represent the distribution and The mean embedding in RKHS, then MMD is defined as:

[0130] (18)

[0131] (19)

[0132] in, is the kernel function, is the RKHS formed by the kernel function.

[0133] The logic of the above MMD calculation formula comes from the distribution mean embedding theory, that is, any distribution can be embedded into a high-dimensional space through a kernel function, so that its characteristic mean can directly reflect the distribution characteristics. Among them, the kernel mean embedding does not rely on the explicit construction mapping function , but is directly determined by the kernel function , so even if there may be different mapping function forms in the same RKHS, this will not affect the result of the distribution mean embedding. This embedding satisfies consistency and uniqueness in theory, and is therefore suitable for distribution alignment.

[0134] By expanding , we can get:

[0135] (20)

[0136] Further using the properties of the kernel function, the mean embedding is expressed as an expectation:

[0137] (twenty one)

[0138] Therefore, the formula for MMD can be written as:

[0139] (twenty two)

[0140] Since the distribution of and is usually unknown, the calculation of MMD requires empirical estimation based on finite samples. Assume that the number of source domain and target domain samples are and , the source domain samples are , the target domain sample is , taking the sample mean as an unbiased estimate of the expected distribution, the empirical estimation formula for MMD can be obtained as:

[0141] (twenty three)

[0142] The above transition from theoretical to empirical formula is based on the assumption of independent and identical distribution of samples. When the sample size is sufficiently large, the empirical formula is an asymptotic approximation of the theoretical formula.

[0143] However, MMD only uses a single kernel function and cannot fully capture the differences between complex distributions. MK-MMD improves this shortcoming by introducing multiple kernel functions. and its weight , a total kernel is constructed by multiple weighted kernels to capture more complex distribution differences. Based on the theoretical basis of MMD, the calculation formula of MK-MMD is:

[0144] (twenty four)

[0145] in, To use The MMD empirical estimation formula of the kernel function.

[0146] Considering that MK-MMD can overcome the shortcomings of single-core MMD to a certain extent, its core weight It is usually fixed and cannot dynamically adapt to the needs of the task. To this end, this embodiment proposes Dynamic Kernelized Maximum Mean Difference (DK-MMD), the core idea of ​​which is to dynamically learn the kernel weights by introducing a parameterized model (such as MLP) , so that it can adapt to the feature changes of the source domain and the target domain. The calculation formula of DK-MMD is:

[0147] (25)

[0148] in, To parameterize the kernel weights, the learnable parameters (e.g. MLP weights) dynamic adjustment; The optimization is achieved by minimizing the total loss function.

[0149] In the transfer learning framework, the total loss function of the model is composed of task loss and DK-MMD loss:

[0150] (26)

[0151] in, is the total loss for the fault location and identification task. This embodiment uses cross entropy loss. is the weight coefficient of the distribution alignment loss.

[0152] Compared with the MK-MMD method with fixed kernel weights, the DK-MMD proposed above can dynamically adjust the kernel weights through a lightweight parameterized model. It can not only adapt to changes in the distribution of the source and target domains more flexibly, but also more intuitively reflect the contribution of different kernel functions to distribution alignment, thereby improving the interpretability of the model.

[0153] Finally, a total loss function is constructed based on the above-mentioned dynamic kernelized maximum mean difference loss and the fault localization and identification task loss. The frozen pre-trained model is fine-tuned in combination with the target domain characteristics. The parameters and kernel weights of the recognition module are continuously optimized through the iterative process of forward propagation and backpropagation until the maximum number of iterations is reached, completing the fine-tuning of the pre-trained model.

[0154] Step S4: Obtain data for each node in the target domain's active distribution network and input this node data into the fault diagnosis model to locate the faulty node and identify the fault type. Specifically, the actual node data of the target domain's active distribution network is input into the trained fault diagnosis model, which outputs the faulty node and its fault type.

[0155] Example 2

[0156] This embodiment provides an active distribution network fault location and identification system based on a spatiotemporal graph network, including:

[0157] The data acquisition module is used to obtain data from each node of the active distribution network after a fault occurs, build a structured graph data, mark the fault nodes and types, and construct a sample data set;

[0158] The model pre-training module is used to pre-train the fault diagnosis model based on the spatiotemporal graph network using the sample dataset as the source domain data. In each iteration, a multi-scale adversarial perturbation addition method based on gradient optimization is used to generate adversarial sample data. Through a dynamic data category balancing mechanism and a confidence assessment mechanism, the data is filtered and added to the dataset, and the model is trained using the updated dataset.

[0159] The model fine-tuning module is used to introduce target domain data and fine-tune the pre-trained model using a transfer learning strategy based on dynamic kernelized maximum mean difference;

[0160] The fault location and identification module is used to obtain the data of each node in the active distribution network of the target domain, input the node data into the fault diagnosis model, locate the fault node and identify the fault type.

[0161] Example 3

[0162] This embodiment provides an electronic device, including: a memory for storing executable instructions; and a processor for implementing the above method provided in this embodiment when executing the executable instructions stored in the memory.

[0163] Example 4

[0164] This embodiment further provides a computer-readable storage medium storing executable instructions. When the executable instructions are executed by a processor, the processor will be caused to execute the above method provided in this embodiment.

[0165] Example 5

[0166] This embodiment provides a computer program product including executable instructions, which are computer instructions stored in a computer-readable storage medium. When a processor of an electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the electronic device performs the method provided in this embodiment.

[0167] The steps involved in the above embodiments 2 to 5 correspond to those in embodiment 1. For detailed implementation, please refer to the relevant description of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media that includes one or more instruction sets; it should also be understood to include any medium that can store, encode, or carry an instruction set for execution by a processor and cause the processor to perform any method of the present invention.

[0168] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computer device. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.

[0169] The above description is only a preferred embodiment of the present invention. Although the specific implementation of the present invention is described in conjunction with the accompanying drawings, it does not limit the scope of protection of the present invention. Those skilled in the art should understand that on the basis of the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present invention.

Claims

1. A method for fault location and identification of active distribution network based on spatiotemporal graph network, characterized in that: include: Obtain data from each node of the active distribution network in the target domain and input the node data into the fault diagnosis model to locate the fault node and identify the fault type. The training process of the fault diagnosis model is as follows: Obtain data from each node of the active distribution network after a fault occurs, build a structured graph, annotate the fault nodes and types, and construct a sample data set; Using a sample dataset as source domain data, a fault diagnosis model based on a spatiotemporal graph network is pre-trained. In each iteration, a multi-scale adversarial perturbation addition method based on gradient optimization is used to generate adversarial sample data. Through a dynamic data category balancing mechanism and a confidence assessment mechanism, the data is filtered and added to the dataset, and the model is trained using the updated dataset. The target domain data is introduced, and a transfer learning strategy based on dynamic kernelized maximum mean difference is used to fine-tune the pre-trained model. The dynamic kernelized maximum mean difference loss is calculated between the target domain data features and the source domain data features to achieve feature alignment. A total loss function is constructed based on the dynamic kernelized maximum mean difference loss and the fault localization and identification task loss, and the frozen pre-trained model is fine-tuned based on the target domain features. Among them, the sample data set is used as the training data set to pre-train the fault diagnosis model based on the spatiotemporal graph network, including: In each iteration, multi-scale adversarial perturbations with multiple steps are generated and added to the sample data in the training dataset to generate adversarial sample data, and the gradient of the added perturbation is accumulated to optimize the generation of perturbations in the next iteration; Based on the sample data and the generated adversarial sample data, a data category dynamic balance mechanism is introduced to monitor the distribution of all samples of each fault type, determine whether the category balance judgment conditions are met, and update the training dataset based on the category balance judgment results combined with the confidence evaluation mechanism; The updated training data set is used to continue training the fault diagnosis model, optimizing the model parameters to meet the optimization goal of minimizing the classification error in the current iteration, and then the next round of iteration is performed until the maximum number of iterations is reached and the model training is completed.

2. The method for locating and identifying faults in an active distribution network based on a spatiotemporal graph network according to claim 1, wherein: The node data includes the amplitude and phase angle of the three-phase voltage at the current node within a T time step window.

3. The method for locating and identifying faults in an active distribution network based on a spatiotemporal graph network according to claim 1, wherein: Based on the category balance judgment results and combined with the confidence assessment mechanism, the training dataset is updated, including: If the balance judgment condition is not met, then according to the confidence of the generated adversarial samples, adversarial samples with a confidence level higher than the set threshold are selected for expansion and the training dataset is updated; On the contrary, if the balance judgment condition is met, the current training data set is judged to be a data-balanced training data set, and the training data set is no longer updated.

4. The method for locating and identifying faults in an active distribution network based on a spatiotemporal graph network according to claim 1, wherein: The fault diagnosis model is built using a spatiotemporal graph network based on a multi-scale attention mechanism, including a time module, a space module, and an identification module; The sample data is input into the spatiotemporal graph network. The time series data of each node in the sample data is first extracted with multi-time scale features through the time module, and then the time features of each node are obtained through the multi-scale spatiotemporal attention mechanism. The temporal features of all nodes are input into the spatial module to extract multi-scale spatial features. The multi-scale spatial features are fused through the graph attention network with multi-hop mechanism and gating mechanism to obtain spatiotemporal features. The spatiotemporal features are input into the identification module. After feature transformation, they are converted into category probability distribution through the softmax layer, and the fault node location and fault category identification results are output.

5. The method for locating and identifying faults in an active distribution network based on a spatiotemporal graph network according to claim 1, wherein: Introducing target domain data, adopting a transfer learning strategy based on dynamic kernelized maximum mean difference, and fine-tuning the pre-trained model, including: Freeze the temporal module and spatial module of the pre-trained model and use the frozen pre-trained model to extract features of the target domain data; The parameters and kernel weights of the recognition module are continuously optimized through the iterative process of forward propagation and back propagation until the maximum number of iterations is reached, completing the fine-tuning of the pre-trained model.

6. An active distribution network fault location and identification system based on a spatiotemporal graph network, characterized in that: include: The data acquisition module is used to obtain data from each node of the active distribution network after a fault occurs, build a structured graph data, mark the fault nodes and types, and construct a sample data set; The model pre-training module is used to pre-train the fault diagnosis model based on the spatiotemporal graph network using the sample dataset as the source domain data; In each iteration, a multi-scale adversarial perturbation addition method based on gradient optimization is used to generate adversarial sample data. Through the dynamic balancing mechanism of data categories and the confidence evaluation mechanism, the data is screened and added to the dataset, and the model is trained using the updated dataset. The model fine-tuning module is used to introduce target domain data and fine-tune the pre-trained model using a transfer learning strategy based on dynamic kernelized maximum mean difference; The fault location and identification module is used to obtain the data of each node in the active distribution network of the target domain, input the node data into the fault diagnosis model, locate the fault node and identify the fault type; Among them, the dynamic kernelized maximum mean difference loss is calculated between the target domain data features and the original domain data features to achieve feature alignment; the total loss function is constructed based on the dynamic kernelized maximum mean difference loss and the fault localization and identification task loss, and the frozen pre-trained model is fine-tuned in combination with the target domain features; Among them, the sample data set is used as the training data set to pre-train the fault diagnosis model based on the spatiotemporal graph network, including: In each iteration, multi-scale adversarial perturbations with multiple steps are generated and added to the sample data in the training dataset to generate adversarial sample data, and the gradient of the added perturbation is accumulated to optimize the generation of perturbations in the next iteration; Based on the sample data and the generated adversarial sample data, a data category dynamic balance mechanism is introduced to monitor the distribution of all samples of each fault type, determine whether the category balance judgment conditions are met, and update the training dataset based on the category balance judgment results combined with the confidence evaluation mechanism; The updated training data set is used to continue training the fault diagnosis model, optimizing the model parameters to meet the optimization goal of minimizing the classification error in the current iteration, and then the next round of iteration is performed until the maximum number of iterations is reached and the model training is completed.

7. An electronic device, characterized in that: include: a memory for storing executable instructions; The processor is configured to implement the active distribution network fault location and identification method based on a spatiotemporal graph network as described in any one of claims 1 to 5 when executing the executable instructions stored in the memory.

8. A computer-readable storage medium, characterized in that Executable instructions are stored, which are used to cause the processor to execute the executable instructions to implement the active distribution network fault location and identification method based on the space-time graph network as described in any one of claims 1 to 5.

9. A computer program product, characterized in that The computer program product includes executable instructions stored in a computer-readable storage medium; When the processor of the electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the active distribution network fault location and identification method based on the space-time graph network described in any one of claims 1 to 5 is implemented.