A low-voltage power distribution network intelligent meter reading system cross-domain anomaly detection method and system

CN122333255APending Publication Date: 2026-07-03SOUTHERN POWER GRID DIGITAL GRID RESEARCH INSTITUTE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTHERN POWER GRID DIGITAL GRID RESEARCH INSTITUTE CO LTD
Filing Date
2026-03-05
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In cross-regional deployments, smart meter reading systems suffer from low detection accuracy and weak generalization ability due to differences in data distribution, scarcity of annotations, complex anomaly patterns, and insufficient model interpretability.

Method used

A source domain baseline model is constructed, and features are extracted using a Transformer encoder. Global and local dependencies are established through a multi-head attention mechanism. Domain adaptation is performed by dynamically aligning the feature distributions of the source and target domains using an adversarial learning framework. Self-supervised anomaly detection is implemented, and anomaly scoring results are generated by combining reconstruction loss and contrastive learning loss. Knowledge reasoning and interpretability analysis are performed, and causal explanation links for anomalous events are output based on a pre-built knowledge graph and causal reasoning mechanism.

Benefits of technology

It significantly improves the detection accuracy and generalization ability of smart meter reading systems, provides logical and interpretable causal reasoning basis, enhances the robustness and reliability of the system, and supports cross-regional migration and online deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122333255A_ABST
    Figure CN122333255A_ABST
Patent Text Reader

Abstract

This invention discloses a cross-domain anomaly detection method and system for a smart meter reading system in a low-voltage distribution network. The method includes the following steps: feature extraction using a Transformer encoder; establishing global and local dependencies through a multi-head attention mechanism to output a high-dimensional feature representation; employing an adversarial learning framework to dynamically align the feature distributions of the source and target domains through a feature extractor, predictor, and domain discriminator, minimizing inter-domain differences; performing anomaly detection on unlabeled data in the target domain by combining reconstruction loss and contrastive learning loss to generate anomaly scoring results; outputting causal explanation chains for anomaly events based on a pre-constructed knowledge graph and causal reasoning mechanism; and integrating the anomaly scoring results and causal explanations to output prediction and decision results. This invention addresses the technical problems of low detection accuracy and weak generalization ability in smart meter reading systems deployed across regions due to differences in data distribution, scarce labeling, complex anomaly patterns, and insufficient model interpretability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of low-voltage distribution network technology, and in particular to a method and system for detecting cross-domain anomalies in a smart meter reading system for low-voltage distribution networks. Background Technology

[0002] Against the backdrop of the construction of the energy internet and digital grids, smart meter reading systems have become a core infrastructure for low-voltage distribution networks to achieve real-time collection, transmission, and management of user electricity consumption data. Smart meters can collect high-dimensional time-series data such as voltage, current, and electricity consumption in real time, providing data support for load forecasting, power quality assessment, and electricity theft detection. However, in actual deployment, the system faces the following key challenges: First, significant differences in data distribution; due to differences in economic level, climate conditions, and electricity consumption structure in different regions, there are obvious distribution offsets in electricity consumption data. Traditional methods based on statistical models (such as ARIMA) or single-domain deep learning models (such as CNN and RNN) struggle to adapt to changes in cross-regional data distribution and exhibit poor generalization ability. Secondly, data scarcity and imbalance exist; newly established regions or remote areas have limited data accumulation, and the cost of anomaly sample labeling is high, leading to insufficient model training. Furthermore, packet loss or delays in communication links cause missing or anomalies in time-series data. Thirdly, anomaly patterns are complex and diverse, including communication interruptions, metering deviations, and electricity theft, exhibiting sparsity, multi-scale, and nonlinear characteristics, making them difficult for traditional methods to accurately capture. Fourthly, interpretability and robustness are insufficient; deep learning models are often "black boxes," with opaque criteria for anomaly detection, and performance degrades significantly in complex scenarios such as missing data and noise interference.

[0003] While some existing technologies attempt to improve cross-domain detection through domain adaptation or self-supervised learning, problems such as insufficient feature alignment, lack of knowledge reasoning mechanisms, and weak interpretability still exist. For example, the patent document with application number CN202211087930.6 discloses a method, system, and device for IoT meter reading based on photovoltaic inverters, but these do not solve the aforementioned technical problems. Therefore, there is an urgent need to propose a method and system for cross-domain anomaly detection in a smart meter reading system for low-voltage distribution networks. Summary of the Invention

