Power grid line loss anomaly correlation diagnosis method based on deep learning
By using deep learning methods to perform multi-source data fusion and multi-task diagnosis of power grid line loss anomalies, the problem of insufficient line loss anomaly analysis capability of traditional methods under multi-source data is solved, and more efficient anomaly detection and localization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID INFO TELECOM GREAT POWER SCI & TECH
- Filing Date
- 2025-11-11
- Publication Date
- 2026-05-15
AI Technical Summary
Traditional line loss anomaly analysis methods are unable to cope with the complexity of multi-source data and the problem of line loss anomalies in multiple dimensions and multiple spatiotemporal levels, resulting in limited anomaly detection rate and accurate location capability.
A deep learning-based method for diagnosing power grid line loss anomalies is adopted. Through multi-source data fusion, label system establishment, multi-dimensional feature construction, and multi-task deep learning diagnostic model, the joint diagnosis of archive, metering, and topological anomalies is achieved.
It significantly improves the full coverage and accuracy of line loss anomaly detection, enabling it to capture complex and hidden anomalies, and enhances the ability to identify complex power grid scenarios and prevent missed detections.
Smart Images

Figure CN121097682B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of line loss detection, and in particular to a deep learning-based method for diagnosing abnormal power grid line loss correlations. Background Technology
[0002] With the continuous improvement of the intelligence level of my country's power grid, line loss management has become an important part of power companies' cost reduction and efficiency improvement and the safe operation of the power grid. Traditional line loss anomaly analysis mainly relies on rule judgment or human experience, which is insufficient to respond to real-world problems such as data diversity, complex causes of anomalies, and hidden event interactions, resulting in limited anomaly detection rate and accurate location capabilities.
[0003] In recent years, the large-scale integration of intelligent sensing devices (such as smart meters, feeder terminals, and monitoring stations) into various parts of the power grid has brought about massive amounts of diverse data, including metering, electrical, archival, topology, operation and maintenance, and anti-theft data. The need for collaborative interaction of multi-source data and automatic attribution of complex behavioral patterns is becoming increasingly prominent. Traditional analytical methods struggle to reveal the deep-seated causes of abnormal line losses from multiple dimensions and spatiotemporal perspectives. Summary of the Invention
[0004] To address the aforementioned issues, the present invention aims to provide a deep learning-based method for diagnosing abnormal power grid line losses, which significantly improves the overall coverage and actual accuracy of abnormal line loss detection.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] A deep learning-based method for diagnosing abnormal power grid line losses includes the following steps:
[0007] S1: Obtain multi-source data related to power grid line loss, fuse the multi-source data, and obtain a multi-dimensional fact sample table after fusion;
[0008] S2: Establish an anomaly labeling system and label the multidimensional fact sample table to obtain a labeled sample set;
[0009] S3: Construct multidimensional features based on labeled sample sets to obtain spatiotemporal multimodal feature tensors;
[0010] S4: Construct a multi-task deep learning diagnostic model and train it based on spatiotemporal multimodal feature tensors to obtain an end-to-end diagnostic model;
[0011] S5: Based on the end-to-end diagnostic model, multi-dimensional structured alarms are obtained according to the implementation data.
[0012] Furthermore, the multi-source data related to power grid line loss includes the master table of the same-period line loss system, the archive system, metering data, topology data, and operation and maintenance records.
[0013] Furthermore, the multi-source data is fused, as follows:
[0014] Before data access, establish a unified business standard and master data standard, and clarify the mapping relationship between the unique device identifier, the area code, the account number and the meter number, as well as the time base.
[0015] The access method is selected based on the characteristics of the source system. Offline batch data is extracted periodically through the data lake for archives, case files, and historical line loss indicators. Streaming data is accessed through Kafka to receive metering increments and topology change events, meeting the requirements for near real-time feature construction. External interfaces pull change snapshots and alarm archives through SQL interfaces.
[0016] Taking the transformer area as the core entity, it is associated with feeders above and transformer-branch-household meter below; and data of different frequencies are resampled to the target window, and left alignment or closed interval merging is used to ensure the comparability of statistics in the same period.
[0017] On a unified primary key and time axis, cross-table fusion is completed, and the line loss indicators and metering granular details of the same period are associated by substation area and time window, and static profiles of archives and operation and maintenance status are overlaid; the GIS topology is mapped into graph structure features, and the topology switching history is projected into the time window as binary features to obtain the fused multidimensional fact sample table.
[0018] Furthermore, an anomaly labeling system was established, and the multidimensional fact sample table was labeled to obtain a labeled sample set, as follows:
[0019] The rule mining method is used to initially screen the multidimensional fact sample table, and anomaly identification rules based on domain knowledge are set. The initial screening results are used as candidate anomaly samples to form a set of label seeds.
[0020] Based on the business characteristics and causes of abnormal power grid line losses, a three-category labeling system is established, covering file anomalies, metering anomalies, and topology anomalies. File anomalies include subcategories such as equipment file discrepancies, missing user files, and unsynchronized asset changes. Metering anomalies are further subdivided into meter malfunctions, data acquisition anomalies, and metering device problems, and are classified and labeled according to the duration and impact of the anomalies.
[0021] Topological anomalies include errors in topological relationships, the impact of topological changes, and lag in GIS data;
[0022] A hierarchical label tree for anomaly types is established, supporting the coexistence of multiple labels and priority sorting, providing rich supervision signals for multi-task learning; and a comprehensive rule base covering electrical features, temporal patterns, and topological relationships is constructed based on rule-based label generation. The rule engine supports dynamic threshold adjustment and condition combination to ensure the flexibility and accuracy of label generation.
[0023] Furthermore, multi-dimensional features are constructed based on the labeled sample set to obtain a spatiotemporal multimodal feature tensor, as detailed below:
[0024] Based on historical time-series data in the labeled sample set, time-dimensional features are obtained, including time-series statistical features and electrical engineering features;
[0025] Time-series statistical feature extraction involves calculating the mean, variance, skewness, and kurtosis statistics of line loss rate, electricity consumption, voltage, and current indicators using a sliding window. Time-series decomposition is employed to break down time-series data into trend, seasonal, and irregular components, extracting periodic patterns and abrupt change features. Electrical engineering feature construction includes power factor variation trends, three-phase imbalance time-series evolution, harmonic distortion rate statistical analysis, and voltage qualification rate fluctuation characteristics. Furthermore, Fourier transform frequency domain analysis is used to extract the spectral and time-frequency joint features of the load curve, identifying frequency domain signatures of abnormal electricity consumption behavior. A feature pyramid with multi-granularity time windows is established, forming a time-dimensional feature matrix X. time For time-series features;
[0026] Based on GIS topology data and equipment connection relationships, a graph structure representation of the power grid is constructed to mine spatial correlation features. The graph topology construction maps power grid entities such as distribution areas, transformers, feeders, and users to graph nodes, and electrical connections, power supply paths, and management affiliations to graph edges, forming a multi-layered heterogeneous graph structure. The degree centrality, betweenness centrality, and proximity centrality of nodes are calculated. Subgraph features are extracted, including the number of k-order neighboring nodes, shortest path length, and clustering coefficient, describing local topological density and connectivity. Electrical distance and influence domain analysis calculates the electrical distance between nodes based on the impedance matrix and constructs a similarity metric based on electrical characteristics. Finally, a spatial dimension feature representation is formed, including a node feature matrix X. node and adjacency matrix A;
[0027] By deeply fusing features from the temporal and spatial dimensions, a spatiotemporal multimodal feature tensor supporting multi-task learning is constructed. Features from different sources and at different scales are normalized, and a feature selection algorithm is used to filter important features and remove redundant and noisy features. A feature engineering pipeline is established to support the dynamic addition of new features and the real-time updating of feature importance.
[0028] Spatiotemporal joint feature construction design spatiotemporal interaction features, constructing multi-scale fusion features, organized using a dictionary structure: {temporal: X time spatial: (X node A), static: X static}, where temporal stores the temporal feature matrix, spatial stores the graph structure features, and static stores the static attribute features.
[0029] Furthermore, the multi-task deep learning diagnostic model adopts an architecture design of shared encoder and task-specific branches to achieve joint diagnosis of archival anomalies, quantitative anomalies, and topological anomalies, including a temporal feature encoding sub-network, a spatial graph convolutional sub-network, a multimodal feature fusion layer, and a multi-task output layer.
[0030] Furthermore, the temporal feature encoding sub-network employs a Transformer-LSTM hybrid architecture to process temporal features and capture long- and short-term dependencies, as detailed below:
[0031] Multi-Head Self-Attention layer:
[0032] ;
[0033] in, Q is the query matrix; K is the key matrix; V is the value matrix; is the scaling factor; softmax is the activation function; Attention represents the attention mechanism; MuliHead is for multi-head splicing; X temporal The input is the temporal feature tensor; h is the number of attention heads; W o To output the projection matrix; Let be the Query projection matrix for the i-th head; Let be the Key projection matrix of the i-th head; Let be the Value projection matrix of the i-th head; the superscript T indicates transpose; contact indicates the concatenation function;
[0034] Location encoding and residual connection:
[0035] ;
[0036] in, Output the hidden state of layer l; represents the hidden state of layer l-1, which serves as the output of the residual connection; LayerNorm is the layer normalization operation; PE is the position encoding matrix;
[0037] LSTM enhancement layer:
[0038] ;
[0039] in, The features at time step t are obtained after passing through L layers of Transformers; The cell state of the LSTM at time step t; Let t be the hidden state of the LSTM at time step t; The hidden state of the previous time step; Cell state at the previous time step; LSTM represents Long Short-Term Memory network; L is the number of coding layers in the Transformer;
[0040] Temporal feature output:
[0041] ;
[0042] Among them, Z temporal This represents the final feature representation of the temporal encoding; GlobalAveragePool is the global average pooling operation.
[0043] Furthermore, the spatial graph convolutional sub-network processes the topological graph structure features based on GAT, as follows:
[0044] Graph attention mechanism:
[0045] ;
[0046] Among them, e ij The original attention score between node i and node j; a T The attention vector is W; W is the linear transformation matrix that projects the input features onto a new feature space; h i ,h j These are the input feature vectors for nodes i and j, respectively; The concatenation of features after transformation of nodes i and j; LeakyReLU is the ReLU activation function; α ij Let be the normalized attention weight of node i to its neighbor node j; Let be the set of neighboring nodes of node i; exp() is the exponentiation of the attention score; e ik Let i be the original attention score between node i and its neighbor node k; k is the neighbor node.
[0047] Graph convolution output:
[0048] ;
[0049] in, The feature representation of node i in the (l+1)th layer; The feature representation of neighbor node j in the l-th layer; Let be the attention weight of node i to neighbor j in layer l; σ is the feature transformation matrix of the l-th layer; σ is the activation function.
[0050] Multi-layered GAT and skip connections:
[0051] ;
[0052] in, The feature matrix of all nodes in the l-th layer; is the node feature matrix of the previous layer; A is the adjacency matrix of the power grid topology; GAT is the forward propagation calculation of the graph attention network layer;
[0053] Graph-level feature aggregation:
[0054] ;
[0055] Among them, Z spatial This represents the final feature representation at the graph level. This is the output feature matrix of the last layer of GAT; This is the feature vector of node i in the last layer; This represents the maximum value of all nodes in each feature dimension; This indicates a concatenation operation; ReadOut indicates a read operation; N is the number of nodes.
[0056] Furthermore, the multimodal feature fusion layer and multi-task output layer are detailed below:
[0057] The multimodal feature fusion layer employs an attention mechanism to fuse temporal, spatial, and static features.
[0058] ;
[0059] Among them, e modal It is a concatenated projection vector of three modal features; Z is the attention projection matrix for temporal features; temporal This is the feature vector output by the timing encoder; Z is the attention projection matrix for spatial features; spatial The feature vector output by the graph convolutional encoder; X is the attention projection matrix for static features; static For static attribute feature vectors; [;;] represents the feature vector concatenation operation; α modal These are the normalized attention weights for the three modalities; Calculate the matrix for modal-level attention;
[0060] Weighted feature fusion:
[0061] ;
[0062] Where α1, α2, and α3 are the attention weights for each modality; Z fused W represents the weighted fused feature vector. static The dimension alignment matrix for static features;
[0063] Cross-modal interaction features:
[0064] ;
[0065] Among them, Z interact This represents a cross-modal interaction feature vector. For feature splicing operations; For Hadamard product; Z is the tensor product; final For the final multimodal fusion features; W interact The interactive feature projection matrix;
[0066] For each anomaly type k∈{archive, measure, topology}, the multi-task output layer outputs:
[0067] ;
[0068] in, Here is the hidden feature representation for task k; here is the first-layer weight matrix for task k. and These are the first-layer weight matrix and bias vector for task k, respectively; and These are the second-layer weight matrix and bias vector for task k, respectively; Let be the predicted anomaly probability value for task k; It is a non-linear activation function; It is a probabilistic activation function;
[0069] Predicted probability output:
[0070] ;
[0071] Wherein, P(y k =1|x) The probability of task k being abnormal given input x;
[0072] Uncertainty estimation (Monte Carlo Dropout):
[0073] ;
[0074] in, The prediction result is the result of the m-th dropout sample; M is the number of samples; f MTL () represents the forward propagation function of the multi-task model; θ is the model parameter; dropout=True indicates that dropout activation is maintained during inference; μ k The predicted mean of M samples; Let V be the prediction variance for M samplings.
[0075] Furthermore, based on the end-to-end diagnostic model and implementation data, multi-dimensional structured alarms are obtained, as follows:
[0076] The pre-processed real-time data is input into the trained end-to-end diagnostic model to perform multi-task anomaly detection inference. The end-to-end diagnostic model loading and optimization uses model serialization technology to optimize inference.
[0077] The end-to-end diagnostic model outputs predicted probabilities for three types of anomalies: archival anomalies, quantitative anomalies, and topological anomalies, along with corresponding uncertainty estimates. Dynamic thresholds are set for each type of anomaly. Confidence assessment and filtering combine uncertainty estimation methods such as Monte Carlo Dropout to calculate the confidence level of the prediction results and filter out prediction results with confidence levels below the threshold.
[0078] The anomaly detection results are converted into structured alarm information, which includes alarm ID, occurrence time, affected objects, anomaly type, severity, and confidence level.
[0079] The present invention has the following beneficial effects:
[0080] 1. This invention significantly improves the full coverage and actual accuracy of line loss anomaly detection, and can capture complex, hidden, and cross-type anomalies that are missed by traditional single methods, thus strengthening the foundation of line loss management for power grid companies.
[0081] 2. This invention deeply integrates multimodal information such as electrical timing characteristics, spatial topology, and static attributes, and utilizes multi-head attention, graph neural networks, and LSTM to achieve automatic modeling of rich patterns such as long-term and short-term timing patterns, cross-regional spatial influence, and static file changes.
[0082] 3. This invention, through its multi-task output design, can collaboratively identify multiple types of anomalies such as archives, metering, and topology, effectively uncovering complex relationships involving multiple causes and effects. Compared with traditional single-point or single-modal diagnosis, it greatly improves the discrimination complexity and missed detection prevention capabilities for complex power grid scenarios, and the model has stronger generalization and adaptability to new types of anomalies. Attached Figure Description
[0083] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0084] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0085] refer to Figure 1 In this embodiment, a deep learning-based method for diagnosing abnormal power grid line losses is provided, comprising the following steps:
[0086] S1: Obtain multi-source data related to power grid line loss, fuse the multi-source data, and obtain a multi-dimensional fact sample table after fusion;
[0087] S2: Establish an anomaly labeling system and label the multidimensional fact sample table to obtain a labeled sample set;
[0088] S3: Construct multidimensional features based on labeled sample sets to obtain spatiotemporal multimodal feature tensors;
[0089] S4: Construct a multi-task deep learning diagnostic model and train it based on spatiotemporal multimodal feature tensors to obtain an end-to-end diagnostic model;
[0090] S5: Based on the end-to-end diagnostic model, multi-dimensional structured alarms are obtained according to the implementation data.
[0091] In this embodiment, the multi-source data related to power grid line loss includes the main table of the synchronous line loss system (transformer area, line loss index, synchronous line loss details), the archive system (equipment / household number archive, asset change flow), the metering system (original data collection, error code, time synchronization, and data retrieval log), the topology data (latest GIS topology, topology switching history, and main equipment connection relationship), and the operation and maintenance records (inspection, defects, patrol, three-phase imbalance, etc.).
[0092] In this embodiment, multi-source data is fused, as follows:
[0093] Before data access, establish a unified business standard and master data standard, and clarify the mapping relationship between the unique device identifier, the area code, the account number and the meter number, as well as the time base.
[0094] The access method is selected based on the characteristics of the source system. Offline batch data is extracted periodically through the data lake for archives, case files, and historical line loss indicators. Streaming data is accessed through Kafka to receive metering increments and topology change events, meeting the requirements for near real-time feature construction. External interfaces pull change snapshots and alarm archives through SQL interfaces.
[0095] Using the transformer substation as the core entity, it is linked upwards to the feeder and downwards to the transformer, branch line, and household meter; ensuring "one object - one primary key - one set of relationships"; and resampling data of different frequencies into the target window, using left alignment or closed interval merging to ensure statistical comparability for the same period.
[0096] On a unified primary key and time axis, cross-table fusion is completed, and the line loss indicators and metering granular details of the same period are associated by substation area and time window. The static profile of the archive (capacity, line diameter, commissioning years) and operation and maintenance status (under inspection / after inspection / defect level) are overlaid. The GIS topology is mapped to graph structure features (node degree, hierarchy depth, electrical distance), and the topology switching history is projected into the time window as a binary feature to obtain the fused multidimensional fact sample table.
[0097] In this embodiment, an anomaly labeling system is established, and a multidimensional fact sample table is labeled to obtain a labeled sample set, as detailed below:
[0098] Rule mining methods are used to initially screen the multidimensional fact sample table, and anomaly identification rules based on domain knowledge are set, such as "line loss rate > 20% for 7 consecutive days", "difference between total meter and sub-meter power consumption > 10%", "sudden change in line loss before and after topology switching > 8 percentage points", "three-phase current imbalance > 30% and power factor < 0.8", etc. The initial screening results are used as candidate anomaly samples to form a set of label seeds.
[0099] Based on the business characteristics and causes of abnormal power grid line losses, a three-category labeling system is established, covering file anomalies, metering anomalies, and topology anomalies. File anomalies include subcategories such as equipment file discrepancies (actual capacity does not match the file, incorrect commissioning time), missing user files (incorrect account number, improper electricity usage classification), and unsynchronized asset changes (files are delayed after equipment replacement, and meters are not updated in a timely manner after migration). Metering anomalies are further subdivided into meter malfunctions (abnormal readings, incorrect multiplier, improper wiring), data acquisition anomalies (communication interruption, garbled data, time calibration deviation), and metering device problems (CT / PT ratio errors, damaged seals, unauthorized bypass connections). The anomalies are further classified and labeled according to their duration and impact.
[0100] Topology anomalies include topology relationship errors (incorrect transformer area affiliation, inaccurate user connection points), the impact of topology changes (line loss fluctuations caused by handover operations, the impact of ring network opening), and GIS data lag (inconsistency between actual topology and system records, temporary wiring not updated).
[0101] A hierarchical label tree for anomaly types is established, supporting the coexistence of multiple labels (a sample can simultaneously exhibit both metering and archival anomalies) and priority ranking, providing rich supervisory signals for multi-task learning. Based on rule-based label generation, a comprehensive rule base covering electrical characteristics, temporal patterns, and topology relationships is constructed, such as "continuous abnormal line loss rate in the distribution area + sudden drop in user power consumption + no maintenance record = suspected electricity theft", "metering failure rate > 50% + voltage qualification rate < 95% = metering device anomaly", and "line loss change within 3 days after topology switching > threshold = topology impact anomaly". The rule engine supports dynamic threshold adjustment and condition combination to ensure the flexibility and accuracy of label generation.
[0102] In this embodiment, multidimensional features are constructed based on the labeled sample set to obtain a spatiotemporal multimodal feature tensor, as detailed below:
[0103] Based on historical time-series data in the labeled sample set, time-dimensional features are obtained, including time-series statistical features and electrical engineering features;
[0104] Time-series statistical feature extraction involves calculating the mean, variance, skewness, and kurtosis statistics of line loss rate, electricity consumption, voltage, and current indicators using a sliding window. Time-series decomposition (e.g., STL, X-13-ARIMA) is employed to break down time-series data into trend, seasonal, and irregular components, extracting periodic patterns and abrupt changes. Electrical engineering feature construction includes power factor variation trends, three-phase imbalance time-series evolution, harmonic distortion rate statistical analysis, and voltage qualification rate fluctuation characteristics. Furthermore, Fourier transform frequency domain analysis is used to extract the spectral and time-frequency joint features of the load curve, identifying frequency domain signatures of abnormal electricity consumption behavior. A feature pyramid with multiple granular time windows (5min, 15min, 1h, 24h) is established to form a time-dimensional feature matrix X. time For time-series features;
[0105] Based on GIS topology data and equipment connection relationships, a graph structure representation of the power grid is constructed to mine spatial correlation features. The graph topology construction maps power grid entities such as distribution areas, transformers, feeders, and users to graph nodes, and electrical connections, power supply paths, and management affiliations to graph edges, forming a multi-layered heterogeneous graph structure. The degree centrality, betweenness centrality, and proximity centrality of nodes are calculated. Subgraph features are extracted, including the number of k-order neighboring nodes, shortest path length, and clustering coefficient, describing local topological density and connectivity. Electrical distance and influence domain analysis calculates the electrical distance between nodes based on the impedance matrix and constructs a similarity metric based on electrical characteristics. Finally, a spatial dimension feature representation is formed, including a node feature matrix X. node and adjacency matrix A;
[0106] By deeply fusing temporal and spatial features, a spatiotemporal multimodal feature tensor supporting multi-task learning is constructed. Features from different sources and at different scales are normalized, including Z-score standardization, to ensure the consistency of feature numerical ranges. Feature selection algorithms (such as mutual information-based, LASSO, and recursive feature elimination) are used to filter important features and remove redundant and noisy features. A feature engineering pipeline is established to support the dynamic addition of new features and the real-time updating of feature importance.
[0107] Spatiotemporal joint features are used to construct spatiotemporal interactive features, such as the correlation between the line loss rate of a certain transformer area and the line loss rate of its topological neighboring transformer areas, and the temporal correlation between time-series abrupt change points and topology change events; multi-scale fusion features are constructed and organized using a dictionary structure: {temporal: X time spatial: (X node A), static: X static}, where temporal stores the temporal feature matrix, spatial stores the graph structure features, and static stores the static attribute features (such as device parameters, user type, etc.).
[0108] In this embodiment, the multi-task deep learning diagnostic model adopts an architecture design of shared encoder and task-specific branches to achieve joint diagnosis of archive anomalies, measurement anomalies, and topological anomalies, including a temporal feature encoding sub-network, a spatial graph convolutional sub-network, a multimodal feature fusion layer, and a multi-task output layer.
[0109] In this embodiment, the temporal feature encoding sub-network uses a Transformer-LSTM hybrid architecture to process temporal features and capture long-short-term dependencies, as detailed below:
[0110] Multi-Head Self-Attention layer:
[0111] ;
[0112] in, Q is the query matrix; K is the key matrix; V is the value matrix; is the scaling factor; softmax is the activation function; Attention represents the attention mechanism; MuliHead is for multi-head splicing; X temporal The input is the temporal feature tensor; h is the number of attention heads; W o To output the projection matrix; Let be the Query projection matrix for the i-th head; Let be the Key projection matrix of the i-th head; Let be the Value projection matrix of the i-th head; the superscript T indicates transpose; contact indicates the concatenation function;
[0113] Location encoding and residual connection:
[0114] ;
[0115] in, Output the hidden state of layer l; represents the hidden state of layer l-1, which serves as the output of the residual connection; LayerNorm is the layer normalization operation; PE is the position encoding matrix;
[0116] LSTM enhancement layer:
[0117] ;
[0118] in, The features at time step t are obtained after passing through L layers of Transformers; The cell state of the LSTM at time step t; Let t be the hidden state of the LSTM at time step t; The hidden state of the previous time step; Cell state at the previous time step; LSTM represents Long Short-Term Memory network; L is the number of coding layers in the Transformer;
[0119] Temporal feature output:
[0120] ;
[0121] Among them, Z temporal This represents the final feature representation of the temporal encoding; GlobalAveragePool is the global average pooling operation.
[0122] In this embodiment, the spatial graph convolutional subnetwork processes the topological graph structure features based on GAT, as follows:
[0123] Graph attention mechanism:
[0124] ;
[0125] Among them, e ij The original attention score between node i and node j; a T The attention vector is W; W is the linear transformation matrix that projects the input features onto a new feature space; h i ,h j These are the input feature vectors for nodes i and j, respectively; The concatenation of features after transformation of nodes i and j; LeakyReLU is the ReLU activation function; α ij Let be the normalized attention weight of node i to its neighbor node j; Let be the set of neighboring nodes of node i; exp() is the exponentiation of the attention score; e ik Let i be the original attention score between node i and its neighbor node k; k is the neighbor node.
[0126] Graph convolution output:
[0127] ;
[0128] in, This represents the feature representation of node i in the (l+1)th layer; The feature representation of neighbor node j in the l-th layer; Let be the attention weight of node i to neighbor j in layer l; σ is the feature transformation matrix of the l-th layer; σ is the activation function.
[0129] Multi-layered GAT and skip connections:
[0130] ;
[0131] in, The feature matrix of all nodes in the l-th layer; is the node feature matrix of the previous layer; A is the adjacency matrix of the power grid topology; GAT is the forward propagation calculation of the graph attention network layer;
[0132] Graph-level feature aggregation:
[0133] ;
[0134] Among them, Z spatial This represents the final feature representation at the graph level. This is the output feature matrix of the last layer of GAT; This is the feature vector of node i in the last layer; This represents the maximum value of all nodes in each feature dimension; This indicates a concatenation operation; ReadOut indicates a read operation; N is the number of nodes.
[0135] In this embodiment, the multimodal feature fusion layer and the multi-task output layer are specifically as follows:
[0136] The multimodal feature fusion layer employs an attention mechanism to fuse temporal, spatial, and static features.
[0137] ;
[0138] Among them, e modal It is a concatenated projection vector of three modal features; Z is the attention projection matrix for temporal features; temporal This is the feature vector output by the timing encoder; Z is the attention projection matrix for spatial features; spatial The feature vector output by the graph convolutional encoder; X is the attention projection matrix for static features; static For static attribute feature vectors; [;;] represents the feature vector concatenation operation; α modal These are the normalized attention weights for the three modalities; Calculate the matrix for modal-level attention;
[0139] Weighted feature fusion:
[0140] ;
[0141] Where α1, α2, and α3 are the attention weights for each modality (α1 is the importance of the temporal modality, α2 is the importance of the spatial modality, and α3 is the importance of the static modality); Z fused W represents the weighted fused feature vector. static The dimension alignment matrix for static features;
[0142] Cross-modal interaction features:
[0143] ;
[0144] Among them, Z interact This represents a cross-modal interaction feature vector. For feature splicing operations; For Hadamard product; Z is the tensor product; final For the final multimodal fusion features; W interact The interactive feature projection matrix;
[0145] For each anomaly type k∈{archive, measurement, topology}, the multi-task output layer outputs:
[0146] ;
[0147] in, Here is the hidden feature representation for task k; here is the first-layer weight matrix for task k. and These are the first-layer weight matrix and bias vector for task k, respectively; and These are the second-layer weight matrix and bias vector for task k, respectively; Let be the predicted anomaly probability value for task k; It is a non-linear activation function; It is a probabilistic activation function;
[0148] Predicted probability output:
[0149] ;
[0150] Wherein, P(y k =1|x) The probability of task k being abnormal given input x;
[0151] Uncertainty estimation (Monte Carlo Dropout):
[0152] ;
[0153] in, The prediction result is the result of the m-th dropout sample; M is the number of samples; f MTL () represents the forward propagation function of the multi-task model; θ is the model parameter; dropout=True indicates that dropout activation is maintained during inference; μ k The predicted mean of M samples; Let V be the prediction variance for M samplings.
[0154] In this embodiment, based on the end-to-end diagnostic model and implementation data, multi-dimensional structured alarms are obtained, as follows:
[0155] The preprocessed real-time data is input into the trained end-to-end diagnostic model for multi-task anomaly detection inference. The end-to-end diagnostic model loading and optimization uses model serialization technology (such as ONNX, TensorRT) for inference optimization.
[0156] The end-to-end diagnostic model outputs predicted probabilities for three types of anomalies: archival anomalies, quantitative anomalies, and topological anomalies, along with corresponding uncertainty estimates. Dynamic thresholds are set for each type of anomaly. Confidence assessment and filtering combine uncertainty estimation methods such as Monte Carlo Dropout to calculate the confidence level of the prediction results and filter out prediction results with confidence levels below the threshold.
[0157] The anomaly detection results are converted into structured alarm information, which includes alarm ID, occurrence time, affected object (transformer area / equipment / user), anomaly type, severity, and confidence level.
[0158] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0159] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0160] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0161] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0162] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A deep learning-based method for diagnosing abnormal power grid line losses, characterized in that, Includes the following steps: S1: Obtain multi-source data related to power grid line loss, fuse the multi-source data, and obtain a fused multi-dimensional fact sample table; S2: Establish an anomaly labeling system and label the multidimensional fact sample table to obtain a labeled sample set; S3: Construct multidimensional features based on labeled sample sets to obtain spatiotemporal multimodal feature tensors; S4: Construct a multi-task deep learning diagnostic model and train it based on spatiotemporal multimodal feature tensors to obtain an end-to-end diagnostic model; the multi-task deep learning diagnostic model adopts an architecture design of shared encoder and task-specific branches to achieve joint diagnosis of archival anomalies, quantitative anomalies, and topological anomalies, including a temporal feature encoding sub-network, a spatial graph convolutional sub-network, a multimodal feature fusion layer, and a multi-task output layer; S5: Based on an end-to-end diagnostic model, multi-dimensional structured alarms are obtained according to implementation data; The temporal feature encoding sub-network uses a Transformer-LSTM hybrid architecture to process temporal features and capture long-short-term dependencies, as detailed below: Multi-Head Self-Attention layer: ; in, Q is the query matrix; K is the key matrix; V is the value matrix; is the scaling factor; softmax is the activation function; Attention represents the attention mechanism; MuliHead is for multi-head splicing; X temporal The input is the temporal feature tensor; h is the number of attention heads; W o To output the projection matrix; Let be the Query projection matrix for the i-th head; Let be the Key projection matrix of the i-th head; Let be the Value projection matrix of the i-th head; the superscript T indicates transpose; contact indicates the concatenation function; Location encoding and residual connection: ; in, Output the hidden state of layer l; represents the hidden state of layer l-1, which serves as the output of the residual connection; LayerNorm is the layer normalization operation; PE is the position encoding matrix; LSTM enhancement layer: ; in, The features at time step t are obtained after passing through L layers of Transformers; The cell state of the LSTM at time step t; Let t be the hidden state of the LSTM at time step t; The hidden state of the previous time step; Cell state at the previous time step; LSTM represents Long Short-Term Memory network; L is the number of coding layers in the Transformer; Temporal feature output: ; Among them, Z temporal This represents the final feature representation of the temporal encoding; GlobalAveragePool is the global average pooling operation.
2. The deep learning-based power grid line loss anomaly correlation diagnosis method according to claim 1, characterized in that, The multi-source data related to power grid line loss includes the master table of the synchronous line loss system, the archive system, metering data, topology data, and operation and maintenance records.
3. The deep learning-based power grid line loss anomaly correlation diagnosis method according to claim 2, characterized in that, The fusion of multi-source data is specifically as follows: Before data access, establish a unified business standard and master data standard, and clarify the mapping relationship between the unique device identifier, the area code, the account number and the meter number, as well as the time base. The access method is selected based on the characteristics of the source system: offline batch data is extracted periodically through the data lake for archives, case files, and historical line loss indicators; streaming data is accessed through Kafka to receive metering increments and topology change events to meet the requirements of near real-time feature construction; external interfaces pull change snapshots and alarm archives through SQL interfaces. Taking the transformer area as the core entity, it is associated with feeders above and transformer-branch-household meter below; and data of different frequencies are resampled to the target window, and left alignment or closed interval merging is used to ensure the comparability of statistics in the same period. On a unified primary key and time axis, cross-table fusion is completed, and the line loss indicators and metering granular details of the same period are associated by substation area and time window, and static profiles of archives and operation and maintenance status are overlaid; the GIS topology is mapped into graph structure features, and the topology switching history is projected into the time window as binary features to obtain the fused multidimensional fact sample table.
4. The deep learning-based power grid line loss anomaly correlation diagnosis method according to claim 1, characterized in that, The establishment of an anomaly labeling system and the labeling of the multidimensional fact sample table to obtain a labeled sample set are detailed below: The rule mining method is used to initially screen the multidimensional fact sample table, and anomaly identification rules based on domain knowledge are set. The initial screening results are used as candidate anomaly samples to form a set of label seeds. Based on the business characteristics and causes of abnormal power grid line losses, a three-category labeling system is established, covering file anomalies, metering anomalies, and topology anomalies. File anomalies include subcategories such as equipment file discrepancies, missing user files, and unsynchronized asset changes. Metering anomalies are further subdivided into meter malfunctions, data acquisition anomalies, and metering device problems, and are classified and labeled according to the duration and impact of the anomalies. Topological anomalies include errors in topological relationships, the impact of topological changes, and lag in GIS data; A hierarchical label tree for anomaly types is established, supporting the coexistence of multiple labels and priority sorting, providing rich supervision signals for multi-task learning; and a comprehensive rule base covering electrical features, temporal patterns, and topological relationships is constructed based on rule-based label generation. The rule engine supports dynamic threshold adjustment and condition combination to ensure the flexibility and accuracy of label generation.
5. The deep learning-based power grid line loss anomaly correlation diagnosis method according to claim 4, characterized in that, The construction of multidimensional features based on the labeled sample set to obtain the spatiotemporal multimodal feature tensor is as follows: Based on historical time-series data in the labeled sample set, time-dimensional features are obtained, including time-series statistical features and electrical engineering features; Time series statistical feature extraction uses a sliding window to calculate the mean, variance, skewness, and kurtosis statistics of line loss rate, electricity consumption, voltage, and current indicators; time series decomposition is used to decompose time series data into trend items, seasonal items, and irregular items, and extract periodic patterns and abrupt change features. The electrical engineering feature construction includes power factor variation trend, three-phase unbalance time evolution, harmonic distortion rate statistical analysis, and voltage qualification rate fluctuation characteristics; Furthermore, by employing Fourier transform frequency domain analysis, the spectral and time-frequency joint features of the load curve are extracted to identify the frequency domain signature of abnormal electricity consumption behavior; a feature pyramid with multi-granularity time windows is established to form a time-dimensional feature matrix X. time For time-series features; Based on GIS topology data and equipment connection relationships, a graph structure representation of the power grid is constructed to mine spatial correlation features. The graph topology construction maps transformer substations, feeders, and user entities to graph nodes, and electrical connections, power supply paths, and management affiliations to graph edges, forming a multi-layered heterogeneous graph structure. The degree centrality, betweenness centrality, and proximity centrality of nodes are calculated. Subgraph features are extracted, including the number of k-order neighboring nodes, shortest path length, and clustering coefficient, describing local topological density and connectivity. Electrical distance and influence domain analysis calculates the electrical distance between nodes based on the impedance matrix and constructs a similarity metric based on electrical characteristics. Finally, a spatial dimension feature representation is formed, including a node feature matrix X. node and adjacency matrix A; By deeply fusing features from the temporal and spatial dimensions, a spatiotemporal multimodal feature tensor supporting multi-task learning is constructed. Features from different sources and at different scales are normalized, and a feature selection algorithm is used to filter important features and remove redundant and noisy features. Establish a feature engineering pipeline to support the dynamic addition of new features and the real-time updating of feature importance; Spatiotemporal joint feature construction design spatiotemporal interaction features, constructing multi-scale fusion features, organized using a dictionary structure: {temporal: X time spatial: (X node A), static: X static }, where temporal stores the temporal feature matrix, spatial stores the graph structure features, and static stores the static attribute features.
6. The deep learning-based power grid line loss anomaly correlation diagnosis method according to claim 1, characterized in that, The spatial graph convolutional sub-network is based on GAT to process the topological graph structure features, as follows: Graph attention mechanism: ; Among them, e ij The original attention score between node i and node j; a T The attention vector is W; W is the linear transformation matrix that projects the input features onto a new feature space; h i ,h j These are the input feature vectors for nodes i and j, respectively; The concatenation of features after transformation of nodes i and j; LeakyReLU is the ReLU activation function; α ij Let be the normalized attention weight of node i to its neighbor node j; Let be the set of neighboring nodes of node i; exp() is the exponentiation of the attention score; e ik Let i be the original attention score between node i and its neighbor node k; k is the neighbor node. Graph convolution output: ; in, This represents the feature representation of node i in the (l+1)th layer; The feature representation of neighbor node j in the l-th layer; Let be the attention weight of node i to neighbor j in layer l; σ is the feature transformation matrix of the l-th layer; σ is the activation function. Multi-layered GAT and skip connections: ; in, The feature matrix of all nodes in the l-th layer; is the node feature matrix of the previous layer; A is the adjacency matrix of the power grid topology; GAT is the forward propagation calculation of the graph attention network layer; Graph-level feature aggregation: ; Among them, Z spatial This represents the final feature representation at the graph level. This is the output feature matrix of the last layer of GAT; This is the feature vector of node i in the last layer; ⊕ represents the maximum value of all nodes in each feature dimension; ⊕ represents the concatenation operation; ReadOut represents the readout operation.
7. The deep learning-based power grid line loss anomaly correlation diagnosis method according to claim 6, characterized in that, The multimodal feature fusion layer and multi-task output layer are as follows: The multimodal feature fusion layer employs an attention mechanism to fuse temporal, spatial, and static features. ; Among them, e modal It is a concatenated projection vector of three modal features; Z is the attention projection matrix for temporal features; temporal This is the feature vector output by the timing encoder; Z is the attention projection matrix for spatial features; spatial The feature vector output by the graph convolutional encoder; X is the attention projection matrix for static features; static For static attribute feature vectors; [;;] represents the feature vector concatenation operation; α modal These are the normalized attention weights for the three modalities; Calculate the matrix for modal-level attention; Weighted feature fusion: ; Where α1, α2, and α3 are the attention weights for each modality; Z fused W represents the weighted fused feature vector. static The dimension alignment matrix for static features; Cross-modal interaction features: ; Among them, Z interact This represents a cross-modal interaction feature vector. For feature splicing operations; For Hadamard product; Z is the tensor product; final For the final multimodal fusion features; W interact The interactive feature projection matrix; For each anomaly type k∈{archive, measurement, topology}, the multi-task output layer outputs: ; in, Here is the hidden feature representation for task k; here is the first-layer weight matrix for task k. and These are the first-layer weight matrix and bias vector for task k, respectively; and These are the second-layer weight matrix and bias vector for task k, respectively; Let be the predicted anomaly probability value for task k; ReLU(·) is a non-linear activation function; sigmoid(·) is a probabilistic activation function; Predicted probability output: ; Wherein, P(y k =1|x) The probability of task k being abnormal given input x; Uncertainty estimation: ; in, The prediction result is the result of the m-th dropout sample; M is the number of samples; f MTL () represents the forward propagation function of the multi-task model; θ is the model parameter; dropout=True indicates that dropout activation is maintained during inference; μ k The predicted mean of M samples; Let V be the prediction variance for M samplings.
8. The deep learning-based power grid line loss anomaly correlation diagnosis method according to claim 1, characterized in that, The end-to-end diagnostic model obtains multi-dimensional structured alarms based on implementation data, as detailed below: The pre-processed real-time data is input into the trained end-to-end diagnostic model to perform multi-task anomaly detection inference. The end-to-end diagnostic model loading and optimization uses model serialization technology to optimize inference. The end-to-end diagnostic model outputs predicted probabilities for three types of anomalies: archival anomalies, quantitative anomalies, and topological anomalies, along with corresponding uncertainty estimates. Dynamic thresholds are set for each type of anomaly. Confidence assessment and filtering combine the Monte Carlo Dropout uncertainty estimation method to calculate the confidence level of the prediction results and filter prediction results with confidence levels below the threshold. The anomaly detection results are converted into structured alarm information, which includes alarm ID, occurrence time, affected objects, anomaly type, severity, and confidence level.