[0004] The main objective of this invention is to propose a cross-regional anomaly detection method and system for a smart meter reading system in a low-voltage distribution network. This aims to solve the technical problems of low detection accuracy and weak generalization ability caused by differences in data distribution, scarce annotations, complex anomaly patterns, and insufficient model interpretability in the cross-regional deployment of smart meter reading systems.

[0005] To achieve the above objectives, the present invention provides a method for detecting cross-domain anomalies in a smart meter reading system for low-voltage distribution networks, wherein the method includes the following steps:

[0006] S1. Construct a source domain baseline model, use a Transformer encoder to extract features from the labeled power consumption time series data in the source domain, establish global and local dependencies through a multi-head attention mechanism, and output a high-dimensional feature representation.

[0007] S2. Domain adaptation is performed by adopting an adversarial learning framework. Through the collaborative optimization of feature extractors, predictors and domain discriminators, the feature distributions of the source domain and the target domain are dynamically aligned to minimize inter-domain differences.

[0008] S3. Implement self-supervised anomaly detection. On unlabeled data in the target domain, combine reconstruction loss and contrastive learning loss to perform anomaly detection and generate anomaly scoring results.

[0009] S4. Knowledge Reasoning and Explainability Analysis: Outputs causal explanation links for anomalous events based on pre-built knowledge graphs and causal reasoning mechanisms.

[0010] S5. Generate prediction and decision results, integrate abnormal scoring results with causal explanations, and output prediction and decision results.

[0011] One preferred embodiment is that the multi-head attention mechanism of the Transformer encoder in step S1 is as follows:

[0012]

[0013] in, This is a multi-head attention mechanism, representing the feature representation of the output. For querying, the query vector is the data from the source domain. The key represents the key vector in the source domain data that matches the query vector. For the first One point of attention, , This is the weight matrix.

[0014] In one preferred embodiment, the attention-weighted aggregation of the attention head is as follows:

[0015]

[0016] in, For single-attention heads, add aggregated output to the attention. For value, This is the scaling factor.

[0017] In one preferred embodiment, the optimization objective of the adversarial learning framework in step S2 is:

[0018]

[0019] in, For feature extractor, For predictors, For domain discriminator, The task loss of the predictor. As a weighting factor, This is the domain discrimination loss of the domain discriminator.

[0020] One preferred embodiment is that the task loss is:

[0021]

[0022] in, Let the expected value of the source domain sample distribution be denoted as . For source domain samples, The true labels corresponding to the source domain samples. For loss function, For predictors, This represents the feature representation extracted by the feature extractor from the source domain samples.

[0023] One preferred embodiment is that the domain discrimination loss is:

[0024]

[0025] in, Let the expected value of the source domain sample distribution be denoted as . For source domain samples, For domain discriminator, This refers to the feature representation extracted by the feature extractor from the source domain samples. The mathematical expectation of the sample distribution in the target domain. For the target domain sample, This represents the feature representation extracted by the feature extractor from the target domain samples.

[0026] One preferred embodiment is that the reconstruction loss is:

[0027]

[0028] in, To reconstruct the loss, The mathematical expectation of the sample distribution in the target domain. For the target domain sample distribution Input data obtained from sampling For self-supervised networks The result obtained after reconstruction.

[0029] One preferred embodiment is that the contrastive learning loss is:

[0030]

[0031] in, To compare learning loss, The number of samples used for comparison. and This refers to the embedded representation of the same instance after different data augmentations. For the first Embedded representations of the samples to be compared For temperature parameters, This is the similarity function.

[0032] One preferred embodiment, step S4, specifically includes:

[0033]

[0034] in, For the first The reasoning score for each potential cause of the anomalous event. For the first One potential reason, This is an abnormal event. For potential reasons and abnormal events Reasoning score on the knowledge graph path To measure potential causes and abnormal events The inference function for the strength of the causal relationship between them.

[0035] A system including the aforementioned method for detecting cross-domain anomalies in a smart meter reading system for low-voltage distribution networks, comprising:

[0036] The module is connected in sequence to form the source domain baseline model training module, the domain adaptation module, the self-supervised anomaly detection module, the knowledge reasoning and interpretability module, and the prediction and decision-making module;

[0037] The source domain baseline model training module is used to extract source domain temporal features;

[0038] The domain adaptation module is used to align the feature distributions of the source domain and the target domain.

[0039] The self-supervised anomaly detection module is used to perform anomaly detection on unlabeled data in the target domain by combining reconstruction loss and contrastive learning loss, and generate anomaly scoring results.

[0040] The knowledge reasoning and interpretability module is used to output the causal explanation chain of abnormal events based on the pre-built knowledge graph and causal reasoning mechanism;

[0041] The prediction and decision-making module is used to integrate abnormal scoring results with causal explanations and output prediction and decision-making results.

[0042] The cross-domain anomaly detection method for a low-voltage distribution network smart meter reading system, as described above, includes the following steps: constructing a source domain baseline model; extracting features from labeled electricity consumption time-series data in the source domain using a Transformer encoder; establishing global and local dependencies through a multi-head attention mechanism; outputting a high-dimensional feature representation; performing domain adaptation by employing an adversarial learning framework, dynamically aligning the feature distributions of the source and target domains through collaborative optimization of the feature extractor, predictor, and domain discriminator, minimizing inter-domain differences; implementing self-supervised anomaly detection by combining reconstruction loss and contrastive learning loss on unlabeled data in the target domain, generating anomaly scoring results; performing knowledge reasoning and interpretability analysis by outputting causal explanation links for abnormal events based on a pre-constructed knowledge graph and causal reasoning mechanism; and generating prediction and decision results by integrating the anomaly scoring results and causal explanations, outputting prediction and decision results. This invention solves the technical problems of low detection accuracy and weak generalization ability in smart meter reading systems deployed across regions due to differences in data distribution, scarcity of labels, complex anomaly patterns, and insufficient model interpretability. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0044] Figure 1 This is a schematic diagram of a cross-domain anomaly detection method for a smart meter reading system in a low-voltage distribution network according to an embodiment of the present invention;

[0045] Figure 2 This is a schematic diagram of a cross-domain anomaly detection system for a low-voltage distribution network smart meter reading system according to an embodiment of the present invention;

[0046] Figure 3 This is a schematic diagram of the field adaptive module in an embodiment of the present invention.

[0047] The realization of the objective, functional characteristics and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0049] It should be noted that all directional indicators (such as up, down, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly.

[0050] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.

[0051] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0052] See Figure 1 According to one aspect of the present invention, the present invention provides a method for detecting cross-domain anomalies in a smart meter reading system for a low-voltage distribution network, wherein the method for detecting cross-domain anomalies in a smart meter reading system for a low-voltage distribution network includes the following steps:

[0053] S1. Construct a source domain baseline model, use a Transformer encoder to extract features from the labeled power consumption time series data in the source domain, establish global and local dependencies through a multi-head attention mechanism, and output a high-dimensional feature representation.

[0054] S2. Domain adaptation is performed by adopting an adversarial learning framework. Through the collaborative optimization of feature extractors, predictors and domain discriminators, the feature distributions of the source domain and the target domain are dynamically aligned to minimize inter-domain differences.

[0055] S3. Implement self-supervised anomaly detection. On unlabeled data in the target domain, combine reconstruction loss and contrastive learning loss to perform anomaly detection and generate anomaly scoring results.

[0056] S4. Knowledge Reasoning and Explainability Analysis: Outputs causal explanation links for anomalous events based on pre-built knowledge graphs and causal reasoning mechanisms.

[0057] S5. Generate prediction and decision results, integrate abnormal scoring results with causal explanations, and output prediction and decision results.

[0058] Specifically, in this embodiment, considering the differences in sampling frequency, environmental conditions, and equipment status among different regions and types of electricity metering terminals, this invention introduces a transfer learning framework to achieve the sharing and distribution alignment of cross-regional power data features. By deeply integrating artificial intelligence methods such as Transformer feature modeling, adversarial domain adaptation, self-supervised anomaly detection, and knowledge reasoning, feature learning and dynamic transfer can be achieved in multi-regional smart meter reading data. This fully explores the potential information structure of unlabeled data in the target domain, accurately identifies complex anomaly patterns, and provides logical and interpretable causal reasoning basis for the detection results. As a result, it effectively improves the intelligence and reliability of the smart meter reading system in key aspects such as energy consumption monitoring, electricity behavior analysis, and equipment status diagnosis.

[0059] Specifically, in this embodiment, the multi-head attention mechanism of the Transformer encoder in step S1 is as follows:

[0060]

[0061] in, This is a multi-head attention mechanism, representing the feature representation of the output. For querying, the query vector is the data from the source domain. The key represents the key vector in the source domain data that matches the query vector. For the first One point of attention, , This is the weight matrix.

[0062] Specifically, in this embodiment, the attention weighted aggregation of the attention head is as follows:

[0063]

[0064] in, For single-attention heads, add aggregated output to the attention. For value, This is the scaling factor.

[0065] Specifically, in this embodiment, the optimization objective of the adversarial learning framework in step S2 is:

[0066]

[0067] in, For feature extractor, For predictors, For domain discriminator, The task loss of the predictor. As a weighting factor, This is the domain discrimination loss of the domain discriminator.

[0068] Specifically, in this embodiment, the task loss is:

[0069]

[0070] in, Let the expected value of the source domain sample distribution be denoted as . For source domain samples, The true labels corresponding to the source domain samples. For loss function, For predictors, This represents the feature representation extracted by the feature extractor from the source domain samples.

[0071] Specifically, in this embodiment, the domain discrimination loss is:

[0072]

[0073] in, Let the expected value of the source domain sample distribution be denoted as . For source domain samples, For domain discriminator, This refers to the feature representation extracted by the feature extractor from the source domain samples. The mathematical expectation of the sample distribution in the target domain. For the target domain sample, This represents the feature representation extracted by the feature extractor from the target domain samples.

[0074] Specifically, in this embodiment, the reconstruction loss is:

[0075]

[0076] in, To reconstruct the loss, The mathematical expectation of the sample distribution in the target domain. For the target domain sample distribution Input data obtained from sampling For self-supervised networks The result obtained after reconstruction.

[0077] Specifically, in this embodiment, the contrastive learning loss is:

[0078]

[0079] in, To compare learning loss, The number of samples used for comparison. and This refers to the embedded representation of the same instance after different data augmentations. For the first Embedded representations of the samples to be compared For temperature parameters, This is the similarity function.

[0080] Specifically, in this embodiment, step S4 is as follows:

[0081]

[0082] in, For the first The reasoning score for each potential cause of the anomalous event. For the first One potential reason, This is an abnormal event. For potential reasons and abnormal events Reasoning score on the knowledge graph path To measure potential causes and abnormal events The inference function for the strength of the causal relationship between them.

[0083] Specifically, in this embodiment, the cross-domain anomaly detection method for the low-voltage distribution network smart meter reading system effectively solves the problems existing in current smart meter reading systems, such as large differences in cross-regional data distribution, insufficient detection accuracy, scarce labeled data, lack of interpretability of results, and limited system robustness. By introducing a Transformer encoder deep feature modeling mechanism through the source domain baseline model training module, it can fully capture the temporal dependence, periodic changes, and nonlinear characteristics of smart meter reading data, thereby obtaining high-quality feature representations and providing a solid foundation for subsequent anomaly detection and prediction. Compared with traditional shallow learning or statistical modeling methods, this invention can maintain strong robustness and generalization ability under multi-source, multi-region, and multi-device data conditions, significantly improving detection accuracy and stability. The domain adaptation module, based on the adversarial domain discrimination mechanism, realizes dynamic alignment of feature distribution between the source domain and the target domain, effectively solving the distribution offset problem between different regions and different types of meter reading terminals, thereby supporting cross-regional migration and online deployment. This mechanism ensures that the model still has high detection performance and adaptability in new environments or on new devices, improving the universality and flexibility of the smart meter reading system. A self-supervised anomaly detection module is introduced, utilizing contrastive learning and latent space reconstruction methods to automatically uncover potential anomaly patterns even in the absence of a large number of labeled samples. This allows for the early identification of various anomaly risks such as sudden energy consumption fluctuations, data forgery, and communication anomalies, significantly enhancing the system's security and reliability. Simultaneously, a knowledge reasoning and interpretability module, combining a rule base and causal reasoning mechanism, not only provides logical explanations for anomaly detection results but also offers maintenance personnel traceable causal links, improving the transparency and credibility of model decision-making. Guided by detection results and knowledge reasoning information, the prediction and decision-making module enables dynamic prediction of user energy consumption trends, intelligent assessment of equipment status, and adaptive optimization of anomaly response strategies. This enhances the intelligence and economy of the smart meter reading system in energy consumption analysis, fault early warning, and maintenance decision-making.

[0084] See Figures 2-3 According to another aspect of the present invention, the present invention provides a cross-domain anomaly detection system for a smart meter reading system in a low-voltage distribution network, comprising:

[0085] The module is connected in sequence to form the source domain baseline model training module, the domain adaptation module, the self-supervised anomaly detection module, the knowledge reasoning and interpretability module, and the prediction and decision-making module;

[0086] The source domain baseline model training module is used to extract source domain temporal features;

[0087] The domain adaptation module is used to align the feature distributions of the source domain and the target domain.

[0088] The self-supervised anomaly detection module is used to perform anomaly detection on unlabeled data in the target domain by combining reconstruction loss and contrastive learning loss, and generate anomaly scoring results.

[0089] The knowledge reasoning and interpretability module is used to output the causal explanation chain of abnormal events based on the pre-built knowledge graph and causal reasoning mechanism;

[0090] The prediction and decision-making module is used to integrate abnormal scoring results with causal explanations and output prediction and decision-making results.

[0091] Specifically, in this embodiment, the present invention comprises five core functional modules forming a complete closed loop from source domain modeling → cross-domain migration → target domain anomaly identification → anomaly interpretation → decision output. The output of each module serves as the input of downstream modules, ensuring that the model can still achieve high-precision, robust, and interpretable anomaly detection under different regions and equipment conditions. Each module executes in the logical order of "modeling first, then migration, then anomaly identification, then reasoning and interpretation, and finally output," forming a strict input-output dependency relationship. This enables cross-domain feature migration and high-precision anomaly detection in the smart meter reading system, significantly improving the detection accuracy and robustness of the model under different regions and equipment data environments. It also provides a traceable causal link explanation for the detection and prediction results, enhancing the model's credibility and practicality in power data scenarios. The present invention can effectively improve the operational security, stability, and automation level of the smart meter reading system, providing key technical support for the construction of a new power Internet of Things and the efficient management of distributed energy.

[0092] Specifically, in this embodiment, the input to the source domain baseline model training module is the labeled electricity consumption time-series data of the source domain, and the output is the source domain feature representation encoded by the Transformer encoder and the initial prediction model. This provides a unified, stable, and generalizable high-dimensional feature space for subsequent cross-domain transfer, that is, it provides the basic feature representation for subsequent modules and is a prerequisite for all cross-domain modeling; in the source domain samples In this invention, a Transformer encoder is used for feature extraction and prediction. The multi-head attention mechanism of the Transformer encoder is as follows:

[0093]

[0094] in, This is a multi-head attention mechanism, representing the feature representation of the output. For querying, the query vector is the data from the source domain. The key represents the key vector in the source domain data that matches the query vector. For the first One point of attention, , This is the weight matrix;

[0095]

[0096] in, For the first Each query weight matrix For the first Key weight matrix, For the first A weight matrix of values; the attention head's weighted aggregation is:

[0097]

[0098] in, For single-attention heads, add aggregated output to the attention. For value, The scaling factor is used to capture both global dependencies and local feature changes over time, providing robust feature representations for subsequent cross-domain transfers.

[0099] Specifically, in this embodiment, the input of the domain adaptation module is the source domain features from the source domain baseline model training module and the features of the unlabeled data in the target domain. The output is a domain-indistinguishable shared feature representation, eliminating data distribution differences between different regions and devices, enabling the model to work normally in the target domain. This module, based on the features of the source domain baseline model training module, achieves feature distribution alignment between the source and target domains through adversarial domain discrimination, which is a necessary step for cross-domain transfer. In the cross-domain transfer scenario, in order to effectively solve the problem of data distribution differences between the source and target domains, this invention uses an adversarial learning framework composed of a feature extractor, a predictor, and a domain discriminator. Through mutual game and collaborative optimization among the three, it achieves efficient transfer of knowledge between domains and improves model performance.

[0100] Specifically, in this embodiment, the feature extractor is the perceptual organ of the entire adversarial learning framework, undertaking the important task of extracting key semantic features from the original input data; when source domain samples and target domain samples Input to feature extractor Then, it leverages the feature extraction capabilities of deep neural networks to perform multi-level encoding and representation learning on the original input. The Transformer encoder, with its self-attention mechanism, can capture long-distance dependencies between elements at different positions in the input data, accurately capturing both temporal correlations of user electricity consumption data in the source domain and local patterns of electricity consumption features in specific scenarios in the target domain. Finally, the feature extractor outputs low-dimensional and domain-invariant feature representations. These features contain semantic information closely related to specific tasks and minimize the distribution differences between domains, laying the foundation for subsequent prediction and domain discrimination tasks.

[0101] Specifically, in this embodiment, the predictor is the core component in the framework responsible for "performing tasks," and it uses the feature representation output by the feature extractor. As input, through the predictor The calculation outputs prediction results relevant to the specific task. The task here can be anomaly detection, such as identifying abnormal patterns in user electricity consumption data, like electricity theft or equipment malfunction; or it can be load forecasting, estimating the electricity load of different regions and different types of users in advance. To quantify the performance of the forecaster, a task loss is defined; the task loss is:

[0102]

[0103] in, Let the expected value of the source domain sample distribution be denoted as . For source domain samples, The true labels corresponding to the source domain samples. The loss function can be chosen based on the task type. For example, cross-entropy loss is used for classification tasks, while mean squared error loss is used for regression tasks. The purpose of this loss function is to enable the predictor to perform the task as accurately as possible on the source domain data and learn effective knowledge relevant to the task. For predictors, This represents the feature representation extracted by the feature extractor from the source domain samples.

[0104] Specifically, in this embodiment, the domain discriminator acts like a "referee," and its task is to discriminate the feature representation of the input. Whether the feature originates from the source domain or the target domain, the feature representation will be determined. Input to domain discriminator After that, the domain discriminator will output the domain label. (The source domain is defined as 1, and the target domain as 0); To train the domain discriminator to better perform the domain discrimination task, a domain discrimination loss is defined; the domain discrimination loss is:

[0105]

[0106] in, Let the expected value of the source domain sample distribution be denoted as . For source domain samples, For domain discriminator, This refers to the feature representation extracted by the feature extractor from the source domain samples. The mathematical expectation of the sample distribution in the target domain. For the target domain sample, The feature representation is extracted by the feature extractor from the target domain sample; the domain discrimination loss drives the domain discriminator to continuously improve its discrimination ability and distinguish the features of the source domain and the target domain as accurately as possible.

[0107] Specifically, in this embodiment, a cooperative game relationship exists among the feature extractor, predictor, and domain discriminator within the entire adversarial learning framework. The goal of the feature extractor is to generate domain-indistinguishable features; that is, it aims to extract features that are difficult for the domain discriminator to identify their source, thereby achieving knowledge transfer from the source domain to the target domain. To achieve this goal, the optimization objective of the adversarial learning framework is:

[0108]

[0109] in, For feature extractor, For predictors, For domain discriminator, The task loss of the predictor. This is a weighting factor used to balance the importance of task loss and domain discrimination loss. The domain discriminant loss is the domain discrimination loss of the domain discriminator. During the optimization process, the predictor and feature extractor will minimize the task loss as much as possible, while making it difficult for the domain discriminator to determine the domain source of the features. Meanwhile, the domain discriminator will maximize the domain discrimination loss as much as possible to improve its own discrimination ability. Through this three-way alternating optimization and collaborative game, the entire model can effectively improve its generalization ability in the target domain while ensuring the performance of the source domain task, thus achieving the goal of cross-domain transfer.

[0110] Specifically, in this embodiment, the input of the self-supervised anomaly module is the domain alignment features output by the domain adaptation module, and the output is the reconstruction error of the target domain samples and the contrastive learning embedding, used for anomaly scoring; in the unlabeled target domain, the automatic learning of potential anomaly modules deeply mines the unlabeled data in the target domain to help improve detection accuracy. The self-supervised anomaly detection module relies on the domain alignment features provided by the domain adaptation module, and therefore must be executed after domain adaptation; in the unlabeled data of the target domain... To fully extract potential information from the data for anomaly detection, this invention introduces a reconstruction task and contrastive learning for self-supervised training. The core idea of ​​the reconstruction loss is to learn the intrinsic feature representation of the data through a self-supervised network, enabling the network to accurately reconstruct the input data. The reconstruction loss is as follows:

[0111]

[0112] in, To reconstruct the loss, The mathematical expectation of the sample distribution in the target domain. For the target domain sample distribution Input data obtained from sampling For self-supervised networks The result obtained after reconstruction;

[0113] By minimizing the expected value of the squared Euclidean distance between the input data and the reconstruction result, the self-supervised network can learn the key features of the data. These features are crucial for subsequent anomaly detection because normal data usually has more stable and easily reconstructed feature patterns, while anomaly data, deviating from the normal feature distribution, is often difficult to reconstruct accurately, resulting in a significant difference in reconstruction loss. Contrastive learning aims to improve the model's ability to distinguish data features, especially for identifying complex anomaly patterns, by learning from different augmented views of the same instance. The contrastive learning loss is:

[0114]

[0115] in, To compare learning loss, The number of samples used for comparison. and To perform different data augmentation operations on the same instance for embedding representation (such as adding noise, local transformations, etc.), these augmentation operations can simulate how the data changes under different scenarios. For the first Embedded representations of the samples to be compared Temperature, as a parameter, controls the sharpness of the similarity distribution, thus affecting the effectiveness of contrastive learning. The similarity function is used; during contrastive learning, the model brings the embeddings of different augmented views of the same instance closer together, while pushing the embeddings of different instances further apart, thereby learning more discriminative feature representations. These feature representations can better distinguish between normal and anomalous data, especially anomalies with complex patterns, significantly improving the model's ability to identify complex anomalous patterns in the target domain. This module enhances the model's ability to identify complex anomalous patterns in the target domain.

[0116] Specifically, in this embodiment, the input of the knowledge reasoning and interpretability module comes from the anomaly scoring results of the self-supervised anomaly detection module and the knowledge graph library and causal relationships, and outputs an anomaly-cause link explanation; it provides causal explanations for anomalies, offering a logical and traceable explanation for the detection results, improving the engineering usability of smart meter reading scenarios. This module does not change the anomaly judgment result, but provides a structured explanation, which is a key link in improving credibility; to enhance the interpretability of anomaly detection results and enable users to understand the causes of anomalies, this invention combines knowledge graphs. With causal reasoning methods; knowledge graphs From the set of nodes (Representing entities, such as devices, event types, etc.) and edge sets (It consists of relationships between entities, such as causal relationships, association relationships, etc.), and it contains prior knowledge within the domain; if the abnormal event is... Through analysis of the knowledge graph and causal exploration, the set of potential causes was obtained as follows: The reasoning score is:

[0117]

[0118] in, For the first The reasoning score for each potential cause of the anomalous event. For the first One potential reason, This is an abnormal event. For potential reasons and abnormal events Reasoning score on the knowledge graph path To measure potential causes and abnormal events The inference function for the strength of causal relationships between individuals is used to measure potential causes through causal discovery algorithms (such as causal graph models and intervention experiments). and abnormal events The module integrates the structural information of the knowledge graph with the strength of the causal relationship to output an explainable "anomaly → cause" chain. This makes the anomaly detection result no longer a black box output, but has a clear causal explanation, which greatly enhances the credibility of the detection result and facilitates users in subsequent troubleshooting and decision-making.

[0119] Specifically, in this embodiment, the input to the prediction and decision-making module is the anomaly result of the self-supervised anomaly detection model and the reasoning explanation from the knowledge reasoning and interpretability module, and the output is anomaly marker, anomaly cause, subsequent trend, or handling suggestions; the results of each module are integrated to obtain a complete detection result that can be directly used for distribution network operation and maintenance; combining the outputs of the aforementioned modules, in order to obtain the final accurate anomaly detection and prediction result, it is necessary to jointly optimize multiple losses, and the optimization objective is:

[0120]

[0121] in, The total loss function for joint optimization, These are weighting coefficients used to balance the importance of each loss in the joint optimization. These coefficients can be adjusted using methods such as cross-validation to adapt to different application scenarios and data characteristics. The model optimizes under this joint loss, outputting anomaly detection and future trend prediction results, and provides explanatory reports in conjunction with the knowledge reasoning module.

[0122] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. All equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. A method for detecting cross-domain anomalies in a smart meter reading system for low-voltage distribution networks, characterized in that, Includes the following steps: S1. Construct a source domain baseline model, use a Transformer encoder to extract features from the labeled power consumption time series data in the source domain, establish global and local dependencies through a multi-head attention mechanism, and output a high-dimensional feature representation. S2. Domain adaptation is performed by adopting an adversarial learning framework. Through the collaborative optimization of feature extractors, predictors and domain discriminators, the feature distributions of the source domain and the target domain are dynamically aligned to minimize inter-domain differences. S3. Implement self-supervised anomaly detection. On unlabeled data in the target domain, combine reconstruction loss and contrastive learning loss to perform anomaly detection and generate anomaly scoring results. S4. Knowledge Reasoning and Explainability Analysis: Outputs causal explanation links for anomalous events based on pre-built knowledge graphs and causal reasoning mechanisms. S5. Generate prediction and decision results, integrate abnormal scoring results with causal explanations, and output prediction and decision results.

2. The method for cross-domain anomaly detection in a smart meter reading system for low-voltage distribution networks according to claim 1, characterized in that, The multi-head attention mechanism of the Transformer encoder in step S1 is as follows: in, This is a multi-head attention mechanism, representing the feature representation of the output. For querying, the query vector is the data from the source domain. The key represents the key vector in the source domain data that matches the query vector. For the first One point of attention, , This is the weight matrix.

3. The cross-domain anomaly detection method for a smart meter reading system in a low-voltage distribution network according to claim 2, characterized in that, The attention-weighted aggregation of the attention heads is as follows: in, For single-attention heads, add aggregated output to the attention. For value, This is the scaling factor.

4. A method for detecting cross-domain anomalies in a smart meter reading system for low-voltage distribution networks according to any one of claims 1-3, characterized in that, The optimization objective of the adversarial learning framework in step S2 is: in, For feature extractor, For predictors, For domain discriminator, The task loss of the predictor. As a weighting factor, This is the domain discrimination loss of the domain discriminator.

5. The cross-domain anomaly detection method for a smart meter reading system in a low-voltage distribution network according to claim 4, characterized in that, The task loss is: in, Let the expected value of the source domain sample distribution be denoted as . For source domain samples, The true labels corresponding to the source domain samples. For loss function, For predictors, This represents the feature representation extracted by the feature extractor from the source domain samples.

6. The cross-domain anomaly detection method for a smart meter reading system in a low-voltage distribution network according to claim 4, characterized in that, The domain discrimination loss is: in, Let the expected value of the source domain sample distribution be denoted as . For source domain samples, For domain discriminator, This refers to the feature representation extracted by the feature extractor from the source domain samples. The mathematical expectation of the sample distribution in the target domain. For the target domain sample, This represents the feature representation extracted by the feature extractor from the target domain samples.

7. A method for detecting cross-domain anomalies in a smart meter reading system for low-voltage distribution networks according to any one of claims 1-3, characterized in that, The reconstruction loss is: in, To reconstruct the loss, The mathematical expectation of the sample distribution in the target domain. For the target domain sample distribution Input data obtained from sampling For self-supervised networks The result obtained after reconstruction.

8. A method for detecting cross-domain anomalies in a smart meter reading system for low-voltage distribution networks according to any one of claims 1-3, characterized in that, The contrastive learning loss is: in, To compare learning loss, The number of samples used for comparison. and This refers to the embedded representation of the same instance after different data augmentations. For the first Embedded representations of the samples to be compared For temperature parameters, This is the similarity function.

9. A method for detecting cross-domain anomalies in a smart meter reading system for low-voltage distribution networks according to any one of claims 1-3, characterized in that, Step S4 specifically includes: in, For the first The reasoning score for each potential cause of the anomalous event. For the first One potential reason, This is an abnormal event. For potential reasons and abnormal events Reasoning score on the knowledge graph path To measure potential causes and abnormal events The inference function for the strength of the causal relationship between them.

10. A system comprising the cross-domain anomaly detection method for a low-voltage distribution network smart meter reading system according to any one of claims 1-9, characterized in that, include: The module is connected in sequence to form the source domain baseline model training module, the domain adaptation module, the self-supervised anomaly detection module, the knowledge reasoning and interpretability module, and the prediction and decision-making module; The source domain baseline model training module is used to extract source domain temporal features; The domain adaptation module is used to align the feature distributions of the source domain and the target domain. The self-supervised anomaly detection module is used to perform anomaly detection on unlabeled data in the target domain by combining reconstruction loss and contrastive learning loss, and generate anomaly scoring results. The knowledge reasoning and interpretability module is used to output the causal explanation chain of abnormal events based on the pre-built knowledge graph and causal reasoning mechanism; The prediction and decision-making module is used to integrate abnormal scoring results with causal explanations and output prediction and decision-making results.

Citation Information

Patent Citations

  • Internet of Things meter reading method, system and device based on photovoltaic inverter

    CN115175023A